diff --git a/typefactory/typefactory.h b/typefactory/typefactory.h index acd90b0..ba3ac6e 100644 --- a/typefactory/typefactory.h +++ b/typefactory/typefactory.h @@ -5,20 +5,20 @@ /** * @brief The TypeFsactory class - base typefactory (abstract factory) template - * @param ClassId_T - unique class identification class. For example string, or integer id. - * @param BaseClass_T - all objects should have one base class. For example vehicle or parameter + * @param ClassId - unique class identification class. For example string, or integer id. + * @param BaseClass - all objects should have one base class. For example vehicle or parameter * @param Args - constructor arguments * * Usage example: * @code - * class Base_T { + * class Base { * public: * virtual int get() = 0; * } * - * class Derived1_T : public Base_T { + * class Derived1 : public Base { * public: - * Derived1_T (int start) : m_start(start){} + * Derived1 (int start) : m_start(start){} * int get() override { * return m_start + 1; * } @@ -26,9 +26,9 @@ * int m_start = 0; * } * - * class Derived2_T : public Base_T { + * class Derived2 : public Base { * public: - * Derived1_T (int start) : m_start(start){} + * Derived1 (int start) : m_start(start){} * int get() override { * return m_start + 2; * } @@ -38,7 +38,7 @@ * . * . * . - * TypeFsactory typefactory; + * TypeFsactory typefactory; * typefactory.registerType("one"); * typefactory.registerType("2"); * @@ -49,13 +49,13 @@ * d2->get(); * @endcode */ -template +template class TypeFsactory { public: /** * @brief BaseClass_SP - base class shared pointer type */ - typedef std::shared_ptr BaseClass_SP; + typedef std::shared_ptr BaseClass_SP; /** * @brief typefactoryFunction - typefactory function pointer type. Generally speaking it is pointer to constructor. */ @@ -75,7 +75,7 @@ class TypeFsactory { * @endcode */ template - void registerType (const ClassId_T& id) { + void registerType (const ClassId& id) { /// store pointer to constructor of Derived class classes[id] = &typefactory; } @@ -86,7 +86,7 @@ class TypeFsactory { * @return shared pointer to new class. * @throws std::out_of_range when id not found in map */ - typefactoryFunction create (const ClassId_T& id) const { + typefactoryFunction create (const ClassId& id) const { /// constructor of registered type will call here return classes.at (id); } @@ -94,7 +94,7 @@ class TypeFsactory { /** * @brief classes - main storage for pointers to constructors of registered types */ - std::unordered_map classes; + std::unordered_map classes; private: /**