odil
C++11libraryfortheDICOMstandard
GetSCU.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 _f82a15e2_fd13_44b5_af7d_c6983494c9c6
10 #define _f82a15e2_fd13_44b5_af7d_c6983494c9c6
11 
12 #include <functional>
13 #include <vector>
14 
15 #include "odil/Association.h"
16 #include "odil/DataSet.h"
17 #include "odil/SCU.h"
18 #include "odil/message/CGetResponse.h"
19 #include "odil/message/CStoreRequest.h"
20 
21 namespace odil
22 {
23 
25 class GetSCU: public SCU
26 {
27 public:
29  typedef std::function<void(DataSet const &)> StoreCallback;
30 
35  typedef StoreCallback Callback;
36 
38  typedef std::function<void(message::CGetResponse const &)> GetCallback;
39 
41  GetSCU(Association & association);
42 
44  virtual ~GetSCU();
45 
47  void get(
48  DataSet const & query, StoreCallback store_callback,
49  GetCallback get_callback=GetCallback()) const;
50 
54  std::vector<DataSet> get(DataSet const & query) const;
55 
56 private:
57  bool _handle_get_response(
58  message::CGetResponse const & response, GetCallback callback) const;
59  void _handle_store_request(
60  message::CStoreRequest const & request, StoreCallback callback) const;
61 };
62 
63 }
64 
65 #endif // _f82a15e2_fd13_44b5_af7d_c6983494c9c6
virtual ~GetSCU()
Destructor.
Definition: GetSCU.cpp:34
Base class for all Service Class Users.
Definition: SCU.h:20
SCU for C-GET services.
Definition: GetSCU.h:25
GetSCU(Association &association)
Constructor.
Definition: GetSCU.cpp:27
StoreCallback Callback
Typedef to keep compatibility with previous versions.
Definition: GetSCU.h:35
std::function< void(DataSet const &)> StoreCallback
Callback called when a C-STORE request is received.
Definition: GetSCU.h:29
Definition: Association.cpp:39
DICOM Data set.
Definition: DataSet.h:28
Association.
Definition: Association.h:29
std::function< void(message::CGetResponse const &)> GetCallback
Callback called when a C-GET response is received.
Definition: GetSCU.h:38