Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ComponentManager.h

Go to the documentation of this file.
00001 
00051 #ifndef _AMIRE_COMPONENT_COMPONENT_MANAGER_H
00052 #define _AMIRE_COMPONENT_COMPONENT_MANAGER_H
00053 
00054 #include <amire/common/Defines.h>
00055 #include <amire/property/PropertyTypeManager.h>
00056 #include "amire/component/ComponentContext.h"
00057 #include "amire/component/ComposedComponent.h"
00058 #include <amire/component/ComponentState.h>
00059 
00060 #include <amire/persistence/DependencyHandler.h>
00061 
00062 namespace amire {
00063   namespace component {
00073     class AMIRE_EXPORT_API ComponentManager : public virtual ComponentContext {
00074     private:
00075       static osg::ref_ptr<ComponentManager> defaultComponentManager;
00076 
00077     public:
00082       static ComponentManager *getDefaultComponentManager();
00083 
00084     private:
00085       StringToComponentMap componentPrototypes;
00086       mutable ComponentStateMap statePrototypes;
00087       amire::property::PropertyTypeManager *propertyTypeManager;
00088       long nextId;
00089       osg::ref_ptr<amire::common::Category> rootCategory;
00090       bool reinitialize;
00091       std::vector<std::string> componentLibraries;
00092 #ifdef WIN32
00093       std::vector<HMODULE> libraryModules;
00094 #endif
00095       ConnectionFilterMap connectionFilterMap;
00096       std::string libraryName;
00097       std::vector<osg::ref_ptr<const ComposedComponent> > localComposedComponentPrototypes;
00098       std::vector<osg::ref_ptr<ConfigurationPropertyExport> > configurationPropertyExports;
00099 
00100     public:
00105       ComponentManager();
00106 
00111       ComponentManager(amire::property::PropertyTypeManager *propertyTypeManager);
00112       virtual ~ComponentManager();
00113 
00118       virtual osg::ref_ptr<const Component> getComponentPrototype(const std::string &name);
00119 
00125       void registerState(const osg::ref_ptr<const ComponentState> &state);
00126 
00132       void registerComponentPrototype(const osg::ref_ptr<Component> &component);
00133 
00139       void registerConnectionFilter(const osg::ref_ptr<ConnectionFilter> &connectionFilter);
00140 
00147       void registerConfigurationPropertyExport(const osg::ref_ptr<ConfigurationPropertyExport> &export);
00148 
00153       const osg::ref_ptr<ConfigurationPropertyExport> &getConfigurationPropertyExport(const std::string &exportName);
00154 
00159       bool containsConfigurationPropertyExport(const std::string &exportName);
00160 
00164       const std::vector<osg::ref_ptr<ConfigurationPropertyExport> > &getConfigurationPropertyExports();
00165 
00171       const osg::ref_ptr<ConnectionFilter> &getConnectionFilter(const std::string &connectionFilterName) const;
00172 
00180       void addComponentLibrary(const std::string &filename, bool baseLibrary = true, amire::persistence::DependencyHandler* handler = NULL);
00181 
00187       bool containsComponentLibrary(const std::string &filename) const;
00188 
00192       void removeComponentLibrary(const std::string &filename);
00193 
00197       const std::vector<std::string> &getComponentLibraryList();
00198 
00203       const ComponentMap &getProtoTypes() const;
00204 
00209       const osg::ref_ptr<const ComponentState> &getState(const std::string &name) const;
00210 
00214       bool isStateRegistered(const std::string &name) const;
00215 
00220       amire::property::PropertyTypeManager *getPropertyTypeManager() const;
00221 
00225       osg::ref_ptr<const amire::common::Category> getRootCategory() const;
00226 
00230       void setReinitializeRequest(bool reinitialize = true);
00231 
00235       bool isReinitializeRequested();
00236 
00241       const std::vector<osg::ref_ptr<const ComposedComponent> > &getLocalComposedComponentPrototypes() const;
00242 
00243     private:
00244       friend class Component;
00245 
00249       long nextPrototypeId();
00250     };
00251   }
00252 }
00253 
00254 #endif

Generated on Tue May 20 17:23:52 2003 for AMIRE-Framework by doxygen1.3