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/odil.h"
18 #include "odil/Value.h"
19 
20 namespace odil
21 {
22 
24 class ODIL_API SCP
25 {
26 public:
32  class ODIL_API DataSetGenerator
33  {
34  public:
36  virtual ~DataSetGenerator() =0;
37 
39  virtual void initialize(message::Request const & request) =0;
40 
42  virtual bool done() const =0;
43 
45  virtual void next() =0;
46 
48  virtual DataSet get() const =0;
49  };
50 
51  class Exception: public odil::Exception
52  {
53  public:
56 
59 
61  Exception(
62  std::string const & message,
63  Value::Integer status, DataSet const & status_fields=DataSet());
64 
66  virtual ~Exception() noexcept;
67  };
68 
70  SCP(Association & association);
71 
73  virtual ~SCP();
74 
76  void receive_and_process();
77 
79  virtual void operator()(message::Message const & message) =0;
80 
82  virtual void operator()(message::Message && message) =0;
83 protected:
85  Association & _association;
86 };
87 
88 }
89 
90 #endif // _f4680d8c_18a8_4317_956d_3ae238cb39cc
Base class for odil exceptions.
Definition: Exception.h:21
Definition: Association.cpp:39
Value::Integer status
Status to be sent back to user.
Definition: SCP.h:55
Definition: SCP.h:51
Base class for all Service Class Providers.
Definition: SCP.h:24
Abstract base class for SCP returning multiple data sets.
Definition: SCP.h:32
DICOM Data set.
Definition: DataSet.h:29
DataSet status_fields
Status detail fields (e.g. offending element).
Definition: SCP.h:58
Association.
Definition: Association.h:30
int64_t Integer
Integer type.
Definition: Value.h:42