odil
C++11libraryfortheDICOMstandard
SCPDispatcher.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 _f0b69ac6_7d52_401d_a2f3_d5d3f7d69376
10 #define _f0b69ac6_7d52_401d_a2f3_d5d3f7d69376
11 
12 #include <map>
13 #include <memory>
14 
15 #include "odil/Association.h"
16 #include "odil/odil.h"
17 #include "odil/SCP.h"
18 #include "odil/Value.h"
19 
20 namespace odil
21 {
22 
24 class ODIL_API SCPDispatcher
25 {
26 public:
28  SCPDispatcher(Association & association);
29 
31  ~SCPDispatcher();
32 
34  bool has_scp(Value::Integer command) const;
35 
37  std::shared_ptr<SCP> const & get_scp(Value::Integer command) const;
38 
40  void set_scp(Value::Integer command, std::shared_ptr<SCP> const & scp);
41 
43  void dispatch();
44 
45 private:
46  typedef std::shared_ptr<SCP> SCPPointer;
47 
48  Association & _association;
49  std::map<Value::Integer, std::shared_ptr<SCP> > _providers;
50 
51 };
52 
53 }
54 
55 #endif // _f0b69ac6_7d52_401d_a2f3_d5d3f7d69376
Definition: Association.cpp:39
Dispatch an incoming message to one of the registered SCPs.
Definition: SCPDispatcher.h:24
Association.
Definition: Association.h:30
int64_t Integer
Integer type.
Definition: Value.h:42