COPASI API  4.40.278
CUndoStack Class Reference

#include <CUndoStack.h>

Inheritance diagram for CUndoStack:
[legend]

Public Types

typedef std::vector< CUndoData * >::const_iterator const_iterator
 
typedef std::vector< CUndoData * >::iterator iterator
 

Public Member Functions

const_iterator begin () const
 
bool canRedo () const
 
bool canUndo () const
 
void clear ()
 
 CUndoStack (const CDataModel &dataModel)
 
size_t currentIndex () const
 
const_iterator end () const
 
std::pair< const CUndoData *, bool > getLastExecution () const
 
const CUndoDataoperator[] (const size_t &index) const
 
CUndoData::CChangeSet record (const CUndoData &data, const bool &execute)
 
CUndoData::CChangeSet redo ()
 
CUndoData::CChangeSet setCurrentIndex (const size_t &index, const bool &execute=true)
 
size_t size () const
 
CUndoData::CChangeSet undo ()
 
 ~CUndoStack ()
 

Private Member Functions

 CUndoStack ()
 

Private Attributes

size_t mCurrent
 
size_t mLastExecuted
 
CDataModelmpDataModel
 

Member Typedef Documentation

◆ const_iterator

◆ iterator

typedef std::vector< CUndoData * >::iterator CUndoStack::iterator

Constructor & Destructor Documentation

◆ CUndoStack() [1/2]

CUndoStack::CUndoStack ( )
private

◆ CUndoStack() [2/2]

CUndoStack::CUndoStack ( const CDataModel dataModel)

◆ ~CUndoStack()

CUndoStack::~CUndoStack ( )

References clear().

Member Function Documentation

◆ begin()

CUndoStack::const_iterator CUndoStack::begin ( ) const

◆ canRedo()

bool CUndoStack::canRedo ( ) const

References mCurrent, and size().

Referenced by record(), and redo().

◆ canUndo()

bool CUndoStack::canUndo ( ) const

References C_INVALID_INDEX, and mCurrent.

Referenced by undo().

◆ clear()

void CUndoStack::clear ( )

References C_INVALID_INDEX, end(), mCurrent, and mLastExecuted.

Referenced by ~CUndoStack().

◆ currentIndex()

size_t CUndoStack::currentIndex ( ) const

References mCurrent.

◆ end()

CUndoStack::const_iterator CUndoStack::end ( ) const

Referenced by clear(), and setCurrentIndex().

◆ getLastExecution()

std::pair< const CUndoData *, bool > CUndoStack::getLastExecution ( ) const

Retrieve the last executed data and indicated whether it was a redo

Returns
std::pair< const CUndoData &, bool > lastExecutedData

References mCurrent, mLastExecuted, and size().

◆ operator[]()

const CUndoData & CUndoStack::operator[] ( const size_t &  index) const

◆ record()

CUndoData::CChangeSet CUndoStack::record ( const CUndoData data,
const bool &  execute 
)

◆ redo()

CUndoData::CChangeSet CUndoStack::redo ( )

◆ setCurrentIndex()

CUndoData::CChangeSet CUndoStack::setCurrentIndex ( const size_t &  index,
const bool &  execute = true 
)

References C_INVALID_INDEX, end(), mCurrent, mLastExecuted, mpDataModel, and size().

Referenced by record(), redo(), and undo().

◆ size()

◆ undo()

CUndoData::CChangeSet CUndoStack::undo ( )

Member Data Documentation

◆ mCurrent

size_t CUndoStack::mCurrent
private

The index of the last applied data, i.e., itself and all data with lower index can be undone.

Referenced by canRedo(), canUndo(), clear(), currentIndex(), getLastExecution(), record(), redo(), setCurrentIndex(), and undo().

◆ mLastExecuted

size_t CUndoStack::mLastExecuted
private

◆ mpDataModel

CDataModel* CUndoStack::mpDataModel
private

Referenced by setCurrentIndex().


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