Odil
A C++11 library for the DICOM standard
GetSCU.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 _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"
22 
23 namespace odil
24 {
25 
27 class ODIL_API GetSCU: public SCU
28 {
29 public:
31  typedef std::function<void(std::shared_ptr<DataSet>)> StoreCallback;
32 
37  typedef StoreCallback Callback;
38 
40  typedef std::function<
41  void(std::shared_ptr<message::CGetResponse>)
42  > GetCallback;
43 
45  GetSCU(Association & association);
46 
48  void get(
49  std::shared_ptr<DataSet> query, StoreCallback store_callback,
50  GetCallback get_callback=GetCallback()) const;
51 
55  std::vector<std::shared_ptr<DataSet>> get(
56  std::shared_ptr<DataSet> query) const;
57 
58 private:
59  void _get(
60  std::shared_ptr<message::CGetRequest const> request,
61  StoreCallback store_callback, GetCallback get_callback) const;
62  bool _handle_get_response(
63  std::shared_ptr<message::CGetResponse> response,
64  GetCallback callback) const;
65  void _handle_store_request(
66  std::shared_ptr<message::CStoreRequest> request,
67  StoreCallback callback) const;
68 };
69 
70 }
71 
72 #endif // _f82a15e2_fd13_44b5_af7d_c6983494c9c6
odil::GetSCU
SCU for C-GET services.
Definition: GetSCU.h:33
odil
Definition: Association.h:24
ODIL_API
#define ODIL_API
Definition: odil.h:28
Association.h
odil::GetSCU::GetCallback
std::function< void(std::shared_ptr< message::CGetResponse >) > GetCallback
Callback called when a C-GET response is received.
Definition: GetSCU.h:54
odil.h
odil::GetSCU::StoreCallback
std::function< void(std::shared_ptr< DataSet >)> StoreCallback
Callback called when a C-STORE request is received.
Definition: GetSCU.h:43
odil::Association
Association.
Definition: Association.h:36
CGetRequest.h
SCU.h
CStoreRequest.h
DataSet.h
CGetResponse.h