fw4spl
|
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in the runtime environment from a configuration file . More...
Namespaces | |
dl | |
The namespace fwRuntime::dl contains classes to manage library module. | |
io | |
The namespace fwRuntime::io contains classes to read and perform profile file . | |
profile | |
The namespace fwRuntime::profile contains classes to manage bundle declares in profile.xml file (activate/start/stop). | |
utils | |
The namespace fwRuntime::utils contains template executable factory classes. | |
Classes | |
struct | Bundle |
Defines the bundle class. More... | |
struct | BundleElement |
Implements the base class for all element managed by a bundle. More... | |
struct | ConfigurationElement |
Defines the configuration element class. More... | |
struct | ConfigurationElementContainer |
Defines the generic configuration element container class. More... | |
class | Convert |
Defines the convert class. More... | |
class | EConfigurationElement |
Editable configuration element : allow the self configuration element building, which reading XML structure provided by bundle descriptions. More... | |
struct | EmptyPlugin |
Implements a default plugin for bundles that don't provide a fwRuntime::IPlugin interface implementation. This plugin does nothing by default. It has not been design to be subclassed, but subclassing is neither forbidden. More... | |
struct | Executable |
Provides a default fwRuntime::IExecutable interface implementation.This class provides a default implementation of the fwRuntime::IExecutable interface and is intended to be used as base class for user defined executable classes being exported by bundles. More... | |
struct | ExecutableFactory |
Defines the abstract executable factory class. More... | |
struct | ExecutableFactoryRegistrar |
Defines an executable factory registrar class.An instance of this class is responsible for the registration of an executable factory instance in the runtime environment. The factory instace gets registered as soon as a registrar instance gets created. That's why this class is design to be instanciated as static object. More... | |
struct | Extension |
Defines the extension class. More... | |
struct | ExtensionPoint |
Defines the extension point class. More... | |
struct | IExecutable |
Defines the base executable interface.An executable object is an instance created by an extension point of a plugin. More... | |
struct | IPlugin |
Defines the plugin interface. More... | |
struct | Plugin |
Provides a default plugin implementation. More... | |
struct | Runtime |
Defines the runtime class. More... | |
struct | RuntimeException |
Defines the runtime exception class. More... | |
struct | Version |
Holds version information for libraries and bundles. More... | |
Functions | |
FWRUNTIME_API std::pair< bool, std::string > | validateConfigurationElement (std::shared_ptr< ::fwRuntime::io::Validator > _validator,::fwRuntime::ConfigurationElement::sptr _element) |
Check configuration element (its XML representation) with respect to the validator (referencing the xsd schema) More... | |
FWRUNTIME_API void | ConfigurationElement2XML (::fwRuntime::ConfigurationElement::sptr _cfgElement, xmlNodePtr pNode) |
Update pNode content according to _cfgElement. More... | |
FWRUNTIME_API ConfigurationElement::sptr | getCfgAsAnExtension (ConfigurationElement::sptr _config, std::string _extension_pt) |
Returns the configuration element embedding the configuration to be considered for initializing an object or a service. More... | |
FWRUNTIME_API std::vector< ConfigurationElement::sptr > | getAllCfgForPoint (std::string _extension_pt) |
Returns configuration elements extending the _extension_pt extension point. | |
FWRUNTIME_API std::vector< std::shared_ptr< ::fwRuntime::Extension > > | getAllExtensionsForPoint (std::string extension_pt) |
Returns extensions extending the _extension_pt extension point. | |
FWRUNTIME_API std::map< std::string, ConfigurationElement::sptr > | getAllIdAndConfigurationElementsForPoint (std::string _extension_pt) |
Returns contribution ids and configuration elements related to a given extension point. More... | |
FWRUNTIME_API std::vector< std::string > | getAllIdsForPoint (std::string _extension_pt) |
Returns contribution ids to a given extension point. More... | |
FWRUNTIME_API std::string | getInfoForPoint (std::string _extension_pt) |
Get information for the point. More... | |
FWRUNTIME_API std::shared_ptr< ExtensionPoint > | findExtensionPoint (const std::string &identifier) |
Retrieves the extension point having the specified identifier. More... | |
template<typename T > | |
T * | createExecutableInstance (const std::shared_ptr< Extension > extension, const std::string &element="executable", const std::string &attribute="class") |
Creates an executable instance for the specified configuration element. More... | |
template<typename T > | |
T * | createExecutableInstance (const std::shared_ptr< ConfigurationElement > element, const std::string &attribute="class") |
Creates an executable instance for the specifed configuration element. More... | |
template<typename OutputIterator > | |
void | getAllExtensionsForPoint (const std::string &identifier, OutputIterator output) |
Retrieves all extensions for the point having the specified identifier. More... | |
template<typename OutputIterator > | |
void | getAllConfigurationElementsForPoint (const std::string &identifier, OutputIterator output) |
Retrieves all configuration elements for the point having the specified identifier. More... | |
template<typename Container > | |
const Container | getAllConfigurationElementsForPoint (const std::string &identifier) |
Retrieves all configuration elements for the point having the specified identifier. More... | |
template<typename Container , typename T > | |
const Container | getAllExecutableForPoint (const std::string &identifier, const std::string &attribute="class") |
Retrieves all executable objects for the point having the specified identifier. More... | |
FWRUNTIME_API std::shared_ptr< ConfigurationElement > | findConfigurationElement (const std::string &identifier, const std::string &pointIdentifier) |
Retrieve the configuation element with the given identifier for the given extension point. More... | |
FWRUNTIME_API std::shared_ptr< Extension > | findExtension (const std::string &identifier) |
Retrieve the extension having the specified identifier. More... | |
FWRUNTIME_API::boost::filesystem::path | getBundleResourcePath (const std::string &bundleIdentifier) noexcept |
Retrieve the filesystem valid path of resources of a bundle. More... | |
FWRUNTIME_API::boost::filesystem::path | getBundleResourceFilePath (const std::string &bundleIdentifier, const ::boost::filesystem::path &path) noexcept |
Retrieve a filesystem valid path for a path relative to the bundle having the specified identifier. More... | |
FWRUNTIME_API::boost::filesystem::path | getBundleResourceFilePath (const ::boost::filesystem::path &path) noexcept |
Retrieve a filesystem valid path for a resource path whose first element is a bundle identifier. For instance for "bundle-0.2/dir/file.txt", the function returns "/home/login/f4s/build/share/bundle-0.2/dir/file.txt". More... | |
FWRUNTIME_API::boost::filesystem::path | getLibraryResourceFilePath (const ::boost::filesystem::path &path) noexcept |
Retrieve a filesystem valid path for a resource path whose first element is a library identifier. For instance for "fwLib-0.2/dir/file.txt", the function returns "/home/login/f4s/build/share/fwLib-0.2/dir/file.txt". More... | |
FWRUNTIME_API::boost::filesystem::path | getResourceFilePath (const ::boost::filesystem::path &path) noexcept |
Retrieve a filesystem valid path for a resource path whose first element is a library or a bundle identifier. More... | |
FWRUNTIME_API::boost::filesystem::path | getBundleResourcePath (std::shared_ptr< Bundle > bundle, const ::boost::filesystem::path &path) noexcept |
Retrieve a filesystem valid path for a path relative to the specified bundle. More... | |
FWRUNTIME_API::boost::filesystem::path | getBundleResourcePath (std::shared_ptr< ConfigurationElement > element, const ::boost::filesystem::path &path) noexcept |
Retrieve a filesystem valid path for a path relative to the bundle of the specified configuration element. More... | |
FWRUNTIME_API::boost::filesystem::path | getBundleResourcePath (const IExecutable *executable, const ::boost::filesystem::path &path) noexcept |
Retrieve a filesystem valid path for a path relative to the specified executable instance. More... | |
FWRUNTIME_API void | addBundles (const boost::filesystem::path &directory) |
Loads all bundles that can be found in the specified directory. More... | |
FWRUNTIME_API std::shared_ptr< ::fwRuntime::profile::Profile > | startProfile (const boost::filesystem::path &path) |
Starts the given bundle set profile. More... | |
FWRUNTIME_API std::shared_ptr< Bundle > | findBundle (const std::string &identifier, const Version &version=Version()) |
Retrieves the bundle with the given identifier and version. More... | |
FWRUNTIME_API void | startBundle (const std::string &identifier) |
Starts the bundle specified by the given identifier. More... | |
std::ostream & | operator<< (std::ostream &_sstream, ConfigurationElement &_configurationElement) |
::boost::filesystem::path | getBundleResourcePath (ConfigurationElement::sptr element, const ::boost::filesystem::path &path) noexcept |
void | addBundles (const ::boost::filesystem::path &directory) |
::fwRuntime::profile::Profile::sptr | startProfile (const ::boost::filesystem::path &path) |
std::ostream & | operator<< (std::ostream &os, const Version &version) |
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in the runtime environment from a configuration file .
FWRUNTIME_API void fwRuntime::addBundles | ( | const boost::filesystem::path & | directory | ) |
Loads all bundles that can be found in the specified directory.
directory | a path to the directory to explore for bundles |
Referenced by getAllExecutableForPoint(), and getBundleResourcePath().
void fwRuntime::ConfigurationElement2XML | ( | ::fwRuntime::ConfigurationElement::sptr | _cfgElement, |
xmlNodePtr | pNode | ||
) |
Update pNode content according to _cfgElement.
Definition at line 51 of file fwRuntime/src/helper.cpp.
T* fwRuntime::createExecutableInstance | ( | const std::shared_ptr< Extension > | extension, |
const std::string & | element = "executable" , |
||
const std::string & | attribute = "class" |
||
) |
Creates an executable instance for the specified configuration element.
[in] | extension | a shared to an extension containing a configuration element to use for the executable instance creation |
[in] | element | a string containing the name of a configuration element |
[in] | attribute | a string containing an element attribute name to use as the executable type |
Definition at line 61 of file operations.hpp.
T* fwRuntime::createExecutableInstance | ( | const std::shared_ptr< ConfigurationElement > | element, |
const std::string & | attribute = "class" |
||
) |
Creates an executable instance for the specifed configuration element.
[in] | element | a shared pointer to a configuration element |
[in] | attribute | a string containing an element attribute name to use as the executable type |
Definition at line 87 of file operations.hpp.
References fwRuntime::Runtime::getDefault().
std::shared_ptr< Bundle > fwRuntime::findBundle | ( | const std::string & | identifier, |
const Version & | version = Version() |
||
) |
Retrieves the bundle with the given identifier and version.
identifier | a string containing a bunle identifier |
version | a version (none by default) |
Definition at line 233 of file operations.cpp.
References fwRuntime::Runtime::findBundle(), and fwRuntime::Runtime::getDefault().
Referenced by getAllExecutableForPoint().
ConfigurationElement::sptr fwRuntime::findConfigurationElement | ( | const std::string & | identifier, |
const std::string & | pointIdentifier | ||
) |
Retrieve the configuation element with the given identifier for the given extension point.
identifier | a string containing the configuration element identifier |
pointIdentifier | a string containing the extension point identifier |
Definition at line 56 of file operations.cpp.
Referenced by getAllExecutableForPoint().
std::shared_ptr< Extension > fwRuntime::findExtension | ( | const std::string & | identifier | ) |
Retrieve the extension having the specified identifier.
identifier | a string containing an extension identifier |
Definition at line 75 of file operations.cpp.
References fwRuntime::Runtime::findExtension(), and fwRuntime::Runtime::getDefault().
Referenced by getAllExecutableForPoint().
std::shared_ptr< ExtensionPoint > fwRuntime::findExtensionPoint | ( | const std::string & | identifier | ) |
Retrieves the extension point having the specified identifier.
[in] | identifier | a string containing an extension point identifier |
Definition at line 83 of file operations.cpp.
References fwRuntime::Runtime::findExtensionPoint(), and fwRuntime::Runtime::getDefault().
Referenced by getAllConfigurationElementsForPoint(), getAllExtensionsForPoint(), and getInfoForPoint().
void fwRuntime::getAllConfigurationElementsForPoint | ( | const std::string & | identifier, |
OutputIterator | output | ||
) |
Retrieves all configuration elements for the point having the specified identifier.
identifier | a string containing an extension point identifier |
output | an insert iterator used to store found configuration elements |
Definition at line 146 of file operations.hpp.
References findExtensionPoint(), OSLM_DEBUG, and OSLM_TRACE.
Referenced by getAllConfigurationElementsForPoint().
const Container fwRuntime::getAllConfigurationElementsForPoint | ( | const std::string & | identifier | ) |
Retrieves all configuration elements for the point having the specified identifier.
This method use the container type specified by the template parameter. The type of the elements of the container must be std::shared_ptr< ConfigurationElement > or the compilation will fail.
Definition at line 185 of file operations.hpp.
References getAllConfigurationElementsForPoint().
const Container fwRuntime::getAllExecutableForPoint | ( | const std::string & | identifier, |
const std::string & | attribute = "class" |
||
) |
Retrieves all executable objects for the point having the specified identifier.
identifier | a string containing the extension point identifier |
attribute | a string containing the name of the element attribute containing the executable identifier (default is "class") |
This method use the container type specified by the template parameter. The type of the elements of the container must be std::shared_ptr< T > or the compilation will fail (where T is the type of the executable you want to create).
Definition at line 213 of file operations.hpp.
References addBundles(), fwRuntime::ConfigurationElementContainer::begin(), fwRuntime::ConfigurationElementContainer::end(), findBundle(), findConfigurationElement(), findExtension(), getBundleResourceFilePath(), getBundleResourcePath(), getLibraryResourceFilePath(), getResourceFilePath(), startBundle(), and startProfile().
void fwRuntime::getAllExtensionsForPoint | ( | const std::string & | identifier, |
OutputIterator | output | ||
) |
Retrieves all extensions for the point having the specified identifier.
identifier | a string containing an extension point identifier |
output | an insert iterator used to store each found extension |
Definition at line 123 of file operations.hpp.
References findExtensionPoint().
std::map< std::string, ConfigurationElement::sptr > fwRuntime::getAllIdAndConfigurationElementsForPoint | ( | std::string | _extension_pt | ) |
Returns contribution ids and configuration elements related to a given extension point.
[in] | _extension_pt | : identifier of the extension point to which configuration elements contribute |
Definition at line 190 of file fwRuntime/src/helper.cpp.
std::vector< std::string > fwRuntime::getAllIdsForPoint | ( | std::string | _extension_pt | ) |
Returns contribution ids to a given extension point.
[in] | _extension_pt | : identifier of the extension point to which configuration elements contribute |
Definition at line 137 of file fwRuntime/src/helper.cpp.
|
noexcept |
Retrieve a filesystem valid path for a path relative to the bundle having the specified identifier.
bundleIdentifier | a string containing a bundle identifier |
path | a bundle relative path |
Definition at line 106 of file operations.cpp.
References fwRuntime::Runtime::findBundle(), getBundleResourcePath(), fwRuntime::Runtime::getDefault(), and SLM_ERROR.
Referenced by getAllExecutableForPoint(), uiImageQt::WindowLevel::starting(), and guiQt::Plugin::stop().
|
noexcept |
Retrieve a filesystem valid path for a resource path whose first element is a bundle identifier. For instance for "bundle-0.2/dir/file.txt", the function returns "/home/login/f4s/build/share/bundle-0.2/dir/file.txt".
path | relative path whose first element is a bundle identifier |
Definition at line 122 of file operations.cpp.
References fwRuntime::Runtime::findBundle(), getBundleResourcePath(), fwRuntime::Runtime::getDefault(), SLM_ASSERT, SLM_ERROR, and fwRuntime::Version::string().
|
noexcept |
Retrieve the filesystem valid path of resources of a bundle.
bundleIdentifier | a string containing a bundle identifier |
Definition at line 91 of file operations.cpp.
References fwRuntime::Runtime::findBundle(), fwRuntime::Runtime::getDefault(), and SLM_ERROR.
Referenced by getAllExecutableForPoint(), getBundleResourceFilePath(), and getBundleResourcePath().
|
noexcept |
Retrieve a filesystem valid path for a path relative to the specified bundle.
bundle | a pointer to a bundle instance |
path | a path relative to the bundle |
Definition at line 185 of file operations.cpp.
References getBundleResourcePath().
|
noexcept |
Retrieve a filesystem valid path for a path relative to the bundle of the specified configuration element.
element | a shared pointer to a configuration element instance |
path | a path relative to the bundle |
|
noexcept |
Retrieve a filesystem valid path for a path relative to the specified executable instance.
executable | a pointer to an executable instance |
path | a path relative to the bundle |
Definition at line 201 of file operations.cpp.
References fwRuntime::Runtime::addBundles(), addBundles(), fwRuntime::io::ProfileReader::createProfile(), getBundleResourcePath(), fwRuntime::Runtime::getDefault(), and startProfile().
ConfigurationElement::sptr fwRuntime::getCfgAsAnExtension | ( | ConfigurationElement::sptr | _config, |
std::string | _extension_pt | ||
) |
Returns the configuration element embedding the configuration to be considered for initializing an object or a service.
[in] | _config | : configuration element containing an attribute "config" specifying the name of the contribution to consider |
[in] | _extension_pt | : extension point to which the configuration should contribute with the name indicated by the previous "config" attribute value |
Definition at line 83 of file fwRuntime/src/helper.cpp.
References OSLM_FATAL_IF, OSLM_WARN_IF, and SLM_WARN_IF.
std::string fwRuntime::getInfoForPoint | ( | std::string | _extension_pt | ) |
Get information for the point.
Definition at line 160 of file fwRuntime/src/helper.cpp.
References findExtensionPoint().
|
noexcept |
Retrieve a filesystem valid path for a resource path whose first element is a library identifier. For instance for "fwLib-0.2/dir/file.txt", the function returns "/home/login/f4s/build/share/fwLib-0.2/dir/file.txt".
path | relative path whose first element is a library identifier |
Definition at line 161 of file operations.cpp.
References fwRuntime::Runtime::getDefault(), and fwRuntime::Runtime::getWorkingPath().
Referenced by getAllExecutableForPoint().
|
noexcept |
Retrieve a filesystem valid path for a resource path whose first element is a library or a bundle identifier.
For instance for a library:
For instance for a bundle:
"/home/login/f4s/build/share/bundle-0.2/dir/file.txt"
path | relative path whose first element is a bundle or library identifier |
Definition at line 171 of file operations.cpp.
References SLM_ERROR_IF.
Referenced by getAllExecutableForPoint().
void fwRuntime::startBundle | ( | const std::string & | identifier | ) |
Starts the bundle specified by the given identifier.
identifier | a string containing a bundle identifier |
Definition at line 240 of file operations.cpp.
References fwRuntime::Runtime::findBundle(), and fwRuntime::Runtime::getDefault().
Referenced by getAllExecutableForPoint().
FWRUNTIME_API std::shared_ptr< ::fwRuntime::profile::Profile > fwRuntime::startProfile | ( | const boost::filesystem::path & | path | ) |
Starts the given bundle set profile.
path | a path to an xml profile file |
Referenced by getAllExecutableForPoint(), and getBundleResourcePath().
std::pair< bool, std::string > fwRuntime::validateConfigurationElement | ( | std::shared_ptr< ::fwRuntime::io::Validator > | _validator, |
::fwRuntime::ConfigurationElement::sptr | _element | ||
) |
Check configuration element (its XML representation) with respect to the validator (referencing the xsd schema)
Definition at line 20 of file fwRuntime/src/helper.cpp.
References SLM_ASSERT.