fw4spl
ConfigLauncher.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 "fwServices/config.hpp"
10 #include "fwServices/IAppConfigManager.hpp"
11 #include "fwServices/IService.hpp"
12 #include "fwServices/registry/AppConfig.hpp"
13 
14 #include <fwActivities/registry/Activities.hpp>
15 
16 #include <fwCom/helper/SigSlotConnection.hpp>
17 
18 #include <fwRuntime/ConfigurationElement.hpp>
19 #include <fwRuntime/EConfigurationElement.hpp>
20 
21 #include <fwTools/Failed.hpp>
22 
23 namespace fwServices
24 {
25 
26 namespace helper
27 {
28 
43 class FWSERVICES_CLASS_API ConfigLauncher
44 {
45 
46 public:
47 
48  typedef std::unique_ptr<ConfigLauncher> uptr;
49  typedef ::fwServices::registry::FieldAdaptorType FieldAdaptorType;
50 
52  FWSERVICES_API ConfigLauncher();
53 
55  FWSERVICES_API virtual ~ConfigLauncher();
56 
60  FWSERVICES_API virtual void parseConfig(const ::fwServices::IService::ConfigType& config,
61  const ::fwServices::IService::sptr& service);
62 
68  FWSERVICES_API virtual void startConfig( SPTR(::fwServices::IService) srv,
69  const FieldAdaptorType& optReplaceMap = FieldAdaptorType() );
70 
72  FWSERVICES_API virtual void stopConfig();
73 
74  //------------------------------------------------------------------------------
75 
76  virtual bool configIsRunning() const
77  {
78  return m_configIsRunning;
79  }
80 
81 protected:
82 
84 
87 
88  // config manager
89  ::fwServices::IAppConfigManager::sptr m_appConfigManager;
90 
91 private:
92 
94  static const std::string s_SELF_KEY;
96  static const std::string s_GENERIC_UID_KEY;
97 
98 };
99 
100 } // helper
101 } // fwServices
Base class for all services.
Definition: IService.hpp:61
#define SPTR(_cls_)
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
This class provides few methods to manage AppConfig (parsing, starting, stopping...).
bool m_configIsRunning
to know if AppConfig is running