Odil
A C++11 library for the DICOM standard
MoveSCU.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 _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"
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(std::shared_ptr<DataSet>)> StoreCallback;
32 
37  typedef StoreCallback Callback;
38 
40  typedef std::function<
41  void(std::shared_ptr<message::CMoveResponse>)
42  > MoveCallback;
43 
45  MoveSCU(Association & association);
46 
48  std::string const & get_move_destination() const;
50  void set_move_destination(std::string const & move_destination);
51 
53  uint16_t get_incoming_port() const;
54 
56  void set_incoming_port(uint16_t port);
57 
59  void move(
60  std::shared_ptr<DataSet> query, StoreCallback store_callback) const;
61 
63  void move(
64  std::shared_ptr<DataSet> query, MoveCallback move_callback) const;
65 
67  void move(
68  std::shared_ptr<DataSet> query, StoreCallback store_callback,
69  MoveCallback move_callback) const;
70 
74  std::vector<std::shared_ptr<DataSet>> move(
75  std::shared_ptr<DataSet> query) const;
76 
77 private:
78  std::string _move_destination;
79  uint16_t _incoming_port;
80 
81  void _move(
82  std::shared_ptr<message::CMoveRequest const> request,
83  StoreCallback store_callback, MoveCallback move_callback) const;
84 
85  void _dispatch(
86  Association & store_association, StoreCallback store_callback,
87  MoveCallback move_callback) const;
88 
89  bool _handle_main_association(MoveCallback callback) const;
90  bool _handle_store_association(
91  Association & association, StoreCallback callback) const;
92 };
93 
94 }
95 
96 #endif // _5ff4d940_4db7_4d85_9d3a_230b944b31fe
odil::MoveSCU::MoveCallback
std::function< void(std::shared_ptr< message::CMoveResponse >) > MoveCallback
Callback called when a C-MOVE response is received.
Definition: MoveSCU.h:51
odil::MoveSCU::StoreCallback
std::function< void(std::shared_ptr< DataSet >)> StoreCallback
Callback called when a C-STORE request is received.
Definition: MoveSCU.h:40
odil
Definition: Association.h:23
ODIL_API
#define ODIL_API
Definition: odil.h:27
Association.h
odil.h
odil::Association
Association.
Definition: Association.h:34
CMoveRequest.h
CMoveResponse.h
SCU.h
odil::MoveSCU
SCU for C-MOVE services.
Definition: MoveSCU.h:31
odil::MoveSCU::Callback
StoreCallback Callback
Typedef to keep compatibility with previous versions.
Definition: MoveSCU.h:46
DataSet.h