class Table : public AbstractTable

ASCII Parameter Table Object

Inheritance:


Public Methods

int Merge (char *fname)
Merge entries from a file into the parameter table

Public

Constructors, destructor
Table (char *fname = NULL, char *prefixes = NULL, int size = 16)
Create a Table object and initialize it from a file
Table ( const Table & S )
Copy constructor
virtual ~Table ()
Destructor

Inherited from AbstractTable:

Public Methods

virtual AbstractTable* Replicate() const
virtual int Size() const
virtual char* Key( int & i)
virtual ostream& Write(ostream&s) const

Public

Read access by key.

virtual int GetValue(const char *key, int &value) const
extract value as int
virtual int GetValue(const char *key, float &value) const
extract value as float
virtual int GetValue(const char *key, double &value) const
extract value as double
virtual int GetValue(const char *key, char *value, int length = 0) const
extract value as string

Write access by key.

virtual int PutValue(const char *key, int value)
write value as int
virtual int PutValue(const char *key, float value)
write value as float
virtual int PutValue(const char *key, double value)
write value as double
virtual int PutValue(const char *key, const char *value)
write value as character string

Read access by indexed key.

virtual int GetArrayValue(const char *key, int ind, int &value) const
extract value as int
virtual int GetArrayValue(const char *key, int ind, float &value) const
read value as float
virtual int GetArrayValue(const char *key, int ind, double &value) const
read value as double
virtual int GetArrayValue(const char *key, int ind, char *value, int length = 0) const
read value into character string

Read access by indexed key.

virtual int PutArrayValue(const char *key, int ind, int value)
write int value
virtual int PutArrayValue(const char *key, int ind, float value)
write float value
virtual int PutArrayValue(const char *key, int ind, double value)
write double value
virtual int PutArrayValue(const char *key, int ind, const char *value)
write character string value

Inherited from HCL_Base:

Public Methods

void IncCount() const
void DecCount() const
int Count() const

Documentation

ASCII Parameter Table Object. This class implements the HCL associative array (hash table) interface defined in the AbstractTable base class.

The principal Table constructor reads the Table's internal data from a "config" file. Each line of the config file is either of the form "Key = Value" or "Object::Key = Value". The first form initializes the parameter associated to "Key" in the table to the value "Value". The second form facilitates the use of one config file for several different objects. If the "Object" matches one of the object names provided by the user (as argument to the constructor, see below), then the parameter is read/written as before. Otherwise, the line is ignored. The type of "Value" can be integer, float, double, or string. String values are optionally enclosed by double-quotes.

Because the keys (strings) are private data for this class, it is a bit on the profligate side with storage.

Constructors, destructor

Table(char *fname = NULL, char *prefixes = NULL, int size = 16)
Create a Table object and initialize it from a file
Parameters:
fname - Name of file to read parameters from or NULL.
prefixes - Space-seperated list of object names. This determines which lines in the file apply to this object. (See the class description.)
size - Initial table size or 0. The table will grow as needed, but it is somewhat more efficient to provide a good size to start with.

Table( const Table & S )
Copy constructor

virtual ~Table()
Destructor

int Merge(char *fname)
Merge entries from a file into the parameter table
Parameters:
fname - File name.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de