Skip to content

IStateful

#include "State/Stateful.h"

Inherited by Core::ResourceManager, I3TApplication, UIModule, ViewportModule, WorkspaceModule

Public Functions

Name
virtual~IStateful()
virtual voidappendScene(const Memento & memento, State::Scene * scene) =0<br>Called on scene append.
virtual voidclearGlobal() =0<br>Set the global state to some default empty state.
virtual voidclearScene(bool newScene) =0<br>Set the scene state to some default empty state.
MementoemptyMemento()<br>Create an empty memento (rapidjson::Document)
virtual voidloadGlobal(const Memento & memento) =0<br>Load global state from a memento.
virtual voidloadScene(const Memento & memento, State::Scene * scene) =0<br>Called on scene load, undo and redo.
virtual MementosaveGlobal() =0<br>Save shared global state.
virtual MementosaveScene(State::Scene * scene) =0<br>Save state for the current scene.

Public Functions Documentation

function ~IStateful

cpp
inline virtual ~IStateful()
inline virtual ~IStateful()

function appendScene

cpp
virtual void appendScene(
    const Memento & memento,
    State::Scene * scene
) =0
virtual void appendScene(
    const Memento & memento,
    State::Scene * scene
) =0

Called on scene append.

Parameters:

  • scene The current scene
  • memento Scene state to appended

Reimplemented by: WorkspaceModule::appendScene, Core::ResourceManager::appendScene, UIModule::appendScene, ViewportModule::appendScene, I3TApplication::appendScene

function clearGlobal

cpp
virtual void clearGlobal() =0
virtual void clearGlobal() =0

Set the global state to some default empty state.

Reimplemented by: Core::ResourceManager::clearGlobal, UIModule::clearGlobal, ViewportModule::clearGlobal, WorkspaceModule::clearGlobal, I3TApplication::clearGlobal

function clearScene

cpp
virtual void clearScene(
    bool newScene
) =0
virtual void clearScene(
    bool newScene
) =0

Set the scene state to some default empty state.

Parameters:

  • newScene Whether to perform basic new scene initialization.

Reimplemented by: Core::ResourceManager::clearScene, UIModule::clearScene, ViewportModule::clearScene, WorkspaceModule::clearScene, I3TApplication::clearScene

function emptyMemento

cpp
inline Memento emptyMemento()
inline Memento emptyMemento()

Create an empty memento (rapidjson::Document)

function loadGlobal

cpp
virtual void loadGlobal(
    const Memento & memento
) =0
virtual void loadGlobal(
    const Memento & memento
) =0

Load global state from a memento.

Parameters:

  • memento New global state

Reimplemented by: Core::ResourceManager::loadGlobal, UIModule::loadGlobal, ViewportModule::loadGlobal, WorkspaceModule::loadGlobal, I3TApplication::loadGlobal

function loadScene

cpp
virtual void loadScene(
    const Memento & memento,
    State::Scene * scene
) =0
virtual void loadScene(
    const Memento & memento,
    State::Scene * scene
) =0

Called on scene load, undo and redo.

Parameters:

  • scene The current scene or nullptr (in case of undo/redo)
  • memento New scene state

Reimplemented by: WorkspaceModule::loadScene, Core::ResourceManager::loadScene, UIModule::loadScene, ViewportModule::loadScene, I3TApplication::loadScene

function saveGlobal

cpp
virtual Memento saveGlobal() =0
virtual Memento saveGlobal() =0

Save shared global state.

Reimplemented by: Core::ResourceManager::saveGlobal, UIModule::saveGlobal, ViewportModule::saveGlobal, WorkspaceModule::saveGlobal, I3TApplication::saveGlobal

function saveScene

cpp
virtual Memento saveScene(
    State::Scene * scene
) =0
virtual Memento saveScene(
    State::Scene * scene
) =0

Save state for the current scene.

Parameters:

  • scene The current scene or nullptr (in case of undo/redo)

Reimplemented by: WorkspaceModule::saveScene, Core::ResourceManager::saveScene, UIModule::saveScene, ViewportModule::saveScene, I3TApplication::saveScene

The scene parameter should contain a scene object for full filesystem saves and nullptr for quick undo/redo operations.


Updated on 2025-05-31 at 12:55:30 +0000