EzGL
Public Member Functions | Static Public Member Functions
EzGL::Component< T > Class Template Reference

The base class to inherit from for all components. More...

#include <Component.hpp>

Inheritance diagram for EzGL::Component< T >:
EzGL::IComponent

Public Member Functions

void IInit (Object &self, Object &main) override
 Initialize all components. More...
 
void IUpdate (Object &self, Object &main) override
 Initialize all components. More...
 

Static Public Member Functions

static ComponentPtr Create ()
 Automatically generated per-class component factory. More...
 

Detailed Description

template<class T>
class EzGL::Component< T >

The base class to inherit from for all components.

To inherit from this class the curiously recurring template pattern (CRTP) must be used. The main reason this is done is so that the Create() function can be automatically generated.

Member Function Documentation

◆ Create()

template<class T>
static ComponentPtr EzGL::Component< T >::Create ( )
inlinestatic

Automatically generated per-class component factory.

Only ComponentFactory should be calling this.

◆ IInit()

template<class T>
void EzGL::Component< T >::IInit ( Object self,
Object main 
)
inlineoverridevirtual

Initialize all components.

Inheritors to Component must define a function exactly like this one except with the name init.

Parameters
selfReference to object in question.
mainReference to main object.

Implements EzGL::IComponent.

◆ IUpdate()

template<class T>
void EzGL::Component< T >::IUpdate ( Object self,
Object main 
)
inlineoverridevirtual

Initialize all components.

Inheritors to Component must define a function exactly like this one except with the name update.

Parameters
selfReference to object in question.
mainReference to main object.

Implements EzGL::IComponent.


The documentation for this class was generated from the following file: