fw4spl
SPushObject.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
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 __GUI_ACTION_SPUSHOBJECT_HPP__
8 #define __GUI_ACTION_SPUSHOBJECT_HPP__
9 
10 #include "gui/config.hpp"
11 
12 #include <fwGui/IActionSrv.hpp>
13 
14 #include <fwTools/Failed.hpp>
15 
16 #include <map>
17 #include <set>
18 
19 namespace gui
20 {
21 namespace action
22 {
23 
37 class GUI_CLASS_API SPushObject : public ::fwGui::IActionSrv
38 {
39 
40 public:
41 
43 
45  GUI_API SPushObject() noexcept;
46 
48  GUI_API virtual ~SPushObject() noexcept;
49 
57  GUI_API virtual KeyConnectionsMap getAutoConnections() const override;
58 
59 protected:
60 
62  virtual void configuring() override;
63 
65  virtual void starting() override;
66 
68  virtual void stopping() override;
69 
71  virtual void updating() override;
72 
73 private:
74 
79  void updateObjects();
80 
81  // [src_map]->[(src_key1, src_key2, ...)]
82  typedef std::map< std::string, std::set< std::string > > SrcKeyMapType;
83  // [dest_key]->[<src_map, src_key>]
84  typedef std::map< std::string, std::pair< std::string, std::string > > DestKeyMapType;
88  DestKeyMapType m_key2src;
89  SrcKeyMapType m_srcMap;
90 
92  std::string m_srcKey;
93 };
94 
95 } // namespace action
96 
97 } // namespace gui
98 
99 #endif // __GUI_ACTION_SPUSHOBJECT_HPP__
100 
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
The namespace gui contains the basic services to build the application IHM.
STL namespace.
Defines the service interface managing the menu items.
Definition: IActionSrv.hpp:24
To add or remove an object in composite with specific key.
Definition: SPushObject.hpp:37
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.