DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
Deki::ObjectRef< T > Struct Template Reference

An object reference the user assigns in the editor. More...

#include <deki/reflection/ObjectRef.h>

Inherits Deki::ObjectRefBase.

Public Member Functions

T * Get () const
Object * GetObject () const
 operator uint32_t () const
ObjectRef & operator= (uint32_t newId)
bool operator== (const ObjectRef &other) const
bool operator!= (const ObjectRef &other) const
T * operator-> () const
 operator bool () const
Public Member Functions inherited from Deki::ObjectRefBase
bool IsValid () const
bool IsResolved () const
void Set (Object *obj)
 Points the reference at obj at runtime. nullptr clears it.
void Set (Object *obj, uint32_t typeId)
 Points the reference at the component of type typeId on obj.

Additional Inherited Members

Public Attributes inherited from Deki::ObjectRefBase
uint32_t id = 0
uint32_t componentTypeId = 0
Object * resolved = nullptr

Detailed Description

template<typename T>
struct Deki::ObjectRef< T >

An object reference the user assigns in the editor.

The property generator recognizes ObjectRef<T>, and the inspector draws an object picker filtered to objects with component T. The engine resolves the reference before Start(), so Get() returns the component directly.

When componentTypeId is set, Get() returns the component with that type id. When it is 0, Get() returns the first component of type T.

Member Function Documentation

◆ Get()

template<typename T>
T * Deki::ObjectRef< T >::Get ( ) const
inline

◆ GetObject()

template<typename T>
Object * Deki::ObjectRef< T >::GetObject ( ) const
inline

◆ operator uint32_t()

template<typename T>
Deki::ObjectRef< T >::operator uint32_t ( ) const
inline

◆ operator=()

template<typename T>
ObjectRef & Deki::ObjectRef< T >::operator= ( uint32_t newId)
inline

◆ operator==()

template<typename T>
bool Deki::ObjectRef< T >::operator== ( const ObjectRef< T > & other) const
inline

◆ operator!=()

template<typename T>
bool Deki::ObjectRef< T >::operator!= ( const ObjectRef< T > & other) const
inline

◆ operator->()

template<typename T>
T * Deki::ObjectRef< T >::operator-> ( ) const
inline

◆ operator bool()

template<typename T>
Deki::ObjectRef< T >::operator bool ( ) const
inlineexplicit

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