7 #ifndef __FWRUNTIME_RUNTIME_HPP__ 8 #define __FWRUNTIME_RUNTIME_HPP__ 10 #include "fwRuntime/config.hpp" 11 #include "fwRuntime/RuntimeException.hpp" 12 #include "fwRuntime/Version.hpp" 14 #include <boost/filesystem/path.hpp> 22 struct ConfigurationElement;
24 struct ExtensionPoint;
26 struct ExecutableFactory;
69 FWRUNTIME_API
void setWorkingPath(const ::boost::filesystem::path& workingPath);
90 FWRUNTIME_API
void addBundle( std::shared_ptr< Bundle > bundle );
104 FWRUNTIME_API
void addBundles( const ::boost::filesystem::path& repository );
135 FWRUNTIME_API std::shared_ptr< Bundle >
findBundle(
const std::string& identifier,
146 FWRUNTIME_API std::shared_ptr< Bundle >
findEnabledBundle(
const std::string& identifier,
201 std::shared_ptr< ConfigurationElement > configurationElement );
210 FWRUNTIME_API std::shared_ptr< ExecutableFactory >
findExecutableFactory(
const std::string& type )
const;
219 FWRUNTIME_API std::shared_ptr< IPlugin >
getPlugin(
const std::shared_ptr< Bundle > bundle )
const;
234 FWRUNTIME_API
void addExtension( std::shared_ptr<Extension> extension);
264 FWRUNTIME_API std::shared_ptr< Extension >
findExtension(
const std::string& identifier )
const;
293 FWRUNTIME_API std::shared_ptr< ExtensionPoint >
findExtensionPoint(
const std::string& identifier )
const;
299 typedef std::set< std::shared_ptr< ExecutableFactory > > ExecutableFactoryContainer;
302 typedef std::set< std::shared_ptr<ExtensionPoint> > ExtensionPointContainer;
305 typedef std::vector< std::shared_ptr<IPlugin> > PluginContainer;
307 static std::shared_ptr<Runtime> m_instance;
309 ExecutableFactoryContainer m_executableFactories;
310 ExtensionContainer m_extensions;
311 ExtensionPointContainer m_extensionPoints;
312 BundleContainer m_bundles;
313 PluginContainer m_plugins;
315 ::boost::filesystem::path m_workingPath;
325 #endif // __FWRUNTIME_RUNTIME_HPP__ static FWRUNTIME_API Runtime * getDefault()
Retrieves the default runtime instance.
Defines the runtime class.
ExtensionContainer::iterator ExtensionIterator
Defines the extension container type.
FWRUNTIME_API void addExtension(std::shared_ptr< Extension > extension)
Registers a new extension.
FWRUNTIME_API ExtensionIterator extensionsEnd()
Retrieves the iterator on the end of the extension collection.
FWRUNTIME_API BundleIterator bundlesBegin()
Retrieves the iterator on the begining of the bundle collection.
FWRUNTIME_API std::shared_ptr< Bundle > findEnabledBundle(const std::string &identifier, const Version &version=Version()) const
Retrieves the enabled bundle for the specified idenfier.
FWRUNTIME_API IExecutable * createExecutableInstance(const std::string &type)
Create an instance of the given executable object type.
FWRUNTIME_API void unregisterExecutableFactory(std::shared_ptr< ExecutableFactory > factory)
Unregister a new executable factory instance to the runtime system.
FWRUNTIME_API std::shared_ptr< Extension > findExtension(const std::string &identifier) const
Retrieves the extension instance matching the specified identifier.
FWRUNTIME_API void setWorkingPath(const ::boost::filesystem::path &workingPath)
Set the working path where Bundles and share folder are located.
FWRUNTIME_API ExtensionIterator extensionsBegin()
Retrieves the iterator on the beginning of the extension collection.
FWRUNTIME_API void addBundle(std::shared_ptr< Bundle > bundle)
Adds a new bundle instance to the runtime system.
Defines the base executable interface.An executable object is an instance created by an extension poi...
FWRUNTIME_API void unregisterBundle(std::shared_ptr< Bundle > bundle)
Unregister a bundle instance to the runtime system.
FWRUNTIME_API BundleIterator bundlesEnd()
Retrieves the iterator on the end of the bundle collection.
Contains fwAtomsFilter::factory utilities.
FWRUNTIME_API std::shared_ptr< Bundle > findBundle(const std::string &identifier, const Version &version=Version()) const
Retrieves the bundle for the specified idenfier.
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.
FWRUNTIME_API std::shared_ptr< ExecutableFactory > findExecutableFactory(const std::string &type) const
Retrieves the executable factory for the given identifier.
~Runtime()
Destructor : does nothing.
std::set< std::shared_ptr< Extension > > ExtensionContainer
Defines the extension container type.
FWRUNTIME_API void addExecutableFactory(std::shared_ptr< ExecutableFactory > factory)
Adds a new executable factory instance to the runtime system.
FWRUNTIME_API std::shared_ptr< IPlugin > getPlugin(const std::shared_ptr< Bundle > bundle) const
Retrieves the plugin instance for the specified bundle.
FWRUNTIME_API void addBundles(const ::boost::filesystem::path &repository)
Adds all bundle found in the given path.
BundleContainer::iterator BundleIterator
Defines the bundle container iterator type.
Holds version information for libraries and bundles.
std::set< std::shared_ptr< Bundle > > BundleContainer
Defines the bundle container type.
FWRUNTIME_API void unregisterExtensionPoint(std::shared_ptr< ExtensionPoint > point)
Unregister a new extension point.
FWRUNTIME_API void addDefaultBundles()
Adds all bundle found at the default location.
FWRUNTIME_API void addExtensionPoint(std::shared_ptr< ExtensionPoint > point)
Registers a new extension point.
FWRUNTIME_API void unregisterExtension(std::shared_ptr< Extension > extension)
Unregister a new extension.
FWRUNTIME_API::boost::filesystem::path getWorkingPath() const
Get the path where Bundles and share folder are located.