Classes | Namespaces | Macros | Functions
factory.h File Reference
#include <corbo-core/console.h>
#include <corbo-core/macros.h>
#include <functional>
#include <memory>
#include <string>
#include <type_traits>
#include <unordered_map>
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  corbo::Factory< Base >
 Generic factory object. More...
 

Namespaces

 corbo
 

Macros

#define FACTORY_REGISTER_OBJECT(type, base)   FACTORY_REGISTER_OBJECT_ID(type, base, 0)
 
#define FACTORY_REGISTER_OBJECT_ID(type, base, id)
 

Functions

template<typename Object >
std::shared_ptr< Object > corbo::create_from_factory (const std::string &name)
 Helper function to create new (derived) objects from factory. More...
 

Macro Definition Documentation

◆ FACTORY_REGISTER_OBJECT

#define FACTORY_REGISTER_OBJECT (   type,
  base 
)    FACTORY_REGISTER_OBJECT_ID(type, base, 0)

Definition at line 139 of file factory.h.

◆ FACTORY_REGISTER_OBJECT_ID

#define FACTORY_REGISTER_OBJECT_ID (   type,
  base,
  id 
)
Value:
static const bool corbo_CAT(corbo_CAT(type, __regged), id) = \
Factory<base>::instance().registerObject(corbo_STRINGIZE(type), std::make_shared<type>());
#define corbo_STRINGIZE(text)
Definition: macros.h:32
#define corbo_CAT(a, b)
Definition: macros.h:36

Definition at line 135 of file factory.h.



control_box_rst
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:07:59