Basic factory template.
More...
#include <factory.h>
|
struct | STypeInfo |
| A struct containing the information about the registered types. More...
|
|
|
static TTypeMap & | GetTypeMap () |
| Creates and returns the TYPE map. More...
|
|
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. More...
|
|
static TYPE * | New (const std::string &str_label) |
| Creates a new object of type TYPE More...
|
|
static bool | Exists (const std::string &str_label) |
| Returns true if the given label exists in the TYPE map. More...
|
|
static void | Print (std::ostream &c_os) |
| Prints the list of registered labels. More...
|
|
static void | Destroy () |
| Frees up all used memory. More...
|
|
template<typename TYPE>
class argos::CFactory< TYPE >
Basic factory template.
Definition at line 59 of file factory.h.
◆ TCreator
Pointer to the function that creates objects of type TYPE
Definition at line 65 of file factory.h.
◆ TTypeMap
The map of registered TYPE
s.
Definition at line 82 of file factory.h.
◆ Destroy()
template<typename TYPE >
void CFactory::Destroy |
( |
| ) |
|
|
static |
◆ Exists()
template<typename TYPE >
bool CFactory::Exists |
( |
const std::string & |
str_label | ) |
|
|
static |
Returns true
if the given label exists in the TYPE
map.
- Returns
true
if the given label exists in the TYPE
map
Definition at line 62 of file factory_impl.h.
◆ GetTypeMap()
◆ New()
template<typename TYPE >
TYPE * CFactory::New |
( |
const std::string & |
str_label | ) |
|
|
static |
Creates a new object of type TYPE
- Parameters
-
str_label | The label of the TYPE to create |
- Returns
- A new object of type
TYPE
Definition at line 48 of file factory_impl.h.
◆ Print()
template<typename TYPE >
void CFactory::Print |
( |
std::ostream & |
c_os | ) |
|
|
static |
Prints the list of registered labels.
- Parameters
-
c_os | The std::ostream to write into |
Definition at line 71 of file factory_impl.h.
◆ Register()
template<typename TYPE >
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.
- Parameters
-
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.
The documentation for this class was generated from the following files: