class ScriptRRefBase

Interop class between C++

& CLR for RRefBase and RRef

<T

>.

Public

Constructors

ScriptRRefBase

ScriptRRefBase(const HResource &nativeObject)

Methods

staticGetAssemblyName

static const char *GetAssemblyName()

staticGetNamespace

static const char *GetNamespace()

staticGetTypeName

static const char *GetTypeName()

staticSetupScriptBindings

static void SetupScriptBindings()

staticCreateScriptObject

static MonoObject *CreateScriptObject(bool construct)

Returns null as resource references cannot be created statically.

Their script object type is mutable depending on the resource type they are referencing. Use CreateScriptObject() that accepts a resource handle instead.

staticCreateScriptObject

static MonoObject *CreateScriptObject(const HResource &handle, ::MonoClass *rawType = nullptr)

Creates a new resource reference script object for the provided resource.

handle
Handle to the resource to wrap.
rawType
Class of the RRef type to use for wrapping the resource. If null then the resource will be wrapped in a non-specific RRefBase object. Otherwise it will be wrapped in a templated RRef <T > object. In the latter case caller is responsible for ensuring the template parameter of RRef matches the actual resource type.

staticBindGenericParam

static ::MonoClass *BindGenericParam(::MonoClass *param)

Creates a RRef type with the provided class bound as its template parameter.

GetNativeObject

NativeType &GetNativeObject()

GetLifetimeTrackingMode

virtual ScriptObjectLifetimeTrackingMode GetLifetimeTrackingMode() const

staticCreateScriptObjectAndWrapper

static MonoObject *CreateScriptObjectAndWrapper(const NativeType &nativeObject)

Creates a new script object and a script object wrapper of , and associates them with the provided native object.

Should not be called if already has an associated script object.

~TScriptObjectWrapper<SelfType, BaseType>

virtual ~TScriptObjectWrapper<SelfType, BaseType>() = default

RecreateScriptObjectAfterScriptReload

void RecreateScriptObjectAfterScriptReload() override

staticGetScriptObjectWrapper

static SelfType *GetScriptObjectWrapper(MonoObject *scriptObject)

Returns the script object wrapper associated with the provided script object.

staticGetMetaData

static const ScriptTypeMetaData *GetMetaData()

Returns the meta-data storing information about the script type.

staticInitializeMetaDataAtLoadTime

static void InitializeMetaDataAtLoadTime()

Takes care of initializing the meta-data when the application first load.

The meta-data will be registered with a global manager that will ensure it is kept up-to-date after operations such as assembly (re)load.

Protected

Methods

BindToScriptObject

void BindToScriptObject(MonoObject *scriptObject) override

Stores a pointer to itself in the script object.

This ensures that calls to GetScriptObjectWrapper() can return the script object wrapper associated with the script object.

Fields

mNativeObject

NativeType mNativeObject

Private

Methods

NotifyScriptObjectDestroyed

void NotifyScriptObjectDestroyed(bool isDestroyedDueToScriptReload) override

Notifies the wrapper that the script object is about to be destroyed.

staticInternalIsLoaded

static bool InternalIsLoaded(ScriptRRefBase *self)

*********************************************************************

staticInternalGetResource

static MonoObject *InternalGetResource(ScriptRRefBase *self)

staticInternalGetUuid

static void InternalGetUuid(ScriptRRefBase *self, UUID *uuid)

staticInternalCastAs

static MonoObject *InternalCastAs(ScriptRRefBase *self, MonoReflectionType *type)