Tramway SDK
Public Member Functions | Protected Attributes | List of all members
tram::Component< T > Class Template Reference

Wrapper for an EntityComponent pointer. More...

#include <entitycomponent.h>

Public Member Functions

 Component ()
 
 ~Component ()
 
void make ()
 
void clear ()
 
T * get ()
 
T * operator-> ()
 
T & operator* ()
 
 operator T* ()
 
 operator bool ()
 

Protected Attributes

T * ptr = nullptr
 

Detailed Description

template<typename T>
class tram::Component< T >

Wrapper for an EntityComponent pointer.

Automatically constructs the EntityComponent in the correct pool, also provides protection against accidental memory leaks.

Constructor & Destructor Documentation

◆ Component()

template<typename T >
tram::Component< T >::Component ( )
inline

◆ ~Component()

template<typename T >
tram::Component< T >::~Component ( )
inline

Member Function Documentation

◆ clear()

template<typename T >
void tram::Component< T >::clear ( )
inline

◆ get()

template<typename T >
T * tram::Component< T >::get ( )
inline

◆ make()

template<typename T >
void tram::Component< T >::make ( )
inline

◆ operator bool()

template<typename T >
tram::Component< T >::operator bool ( )
inlineexplicit

◆ operator T*()

template<typename T >
tram::Component< T >::operator T* ( )
inline

◆ operator*()

template<typename T >
T & tram::Component< T >::operator* ( )
inline

◆ operator->()

template<typename T >
T * tram::Component< T >::operator-> ( )
inline

Member Data Documentation

◆ ptr

template<typename T >
T* tram::Component< T >::ptr = nullptr
protected

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