CPersistentDataCollection Class Reference

provides a collection of references to load/save variables More...

#include <PersistentData.H>

Inheritance diagram for CPersistentDataCollection:

Inheritance graph
[legend]
Collaboration diagram for CPersistentDataCollection:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void ClearStream ()
 delete the assigned file
void ClearCollection ()
 unregister all variables so that the collection becomes empty
 CPersistentDataCollection (const std::string myFilename)
 constructor needs a filename to provide persistent storage
 ~CPersistentDataCollection ()
template<typename T>
void RegisterVar (const std::string ID, T &data)
 register a variable to be persistent
template<typename T>
void UnregisterVar (const std::string ID)
 unregister a variable to be no more persistent
void Load ()
 load the persistent values for the registered variables from file
void Save ()
 save the values for the registered variables to file (to make them persistent)

Protected Types

typedef std::map< std::string,
CPersistentDataInterface * > 
TCollection

Protected Attributes

const std::string filename
TCollection collection


Detailed Description

provides a collection of references to load/save variables

This class stores references to variables denoted by an identifier. On Load/Save requests all these registered variables are read/written to a file (persistent storage).

Warning: Use this class with extreme caution!

Definition at line 78 of file PersistentData.H.


Member Typedef Documentation

typedef std::map<std::string,CPersistentDataInterface*> CPersistentDataCollection::TCollection [protected]

Definition at line 81 of file PersistentData.H.


Constructor & Destructor Documentation

CPersistentDataCollection::CPersistentDataCollection ( const std::string  myFilename  )  [inline, explicit]

constructor needs a filename to provide persistent storage

Definition at line 105 of file PersistentData.H.

CPersistentDataCollection::~CPersistentDataCollection (  )  [inline]

Definition at line 108 of file PersistentData.H.


Member Function Documentation

void CPersistentDataCollection::ClearStream (  )  [inline]

delete the assigned file

Definition at line 88 of file PersistentData.H.

Referenced by elliptic_curves::go().

void CPersistentDataCollection::ClearCollection (  )  [inline]

unregister all variables so that the collection becomes empty

Definition at line 95 of file PersistentData.H.

template<typename T>
void CPersistentDataCollection::RegisterVar ( const std::string  ID,
T &  data 
) [inline]

register a variable to be persistent

Definition at line 111 of file PersistentData.H.

References exit().

Referenced by elliptic_curves::go().

Here is the call graph for this function:

template<typename T>
void CPersistentDataCollection::UnregisterVar ( const std::string  ID  )  [inline]

unregister a variable to be no more persistent

Definition at line 122 of file PersistentData.H.

References exit().

Here is the call graph for this function:

void CPersistentDataCollection::Load (  )  [inline]

load the persistent values for the registered variables from file

Definition at line 137 of file PersistentData.H.

References cout, endl(), exit(), isspace(), and MARK.

Referenced by elliptic_curves::go().

Here is the call graph for this function:

void CPersistentDataCollection::Save (  )  [inline]

save the values for the registered variables to file (to make them persistent)

Definition at line 170 of file PersistentData.H.

References std::basic_ios< _CharT, _Traits >::out, and std::basic_ios< _CharT, _Traits >::trunc.

Referenced by elliptic_curves::go().


Member Data Documentation

const std::string CPersistentDataCollection::filename [protected]

Definition at line 82 of file PersistentData.H.

TCollection CPersistentDataCollection::collection [protected]

Definition at line 83 of file PersistentData.H.


The documentation for this class was generated from the following file:
Generated on Wed Nov 7 23:31:00 2007 for Qsieve by  doxygen 1.5.4