DEKI/ENGINE docs
manual api reference
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
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 bool () const
 operator uint32_t () const
bool operator!= (const ObjectRef &other) const
T * operator-> () const
ObjectRef & operator= (uint32_t newId)
bool operator== (const ObjectRef &other) const
Public Member Functions inherited from Deki::ObjectRefBase
bool IsResolved () const
bool IsValid () 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 componentTypeId = 0
uint32_t id = 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 bool()

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

◆ operator uint32_t()

template<typename T>
Deki::ObjectRef< T >::operator uint32_t ( ) 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=()

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

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