CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::ComponentType Class Referenceabstract

A type that describes and provides type-erased operations on a component. More...

#include <CeresEngine/Entity/Component.hpp>

Inheritance diagram for CeresEngine::ComponentType:
CeresEngine::TComponentType< C >

Public Member Functions

 ComponentType (const ComponentType &)=delete
 
ComponentTypeoperator= (const ComponentType &)=delete
 
 ComponentType (ComponentType &&)=delete
 
ComponentTypeoperator= (ComponentType &&)=delete
 
virtual const ClassgetClass () const noexcept=0
 Returns the meta class of the component.
 
virtual Type getType () const noexcept=0
 Returns the meta type of the component.
 
virtual const ClassgetAccessorClass () const noexcept=0
 Returns the component accessor meta class.
 
virtual Type getAccessorType () const noexcept=0
 Returns the component accessor meta type.
 
virtual Box getAny (AbstractComponent &component) const noexcept=0
 
virtual Box getAny (const AbstractComponent &component) const noexcept=0
 
virtual void setAny (AbstractComponent &component, const Box &any) const noexcept=0
 
virtual void setAny (AbstractComponent &component, Box &&any) const noexcept=0
 
virtual void emitComponentAdded (const Entity &entity) const =0
 
virtual void emitComponentRemoved (const Entity &entity) const =0
 

Static Public Member Functions

template<typename C >
static const TComponentType< C > & get () noexcept
 The type instance for a component of the C.
 

Public Attributes

const ComponentID componentID
 The component type ID.
 
const ComponentMask componentMask
 

Protected Member Functions

 ComponentType (const ComponentID componentID)
 

Static Protected Attributes

static ComponentID nextComponentID
 The next component ID to be statically allocated by the compiler.
 

Friends

bool operator== (const ComponentType &lhs, const ComponentType &rhs) noexcept
 Compares two ComponentType instances for equality.
 
bool operator!= (const ComponentType &lhs, const ComponentType &rhs) noexcept
 Compares two ComponentType instances for inequality.
 

Detailed Description

A type that describes and provides type-erased operations on a component.

Constructor & Destructor Documentation

◆ ComponentType() [1/3]

CeresEngine::ComponentType::ComponentType ( const ComponentID  componentID)
inlineexplicitprotected

◆ ComponentType() [2/3]

CeresEngine::ComponentType::ComponentType ( const ComponentType )
delete

◆ ComponentType() [3/3]

CeresEngine::ComponentType::ComponentType ( ComponentType &&  )
delete

Member Function Documentation

◆ emitComponentAdded()

virtual void CeresEngine::ComponentType::emitComponentAdded ( const Entity entity) const
pure virtual

◆ emitComponentRemoved()

virtual void CeresEngine::ComponentType::emitComponentRemoved ( const Entity entity) const
pure virtual

◆ get()

template<typename C >
const TComponentType< C > & CeresEngine::ComponentType::get ( )
inlinestaticnoexcept

The type instance for a component of the C.

This instance is unique for any given component type C and is safe to perform pointer comparisons on the type.

Template Parameters
CThe type of component to return the type descriptor for.

◆ getAccessorClass()

virtual const Class * CeresEngine::ComponentType::getAccessorClass ( ) const
pure virtualnoexcept

Returns the component accessor meta class.

Implemented in CeresEngine::TComponentType< C >.

◆ getAccessorType()

virtual Type CeresEngine::ComponentType::getAccessorType ( ) const
pure virtualnoexcept

Returns the component accessor meta type.

Implemented in CeresEngine::TComponentType< C >.

◆ getAny() [1/2]

virtual Box CeresEngine::ComponentType::getAny ( AbstractComponent component) const
pure virtualnoexcept

◆ getAny() [2/2]

virtual Box CeresEngine::ComponentType::getAny ( const AbstractComponent component) const
pure virtualnoexcept

◆ getClass()

virtual const Class * CeresEngine::ComponentType::getClass ( ) const
pure virtualnoexcept

Returns the meta class of the component.

Implemented in CeresEngine::TComponentType< C >.

◆ getType()

virtual Type CeresEngine::ComponentType::getType ( ) const
pure virtualnoexcept

Returns the meta type of the component.

Implemented in CeresEngine::TComponentType< C >.

◆ operator=() [1/2]

ComponentType & CeresEngine::ComponentType::operator= ( ComponentType &&  )
delete

◆ operator=() [2/2]

ComponentType & CeresEngine::ComponentType::operator= ( const ComponentType )
delete

◆ setAny() [1/2]

virtual void CeresEngine::ComponentType::setAny ( AbstractComponent component,
Box &&  any 
) const
pure virtualnoexcept

◆ setAny() [2/2]

virtual void CeresEngine::ComponentType::setAny ( AbstractComponent component,
const Box any 
) const
pure virtualnoexcept

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const ComponentType lhs,
const ComponentType rhs 
)
friend

Compares two ComponentType instances for inequality.

If true, lhs and `rhs instances represent different component types.

◆ operator==

bool operator== ( const ComponentType lhs,
const ComponentType rhs 
)
friend

Compares two ComponentType instances for equality.

If true, lhs and `rhs instances represent the same component type.

Member Data Documentation

◆ componentID

const ComponentID CeresEngine::ComponentType::componentID

The component type ID.

Used as index when accessing storage for the component.

◆ componentMask

const ComponentMask CeresEngine::ComponentType::componentMask

◆ nextComponentID

ComponentID CeresEngine::ComponentType::nextComponentID
staticprotected

The next component ID to be statically allocated by the compiler.


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