15#define LDS_CFG Configuration::instance()
39 void setSupportedServices(
const std::list<ServiceInformation>& _services) { m_supportedServices = _services; };
40 const std::list<ServiceInformation>&
supportedServices(
void)
const {
return m_supportedServices; };
42 void setLauncherPath(
const std::string& _launcherPath) { m_launcherPath = _launcherPath; };
43 const std::string
launcherPath(
void)
const {
return m_launcherPath; };
55 bool m_configurationImported;
56 std::list<ServiceInformation> m_supportedServices;
57 std::string m_launcherPath;
58 std::string m_servicesLibraryPath;
59 unsigned int m_defaultMaxCrashRestarts;
60 unsigned int m_defaultMaxStartupRestarts;
This file contains defines that may be used simplyfy class creation.
Definition Configuration.h:17
virtual ~Configuration()
Definition Configuration.cpp:176
const std::list< ServiceInformation > & supportedServices(void) const
Definition Configuration.h:40
static Configuration & instance(void)
Definition Configuration.cpp:29
void setSupportedServices(const std::list< ServiceInformation > &_services)
Definition Configuration.h:39
unsigned int defaultMaxStartupRestarts(void) const
Definition Configuration.h:52
void setLauncherPath(const std::string &_launcherPath)
Definition Configuration.h:42
unsigned int defaultMaxCrashRestarts(void) const
Definition Configuration.h:49
void setDefaultMaxCrashRestarts(unsigned int _restarts)
Definition Configuration.h:48
bool supportsService(const std::string &_serviceName) const
Returns true if the provided service is supported by this LDS.
Definition Configuration.cpp:165
void setServicesLibraryPath(const std::string &_path)
Definition Configuration.h:45
void setDefaultMaxStartupRestarts(unsigned int _restarts)
Definition Configuration.h:51
virtual void setFromJsonObject(const ot::ConstJsonObject &_object) override
Will set the object contents from the provided JSON object.
Definition Configuration.cpp:49
int importFromEnvironment(void)
Will load the confiuguration from the environment Returns an exit code (use LDS_EXIT_....
Definition Configuration.cpp:139
virtual void addToJsonObject(ot::JsonValue &_object, ot::JsonAllocator &_allocator) const override
Add the object contents to the provided JSON object.
Definition Configuration.cpp:34
const std::string & servicesLibraryPath(void) const
Definition Configuration.h:46
const std::string launcherPath(void) const
Definition Configuration.h:43
The Serializable class is the default interface of serializable objects.
Definition Serializable.h:17
rapidjson::Value JsonValue
Writable JSON value.
Definition JSON.h:27
rapidjson::GenericObject< true, rapidjson::GenericValue< rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > > > ConstJsonObject
Read only JSON Object.
Definition JSON.h:35
rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > JsonAllocator
Allocator used for writing to JSON values.
Definition JSON.h:30