Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::UndoManager Class Reference

#include <UndoManager.h>

Public Types

using UndoStack = std::deque< std::shared_ptr< IUndoEntry > >
 

Public Member Functions

 UndoManager (U32 maxSize)
 
bool Undo ()
 
bool Redo ()
 
size_t UndoStackSize () const noexcept
 
size_t RedoStackSize () const noexcept
 
const stringlasActionName () const noexcept
 
template<typename T >
void registerUndoEntry (const UndoEntry< T > &entry)
 

Private Member Functions

bool apply (const std::shared_ptr< IUndoEntry > &entry)
 

Private Attributes

const U32 _maxSize = 10
 
UndoStack _undoStack
 
UndoStack _redoStack
 
string _lastActionName
 

Detailed Description

Definition at line 69 of file UndoManager.h.

Member Typedef Documentation

◆ UndoStack

using Divide::UndoManager::UndoStack = std::deque<std::shared_ptr<IUndoEntry> >

Definition at line 72 of file UndoManager.h.

Constructor & Destructor Documentation

◆ UndoManager()

Divide::UndoManager::UndoManager ( U32  maxSize)
explicit

Definition at line 7 of file UndoManager.cpp.

Member Function Documentation

◆ apply()

bool Divide::UndoManager::apply ( const std::shared_ptr< IUndoEntry > &  entry)
private

Definition at line 41 of file UndoManager.cpp.

◆ lasActionName()

const string & Divide::UndoManager::lasActionName ( ) const
noexcept

Definition at line 51 of file UndoManager.cpp.

◆ Redo()

bool Divide::UndoManager::Redo ( )

Definition at line 27 of file UndoManager.cpp.

◆ RedoStackSize()

size_t Divide::UndoManager::RedoStackSize ( ) const
inlinenoexcept

Definition at line 81 of file UndoManager.h.

◆ registerUndoEntry()

template<typename T >
void Divide::UndoManager::registerUndoEntry ( const UndoEntry< T > &  entry)
inline

Definition at line 86 of file UndoManager.h.

◆ Undo()

bool Divide::UndoManager::Undo ( )

Definition at line 12 of file UndoManager.cpp.

◆ UndoStackSize()

size_t Divide::UndoManager::UndoStackSize ( ) const
inlinenoexcept

Definition at line 80 of file UndoManager.h.

Member Data Documentation

◆ _lastActionName

string Divide::UndoManager::_lastActionName
private

Definition at line 102 of file UndoManager.h.

◆ _maxSize

const U32 Divide::UndoManager::_maxSize = 10
private

Definition at line 99 of file UndoManager.h.

◆ _redoStack

UndoStack Divide::UndoManager::_redoStack
private

Definition at line 101 of file UndoManager.h.

◆ _undoStack

UndoStack Divide::UndoManager::_undoStack
private

Definition at line 100 of file UndoManager.h.


The documentation for this class was generated from the following files: