- Timestamp:
- Jan 8, 2013, 1:51:02 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/kernel/ComponentManager.h
r14 r16 66 66 * @return Number of components loaded by the manager. 67 67 */ 68 PACPUSLIB_API std::size_t loadComponents( QStringfile);68 PACPUSLIB_API std::size_t loadComponents(const QString& file); 69 69 70 70 /** Start all the components … … 77 77 * @return True if the component exists and has been started, otherwise false. 78 78 */ 79 PACPUSLIB_API int start( QStringcomponent);79 PACPUSLIB_API int start(const QString& component); 80 80 81 81 /** Stop all the components … … 88 88 * @return True if the component has been stopped, otherwise false. 89 89 */ 90 PACPUSLIB_API int stop( QStringcomponent);90 PACPUSLIB_API int stop(const QString& component); 91 91 92 92 /** Get a pointer to the component referred by @em name. … … 94 94 * @return Pointer to the component if it exists, otherwise @em NULL. 95 95 */ 96 PACPUSLIB_API ComponentBase* getComponent( QStringname);96 PACPUSLIB_API ComponentBase* getComponent(const QString& name); 97 97 98 98 /** Get the list of all the names of the component known by the manager. … … 105 105 * @return True if the plugin has been loaded, otherwise false. 106 106 */ 107 PACPUSLIB_API bool loadPlugin( QStringfilename);107 PACPUSLIB_API bool loadPlugin(const QString& filename); 108 108 109 109 private: 110 110 /// Create a new component of type 'type' and with the name 'name' 111 bool createComponent( QString type, QStringname);111 bool createComponent(const QString& type, const QString& name); 112 112 113 bool registerComponent(ComponentBase * addr, QStringname);114 bool registerComponentFactory(ComponentFactoryBase * addr, QStringtype);113 bool registerComponent(ComponentBase* addr, const QString& name); 114 bool registerComponentFactory(ComponentFactoryBase* addr, const QString& type); 115 115 116 bool unRegisterComponent( QStringname);117 bool unRegisterComponentFactory( QStringtype);116 bool unRegisterComponent(const QString& name); 117 bool unRegisterComponentFactory(const QString& type); 118 118 119 119 // Allow 2 functions to access to private members of ComponentManager 120 friend void ComponentFactoryBase::addFactory(ComponentFactoryBase 120 friend void ComponentFactoryBase::addFactory(ComponentFactoryBase* addr, const QString & type); 121 121 friend void ComponentFactoryBase::addComponent(const QString & name); 122 122 -
trunk/src/PacpusLib/ComponentManager.cpp
r15 r16 54 54 } 55 55 56 bool ComponentManager::registerComponentFactory(ComponentFactoryBase * addr, QStringtype)56 bool ComponentManager::registerComponentFactory(ComponentFactoryBase* addr, const QString& type) 57 57 { 58 58 LOG_TRACE("registerComponentFactory(type="<< type << ")"); … … 71 71 } 72 72 73 bool ComponentManager::unRegisterComponentFactory( QStringtype)73 bool ComponentManager::unRegisterComponentFactory(const QString& type) 74 74 { 75 75 LOG_TRACE("unRegisterComponentFactory(type="<< type << ")"); … … 87 87 } 88 88 89 bool ComponentManager::registerComponent(ComponentBase * addr, QStringname)89 bool ComponentManager::registerComponent(ComponentBase* addr, const QString& name) 90 90 { 91 91 LOG_TRACE("registerComponent(name="<< name << ")"); … … 103 103 } 104 104 105 bool ComponentManager::unRegisterComponent( QStringname)105 bool ComponentManager::unRegisterComponent(const QString& name) 106 106 { 107 107 LOG_TRACE("unRegisterComponent(name="<< name << ")"); … … 121 121 } 122 122 123 bool ComponentManager::createComponent( QString type, QStringname)123 bool ComponentManager::createComponent(const QString& type, const QString& name) 124 124 { 125 125 LOG_TRACE("createComponent(type=" << type << ", " << "name="<< name << ")"); … … 136 136 } 137 137 138 bool ComponentManager::loadPlugin( QStringfilename)138 bool ComponentManager::loadPlugin(const QString& filename) 139 139 { 140 140 LOG_TRACE("loadPlugin(filename=" << filename << ")"); … … 163 163 } 164 164 165 std::size_t ComponentManager::loadComponents( QStringconfigFilename)165 std::size_t ComponentManager::loadComponents(const QString& configFilename) 166 166 { 167 167 LOG_TRACE("loadComponents(filename=" << configFilename << ")"); … … 265 265 } 266 266 267 int ComponentManager::start( QStringcomponentName)267 int ComponentManager::start(const QString& componentName) 268 268 { 269 269 LOG_TRACE("start(component=" << componentName << ")"); … … 297 297 } 298 298 299 int ComponentManager::stop( QStringcomponentName)299 int ComponentManager::stop(const QString& componentName) 300 300 { 301 301 LOG_TRACE("stop(component=" << componentName << ")"); … … 318 318 } 319 319 320 ComponentBase * ComponentManager::getComponent(QStringname)320 ComponentBase* ComponentManager::getComponent(const QString& name) 321 321 { 322 322 LOG_TRACE("getComponent(name=" << name << ")");
Note:
See TracChangeset
for help on using the changeset viewer.