17template<
typename TYPE>
26template<
typename TYPE>
28 const std::string& str_author,
29 const std::string& str_version,
30 const std::string& str_brief_desc,
31 const std::string& str_long_desc,
32 const std::string& str_status,
35 psTypeInfo->
Author = str_author;
36 psTypeInfo->
Version = str_version;
39 psTypeInfo->
Status = str_status;
40 psTypeInfo->
Creator = pc_creator;
47template<
typename TYPE>
49 typename TTypeMap::iterator it =
GetTypeMap().find(str_label);
51 return it->second->Creator();
61template<
typename TYPE>
63 typename TTypeMap::iterator it =
GetTypeMap().find(str_label);
70template<
typename TYPE>
72 typename TTypeMap::iterator it;
73 c_os <<
"Symbols:" << std::endl;
77 c_os << it->first <<
" (" << it->second->BriefDescription <<
")" << std::endl;
84template<
typename TYPE>
86 typename TTypeMap::iterator it;
#define THROW_ARGOSEXCEPTION(message)
This macro throws an ARGoS exception with the passed message.
TYPE * TCreator()
Pointer to the function that creates objects of type TYPE
static void Print(std::ostream &c_os)
Prints the list of registered labels.
static TYPE * New(const std::string &str_label)
Creates a new object of type TYPE
static bool Exists(const std::string &str_label)
Returns true if the given label exists in the TYPE map.
static TTypeMap & GetTypeMap()
Creates and returns the TYPE map.
std::map< std::string, STypeInfo * > TTypeMap
The map of registered TYPEs.
static void Destroy()
Frees up all used memory.
static void Register(const std::string &str_label, const std::string &str_author, const std::string &str_version, const std::string &str_brief_desc, const std::string &str_long_desc, const std::string &str_status, TCreator *pc_creator)
Registers a new TYPE creator in the factory.
A struct containing the information about the registered types.
std::string BriefDescription
std::string LongDescription