odil
C++11libraryfortheDICOMstandard
MoveSCU.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 _5ff4d940_4db7_4d85_9d3a_230b944b31fe
10 #define _5ff4d940_4db7_4d85_9d3a_230b944b31fe
11 
12 #include <functional>
13 #include <string>
14 #include <vector>
15 
16 #include "odil/Association.h"
17 #include "odil/DataSet.h"
18 #include "odil/message/CMoveRequest.h"
19 #include "odil/message/CMoveResponse.h"
20 #include "odil/odil.h"
21 #include "odil/SCU.h"
22 
23 namespace odil
24 {
25 
27 class ODIL_API MoveSCU: public SCU
28 {
29 public:
31  typedef std::function<void(DataSet &&)> StoreCallback;
32 
37  typedef StoreCallback Callback;
38 
40  typedef std::function<void(message::CMoveResponse &&)> MoveCallback;
41 
43  MoveSCU(Association & association);
44 
46  virtual ~MoveSCU();
47 
49  std::string const & get_move_destination() const;
51  void set_move_destination(std::string const & move_destination);
52 
54  uint16_t get_incoming_port() const;
55 
57  void set_incoming_port(uint16_t port);
58 
60  void move(DataSet const & query, StoreCallback store_callback) const;
61 
63  void move(DataSet && query, StoreCallback store_callback) const;
64 
66  void move(DataSet const & query, MoveCallback move_callback) const;
67 
69  void move(DataSet && query, MoveCallback move_callback) const;
70 
72  void move(
73  DataSet const & query, StoreCallback store_callback,
74  MoveCallback move_callback) const;
75 
77  void move(
78  DataSet && query, StoreCallback store_callback,
79  MoveCallback move_callback) const;
80 
84  std::vector<DataSet> move(DataSet const & query) const;
85 
89  std::vector<DataSet> move(DataSet && query) const;
90 
91 private:
92  std::string _move_destination;
93  uint16_t _incoming_port;
94 
95  void _move(
96  message::CMoveRequest const & request, StoreCallback store_callback,
97  MoveCallback move_callback) const;
98 
99  void _dispatch(
100  Association & store_association, StoreCallback store_callback,
101  MoveCallback move_callback) const;
102 
103  bool _handle_main_association(MoveCallback callback) const;
104  bool _handle_store_association(
105  Association & association, StoreCallback callback) const;
106 };
107 
108 }
109 
110 #endif // _5ff4d940_4db7_4d85_9d3a_230b944b31fe
std::function< void(DataSet &&)> StoreCallback
Callback called when a C-STORE request is received.
Definition: MoveSCU.h:31
Base class for all Service Class Users.
Definition: SCU.h:21
Definition: Association.cpp:39
StoreCallback Callback
Typedef to keep compatibility with previous versions.
Definition: MoveSCU.h:37
DICOM Data set.
Definition: DataSet.h:29
std::function< void(message::CMoveResponse &&)> MoveCallback
Callback called when a C-MOVE response is received.
Definition: MoveSCU.h:40
Association.
Definition: Association.h:30
SCU for C-MOVE services.
Definition: MoveSCU.h:27