fw4spl
SObjFromSlot.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #include "ctrlSelection/config.hpp"
10 #include "ctrlSelection/IUpdaterSrv.hpp"
11 
12 namespace ctrlSelection
13 {
14 
15 namespace updater
16 {
17 
37 class CTRLSELECTION_CLASS_API SObjFromSlot : public ::ctrlSelection::IUpdaterSrv
38 {
39 
40 public:
41 
43 
45  CTRLSELECTION_API SObjFromSlot() noexcept;
46 
48  CTRLSELECTION_API virtual ~SObjFromSlot() noexcept;
49 
54  static const ::fwCom::Slots::SlotKeyType s_ADD_OR_SWAP_SLOT;
55  static const ::fwCom::Slots::SlotKeyType s_ADD_SLOT;
56  static const ::fwCom::Slots::SlotKeyType s_SWAP_OBJ_SLOT;
57  static const ::fwCom::Slots::SlotKeyType s_REMOVE_SLOT;
58  static const ::fwCom::Slots::SlotKeyType s_REMOVE_IF_PRESENT_SLOT;
63 protected:
64 
66  CTRLSELECTION_API virtual void configuring() override;
67 
69  CTRLSELECTION_API virtual void starting() override;
70 
72  CTRLSELECTION_API virtual void stopping() override;
73 
75  CTRLSELECTION_API virtual void updating() override;
76 
78  CTRLSELECTION_API virtual void info( std::ostream& _sstream ) override;
79 
84  void add(::fwData::Object::sptr obj);
86 
92  void addOrSwap(::fwData::Object::sptr obj);
93 
95  void swap(::fwData::Object::sptr obj);
96 
98  void remove();
99 
101  void removeIfPresent();
105 };
106 
107 } // updater
108 } // ctrlSelection
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
STL namespace.
Registers/unregisters the object given by the slots.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
An updater is use to register/unregister object in the OSR when it receives specific signals (declare...
Definition: IUpdaterSrv.hpp:24
Contains the representation of the data objects used in the framework.
The namespace ctrlSelection contains several interfaces for manager, updater and wrapper.
Definition: BookmarkSrv.hpp:15