EzGL
Data Structures | Macros | Typedefs
ComponentFactory.hpp File Reference

Component enlister and smart pointer factory. More...

#include "EzGL/IComponent.hpp"
#include <map>
#include <memory>
#include <string>
#include <vector>

Go to the source code of this file.

Data Structures

class  EzGL::ComponentFactory
 Component enlister and smart pointer factory. More...
 

Macros

#define EZGL_COMPONENT_ENLIST(Obj)
 Enlist your custom component to the component factory. More...
 

Typedefs

using EzGL::ComponentPtr = std::unique_ptr< class IComponent >
 Component smart pointer type.
 
using EzGL::ComponentVec = std::vector< ComponentPtr >
 Component smart pointer container.
 

Detailed Description

Component enlister and smart pointer factory.

Macro Definition Documentation

◆ EZGL_COMPONENT_ENLIST

#define EZGL_COMPONENT_ENLIST (   Obj)
Value:
EzGL::ComponentFactory::Key const Obj##ComponentID = \
EzGL::ComponentFactory::Enlist<Component<class Obj>>(#Obj)
std::string Key
Component key type.
Definition: ComponentFactory.hpp:71

Enlist your custom component to the component factory.

When implementing a component, place this in your header file just before the class definition.

Parameters
ObjThe name of the component class being enlisted.