Skip to content

IStateful

#include "State/Stateful.h"

Inherited by Core::ResourceManager, Vp::Viewport, WorkspaceWindow

Public Functions

Name
virtual~IStateful()
virtual voidclearGlobal() =0<br>Set the global state to some default empty state.
virtual voidclearScene() =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 clearGlobal

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

Set the global state to some default empty state.

Reimplemented by: Core::ResourceManager::clearGlobal, WorkspaceWindow::clearGlobal, Vp::Viewport::clearGlobal

function clearScene

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

Set the scene state to some default empty state.

Reimplemented by: Core::ResourceManager::clearScene, WorkspaceWindow::clearScene, Vp::Viewport::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, WorkspaceWindow::loadGlobal, Vp::Viewport::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: WorkspaceWindow::loadScene, Core::ResourceManager::loadScene, Vp::Viewport::loadScene

function saveGlobal

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

Save shared global state.

Reimplemented by: Core::ResourceManager::saveGlobal, WorkspaceWindow::saveGlobal, Vp::Viewport::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: WorkspaceWindow::saveScene, Core::ResourceManager::saveScene, Vp::Viewport::saveScene

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


Updated on 2024-11-06 at 20:16:53 +0000