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/CMoveResponse.h"
19 #include "odil/SCU.h"
20 
21 namespace odil
22 {
23 
25 class MoveSCU: 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::CMoveResponse const &)> MoveCallback;
39 
41  MoveSCU(Association & association);
42 
44  virtual ~MoveSCU();
45 
47  std::string const & get_move_destination() const;
49  void set_move_destination(std::string const & move_destination);
50 
52  uint16_t get_incoming_port() const;
53 
55  void set_incoming_port(uint16_t port);
56 
58  void move(DataSet const & query, StoreCallback store_callback) const;
59 
61  void move(DataSet const & query, MoveCallback move_callback) const;
62 
64  void move(
65  DataSet const & query, StoreCallback store_callback,
66  MoveCallback move_callback) const;
67 
71  std::vector<DataSet> move(DataSet const & query) const;
72 
73 private:
74  std::string _move_destination;
75  uint16_t _incoming_port;
76 
77  void _dispatch(
78  Association & store_association, StoreCallback store_callback,
79  MoveCallback move_callback) const;
80 
81  bool _handle_main_association(MoveCallback callback) const;
82  bool _handle_store_association(
83  Association & association, StoreCallback callback) const;
84 };
85 
86 }
87 
88 #endif // _5ff4d940_4db7_4d85_9d3a_230b944b31fe
Base class for all Service Class Users.
Definition: SCU.h:20
Definition: Association.cpp:39
std::function< void(message::CMoveResponse const &)> MoveCallback
Callback called when a C-MOVE response is received.
Definition: MoveSCU.h:38
uint16_t get_incoming_port() const
Return the port for incoming associations, defaults to 0.
Definition: MoveSCU.cpp:56
void move(DataSet const &query, StoreCallback store_callback) const
Perform the C-MOVE using callbacks.
Definition: MoveSCU.cpp:70
void set_incoming_port(uint16_t port)
Set the port for incoming associations, use 0 to disable.
Definition: MoveSCU.cpp:63
std::string const & get_move_destination() const
Return the AE title of the destination, defaults to "".
Definition: MoveSCU.cpp:42
StoreCallback Callback
Typedef to keep compatibility with previous versions.
Definition: MoveSCU.h:35
DICOM Data set.
Definition: DataSet.h:28
void set_move_destination(std::string const &move_destination)
Set the AE title of the destination.
Definition: MoveSCU.cpp:49
std::function< void(DataSet const &)> StoreCallback
Callback called when a C-STORE request is received.
Definition: MoveSCU.h:29
Association.
Definition: Association.h:29
SCU for C-MOVE services.
Definition: MoveSCU.h:25
MoveSCU(Association &association)
Constructor.
Definition: MoveSCU.cpp:28
virtual ~MoveSCU()
Destructor.
Definition: MoveSCU.cpp:35