47 #include <argos3/core/utility/configuration/argos_exception.h>
58 template<
typename TYPE>
82 typedef std::map<std::string, STypeInfo*>
TTypeMap;
101 static void Register(
const std::string& str_label,
102 const std::string& str_author,
103 const std::string& str_version,
104 const std::string& str_brief_desc,
105 const std::string& str_long_desc,
106 const std::string& str_status,
113 static TYPE*
New(
const std::string& str_label);
119 static bool Exists(
const std::string& str_label);
125 static void Print(std::ostream& c_os);
136 #include <argos3/core/utility/plugins/factory_impl.h>
149 #define REGISTER_SYMBOL(BASECLASS, \
159 BASECLASS* BASECLASS ## CLASSNAME ## Creator() { \
160 return new CLASSNAME; \
163 class C ## BASECLASS ## CLASSNAME ## Proxy { \
165 C ## BASECLASS ## CLASSNAME ## Proxy() { \
166 CFactory<BASECLASS>:: \
173 BASECLASS ## CLASSNAME ## Creator); \
176 C ## BASECLASS ## CLASSNAME ## Proxy BASECLASS ## CLASSNAME ## _p; \
The namespace containing all the ARGoS related code.
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.
TYPE * TCreator()
Pointer to the function that creates objects of type TYPE
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