8 #pragma GCC visibility push(default) 12 #include <libxml/xmlstring.h> 14 #pragma GCC visibility pop 17 #include <fwCore/base.hpp> 19 #include "fwRuntime/Bundle.hpp" 20 #include "fwRuntime/ExtensionPoint.hpp" 21 #include "fwRuntime/Runtime.hpp" 22 #include "fwRuntime/io/Validator.hpp" 23 #include "fwRuntime/Extension.hpp" 24 #include "fwRuntime/helper.hpp" 36 m_xmlDoc ( xmlNewDoc(BAD_CAST
"1.0") ),
37 m_xmlNode ( xmlCopyNode(xmlNode, 1) ),
38 m_validity ( UnknownValidity )
40 xmlDocSetRootElement(m_xmlDoc, m_xmlNode);
47 xmlFreeDoc( m_xmlDoc );
99 std::shared_ptr< io::Validator > validator(
point->getExtensionValidator() );
100 OSLM_ASSERT(
"The validator creation failed for the point "<<
point->getIdentifier(), validator );
103 validator->clearErrorLog();
104 if( validator->validate( m_xmlNode ) == true )
111 const std::string identifier = m_id.empty() ?
"anonymous" : m_id;
114 <<
": invalid extension XML element node does not respect schema. Verification error log is : " 115 << std::endl << validator->getErrorLog() );
123 void Extension::operator=(
const Extension&) noexcept
static FWRUNTIME_API Runtime * getDefault()
Retrieves the default runtime instance.
Defines the runtime class.
The extension passed the validation.
#define OSLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
Implements the base class for all element managed by a bundle.
Defines the extension class.
Defines the runtime exception class.
Extension(std::shared_ptr< Bundle > bundle, const std::string &id, const std::string &point, const xmlNodePtr xmlNode)
Constructor.
Validity
Defines the validity states of an extension.
The extension failed the validation.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
FWRUNTIME_API std::shared_ptr< ExtensionPoint > findExtensionPoint(const std::string &identifier) const
Retrieves the extension point instance matching the specified identifier.
#define OSLM_ERROR(message)
FWRUNTIME_API const std::string & getIdentifier() const
Retrieves the extension identifier.
FWRUNTIME_API std::shared_ptr< Bundle > getBundle() const
Retrieves the bundle that owns the extension.
FWRUNTIME_API Validity getValidity() const
Retrieves the validity of the extension.
FWRUNTIME_API Validity validate()
Validates the extension.
FWRUNTIME_API const std::string & getPoint() const
Retrieves the extension point identifier.
FWRUNTIME_API xmlNodePtr getXmlNode() const
Retrieves the xml node that represents the extension.
The extension has not been validated.