1#ifndef FACTORY_INCLUDED
2#define FACTORY_INCLUDED
10 template<
typename BaseType >
32 template<
typename DerivedType >
35 static_assert( std::is_base_of< BaseType , DerivedType >::value ,
"[ERROR] BaseType must be base of DerivedType" );
36 BaseType *baseType =
new DerivedType();
43 template<
typename BaseType ,
typename DerivedType >
46 static_assert( std::is_base_of< BaseType , DerivedType >::value ,
"[ERROR] BaseType must be base of DerivedType" );
51 BaseType *
_create(
void ){
return new DerivedType(); }
BaseType * create(void)
Definition: factory.h:33
virtual BaseType * _create(void)=0
std::vector< BaseType * > _baseTypes
Definition: factory.h:14
virtual ~BaseFactory(void)
Definition: factory.h:21
BaseType * create(void)
Definition: factory.h:24
BaseType * _create(void)
Definition: factory.h:51