Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

sc::SavableState Class Reference

Base class for objects that can save/restore state. More...

#include <state.h>

Inheritance diagram for sc::SavableState:

Inheritance graph
[legend]
Collaboration diagram for sc::SavableState:

Collaboration graph
[legend]
List of all members.

Public Methods

SavableState & operator= (const SavableState &)
virtual ~SavableState ()
void save_state (StateOut &)
 Save the state of the object as specified by the StateOut object. More...

void save_object_state (StateOut &)
 This can be used for saving state when the exact type of the object is known for both the save and the restore. More...

virtual void save_vbase_state (StateOut &)
 Save the virtual bases for the object. More...

virtual void save_data_state (StateOut &)
 Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR initializes them. More...


Static Public Methods

void save_state (SavableState *s, StateOut &)
SavableState * restore_state (StateIn &si)
 Restores objects saved with save_state. More...

SavableState * key_restore_state (StateIn &si, const char *keyword)
 Like restore_state, but keyword is used to override values while restoring.

SavableState * dir_restore_state (StateIn &si, const char *objectname, const char *keyword=0)

Protected Methods

 SavableState ()
 SavableState (const SavableState &)
 SavableState (StateIn &)
 Each derived class StateIn CTOR handles the restore corresponding to calling save_object_state, save_vbase_state, and save_data_state listed above. More...


Detailed Description

Base class for objects that can save/restore state.


Constructor & Destructor Documentation

sc::SavableState::SavableState StateIn   [protected]
 

Each derived class StateIn CTOR handles the restore corresponding to calling save_object_state, save_vbase_state, and save_data_state listed above.

All derived class StateIn& constructors must invoke the SavableState(StateIn&) constructor.


Member Function Documentation

SavableState* sc::SavableState::restore_state StateIn   si [static]
 

Restores objects saved with save_state.

The exact type of the next object in si can be any type publically derived from the SavableState. Derived classes implement a similar static function that returns a pointer to the derived class. If the objectname is given the directory will be consulted to find and restore that object.

virtual void sc::SavableState::save_data_state StateOut   [virtual]
 

Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR initializes them.

This must be implemented by the derived class if the class has data.

Reimplemented in sc::AtomInfo.

void sc::SavableState::save_object_state StateOut  
 

This can be used for saving state when the exact type of the object is known for both the save and the restore.

To restore objects saved in this way the user must directly invoke the object's StateIn& constructor.

void sc::SavableState::save_state StateOut  
 

Save the state of the object as specified by the StateOut object.

This routine saves the state of the object (which includes the nonvirtual bases), the virtual bases, and type information. The default implementation should be adequate.

virtual void sc::SavableState::save_vbase_state StateOut   [virtual]
 

Save the virtual bases for the object.

This must be done in the same order that the ctor initializes the virtual bases. This does not include the DescribedClass and SavableState virtual base classes. This must be implemented by the user if the class has other virtual bases. (These virtual bases must come after SavableState, if SavableState is virtual.)


The documentation for this class was generated from the following file:
Generated at Fri Jan 10 08:16:40 2003 for MPQC 2.1.3 using the documentation package Doxygen 1.2.14.