Changeset 116 in pacpusframework for trunk/include/Pacpus/kernel/ComponentFactory.h
- Timestamp:
- 06/25/13 13:44:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/kernel/ComponentFactory.h
r115 r116 23 23 #include <Pacpus/kernel/ComponentFactoryBase.h> 24 24 25 #include <QtGlobal>26 25 #include <QString> 27 26 … … 37 36 /// @see pacpus::ComponentFactory 38 37 #define REGISTER_COMPONENT(className, factoryName) \ 39 static pacpus::ComponentFactory<className> sFactory(factoryName)38 static pacpus::ComponentFactory<className> sFactory(factoryName) 40 39 41 40 namespace pacpus { … … 50 49 { 51 50 BOOST_STATIC_ASSERT_MSG((boost::is_base_of<ComponentBase, T>::value), "T must inherit from ComponentBase"); 51 52 52 public: 53 /** Ctor of ComponentFactory, initialize the factory of the components of type @em T. 54 * @param type Name of the type of the components. 55 */ 53 /// Ctor of ComponentFactory, initialize the factory of the components of type @em T. 54 /// @param type Name of the type of the components. 56 55 ComponentFactory(const QString& type); 57 58 / ** Dtor of ComponentFactory. */56 57 /// Dtor of ComponentFactory. 59 58 virtual ~ComponentFactory(); 60 59 61 /** Get the name of the type of the components. 62 * @return Name of the type of the components. 63 */ 60 /// Gets the name of the type of the components. 61 /// @returns Name of the type of the components. 64 62 const QString& getType() const; 65 63 66 64 protected: 67 65 virtual ComponentBase* instantiateComponent(const QString& name); 68 66 69 67 private: 70 68 QString mType; … … 73 71 template <typename T> 74 72 ComponentFactory<T>::ComponentFactory(const QString& type) 75 : mType(type)73 : mType(type) 76 74 { 77 75 assert(!type.isEmpty()); … … 96 94 } 97 95 98 } // pacpus96 } // namespace pacpus 99 97 100 98 #endif // DEF_PACPUS_DBITEEXCEPTION_H
Note:
See TracChangeset
for help on using the changeset viewer.