34 #ifndef CARTOBASE_OBJECT_OBJECT_FACTORY_H 35 #define CARTOBASE_OBJECT_OBJECT_FACTORY_H 55 typedef std::map< std::string, ObjectFactoryFunction > FactoriesType;
58 static Object _defaultFactoryFunction();
64 inline void _registerDefaultFactory(
const std::string &type );
65 Object _createObject(
const std::string &type )
const;
69 FactoriesType _factories;
76 _singleton()._registerDefaultFactory<T>( type );
81 Object ObjectFactory::_defaultFactoryFunction()
93 inline void ObjectFactory::_registerDefaultFactory(
const std::string &type )
95 _registerFactory( type, &ObjectFactory::_defaultFactoryFunction<T> );
101 #endif // ifndef CARTOBASE_OBJECT_OBJECT_FACTORY_H
static void registerFactory(const std::string &type, ObjectFactoryFunction)
static Object createObject(const std::string &type)
Base class for reference counted objects (intrusive)
static Object value()
factory function: builds an Object by using the default constructor
Object(* ObjectFactoryFunction)()
static void registerDefaultFactory(const std::string &type)