ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
Basic factory template. More...
#include <factory.h>
Classes | |
struct | STypeInfo |
A struct containing the information about the registered types. More... | |
Public Types | |
typedef TYPE * | TCreator () |
Pointer to the function that creates objects of type TYPE | |
typedef std::map< std::string, STypeInfo * > | TTypeMap |
The map of registered TYPE s. | |
Static Public Member Functions | |
static TTypeMap & | GetTypeMap () |
Creates and returns the TYPE map. | |
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. | |
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 void | Print (std::ostream &c_os) |
Prints the list of registered labels. | |
static void | Destroy () |
Frees up all used memory. |
Basic factory template.
typedef TYPE* argos::CFactory< TYPE >::TCreator() |
typedef std::map<std::string, STypeInfo*> argos::CFactory< TYPE >::TTypeMap |
void CFactory::Destroy | ( | ) | [static] |
Frees up all used memory.
Definition at line 85 of file factory_impl.h.
bool CFactory::Exists | ( | const std::string & | str_label | ) | [static] |
Returns true
if the given label exists in the TYPE
map.
true
if the given label exists in the TYPE
map Definition at line 62 of file factory_impl.h.
CFactory< TYPE >::TTypeMap & CFactory::GetTypeMap | ( | ) | [static] |
Creates and returns the TYPE
map.
TYPE
mapDefinition at line 18 of file factory_impl.h.
TYPE * CFactory::New | ( | const std::string & | str_label | ) | [static] |
Creates a new object of type TYPE
str_label | The label of the TYPE to create |
TYPE
Definition at line 48 of file factory_impl.h.
void CFactory::Print | ( | std::ostream & | c_os | ) | [static] |
Prints the list of registered labels.
c_os | The std::ostream to write into |
Definition at line 71 of file factory_impl.h.
void CFactory::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 | ||
) | [static] |
Registers a new TYPE
creator in the factory.
str_label | The label associated to the TYPE creator |
str_author | The author of the plugin |
str_version | The version of the plugin |
str_brief_desc | The brief description of the plugin |
str_long_desc | The long description of the plugin |
str_status | The status of the plugin |
pc_creator | The TYPE creator of the factory |
Definition at line 27 of file factory_impl.h.