7 #ifndef __FWRUNTIME_PROFILE_PROFILE_HPP__ 8 #define __FWRUNTIME_PROFILE_PROFILE_HPP__ 10 #include "fwRuntime/config.hpp" 12 #include <fwCore/base.hpp> 14 #include <boost/filesystem/path.hpp> 15 #include <boost/make_shared.hpp> 16 #include <boost/utility.hpp> 47 typedef std::vector< std::string > ParamsContainer;
48 typedef std::function< int () > RunCallbackType;
97 FWRUNTIME_API
void start();
98 FWRUNTIME_API
void stop();
103 FWRUNTIME_API
int run();
104 FWRUNTIME_API
int defaultRun();
105 FWRUNTIME_API
void setRunCallback(RunCallbackType callback);
110 FWRUNTIME_API
void setup();
111 FWRUNTIME_API
void cleanup();
140 m_filePath = _filePath;
158 m_sVersion = _sVersion;
166 return m_checkSingleInstance;
176 m_checkSingleInstance = _checkSingleInstance;
180 android_app* getApp()
const 187 void setApp(android_app* app)
194 ParamsContainer getParams()
const 199 FWRUNTIME_API
void setParams(
const ParamsContainer& params);
200 FWRUNTIME_API
void setParams(
int argc,
char** argv);
224 typedef std::vector< SPTR(Activater) > ActivaterContainer;
225 typedef std::vector< SPTR(Starter) > StarterContainer;
226 typedef std::vector< SPTR(Stopper) > StopperContainer;
227 typedef std::vector< SPTR(Initializer) > InitializerContainer;
228 typedef std::vector< SPTR(Uninitializer) > UninitializerContainer;
230 ActivaterContainer m_activaters;
231 StarterContainer m_starters;
232 StopperContainer m_stoppers;
233 InitializerContainer m_initializers;
234 UninitializerContainer m_uninitializers;
237 std::string m_sVersion;
238 ::boost::filesystem::path m_filePath;
240 bool m_checkSingleInstance;
241 RunCallbackType m_run;
246 ParamsContainer m_params;
FWRUNTIME_API void add(std::shared_ptr< Activater > activater)
Adds a new activator.
FWRUNTIME_API void setCurrentProfile(Profile::sptr prof)
Set current profile.
Activates a given bundle with optional parameters.
Base class for all FW4SPL's classes.
FWRUNTIME_API Profile::sptr getCurrentProfile()
Get current profile.
std::string getName() const
Return profile name.
bool getCheckSingleInstance() const
Return profile CheckSingleInstance.
char ** getRawParams() const
Returns a raw pointer on internal arguments. The returned data shall not be modified. This is provided for external library needs (QApplication contructor for example)
void setFilePath(const ::boost::filesystem::path &_filePath)
Set profile m_filePath.
void setCheckSingleInstance(bool _checkSingleInstance)
Set profile CheckSingleInstance.
FWRUNTIME_API void setup()
Once started, setup the profile.
FWRUNTIME_API int run()
Run the profile.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
Implements a bundle set profile.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
std::string getVersion() const
Return profile version.
void setVersion(std::string _sVersion)
Set profile version.
FWRUNTIME_API void start()
Starts the profile.
FWRUNTIME_API Profile()
Constructor : does nothing.
void setName(std::string _sName)
Set profile name.
::boost::filesystem::path getFilePath() const
Get profile m_filePath.
int & getRawArgCount()
Returns internal arg count. The returned int shall not be modified. This is provided for external lib...