Nui Engine
A game engine framework
Loading...
Searching...
No Matches
Nui::ECS::ComponentHandle< T > Class Template Reference

This class provides a handle to a component. More...

#include <Component.h>

Public Member Functions

 ComponentHandle (T *component)
 
bool IsValid () const noexcept
 Checks if the component is valid.
 
T & Get () const noexcept
 Get the component.
 
T * operator-> () const
 Get the component.
 
 operator bool () const
 Implicit conversion to bool to check if the component is valid.
 

Detailed Description

template<typename T>
class Nui::ECS::ComponentHandle< T >

This class provides a handle to a component.

Template Parameters
TThe type of stored component data

Member Function Documentation

◆ Get()

template<typename T >
T & Nui::ECS::ComponentHandle< T >::Get ( ) const
inlinenoexcept

Get the component.

Returns
Reference to the component

◆ IsValid()

template<typename T >
bool Nui::ECS::ComponentHandle< T >::IsValid ( ) const
inlinenoexcept

Checks if the component is valid.

Returns
True if the component is valid

◆ operator->()

template<typename T >
T * Nui::ECS::ComponentHandle< T >::operator-> ( ) const
inline

Get the component.

Returns
Pointer to the component

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