27template <
typename BASE_T>
51template <
typename BASE_T,
typename CREATE_T>
66 CREATE_T* obj =
new CREATE_T();
77template <
typename BASE_T>
82 using CreatorMap = std::map<std::string, DtBaseCreator<BASE_T>*>;
111 template <
typename CREATE_T>
116 name =
typeid(CREATE_T).name();
125 LOG_WARN(
"Util") <<
"Replacing existing creator " << name << std::endl;
129 LOG_INFO(
"Util") <<
"Adding creator" << name << std::endl;
142 LOG_WARN(
"Util") <<
"Cannot find creator for " << name << std::endl;
146 return iter->second->create();
virtual BASE_T * create()=0
Pure virtual method to create an object.
DtBaseCreator()
Default constructor.
Definition factory.h:32
virtual ~DtBaseCreator()
Virtual destructor.
Definition factory.h:35
Concrete creator class for objects with a default constructor.
Definition factory.h:53
DtCreator()
Default constructor.
Definition factory.h:56
virtual CREATE_T * create() override
Creates a new instance of CREATE_T.
Definition factory.h:64
virtual ~DtCreator() override
Virtual destructor.
Definition factory.h:59
CreatorMap myCreators
Definition factory.h:156
BASE_T * create(std::string name)
Creates an object by name.
Definition factory.h:137
std::map< std::string, DtBaseCreator< DtValueTransform > * > CreatorMap
Definition factory.h:82
DtFactory()
Default constructor.
Definition factory.h:85
virtual ~DtFactory()
Virtual destructor.
Definition factory.h:90
CreatorMap & creatorMap()
Gets the map of registered creators.
Definition factory.h:152
void addCreator(std::string name="")
Registers a creator for a specific type.
Definition factory.h:112
Provides logging functionality with various severity levels and channels.
#define LOG_WARN(channel)
Macro to log a warning message to log files.
Definition logger.h:69
#define LOG_INFO(channel)
Macro to log an informational message to log files.
Definition logger.h:74
Include export definitions for this library.
Definition glsVreMessageUtil.h:49