Changeset 116 in pacpusframework for trunk/include/Pacpus/kernel/ComponentManager.h
- Timestamp:
- 06/25/13 13:44:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/kernel/ComponentManager.h
r76 r116 18 18 #define DEF_PACPUS_COMPONENTMANAGER_H 19 19 20 #include <Pacpus/kernel/ComponentFactoryBase.h> 20 21 #include <Pacpus/kernel/pacpus.h> 21 #include <Pacpus/kernel/ ComponentFactoryBase.h>22 #include <Pacpus/kernel/PacpusLibConfig.h> 22 23 #include <Pacpus/kernel/PacpusPluginInterface.h> 23 24 #include <Pacpus/kernel/XmlConfigFile.h> … … 41 42 { 42 43 friend class ComponentBase; 44 45 // Allow 2 functions to access to private members of ComponentManager 46 friend void ComponentFactoryBase::addFactory(ComponentFactoryBase * addr, const QString & type); 47 friend void ComponentFactoryBase::addComponent(const QString & name); 43 48 44 49 public: … … 68 73 }; 69 74 70 /** Load the components included in the XML config file. 71 * @param file Name of the XML file. 72 * @return Number of components loaded by the manager. 73 */ 75 /// Loads the components included in the XML config file. 76 /// @param file Name of the XML file. 77 /// @returns Number of components loaded by the manager. 74 78 PACPUSLIB_API std::size_t loadComponents(const QString& file); 75 79 76 /** Start all the components 77 * @return True if all the component has been started, otherwise false. 78 */ 80 /// Starts all the components 81 /// @return @b true if all the component has been started, @b false otherwise. 79 82 PACPUSLIB_API bool start(); 80 83 81 /** Start only the component passed in parameter. 82 * @param component Component to start. 83 * @return True if the component exists and has been started, otherwise false. 84 */ 84 /// Starts only the component passed in parameter. 85 /// @param component Component to start. 86 /// @returns @b true if the component exists and has been started, @b false otherwise. 85 87 PACPUSLIB_API bool start(const QString& component); 86 88 87 /** Stop all the components 88 * @return True if all the component has been stopped, otherwise false. 89 */ 89 /// Stops all the components 90 /// @returns @b true if all the component has been stopped, @b false otherwise. 90 91 PACPUSLIB_API bool stop(); 91 92 92 /** Stop only the component passed in parameter. 93 * @param component Component to stop. 94 * @return True if the component has been stopped, otherwise false. 95 */ 93 /// Stops only the component passed in parameter. 94 /// @param component Component to stop. 95 /// @returns @b true if the component has been stopped, @b false otherwise. 96 96 PACPUSLIB_API bool stop(const QString& component); 97 97 98 / ** Geta pointer to the component referred by @em name.99 * @param name Name of the component.100 * @return Pointer to the component if it exists, otherwise @em NULL.101 */98 /// Gets a pointer to the component referred by @em name. 99 /// 100 /// @param name Name of the component. 101 /// @returns Pointer to the component if it exists, @b NULL otherwise. 102 102 PACPUSLIB_API ComponentBase* getComponent(const QString& name); 103 103 104 /** Get the list of all the names of the component known by the manager. 105 * @return List of all the component's name. 106 */ 104 /// Gets the list of all the names of the component known by the manager. 105 /// @returns List of all the component's name. 107 106 PACPUSLIB_API QStringList getAllComponentsName() const; 108 107 109 /** Load a new plugin from the file filename (it may be a .so/.dll file) 110 * @param filename Name of the shared object or the dll. 111 * @return True if the plugin has been loaded, otherwise false. 112 */ 108 /// Loads a new plugin from the file filename (it may be a .so/.dll file) 109 /// @param filename Name of the shared object or the dll. 110 /// @returns @b true if the plugin has been loaded, @b false otherwise . 113 111 PACPUSLIB_API bool loadPlugin(const QString& filename); 114 112 … … 118 116 119 117 bool registerComponent(ComponentBase* addr, const QString& name); 120 bool registerComponentFactory(ComponentFactoryBase * addr, const QString& type);118 bool registerComponentFactory(ComponentFactoryBase * addr, const QString& type); 121 119 122 120 bool unRegisterComponent(const QString& name); 123 121 bool unRegisterComponentFactory(const QString& type); 124 125 // Allow 2 functions to access to private members of ComponentManager126 friend void ComponentFactoryBase::addFactory(ComponentFactoryBase* addr, const QString & type);127 friend void ComponentFactoryBase::addComponent(const QString & name);128 122 129 123 /// private constructor accessible only via static create() function
Note:
See TracChangeset
for help on using the changeset viewer.