Odil
A C++11 library for the DICOM standard
SCP.h
Go to the documentation of this file.
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 
25 {
26 public:
33  {
34  public:
36  virtual ~DataSetGenerator() =0;
37 
39  virtual void initialize(
40  std::shared_ptr<message::Request const> request) =0;
41 
43  virtual bool done() const =0;
44 
46  virtual void next() =0;
47 
49  virtual std::shared_ptr<DataSet> get() const =0;
50  };
51 
52  class Exception: public odil::Exception
53  {
54  public:
57 
59  std::shared_ptr<DataSet> status_fields;
60 
63  std::string const & message,
64  Value::Integer status, std::shared_ptr<DataSet> status_fields={});
65 
67  virtual ~Exception() noexcept;
68  };
69 
71  SCP(Association & association);
72 
74  virtual ~SCP() = default;
75 
77  void receive_and_process();
78 
80  virtual void operator()(std::shared_ptr<message::Message> message) =0;
81 protected:
83  Association & _association;
84 };
85 
86 }
87 
88 #endif // _f4680d8c_18a8_4317_956d_3ae238cb39cc
Association.
Definition: Association.h:31
Base class for odil exceptions.
Definition: Exception.h:22
Abstract base class for SCP returning multiple data sets.
Definition: SCP.h:33
virtual void initialize(std::shared_ptr< message::Request const > request)=0
Initialize the generator.
virtual std::shared_ptr< DataSet > get() const =0
Return the current element.
virtual bool done() const =0
Test whether all elements have been generated.
virtual void next()=0
Prepare the next element.
virtual ~DataSetGenerator()=0
Destructor.
Definition: SCP.h:53
virtual ~Exception() noexcept
Destructor.
std::shared_ptr< DataSet > status_fields
Status detail fields (e.g. offending element).
Definition: SCP.h:59
Value::Integer status
Status to be sent back to user.
Definition: SCP.h:56
Exception(std::string const &message, Value::Integer status, std::shared_ptr< DataSet > status_fields={})
Constructor.
Base class for all Service Class Providers.
Definition: SCP.h:25
int64_t Integer
Integer type.
Definition: Value.h:42
Definition: Association.h:25
#define ODIL_API
Definition: odil.h:28