COPASI API
4.40.278
|
#include <CUndoStack.h>
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 CUndoData & | operator[] (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 |
CDataModel * | mpDataModel |
typedef std::vector< CUndoData * >::const_iterator CUndoStack::const_iterator |
typedef std::vector< CUndoData * >::iterator CUndoStack::iterator |
|
private |
CUndoStack::CUndoStack | ( | const CDataModel & | dataModel | ) |
CUndoStack::~CUndoStack | ( | ) |
References clear().
CUndoStack::const_iterator CUndoStack::begin | ( | ) | const |
bool CUndoStack::canRedo | ( | ) | const |
bool CUndoStack::canUndo | ( | ) | const |
References C_INVALID_INDEX, and mCurrent.
Referenced by undo().
void CUndoStack::clear | ( | ) |
References C_INVALID_INDEX, end(), mCurrent, and mLastExecuted.
Referenced by ~CUndoStack().
size_t CUndoStack::currentIndex | ( | ) | const |
References mCurrent.
CUndoStack::const_iterator CUndoStack::end | ( | ) | const |
Referenced by clear(), and setCurrentIndex().
std::pair< const CUndoData *, bool > CUndoStack::getLastExecution | ( | ) | const |
Retrieve the last executed data and indicated whether it was a redo
References mCurrent, mLastExecuted, and size().
const CUndoData & CUndoStack::operator[] | ( | const size_t & | index | ) | const |
CUndoData::CChangeSet CUndoStack::record | ( | const CUndoData & | data, |
const bool & | execute | ||
) |
References canRedo(), mCurrent, and setCurrentIndex().
Referenced by CDataModel::applyData(), and CDataModel::recordData().
CUndoData::CChangeSet CUndoStack::redo | ( | ) |
References canRedo(), mCurrent, and setCurrentIndex().
CUndoData::CChangeSet CUndoStack::setCurrentIndex | ( | const size_t & | index, |
const bool & | execute = true |
||
) |
References C_INVALID_INDEX, end(), mCurrent, mLastExecuted, mpDataModel, and size().
size_t CUndoStack::size | ( | ) | const |
Referenced by canRedo(), getLastExecution(), setCurrentIndex(), and CProvenanceXMLWriter::updateCurrentSessionProvenance().
CUndoData::CChangeSet CUndoStack::undo | ( | ) |
References canUndo(), mCurrent, and setCurrentIndex().
|
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().
|
private |
Referenced by clear(), getLastExecution(), and setCurrentIndex().
|
private |
Referenced by setCurrentIndex().