fw4spl
|
Defines the extension class. More...
#include <Extension.hpp>
Public Types | |
enum | Validity { UnknownValidity, Valid, Invalid } |
Defines the validity states of an extension. More... | |
Public Types inherited from fwRuntime::ConfigurationElementContainer | |
typedef std::vector< std::shared_ptr< ConfigurationElement > > | Container |
Defines the configuration element container type. More... | |
typedef Container::iterator | Iterator |
Defines the configuration element container type. More... | |
Public Member Functions | |
~Extension () | |
Destructor. | |
FWRUNTIME_API const std::string & | getIdentifier () const |
Retrieves the extension identifier. More... | |
FWRUNTIME_API const std::string & | getPoint () const |
Retrieves the extension point identifier. More... | |
FWRUNTIME_API Validity | getValidity () const |
Retrieves the validity of the extension. More... | |
FWRUNTIME_API xmlNodePtr | getXmlNode () const |
Retrieves the xml node that represents the extension. More... | |
FWRUNTIME_API Validity | validate () |
Validates the extension. More... | |
Public Member Functions inherited from fwRuntime::BundleElement | |
FWRUNTIME_API std::shared_ptr< Bundle > | getBundle () const |
Retrieves the bundle that owns the extension. More... | |
FWRUNTIME_API bool | isEnable () const |
Tells if the element is enabled or not. More... | |
FWRUNTIME_API void | setEnable (const bool enable) |
Set if the element is enabled or not. More... | |
Public Member Functions inherited from fwRuntime::ConfigurationElementContainer | |
FWRUNTIME_API Iterator | begin () |
Retrieves the iterator on the first managed configuration element. More... | |
FWRUNTIME_API Iterator | end () |
Retrieves the iterator on the end of the configuration element container. More... | |
FWRUNTIME_API const Container & | getElements () const |
Returns the configuration element container. More... | |
FWRUNTIME_API const std::shared_ptr< ConfigurationElement > | findConfigurationElement (const std::string &name) const |
Retrieves the first configuration corresponding to the specified name. More... | |
FWRUNTIME_API bool | hasConfigurationElement (const std::string &name) const |
Test if has an configuration corresponding to the specified name. More... | |
FWRUNTIME_API ConfigurationElementContainer | findAllConfigurationElement (const std::string &name) const |
Retrieves the configurations corresponding to the specified name. More... | |
FWRUNTIME_API size_t | size () const |
Return the number of configurations. More... | |
Protected Member Functions | |
Extension (std::shared_ptr< Bundle > bundle, const std::string &id, const std::string &point, const xmlNodePtr xmlNode) | |
Constructor. More... | |
Protected Member Functions inherited from fwRuntime::BundleElement | |
BundleElement () | |
Constructor. More... | |
BundleElement (std::shared_ptr< Bundle > bundle) | |
Constructor. More... | |
Protected Member Functions inherited from fwRuntime::ConfigurationElementContainer | |
FWRUNTIME_API void | addConfigurationElement (std::shared_ptr< ConfigurationElement > element) |
Adds a new configuration element to the extension. More... | |
Friends | |
struct | ::fwRuntime::io::BundleDescriptorReader |
Defines the extension class.
Definition at line 30 of file Extension.hpp.
Defines the validity states of an extension.
Enumerator | |
---|---|
UnknownValidity |
The extension has not been validated. |
Valid |
The extension passed the validation. |
Invalid |
The extension failed the validation. |
Definition at line 38 of file Extension.hpp.
|
protected |
Constructor.
[in] | bundle | a pointer to the bundle the extension is attached to |
[in] | id | a string containing the extension identifier |
[in] | point | a string containing the extension point identifier |
[in] | xmlNode | a pointer to the xml node that represents the extension |
Definition at line 31 of file Extension.cpp.
const std::string & fwRuntime::Extension::getIdentifier | ( | ) | const |
Retrieves the extension identifier.
Definition at line 52 of file Extension.cpp.
Referenced by validate().
const std::string & fwRuntime::Extension::getPoint | ( | ) | const |
Retrieves the extension point identifier.
Definition at line 59 of file Extension.cpp.
Extension::Validity fwRuntime::Extension::getValidity | ( | ) | const |
Retrieves the validity of the extension.
The validity is computed using the xml node representing the extension and the xml schema of the extension's related extension point. When the extension point does not provide a schema, the extension is assumed to be valid.
Definition at line 73 of file Extension.cpp.
xmlNodePtr fwRuntime::Extension::getXmlNode | ( | ) | const |
Retrieves the xml node that represents the extension.
Definition at line 66 of file Extension.cpp.
Extension::Validity fwRuntime::Extension::validate | ( | ) |
Validates the extension.
Calling this method more than one time will only cause the current validity to be returned.
Definition at line 80 of file Extension.cpp.
References fwRuntime::Runtime::findExtensionPoint(), fwRuntime::BundleElement::getBundle(), fwRuntime::Runtime::getDefault(), getIdentifier(), Invalid, OSLM_ASSERT, OSLM_ERROR, UnknownValidity, and Valid.