odil
C++11libraryfortheDICOMstandard
SCP.h
1 /*************************************************************************
2  * odil - Copyright (C) Universite de Strasbourg
3  * Distributed under the terms of the CeCILL-B license, as published by
4  * the CEA-CNRS-INRIA. Refer to the LICENSE file or to
5  * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
6  * for details.
7  ************************************************************************/
8 
9 #ifndef _f4680d8c_18a8_4317_956d_3ae238cb39cc
10 #define _f4680d8c_18a8_4317_956d_3ae238cb39cc
11 
12 #include "odil/Association.h"
13 #include "odil/DataSet.h"
14 #include "odil/Exception.h"
15 #include "odil/message/Message.h"
16 #include "odil/message/Request.h"
17 #include "odil/Value.h"
18 
19 namespace odil
20 {
21 
23 class SCP
24 {
25 public:
32  {
33  public:
35  virtual ~DataSetGenerator() =0;
36 
38  virtual void initialize(message::Request const & request) =0;
39 
41  virtual bool done() const =0;
42 
44  virtual void next() =0;
45 
47  virtual DataSet get() const =0;
48  };
49 
50  class Exception: public odil::Exception
51  {
52  public:
55 
58 
60  Exception(
61  std::string const & message,
62  Value::Integer status, DataSet const & status_fields=DataSet());
63 
65  virtual ~Exception() noexcept;
66  };
67 
69  SCP(Association & association);
70 
72  virtual ~SCP();
73 
75  void receive_and_process();
76 
78  virtual void operator()(message::Message const & message) =0;
79 protected:
82 };
83 
84 }
85 
86 #endif // _f4680d8c_18a8_4317_956d_3ae238cb39cc
virtual bool done() const =0
Test whether all elements have been generated.
Base class for odil exceptions.
Definition: Exception.h:19
Definition: Association.cpp:39
Value::Integer status
Status to be sent back to user.
Definition: SCP.h:54
virtual void next()=0
Prepare the next element.
Definition: SCP.h:50
virtual void initialize(message::Request const &request)=0
Initialize the generator.
Base class for all Service Class Providers.
Definition: SCP.h:23
Abstract base class for SCP returning multiple data sets.
Definition: SCP.h:31
void receive_and_process()
Receive and process a message.
Definition: SCP.cpp:55
Association & _association
Association with peer.
Definition: SCP.h:81
DICOM Data set.
Definition: DataSet.h:28
virtual ~DataSetGenerator()=0
Destructor.
Definition: SCP.cpp:20
DataSet status_fields
Status detail fields (e.g. offending element).
Definition: SCP.h:57
Association.
Definition: Association.h:29
int64_t Integer
Integer type.
Definition: Value.h:40