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/odil.h"
18 #include "odil/SCU.h"
19 #include "odil/message/CGetRequest.h"
20 #include "odil/message/CGetResponse.h"
21 #include "odil/message/CStoreRequest.h"
22 
23 namespace odil
24 {
25 
27 class ODIL_API GetSCU: public SCU
28 {
29 public:
31  typedef std::function<void(DataSet &&)> StoreCallback;
32 
37  typedef StoreCallback Callback;
38 
40  typedef std::function<void(message::CGetResponse &&)> GetCallback;
41 
43  GetSCU(Association & association);
44 
46  virtual ~GetSCU();
47 
49  void get(
50  DataSet const & query, StoreCallback store_callback,
51  GetCallback get_callback=GetCallback()) const;
52 
54  void get(
55  DataSet && query, StoreCallback store_callback,
56  GetCallback get_callback=GetCallback()) const;
57 
61  std::vector<DataSet> get(DataSet const & query) const;
62 
66  std::vector<DataSet> get(DataSet && query) const;
67 
68 private:
69  void _get(
70  message::CGetRequest const & request,
71  StoreCallback store_callback, GetCallback get_callback) const;
72  bool _handle_get_response(
73  message::CGetResponse && response, GetCallback callback) const;
74  void _handle_store_request(
75  message::CStoreRequest && request, StoreCallback callback) const;
76 };
77 
78 }
79 
80 #endif // _f82a15e2_fd13_44b5_af7d_c6983494c9c6
Base class for all Service Class Users.
Definition: SCU.h:21
SCU for C-GET services.
Definition: GetSCU.h:27
StoreCallback Callback
Typedef to keep compatibility with previous versions.
Definition: GetSCU.h:37
Definition: Association.cpp:39
DICOM Data set.
Definition: DataSet.h:29
std::function< void(DataSet &&)> StoreCallback
Callback called when a C-STORE request is received.
Definition: GetSCU.h:31
Association.
Definition: Association.h:30
std::function< void(message::CGetResponse &&)> GetCallback
Callback called when a C-GET response is received.
Definition: GetSCU.h:40