Changeset 43 in pacpusframework
- Timestamp:
- Jan 8, 2013, 9:53:01 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/kernel/ComponentFactoryBase.h
r31 r43 1 1 /** 2 2 * 3 * Distributed under the UTC Heudiascy Pacpus License, Version 1.0. 4 * Copyright (c) UTC Heudiasyc 2010 - 2013. All rights reserved. 5 * 6 * See the LICENSE file for more information or a copy at: 7 * http://www.hds.utc.fr/~kurdejma/LICENSE_1_0.txt 8 * 3 * This file is part of the PACPUS framework distributed under the 4 * CECILL-C License, Version 1.0. 5 * 6 * @author Gerald Dherbomez 7 * @date December, 2012 8 * @version $Id$ 9 * @copyright Copyright (c) UTC/CNRS Heudiasyc 2005 - 2013. All rights reserved. 10 * 9 11 */ 10 12 … … 27 29 { 28 30 friend class ComponentManager; 29 30 31 public: 31 ComponentFactoryBase(); 32 virtual ~ComponentFactoryBase(); 32 /** Ctor of ComponentFactoryBase. */ 33 ComponentFactoryBase(); 34 /** Dtor of ComponentFactoryBase. */ 35 virtual ~ComponentFactoryBase(); 33 36 34 37 protected: 35 virtual ComponentBase * instantiateComponent(const QString & name) = 0; 36 void addFactory(ComponentFactoryBase * addr, const QString & type); 37 void addComponent(const QString & name); 38 /** Create a new component having @em name as component name. 39 * @param name Name of the instantiated component. 40 * @return Pointer on the newly created component, you become the owner of its lifetime. 41 */ 42 virtual ComponentBase * instantiateComponent(const QString& name) = 0; 43 44 /** Register a new factory. 45 * @param addr Address of the factory. 46 * @param type Name of the type created by the factory. 47 */ 48 void addFactory(ComponentFactoryBase* addr, const QString& type); 49 50 /** Add a new component. 51 * @param name Name of the new component. 52 */ 53 void addComponent(const QString& name); 38 54 39 55 private: 40 ComponentManager 56 ComponentManager* mgr_; 41 57 }; 42 58 -
trunk/src/PacpusLib/ComponentFactoryBase.cpp
r31 r43 1 1 /** 2 2 * 3 * Distributed under the UTC Heudiascy Pacpus License, Version 1.0. 4 * Copyright (c) UTC Heudiasyc 2010 - 2013. All rights reserved. 5 * 6 * See the LICENSE file for more information or a copy at: 7 * http://www.hds.utc.fr/~kurdejma/LICENSE_1_0.txt 8 * 3 * This file is part of the PACPUS framework distributed under the 4 * CECILL-C License, Version 1.0. 5 * 6 * @author Gerald Dherbomez 7 * @date December, 2012 8 * @version $Id$ 9 * @copyright Copyright (c) UTC/CNRS Heudiasyc 2005 - 2013. All rights reserved. 10 * 9 11 */ 10 12 … … 22 24 23 25 ComponentFactoryBase::ComponentFactoryBase() 26 : mgr_(NULL) 24 27 { 25 28 LOG_TRACE("constructor"); 26 27 29 // get the adress of the ComponentManager instance 28 30 mgr_ = ComponentManager::getInstance(); … … 34 36 } 35 37 36 void ComponentFactoryBase::addFactory(ComponentFactoryBase * addr, const QString& type)38 void ComponentFactoryBase::addFactory(ComponentFactoryBase* addr, const QString& type) 37 39 { 38 40 LOG_DEBUG("addFactory(type="<< type << ")"); … … 48 50 } 49 51 50 void ComponentFactoryBase::addComponent(const QString 52 void ComponentFactoryBase::addComponent(const QString& name) 51 53 { 52 54 LOG_DEBUG("addComponent(" << name << ")");
Note:
See TracChangeset
for help on using the changeset viewer.