fw4spl
|
Defines the bundle class. More...
#include <Bundle.hpp>
Public Types | |
Type definitions | |
typedef std::set< std::shared_ptr< ExecutableFactory > > | ExecutableFactoryContainer |
Defines the executable. | |
typedef ExecutableFactoryContainer::const_iterator | ExecutableFactoryConstIterator |
Defines the executable. | |
typedef std::set< std::shared_ptr< Extension > > | ExtensionContainer |
Defines the extension container. | |
typedef ExtensionContainer::const_iterator | ExtensionConstIterator |
Defines the extension container. | |
typedef std::set< std::shared_ptr< ExtensionPoint > > | ExtensionPointContainer |
Defines the extension point. | |
typedef ExtensionPointContainer::const_iterator | ExtensionPointConstIterator |
Defines the extension point. | |
typedef std::set< std::shared_ptr< dl::Library > > | LibraryContainer |
Defines the dynamic library container. | |
typedef LibraryContainer::const_iterator | LibraryConstIterator |
Defines the dynamic library container. | |
Public Member Functions | |
FWRUNTIME_API void | initialize () |
Initialize the bundle. More... | |
FWRUNTIME_API void | uninitialize () |
bool | isStarted () |
bool | isInitialized () |
Dynamic Libraries | |
FWRUNTIME_API void | addLibrary (std::shared_ptr< dl::Library > library) |
Adds the specified library to the bundle. More... | |
FWRUNTIME_API LibraryConstIterator | librariesBegin () const |
Retrieves the iterator on the first item in the managed dynamic library collection. More... | |
FWRUNTIME_API LibraryConstIterator | librariesEnd () const |
Retrieves the iterator on the ending item in the managed dynamic library collection. More... | |
Executable Factories & Dynamic Objects Instantiation | |
FWRUNTIME_API void | addExecutableFactory (std::shared_ptr< ExecutableFactory > factory) |
Adds an executable factory instance to the bundle. More... | |
FWRUNTIME_API IExecutable * | createExecutableInstance (const std::string &type) |
Create an instance of the given executable object type. More... | |
FWRUNTIME_API ExecutableFactoryConstIterator | executableFactoriesBegin () const |
Retrieves the iterator on the first item in the managed executable factory collection. More... | |
FWRUNTIME_API ExecutableFactoryConstIterator | executableFactoriesEnd () const |
Retrieves the iterator on the ending item in the managed executable factory collection. More... | |
FWRUNTIME_API std::shared_ptr< ExecutableFactory > | findExecutableFactory (const std::string &type) const |
Retrieves the executable factory instance for the specified type name. More... | |
Extensions | |
void | addExtension (std::shared_ptr< Extension > extension) |
Adds the specified extension to the bundle. More... | |
FWRUNTIME_API bool | hasExtension (const std::string &identifier) const |
Tells if an specific extension exists. More... | |
FWRUNTIME_API void | setEnableExtension (const std::string &identifier, const bool enable) |
Search a specific extension in the bundle to enable or disable it. More... | |
FWRUNTIME_API ExtensionConstIterator | extensionsBegin () const |
Retrieves the iterator on the first item in the managed extension collection. More... | |
FWRUNTIME_API ExtensionConstIterator | extensionsEnd () const |
Retrieves the iterator on the ending item in the managed extension collection. More... | |
Extension Points | |
void | addExtensionPoint (std::shared_ptr< ExtensionPoint > extension) |
Adds the specified extension point to the bundle. More... | |
FWRUNTIME_API std::shared_ptr< ExtensionPoint > | findExtensionPoint (const std::string &identifier) const |
Retrieves the extension point for the given identifier. More... | |
FWRUNTIME_API bool | hasExtensionPoint (const std::string &identifier) const |
Tells if a specific extension point exists. More... | |
FWRUNTIME_API void | setEnableExtensionPoint (const std::string &identifier, const bool enable) |
Search a specific extension point in the bundle to enable or disable it. More... | |
FWRUNTIME_API ExtensionPointConstIterator | extensionPointsBegin () const |
Retrieves the iterator on the first item in the managed extension point collection. More... | |
FWRUNTIME_API ExtensionPointConstIterator | extensionPointsEnd () const |
Retrieves the iterator on the ending item in the managed extension point collection. More... | |
Misc | |
FWRUNTIME_API void | addRequirement (const std::string &requirement) |
Adds a requirement to the bundle. More... | |
FWRUNTIME_API const std::string & | getIdentifier () const |
Retrieves the bundle identifier. More... | |
FWRUNTIME_APIconst::boost::filesystem::path & | getLibraryLocation () const |
Retrieves the bundle location. More... | |
FWRUNTIME_APIconst::boost::filesystem::path & | getResourcesLocation () const |
Retrieves the bundle location. More... | |
FWRUNTIME_API const std::string | getClass () const |
Retrieves the class representing the bundle executable part. More... | |
FWRUNTIME_API const Version & | getVersion () const |
Retrieves the version of the bundle. More... | |
FWRUNTIME_API std::shared_ptr< IPlugin > | getPlugin () const |
Retrieves the plugin instance for the specified bundle identifier. More... | |
State Management | |
FWRUNTIME_API bool | isEnable () const |
Tells if the bundle is enable. | |
FWRUNTIME_API void | setEnable (const bool state) |
Changes the enable state of the bundle. More... | |
FWRUNTIME_API void | start () |
Starts the bundle. More... | |
FWRUNTIME_API void | stop () |
Tells if the bundle is enable. | |
Parameters Management | |
FWRUNTIME_API void | addParameter (const std::string &identifier, const std::string &value) |
Adds a parameter to the bundle. More... | |
FWRUNTIME_API const std::string | getParameterValue (const std::string &identifier) const |
Retrieves the value of the given parameter. More... | |
FWRUNTIME_API bool | hasParameter (const std::string &name) const |
Tells if a parameter exists. More... | |
Static Public Member Functions | |
static std::shared_ptr< Bundle > | getLoadingBundle () |
Retrieves the pointer to the bundle that is currently loading its dynamic libraries. | |
static FWRUNTIME_API std::string | getBundleStr (const std::string &identifier, const Version &version) |
Static Public Attributes | |
static const char | s_VERSION_DELIMITER = '-' |
Protected Member Functions | |
Bundle (const ::boost::filesystem::path &location, const std::string &id, const std::string &version) | |
Constructor. More... | |
Bundle (const ::boost::filesystem::path &location, const std::string &id, const std::string &version, const std::string &pluginClass) | |
Constructor. More... | |
Friends | |
struct | ::fwRuntime::io::BundleDescriptorReader |
Defines the bundle class.
Definition at line 45 of file Bundle.hpp.
|
protected |
Constructor.
[in] | location | a path to the directory containing the bundle |
[in] | id | a string containing the bundle identifier |
[in] | version | a string containing the bundle version |
Definition at line 44 of file Bundle.cpp.
|
protected |
Constructor.
[in] | location | a path to the directory containing the bundle |
[in] | id | a string containing the bundle identifier |
[in] | version | a string containing the bundler version |
[in] | pluginClass | a string containing the bundle's pugin class name |
Definition at line 53 of file Bundle.cpp.
References SLM_ASSERT.
void fwRuntime::Bundle::addExecutableFactory | ( | std::shared_ptr< ExecutableFactory > | factory | ) |
Adds an executable factory instance to the bundle.
[in] | factory | a shared pointer to the executable factory instance to add |
Definition at line 78 of file Bundle.cpp.
void fwRuntime::Bundle::addExtension | ( | std::shared_ptr< Extension > | extension | ) |
Adds the specified extension to the bundle.
[in] | extension | a shared pointer to the extension to add |
Definition at line 115 of file Bundle.cpp.
void fwRuntime::Bundle::addExtensionPoint | ( | std::shared_ptr< ExtensionPoint > | extension | ) |
Adds the specified extension point to the bundle.
[in] | extension | a shared pointer to the extension point to add |
Definition at line 165 of file Bundle.cpp.
void fwRuntime::Bundle::addLibrary | ( | std::shared_ptr< dl::Library > | library | ) |
Adds the specified library to the bundle.
[in] | library | a shared pointer to the library to add |
Definition at line 232 of file Bundle.cpp.
References fwRuntime::dl::LibraryBridge< Implementor >::setBundle().
void fwRuntime::Bundle::addParameter | ( | const std::string & | identifier, |
const std::string & | value | ||
) |
Adds a parameter to the bundle.
[in] | identifier | a string containing the parameter identifier |
[in] | value | a string containing the parameter value |
Definition at line 554 of file Bundle.cpp.
void fwRuntime::Bundle::addRequirement | ( | const std::string & | requirement | ) |
Adds a requirement to the bundle.
[in] | requirement | a string containing a bundle identifier that is required |
Definition at line 254 of file Bundle.cpp.
FWRUNTIME_API IExecutable* fwRuntime::Bundle::createExecutableInstance | ( | const std::string & | type | ) |
Create an instance of the given executable object type.
type | a string containing an executable type |
Bundle::ExecutableFactoryConstIterator fwRuntime::Bundle::executableFactoriesBegin | ( | ) | const |
Retrieves the iterator on the first item in the managed executable factory collection.
Definition at line 85 of file Bundle.cpp.
Bundle::ExecutableFactoryConstIterator fwRuntime::Bundle::executableFactoriesEnd | ( | ) | const |
Retrieves the iterator on the ending item in the managed executable factory collection.
Definition at line 92 of file Bundle.cpp.
Bundle::ExtensionPointConstIterator fwRuntime::Bundle::extensionPointsBegin | ( | ) | const |
Retrieves the iterator on the first item in the managed extension point collection.
Definition at line 218 of file Bundle.cpp.
Bundle::ExtensionPointConstIterator fwRuntime::Bundle::extensionPointsEnd | ( | ) | const |
Retrieves the iterator on the ending item in the managed extension point collection.
Definition at line 225 of file Bundle.cpp.
Bundle::ExtensionConstIterator fwRuntime::Bundle::extensionsBegin | ( | ) | const |
Retrieves the iterator on the first item in the managed extension collection.
Definition at line 152 of file Bundle.cpp.
Bundle::ExtensionConstIterator fwRuntime::Bundle::extensionsEnd | ( | ) | const |
Retrieves the iterator on the ending item in the managed extension collection.
Definition at line 159 of file Bundle.cpp.
std::shared_ptr< ExecutableFactory > fwRuntime::Bundle::findExecutableFactory | ( | const std::string & | type | ) | const |
Retrieves the executable factory instance for the specified type name.
[in] | type | a string containing a type name |
Definition at line 99 of file Bundle.cpp.
std::shared_ptr< ExtensionPoint > fwRuntime::Bundle::findExtensionPoint | ( | const std::string & | identifier | ) | const |
Retrieves the extension point for the given identifier.
[in] | identifier | a string containing the extension point identifier |
Definition at line 172 of file Bundle.cpp.
const std::string fwRuntime::Bundle::getClass | ( | ) | const |
Retrieves the class representing the bundle executable part.
Definition at line 261 of file Bundle.cpp.
Referenced by start().
const std::string & fwRuntime::Bundle::getIdentifier | ( | ) | const |
Retrieves the bundle identifier.
Definition at line 268 of file Bundle.cpp.
Referenced by getVersion(), initialize(), and start().
const ::boost::filesystem::path & fwRuntime::Bundle::getLibraryLocation | ( | ) | const |
Retrieves the bundle location.
Definition at line 275 of file Bundle.cpp.
Referenced by fwRuntime::dl::Native::~Native().
const std::string fwRuntime::Bundle::getParameterValue | ( | const std::string & | identifier | ) | const |
Retrieves the value of the given parameter.
[in] | identifier | a string containing a parameter identifier |
Definition at line 561 of file Bundle.cpp.
std::shared_ptr< IPlugin > fwRuntime::Bundle::getPlugin | ( | ) | const |
Retrieves the plugin instance for the specified bundle identifier.
Definition at line 289 of file Bundle.cpp.
const ::boost::filesystem::path & fwRuntime::Bundle::getResourcesLocation | ( | ) | const |
Retrieves the bundle location.
Definition at line 282 of file Bundle.cpp.
const Version & fwRuntime::Bundle::getVersion | ( | ) | const |
Retrieves the version of the bundle.
Definition at line 296 of file Bundle.cpp.
References fwRuntime::Runtime::findEnabledBundle(), fwRuntime::Runtime::getDefault(), getIdentifier(), SLM_ASSERT, SLM_ERROR, SLM_TRACE, and SPTR.
Referenced by fwRuntime::dl::Native::getNativeName(), and start().
bool fwRuntime::Bundle::hasExtension | ( | const std::string & | identifier | ) | const |
Tells if an specific extension exists.
[in] | identifier | the extension identifier |
Definition at line 122 of file Bundle.cpp.
bool fwRuntime::Bundle::hasExtensionPoint | ( | const std::string & | identifier | ) | const |
Tells if a specific extension point exists.
[in] | identifier | the extension point identifier |
Definition at line 188 of file Bundle.cpp.
bool fwRuntime::Bundle::hasParameter | ( | const std::string & | name | ) | const |
Tells if a parameter exists.
Definition at line 570 of file Bundle.cpp.
References fwRuntime::Version::string().
void fwRuntime::Bundle::initialize | ( | ) |
Initialize the bundle.
Definition at line 501 of file Bundle.cpp.
References getIdentifier(), SLM_ASSERT, and SLM_TRACE.
Bundle::LibraryConstIterator fwRuntime::Bundle::librariesBegin | ( | ) | const |
Retrieves the iterator on the first item in the managed dynamic library collection.
Definition at line 240 of file Bundle.cpp.
Bundle::LibraryConstIterator fwRuntime::Bundle::librariesEnd | ( | ) | const |
Retrieves the iterator on the ending item in the managed dynamic library collection.
Definition at line 247 of file Bundle.cpp.
void fwRuntime::Bundle::setEnable | ( | const bool | state | ) |
Changes the enable state of the bundle.
Definition at line 547 of file Bundle.cpp.
void fwRuntime::Bundle::setEnableExtension | ( | const std::string & | identifier, |
const bool | enable | ||
) |
Search a specific extension in the bundle to enable or disable it.
[in] | identifier | the extension identifier |
[in] | enable | enable or disable this extension |
Definition at line 138 of file Bundle.cpp.
void fwRuntime::Bundle::setEnableExtensionPoint | ( | const std::string & | identifier, |
const bool | enable | ||
) |
Search a specific extension point in the bundle to enable or disable it.
[in] | identifier | the extension point identifier |
[in] | enable | enable or disable this extension point |
Definition at line 204 of file Bundle.cpp.
void fwRuntime::Bundle::start | ( | ) |
Starts the bundle.
Definition at line 389 of file Bundle.cpp.
References fwRuntime::Runtime::createExecutableInstance(), getClass(), fwRuntime::Runtime::getDefault(), getIdentifier(), getVersion(), SLM_ASSERT, SLM_TRACE, and SPTR.