Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
ObjectRef< T > Struct Template Reference

Object reference wrapper for editor-assignable object IDs. More...

#include <ObjectRef.h>

Inherits ObjectRefBase.

Public Member Functions

T * Get () const
DekiObjectGetObject () const
 operator uint32_t () const
ObjectRefoperator= (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 ObjectRefBase
bool IsValid () const
bool IsResolved () const
void Set (DekiObject *obj)
 Set the reference to an object (runtime assignment).
void Set (DekiObject *obj, uint32_t typeId)
 Set the reference to a specific component on an object.

Additional Inherited Members

Public Attributes inherited from ObjectRefBase
uint32_t id = 0
uint32_t componentTypeId = 0
DekiObjectresolved = nullptr

Detailed Description

template<typename T>
struct ObjectRef< T >

Object reference wrapper for editor-assignable object IDs.

ObjectRef<T> provides a uint32_t object ID that the property generator recognizes as an ObjectRef type, causing the inspector to draw an object picker dropdown filtered by component type T.

The engine automatically resolves ObjectRef references before Start() is called, so you can use Get() to retrieve the component directly.

When componentTypeId is set, Get() returns the specific component matching that type ID. When componentTypeId is 0, Get() returns the first component matching template type T (backward compatible behavior).

Template Parameters
TThe component type to filter by in the object picker

Member Function Documentation

◆ Get()

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

◆ GetObject()

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

◆ operator uint32_t()

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

◆ operator=()

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

◆ operator==()

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

◆ operator!=()

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

◆ operator->()

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

◆ operator bool()

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

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