fw4spl
Signals.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWCOM_SIGNALS_HPP__
8 #define __FWCOM_SIGNALS_HPP__
9 
10 #include <map>
11 #include <vector>
12 
13 #include "fwCore/macros.hpp"
14 #include "fwCom/config.hpp"
15 
16 namespace fwCom
17 {
18 
19 struct SignalBase;
20 
28 class FWCOM_CLASS_API Signals
29 {
30 public:
31 
32  typedef std::string SignalKeyType;
33  typedef std::map< SignalKeyType, SPTR( SignalBase ) > SignalMapType;
34  typedef std::vector < SignalKeyType > SignalKeyContainerType;
35 
37  FWCOM_API Signals();
38 
40  FWCOM_API virtual ~Signals();
41 
43  FWCOM_API Signals& operator()( const SignalKeyType &key, const SPTR( SignalBase ) &Signal );
44 
46  FWCOM_API SPTR( SignalBase ) operator[]( const SignalKeyType &key ) const;
47 
49  FWCOM_API SignalKeyContainerType getSignalKeys() const;
50 
51 
52 
53 protected:
54 
56  Signals( const Signals& );
57 
59  Signals& operator=( const Signals& );
60 
62  SignalMapType m_signals;
63 };
64 
65 } // namespace fwCom
66 
67 #endif //__FWCOM_SIGNALS_HPP__
#define SPTR(_cls_)
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
This file defines fwCore base macros.
This class proposes a mapping between a SignalKeyType and a SignalBase.
Definition: Signals.hpp:28
SignalMapType m_signals
Association < key , SPTR( SignalBase ) >
Definition: Signals.hpp:62
Signal base class.
Definition: SignalBase.hpp:23