StateManager
Handles app state management.
#include "State/StateManager.h"
Inherits from Module
Public Functions
| Name | |
|---|---|
| StateManager() =default | |
| void | addOriginator(IStateful * originator) |
| bool | canRedo() const |
| bool | canUndo() const |
| const fs::path | fetchTmpDirectory()<br>Returns the temporary directory path just like getTmpDirectory() but creates it if it doesn't exist yet. |
| Scene * | getCurrentScene() |
| const Memento & | getCurrentState() const |
| int | getMementosCount() const |
| int | getPossibleRedosCount() const |
| int | getPossibleUndosCount() const |
| const fs::path | getTmpDirectory() const |
| fs::path | getTmpDirectoryLockFileName() |
| bool | hasScene() |
| bool | isDirty() const |
| bool | loadGlobal() |
| bool | loadScene(const fs::path & path) |
| void | loadUserData() |
| void | newScene(bool firstRun =false) |
| virtual void | onBeginFrame() override |
| virtual void | onClose() override |
| virtual void | onInit() override |
| void | redo() |
| void | resetGlobal() |
| bool | saveGlobal() |
| bool | saveScene() |
| bool | saveScene(const fs::path & scene) |
| void | saveUserData() |
| void | takeSnapshot() |
| void | undo() |
| bool | isValidScenePath(const fs::path path) |
Friends
| Name | |
|---|---|
| class | Application |
Additional inherited members
Public Functions inherited from Module
| Name | |
|---|---|
| Module() =default | |
| virtual | ~Module() =default |
| virtual void | onEndFrame() |
| virtual void | onUpdate(double deltaSeconds) |
Public Functions Documentation
function StateManager
cpp
StateManager() =defaultStateManager() =defaultfunction addOriginator
cpp
inline void addOriginator(
IStateful * originator
)inline void addOriginator(
IStateful * originator
)function canRedo
cpp
bool canRedo() constbool canRedo() constfunction canUndo
cpp
bool canUndo() constbool canUndo() constfunction fetchTmpDirectory
cpp
const fs::path fetchTmpDirectory()const fs::path fetchTmpDirectory()Returns the temporary directory path just like getTmpDirectory() but creates it if it doesn't exist yet.
function getCurrentScene
cpp
inline Scene * getCurrentScene()inline Scene * getCurrentScene()function getCurrentState
cpp
const Memento & getCurrentState() constconst Memento & getCurrentState() constfunction getMementosCount
cpp
int getMementosCount() constint getMementosCount() constfunction getPossibleRedosCount
cpp
int getPossibleRedosCount() constint getPossibleRedosCount() constTodoTest me!
function getPossibleUndosCount
cpp
int getPossibleUndosCount() constint getPossibleUndosCount() constfunction getTmpDirectory
cpp
const fs::path getTmpDirectory() constconst fs::path getTmpDirectory() constfunction getTmpDirectoryLockFileName
cpp
inline fs::path getTmpDirectoryLockFileName()inline fs::path getTmpDirectoryLockFileName()function hasScene
cpp
inline bool hasScene()inline bool hasScene()Return: Whether a previously saved scene is currently loaded.
function isDirty
cpp
inline bool isDirty() constinline bool isDirty() constfunction loadGlobal
cpp
bool loadGlobal()bool loadGlobal()function loadScene
cpp
bool loadScene(
const fs::path & path
)bool loadScene(
const fs::path & path
)function loadUserData
cpp
void loadUserData()void loadUserData()function newScene
cpp
void newScene(
bool firstRun =false
)void newScene(
bool firstRun =false
)function onBeginFrame
cpp
virtual void onBeginFrame() overridevirtual void onBeginFrame() overrideReimplements: Module::onBeginFrame
function onClose
cpp
virtual void onClose() overridevirtual void onClose() overrideReimplements: Module::onClose
function onInit
cpp
virtual void onInit() overridevirtual void onInit() overrideReimplements: Module::onInit
function redo
cpp
void redo()void redo()function resetGlobal
cpp
void resetGlobal()void resetGlobal()function saveGlobal
cpp
bool saveGlobal()bool saveGlobal()function saveScene
cpp
bool saveScene()bool saveScene()function saveScene
cpp
bool saveScene(
const fs::path & scene
)bool saveScene(
const fs::path & scene
)function saveUserData
cpp
void saveUserData()void saveUserData()function takeSnapshot
cpp
void takeSnapshot()void takeSnapshot()function undo
cpp
void undo()void undo()function isValidScenePath
cpp
static bool isValidScenePath(
const fs::path path
)static bool isValidScenePath(
const fs::path path
)Friends
friend Application
cpp
friend class Application(
Application
);friend class Application(
Application
);Updated on 2025-09-07 at 16:13:50 +0000