24 template <
typename CtorSignature>
class Factory;
26 template<
class BaseType,
class ...ParamType>
31 using CreateObjectFunc = BaseType (*)(ParamType...);
37 std::vector<string> names;
38 for(
auto const& createIter: _create)
39 names.push_back(createIter.first);
46 static Factory<BaseType (ParamType...)> fact;
52 const Factory<BaseType (ParamType...)> * operator() ()
const {
return Instance();}
53 Factory<BaseType (ParamType...)> * operator() () {
return Instance();}
56 BaseType
Create(
string name, ParamType ...param) {
57 typename map<string,CreateObjectFunc>::const_iterator objItr = _create.find(name);
58 if (objItr != _create.end()) {
59 return (objItr->second)(param...);
68 template<
class DerivedType>
71 _create[name] = &createObj<DerivedType>;
76 map<string,CreateObjectFunc> _create;
79 template <
class DerivedType>
80 static BaseType createObj(ParamType ...param)
81 {
return new DerivedType(param...);}
Holds a base class that all action classes will be derived from.
The base class that all estimator classes will be derived from.
Factory< BaseType(ParamType...)> * Instance()
Singleton access.
vector< string > getNames() const
The names of all objects instatiated by the factory.
BaseType Create(string name, ParamType ...param)
Return an instantiated object with a given name.
bool Register(string name)
Register the derived type with a descriptive name in the map.
An abstract factory class which creates new object instances based on a string descripter and constru...
The base class that all moves will be derived from.
The space-time trajectories.