fw4spl
fwRuntime::Extension Struct Reference

Defines the extension class. More...

#include <Extension.hpp>

+ Inheritance diagram for fwRuntime::Extension:
+ Collaboration diagram for fwRuntime::Extension:

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< BundlegetBundle () 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 ContainergetElements () const
 Returns the configuration element container. More...
 
FWRUNTIME_API const std::shared_ptr< ConfigurationElementfindConfigurationElement (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
 

Detailed Description

Defines the extension class.

Definition at line 30 of file Extension.hpp.

Member Enumeration Documentation

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.

Constructor & Destructor Documentation

fwRuntime::Extension::Extension ( std::shared_ptr< Bundle bundle,
const std::string &  id,
const std::string &  point,
const xmlNodePtr  xmlNode 
)
protected

Constructor.

Parameters
[in]bundlea pointer to the bundle the extension is attached to
[in]ida string containing the extension identifier
[in]pointa string containing the extension point identifier
[in]xmlNodea pointer to the xml node that represents the extension

Definition at line 31 of file Extension.cpp.

Member Function Documentation

const std::string & fwRuntime::Extension::getIdentifier ( ) const

Retrieves the extension identifier.

Returns
a string containing the extension identifier (may be empty)

Definition at line 52 of file Extension.cpp.

Referenced by validate().

+ Here is the caller graph for this function:

const std::string & fwRuntime::Extension::getPoint ( ) const

Retrieves the extension point identifier.

Returns
a string containing 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.

Returns
the validity

Definition at line 73 of file Extension.cpp.

xmlNodePtr fwRuntime::Extension::getXmlNode ( ) const

Retrieves the xml node that represents the extension.

Returns
a pointer to an xml node

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.

Returns
the extension validity

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.

+ Here is the call graph for this function:


The documentation for this struct was generated from the following files: