Exotica
Classes | Namespaces | Macros
factory.h File Reference
#include <map>
#include <memory>
#include <typeinfo>
#include <exotica_core/object.h>
#include <exotica_core/tools.h>
#include <pluginlib/class_list_macros.h>
Include dependency graph for factory.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  exotica::Registrar< BaseClass >
 Registration Class for the object type: Also templated: More...
 
class  exotica::Factory< BaseClass >
 Templated Object factory for Default-constructible classes. The Factory is itself a singleton. More...
 
class  exotica::Registrar< BaseClass >
 Registration Class for the object type: Also templated: More...
 

Namespaces

 exotica
 

Macros

#define EXOTICA_CORE_REGISTER(BASE, TYPE, DERIV)
 Generic Factory Macro definition: to be specialised by each new base type which wishes to make use of a factory for instantiation of derived classes. More...
 
#define EXOTICA_CORE_REGISTER_CORE(BASE, TYPE, DERIV)   static exotica::Registrar<BASE> EX_UNIQ(object_registrar_, __LINE__)("exotica/" TYPE, []() -> BASE* { return new DERIV(); }, #BASE);
 

Macro Definition Documentation

◆ EXOTICA_CORE_REGISTER

#define EXOTICA_CORE_REGISTER (   BASE,
  TYPE,
  DERIV 
)
Value:
static exotica::Registrar<BASE> EX_UNIQ(object_registrar_, __LINE__)("exotica/" TYPE, []() -> BASE* { return new DERIV(); }, #BASE); \
PLUGINLIB_EXPORT_CLASS(DERIV, BASE)

Generic Factory Macro definition: to be specialised by each new base type which wishes to make use of a factory for instantiation of derived classes.

Parameters
IDENTIdentifier Type : should be specialised by redefining a macro
BASEBase Object type : should be specialised by redefining a macro
TYPEThe name to identify the class (should be of type IDENT)
DERIVThe Derived Class type (should inherit from BASE)

◆ EXOTICA_CORE_REGISTER_CORE

#define EXOTICA_CORE_REGISTER_CORE (   BASE,
  TYPE,
  DERIV 
)    static exotica::Registrar<BASE> EX_UNIQ(object_registrar_, __LINE__)("exotica/" TYPE, []() -> BASE* { return new DERIV(); }, #BASE);
EX_UNIQ
#define EX_UNIQ(x, y)
Definition: tools.h:60
exotica::Registrar
Registration Class for the object type: Also templated:
Definition: factory.h:56