CppMicroServices

C++ Micro Services: ModuleSettings Class Reference
ModuleSettings Class Reference

Query and set certain properties of the CppMicroServices library. More...

Public Types

typedef std::vector< std::string > PathList
 

Public Member Functions

 ModuleSettings ()
 
 ~ModuleSettings ()
 
 ModuleSettings (const ModuleSettings &)=delete
 
ModuleSettingsoperator= (const ModuleSettings &)=delete
 
bool IsThreadingSupportEnabled ()
 
bool IsAutoLoadingEnabled ()
 
void SetAutoLoadingEnabled (bool enable)
 Enable or disable auto-loading support. More...
 
PathList GetAutoLoadPaths ()
 
void SetAutoLoadPaths (const PathList &paths)
 Set a list of paths in the file-system from which modules should be auto-loaded. More...
 
void AddAutoLoadPath (const std::string &path)
 Add a path in the file-system to the list of paths from which modules will be auto-loaded. More...
 

Static Public Member Functions

static std::string CURRENT_MODULE_PATH ()
 Returns a special string which can be used as an argument for a AddAutoLoadPath() call. More...
 

Detailed Description

Query and set certain properties of the CppMicroServices library.

The following environment variables influence the runtime behavior of the CppMicroServices library:

  • US_DISABLE_AUTOLOADING If set, auto-loading of modules is disabled.
  • US_AUTOLOAD_PATHS A ':' (Unix) or ';' (Windows) separated list of paths from which modules should be auto-loaded.
Deprecated:
Use FrameworkFactory::NewFramework(std::map<std::string, std::string> configuration) to configure the framework.
Remarks
This class is thread safe.

Member Typedef Documentation

typedef std::vector<std::string> ModuleSettings::PathList

Constructor & Destructor Documentation

ModuleSettings::ModuleSettings ( )
ModuleSettings::~ModuleSettings ( )
ModuleSettings::ModuleSettings ( const ModuleSettings )
delete

Member Function Documentation

void ModuleSettings::AddAutoLoadPath ( const std::string &  path)

Add a path in the file-system to the list of paths from which modules will be auto-loaded.

Parameters
pathThe additional absolute auto-load path in the file-system.
static std::string ModuleSettings::CURRENT_MODULE_PATH ( )
static

Returns a special string which can be used as an argument for a AddAutoLoadPath() call.

When a module is loaded and this string has been added as a path to the list of auto-load paths the CppMicroServices library will auto-load all modules from the currently being loaded module's auto-load directory.

Returns
A string to be used in AddAutoLoadPath().
Remarks
The returned string is contained in the default set of auto-load paths, unless a new set of paths is given by a call to SetAutoLoadPaths().
See also
MicroServices_AutoLoading
US_INITIALIZE_MODULE
PathList ModuleSettings::GetAutoLoadPaths ( )
Returns
A list of paths in the file-system from which modules will be auto-loaded.
bool ModuleSettings::IsAutoLoadingEnabled ( )
Returns
true if support for module auto-loading is enabled, false otherwise.
Remarks
This method will always return false if support for auto-loading has not been configured into the CppMicroServices library or if it has been disabled by defining the US_DISABLE_AUTOLOADING environment variable.
bool ModuleSettings::IsThreadingSupportEnabled ( )
Returns
true if threading support has been configured into the CppMicroServices library, false otherwise.
ModuleSettings& ModuleSettings::operator= ( const ModuleSettings )
delete
void ModuleSettings::SetAutoLoadingEnabled ( bool  enable)

Enable or disable auto-loading support.

Parameters
enableIf true, enable auto-loading support, disable it otherwise.
Remarks
Calling this method will have no effect if support for auto-loading has not been configured into the CppMicroServices library of it it has been disabled by defining the US_DISABLE_AUTOLOADING envrionment variable.
void ModuleSettings::SetAutoLoadPaths ( const PathList paths)

Set a list of paths in the file-system from which modules should be auto-loaded.

Parameters
pathsA list of absolute file-system paths.