odil
C++11libraryfortheDICOMstandard
EchoSCP.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 _1a61d976_ba12_4dba_af34_67f064d38506
10 #define _1a61d976_ba12_4dba_af34_67f064d38506
11 
12 #include <functional>
13 
14 #include "odil/Association.h"
15 #include "odil/odil.h"
16 #include "odil/SCP.h"
17 #include "odil/Value.h"
18 #include "odil/message/CEchoRequest.h"
19 #include "odil/message/Message.h"
20 
21 namespace odil
22 {
23 
25 class ODIL_API EchoSCP: public SCP
26 {
27 public:
32  typedef std::function<Value::Integer(message::CEchoRequest const &)> Callback;
33 
35  EchoSCP(Association & association);
36 
38  EchoSCP(Association & association, Callback const & callback);
39 
41  virtual ~EchoSCP();
42 
44  Callback const & get_callback() const;
45 
47  void set_callback(Callback const & callback);
48 
50  virtual void operator()(message::Message const & message);
51 
53  virtual void operator()(message::Message && message);
54 
55 private:
56  Callback _callback;
57  void operator()(message::CEchoRequest const & request);
58 };
59 
60 }
61 
62 #endif // _1a61d976_ba12_4dba_af34_67f064d38506
std::function< Value::Integer(message::CEchoRequest const &)> Callback
Callback called when a request is received, shall throw an SCP::Exception on error.
Definition: EchoSCP.h:32
SCP for C-Echo services.
Definition: EchoSCP.h:25
Definition: Association.cpp:39
Base class for all Service Class Providers.
Definition: SCP.h:24
Association.
Definition: Association.h:30