45 template <
typename Base,
typename constructorArg,
typename SharedPo
inter = std::shared_ptr<Base> >
51 std::string className;
78 if (subTypes()->find(name) == subTypes()->end())
80 ARMARX_DEBUG <<
"factory does not manage a type of name " << name;
85 ARMARX_DEBUG <<
"done initializing object for name " << name;
88 result->className = name;
101 std::vector<std::string> result;
102 typename std::map<std::string, initialisationFunction>::iterator it = subTypes()->begin();
104 for (; it != subTypes()->end(); ++it)
106 result.push_back(it->first);
119 return "AbstractFactoryMethod";
140 ARMARX_VERBOSE <<
typeid(Base).name() <<
"Registering factory '" << name <<
"' for function of type: "
141 << armarx::GetTypeString<Base>();
143 (*subTypes())[name] = init;
153 Base::registerClass(name, init);
164 static std::shared_ptr<std::map<std::string, initialisationFunction> > subTypes()
166 static std::shared_ptr<std::map<std::string, initialisationFunction> > subTypes(
new std::map<std::string, initialisationFunction>);