Class implements a factory pattern. More...
#include <valueFactory.hpp>
Public Member Functions | |
T | getValue (std::string name) |
returns enumeration value More... | |
void | registerValue (std::string, T) |
registers an enumeration value More... | |
Static Public Member Functions | |
static ValueFactory & | instance () |
returns reference to instance of singleton factory More... | |
Private Member Functions | |
ValueFactory () | |
constructor More... | |
ValueFactory (const ValueFactory &) | |
copy constructor More... | |
ValueFactory & | operator= (const ValueFactory &) |
assignment constructor More... | |
Private Attributes | |
std::map< std::string, T > | creators |
Map holding the creators of class and their string codes. More... | |
Detailed Description
template<class T>
class julian::ValueFactory< T >
Class implements a factory pattern.
Class implement singleton factory pattern. On the basis of string it creates the enumeration value is created.
Constructor & Destructor Documentation
|
inlineprivate |
constructor
Private constructors disables creating the instance of class
|
inlineprivate |
copy constructor
Private copy constructors disables copying the instance of class
Member Function Documentation
T julian::ValueFactory< T >::getValue | ( | std::string | name | ) |
returns enumeration value
If the key was not found in map, the default object is returned (first in map).
|
static |
returns reference to instance of singleton factory
|
inlineprivate |
assignment constructor
Private assignment constructor disables copying the instance of class
void julian::ValueFactory< T >::registerValue | ( | std::string | name, |
T | x | ||
) |
registers an enumeration value
Factory returns the enum basing on provided string, but first appropriate mapping must be created. This method registers the enum value
Member Data Documentation
|
private |
Map holding the creators of class and their string codes.
The documentation for this class was generated from the following file:
- C:/Unix/home/OEM/jULIAN/src/utils/valueFactory.hpp