FOX/ObjCryst++  2022
ObjCryst::XMLConfigHistory Class Reference

Class to store XMLConfig configurations. More...

Public Member Functions

 XMLConfigHistory (const int maxnb=20)
 Constructor. More...
 
bool Store ()
 Store a new configuration. More...
 
void Restore (boost::shared_ptr< XMLConfig > &p)
 Restore a configuration.
 
std::list< boost::shared_ptr< XMLConfig > > GetList ()
 Access the list of configurations.
 
const std::list< boost::shared_ptr< XMLConfig > > GetList () const
 Access the list of configurations.
 
bool Previous ()
 Reload the previous (older) configuration in the list. More...
 
bool Next ()
 Reload the next (more recent) configuration in the list. More...
 

Private Attributes

int mMaxNb
 Maximum number of stored configurations.
 
std::list< boost::shared_ptr< XMLConfig > > mvpConfig
 List of configurations.
 
boost::shared_ptr< XMLConfigmpCurrentConfig
 The current configuration loaded (can be null if none is selected) This is reset every time a change is manually made.
 
bool mLock
 Lock used during Store and Restore.
 

Detailed Description

Class to store XMLConfig configurations.

Definition at line 68 of file Undo.h.

Constructor & Destructor Documentation

◆ XMLConfigHistory()

ObjCryst::XMLConfigHistory::XMLConfigHistory ( const int  maxnb = 20)

Constructor.

Parameters
maxnbmaximum size of history

Definition at line 358 of file Undo.cpp.

Member Function Documentation

◆ Next()

bool ObjCryst::XMLConfigHistory::Next ( )

Reload the next (more recent) configuration in the list.

Returns
: true if the loading was done, false otherwise (no available configuration or last)

Definition at line 428 of file Undo.cpp.

◆ Previous()

bool ObjCryst::XMLConfigHistory::Previous ( )

Reload the previous (older) configuration in the list.

Returns
: true if the loading was done, false otherwise (no available configuration or last)

Definition at line 403 of file Undo.cpp.

◆ Store()

bool ObjCryst::XMLConfigHistory::Store ( )

Store a new configuration.

If there is no difference with the previous one, nothing is done.

Returns
: true if a new configuration was saved, false otherwise

Definition at line 362 of file Undo.cpp.


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