fw4spl
SActivitySequencer.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 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 __ACTIVITIES_SACTIVITYSEQUENCER_HPP__
8 #define __ACTIVITIES_SACTIVITYSEQUENCER_HPP__
9 
10 #include "activities/config.hpp"
11 
12 #include <fwCom/Signal.hpp>
13 
14 #include <fwMedData/ActivitySeries.hpp>
15 
16 #include <fwServices/IController.hpp>
17 
18 namespace activities
19 {
20 
68 class ACTIVITIES_CLASS_API SActivitySequencer : public ::fwServices::IController
69 {
70 
71 public:
72 
74 
76  ACTIVITIES_API SActivitySequencer() noexcept;
77 
79  ACTIVITIES_API virtual ~SActivitySequencer() noexcept;
80 
82  ACTIVITIES_API virtual KeyConnectionsMap getAutoConnections() const override;
83 
88  typedef ::fwCom::Signal<void (::fwMedData::ActivitySeries::sptr ) > ActivityCreatedSignalType;
89  typedef ::fwCom::Signal<void (bool) > EnabledPreviousSignalType;
90  typedef ::fwCom::Signal<void (bool) > EnabledNextSignalType;
95 protected:
96 
98  virtual void starting() override;
99 
101  virtual void stopping() override;
102 
110  virtual void updating() override;
111 
113  virtual void configuring() override;
114 
115 private:
116 
117  typedef std::vector< std::string > ActivitesType;
118  typedef std::map< std::string, ::fwData::Object::sptr > RequirementsType;
119 
121  void next();
122 
124  void previous();
125 
127  void sendInfo() const;
128 
130  void storeActivityData();
131 
133  ::fwMedData::ActivitySeries::sptr getActivity(size_t index);
134 
136  bool checkValidity(const ::fwMedData::ActivitySeries::csptr& activity, bool showDialog = true) const;
137 
139  ActivitesType m_activityIds;
140 
142  int m_currentActivity;
143 
145  RequirementsType m_requirements;
146 
147  ActivityCreatedSignalType::sptr m_sigActivityCreated;
148  EnabledPreviousSignalType::sptr m_sigEnabledPrevious;
149  EnabledNextSignalType::sptr m_sigEnabledNext;
150 
151 };
152 
153 } // activities
154 
155 #endif // __ACTIVITIES_SACTIVITYSEQUENCER_HPP__
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
Namespace containing medical data.
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
STL namespace.
This interface defines control service API. Does nothing particularly, can be considered as a default...
Definition: IController.hpp:23
The namespace activities contains helpers and services allowing to launch activities.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Contains the representation of the data objects used in the framework.
This service allows to launch activities sequentially.