class ScriptReflectableWrapper

Provides a base class for all script object wrappers that wrap an IReflectable object that may be passed as a shared pointer.

Public

Methods

GetBaseNativeObjectAsShared

const SPtr<IReflectable> &GetBaseNativeObjectAsShared() const

Returns the root base class of the wrapped native object as a shared pointer.

IsNativeObjectValid

bool IsNativeObjectValid() const

Checks is the native object alive and valid.

staticGetOrCreateScriptObject

static MonoObject *GetOrCreateScriptObject(const SPtr<IReflectable> &nativeObject)

Attempts to retrieve an existing associated script object from the provided native object.

If one doesn't exist, a new script object and the associated script wrapper will be created.

Unlike GetOrCreateScriptObject implemented on TScriptReflectableWrapper, this always accepts the object as an IReflectable, and needs to perform type lookup to get the exact script wrapper type.

staticGetScriptObjectWrapper

static ScriptReflectableWrapper *GetScriptObjectWrapper(const ScriptTypeMetaData &wrapperMetaData, MonoObject *scriptObject)

Returns the script object wrapper associated with the provided script object, and wrapped by a wrapper that owns the provided meta-data.

Protected

Methods

NotifyNativeObjectDestroyed

void NotifyNativeObjectDestroyed() override

Notifies the wrapper that the native object it is managing is about to be destroyed.

Fields

mNativeObjectStrongHandle

SPtr<IReflectable> mNativeObjectStrongHandle