9 #include "fwRuntime/BundleElement.hpp" 10 #include "fwRuntime/config.hpp" 11 #include "fwRuntime/Extension.hpp" 12 #include "fwRuntime/Runtime.hpp" 14 #include <fwCore/base.hpp> 16 #include <boost/filesystem/path.hpp> 28 struct BundleDescriptorReader;
41 friend struct ::fwRuntime::io::BundleDescriptorReader;
53 typedef std::back_insert_iterator< ConfigurationElementContainer > Inserter;
55 ConfigurationElementContainer container;
56 Inserter inserter(container);
58 getAllConfigurationElements<Inserter>( inserter );
70 template<
typename OutputIterator>
74 typedef std::vector< std::shared_ptr< Extension > > ExtensionContainer;
75 typedef std::back_insert_iterator< ExtensionContainer > Inserter;
77 ExtensionContainer extensions;
78 Inserter inserter(extensions);
80 getAllExtensions( inserter );
83 for( ExtensionContainer::const_iterator i = extensions.begin(); i != extensions.end(); ++i )
85 std::shared_ptr< Extension > extension( *i );
86 if ( extension->isEnable() )
88 std::copy( extension->begin(), extension->end(), output);
90 OSLM_DEBUG_IF(
"getAllConfigurationElements for point=" << extension->getPoint() <<
91 " extension" << extension->getIdentifier() <<
"extension disabled", !extension->isEnable());
101 template<
typename OutputIterator>
108 std::shared_ptr< Extension > extension( *i );
109 if( extension->getPoint() == m_id && extension->isEnable() ==
true 124 FWRUNTIME_API
const std::string& getIdentifier()
const;
131 FWRUNTIME_API std::shared_ptr< io::Validator > getExtensionValidator()
const;
145 const std::shared_ptr<Bundle> bundle,
146 const std::string&
id,
147 const boost::filesystem::path& schema);
151 const std::string m_id;
153 const ::boost::filesystem::path m_schema;
155 mutable std::shared_ptr< io::Validator > m_validator;
static FWRUNTIME_API Runtime * getDefault()
Retrieves the default runtime instance.
Defines the runtime class.
ExtensionContainer::iterator ExtensionIterator
Defines the extension container type.
The extension passed the validation.
Implements the base class for all element managed by a bundle.
#define OSLM_DEBUG_IF(message, cond)
FWRUNTIME_API ExtensionIterator extensionsEnd()
Retrieves the iterator on the end of the extension collection.
FWRUNTIME_API ExtensionIterator extensionsBegin()
Retrieves the iterator on the beginning of the extension collection.
Defines the extension point class.
std::vector< std::shared_ptr< ConfigurationElement > > Container
Defines the configuration element container type.
void getAllConfigurationElements(OutputIterator &output) const
Retrieves all configuration elements contributed by extensions connected to the extension point insta...
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
const ConfigurationElementContainer getAllConfigurationElements() const
Retrieves all configuration elements contributed by extensions connected to the extension point insta...
void getAllExtensions(OutputIterator &output) const
Retrieves all extensions contributed to the point instance.