class ScriptManagedUndoableOperation

Interop class between C++

& CLR for CmdManaged.

Public

Constructors

ScriptManagedUndoableOperation

ScriptManagedUndoableOperation(const SPtr<ManagedUndoableOperation> &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 managed undoable operations cannot be created statically.

Their script object type is mutable depending on the script type they are referencing.

GetNativeObjectAsShared

SPtr<NativeType> GetNativeObjectAsShared() const

Returns the wrapped native object as a shared pointer.

GetNativeObjectReferenceCount

u32 GetNativeObjectReferenceCount() const override

staticCreateScriptObjectAndWrapper

static MonoObject *CreateScriptObjectAndWrapper(const SPtr<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.

staticGetOrCreateScriptObject

static MonoObject *GetOrCreateScriptObject(const SPtr<NativeType> &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.

~TScriptObjectWrapper<SelfType, BaseType>

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

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.

Private

Methods

TriggerCommit

void TriggerCommit()

Triggers the Commit() method on the managed object instance.

TriggerRevert

void TriggerRevert()

Triggers the Revert() method on the managed object instance.

ShouldPersistScriptReload

bool ShouldPersistScriptReload() const override

If true, the object will be given an opportunity to back up its data before a script reload operation, and its script object will be automatically recreated once script reload ends, and given an opportunity to restore the backed up data.

If false, the script object and its wrapper will be destroyed on script reload.

RecreateScriptObjectAfterScriptReload

void RecreateScriptObjectAfterScriptReload() override

BackupDataBeforeScriptReload

TOptional<ScriptObjectReloadPersistentData> BackupDataBeforeScriptReload() override

Called on all script object wrappers when script reload is about to happen.

Allows the script object to back up its current state so it may be restored after reload completes. Only relevant for script objects that persist script reload (i.e. ShouldPersistScriptReload() returns true).

RestoreDataAfterScriptReload

void RestoreDataAfterScriptReload(const ScriptObjectReloadPersistentData &data) override

Called on all script object wrappers after script objects have been created in RecreateScriptObjectAfterScriptReload().

Allows you to restore data backed up in BackupDataBeforeScriptReload() call to the newly created script object. Only relevant for script objects that persist script reload (i.e. ShouldPersistScriptReload() returns true).

staticInternalCreateInstance

static void InternalCreateInstance(MonoObject *instance)

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

Fields

mTypeMissing

bool mTypeMissing

mSerializedObjectData

SPtr<ManagedSerializableObject> mSerializedObjectData