Skip to content

StateManager

Handles app state management.

#include "State/StateManager.h"

Inherits from Module

Public Functions

Name
StateManager() =default
voidaddOriginator(IStateful * originator)
boolcanRedo() const
boolcanUndo() const
const fs::pathfetchTmpDirectory()<br>Returns the temporary directory path just like getTmpDirectory() but creates it if it doesn't exist yet.
Scene *getCurrentScene()
const Memento &getCurrentState() const
intgetMementosCount() const
intgetPossibleRedosCount() const
intgetPossibleUndosCount() const
const fs::pathgetTmpDirectory() const
fs::pathgetTmpDirectoryLockFileName()
boolhasScene()
boolisDirty() const
boolloadGlobal()
boolloadScene(const fs::path & path)
voidloadUserData()
voidnewScene(bool firstRun =false)
virtual voidonBeginFrame() override
virtual voidonClose() override
virtual voidonInit() override
voidredo()
voidresetGlobal()
boolsaveGlobal()
boolsaveScene()
boolsaveScene(const fs::path & scene)
voidsaveUserData()
voidtakeSnapshot()
voidundo()
boolisValidScenePath(const fs::path path)

Friends

Name
classApplication

Additional inherited members

Public Functions inherited from Module

Name
Module() =default
virtual~Module() =default
virtual voidonEndFrame()
virtual voidonUpdate(double deltaSeconds)

Public Functions Documentation

function StateManager

cpp
StateManager() =default
StateManager() =default

function addOriginator

cpp
inline void addOriginator(
    IStateful * originator
)
inline void addOriginator(
    IStateful * originator
)

function canRedo

cpp
bool canRedo() const
bool canRedo() const

function canUndo

cpp
bool canUndo() const
bool canUndo() const

function 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() const
const Memento & getCurrentState() const

function getMementosCount

cpp
int getMementosCount() const
int getMementosCount() const

function getPossibleRedosCount

cpp
int getPossibleRedosCount() const
int getPossibleRedosCount() const

TodoTest me!

function getPossibleUndosCount

cpp
int getPossibleUndosCount() const
int getPossibleUndosCount() const

function getTmpDirectory

cpp
const fs::path getTmpDirectory() const
const fs::path getTmpDirectory() const

function 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() const
inline bool isDirty() const

function 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() override
virtual void onBeginFrame() override

Reimplements: Module::onBeginFrame

function onClose

cpp
virtual void onClose() override
virtual void onClose() override

Reimplements: Module::onClose

function onInit

cpp
virtual void onInit() override
virtual void onInit() override

Reimplements: 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 2024-11-06 at 20:16:53 +0000