supertux
Public Member Functions | List of all members
TypedUID< T > Class Template Reference

Typed UIDs allows storing GameObjects as UID while offering to option to use the object either as if it was a pointer or as if it was an UID. More...

#include <typed_uid.hpp>

Inheritance diagram for TypedUID< T >:
Inheritance graph
[legend]
Collaboration diagram for TypedUID< T >:
Collaboration graph
[legend]

Public Member Functions

 TypedUID (const T *object)
 
 TypedUID (const TypedUID &other)=default
 
TypedUIDoperator= (const TypedUID &other)=default
 
T * get () const
 
TypedUIDoperator= (const T *object)
 
TypedUIDoperator= (const UID &other)
 
T * operator-> () const
 
T & operator* () const
 
bool operator== (const T *object) const
 
bool operator!= (const T *object) const
 
 operator bool () const
 
- Public Member Functions inherited from UID
 UID (const UID &other)=default
 
UIDoperator= (const UID &other)=default
 
 operator bool () const
 
bool operator< (const UID &other) const
 
bool operator== (const UID &other) const
 
bool operator!= (const UID &other) const
 
Magic get_magic () const
 

Additional Inherited Members

- Public Types inherited from UID
using Magic = uint8_t
 
- Protected Attributes inherited from UID
uint32_t m_value
 

Detailed Description

template<class T>
class TypedUID< T >

Typed UIDs allows storing GameObjects as UID while offering to option to use the object either as if it was a pointer or as if it was an UID.

This helps staying resilient against the objects' variable lifetime.


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