SAMRAI::tbox::MemoryDatabase Class Reference

#include <source/toolbox/database/MemoryDatabase.h>

Inheritance diagram for SAMRAI::tbox::MemoryDatabase:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 MemoryDatabase (const std::string &name)
virtual ~MemoryDatabase ()
virtual bool create (const std::string &name)
virtual bool open (const std::string &name)
virtual bool close ()
virtual std::string getName () const
virtual bool keyExists (const std::string &key)
virtual Array< std::string > getAllKeys ()
virtual enum DataType getArrayType (const std::string &key)
 Return the type of data associated with the key.
virtual int getArraySize (const std::string &key)
virtual bool isDatabase (const std::string &key)
virtual Pointer< DatabaseputDatabase (const std::string &key)
virtual Pointer< DatabasegetDatabase (const std::string &key)
virtual bool isBool (const std::string &key)
virtual void putBool (const std::string &key, const bool &data)
virtual void putBoolArray (const std::string &key, const Array< bool > &data)
virtual void putBoolArray (const std::string &key, const bool *const data, const int nelements)
virtual bool getBool (const std::string &key)
virtual bool getBoolWithDefault (const std::string &key, const bool &defaultvalue)
virtual Array< bool > getBoolArray (const std::string &key)
virtual void getBoolArray (const std::string &key, bool *data, const int nelements)
virtual bool isDatabaseBox (const std::string &key)
virtual void putDatabaseBox (const std::string &key, const DatabaseBox &data)
virtual void putDatabaseBoxArray (const std::string &key, const Array< DatabaseBox > &data)
virtual void putDatabaseBoxArray (const std::string &key, const DatabaseBox *const data, const int nelements)
virtual DatabaseBox getDatabaseBox (const std::string &key)
virtual DatabaseBox getDatabaseBoxWithDefault (const std::string &key, const DatabaseBox &defaultvalue)
virtual Array< DatabaseBoxgetDatabaseBoxArray (const std::string &key)
virtual void getDatabaseBoxArray (const std::string &key, DatabaseBox *data, const int nelements)
virtual bool isChar (const std::string &key)
virtual void putChar (const std::string &key, const char &data)
virtual void putCharArray (const std::string &key, const Array< char > &data)
virtual void putCharArray (const std::string &key, const char *const data, const int nelements)
virtual char getChar (const std::string &key)
virtual char getCharWithDefault (const std::string &key, const char &defaultvalue)
virtual Array< char > getCharArray (const std::string &key)
virtual void getCharArray (const std::string &key, char *data, const int nelements)
virtual bool isComplex (const std::string &key)
virtual void putComplex (const std::string &key, const dcomplex &data)
virtual void putComplexArray (const std::string &key, const Array< dcomplex > &data)
virtual void putComplexArray (const std::string &key, const dcomplex *const data, const int nelements)
virtual dcomplex getComplex (const std::string &key)
virtual dcomplex getComplexWithDefault (const std::string &key, const dcomplex &defaultvalue)
virtual Array< dcomplexgetComplexArray (const std::string &key)
virtual void getComplexArray (const std::string &key, dcomplex *data, const int nelements)
virtual bool isDouble (const std::string &key)
virtual void putDouble (const std::string &key, const double &data)
virtual void putDoubleArray (const std::string &key, const Array< double > &data)
virtual void putDoubleArray (const std::string &key, const double *const data, const int nelements)
virtual double getDouble (const std::string &key)
virtual double getDoubleWithDefault (const std::string &key, const double &defaultvalue)
virtual Array< double > getDoubleArray (const std::string &key)
virtual void getDoubleArray (const std::string &key, double *data, const int nelements)
virtual bool isFloat (const std::string &key)
virtual void putFloat (const std::string &key, const float &data)
virtual void putFloatArray (const std::string &key, const Array< float > &data)
virtual void putFloatArray (const std::string &key, const float *const data, const int nelements)
virtual float getFloat (const std::string &key)
virtual float getFloatWithDefault (const std::string &key, const float &defaultvalue)
virtual Array< float > getFloatArray (const std::string &key)
virtual void getFloatArray (const std::string &key, float *data, const int nelements)
virtual bool isInteger (const std::string &key)
virtual void putInteger (const std::string &key, const int &data)
virtual void putIntegerArray (const std::string &key, const Array< int > &data)
virtual void putIntegerArray (const std::string &key, const int *const data, const int nelements)
virtual int getInteger (const std::string &key)
virtual int getIntegerWithDefault (const std::string &key, const int &defaultvalue)
virtual Array< int > getIntegerArray (const std::string &key)
virtual void getIntegerArray (const std::string &key, int *data, const int nelements)
virtual bool isString (const std::string &key)
virtual void putString (const std::string &key, const std::string &data)
virtual void putStringArray (const std::string &key, const Array< std::string > &data)
virtual void putStringArray (const std::string &key, const std::string *const data, const int nelements)
virtual std::string getString (const std::string &key)
virtual std::string getStringWithDefault (const std::string &key, const std::string &defaultvalue)
virtual Array< std::string > getStringArray (const std::string &key)
virtual void getStringArray (const std::string &key, std::string *data, const int nelements)
virtual std::string getName ()
 Returns the name of this database.
bool keyAccessed (const std::string &key)
virtual void printClassData (std::ostream &os=pout)
void printUnusedKeys (std::ostream &os=pout) const
void printDefaultKeys (std::ostream &os=pout) const

Detailed Description

Class MemoryDatabase stores (key,value) pairs in a hierarchical database. Each value may be another database, boolean, box, character, complex, double, float, integer, or string. Note that boxes are stored using the toolbox box class that can store boxes of any dimension in the same data structure.

See the Database class documentation for a description of the generic database interface.

The memory database is used for storing input (a "deck") in memory; the derived class InputDatabase use for this purpose; InputDatabase is kept around for historical reasons and the name is a bit more clear than "memory" database but this class is very generic. The Parser is really the class that process the input; it parses the input file into a database.

Note that the memory database will attempt to promote numerical types where appropriate. The promotion chain is int -> float -> double -> complex. For example, an integer key will be promoted to a complex value if isComplex() or getComplex() is called. Double values will also be truncated to floats (with loss of information) if a float call is made on a double value.

It is assumed that all processors will access the database in the same manner. Thus, all error messages are output to pout instead of perr.


Constructor & Destructor Documentation

SAMRAI::tbox::MemoryDatabase::MemoryDatabase ( const std::string &  name  )  [inline]

The memory database constructor creates an empty database with the specified name.

SAMRAI::tbox::MemoryDatabase::~MemoryDatabase (  )  [virtual]

The memory database destructor deallocates the data in the database.


Member Function Documentation

bool SAMRAI::tbox::MemoryDatabase::create ( const std::string &  name  )  [virtual]

Create a new database file.

Returns true if successful.

Parameters:
name name of database. Normally a filename.

Implements SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::open ( const std::string &  name  )  [virtual]

Open an existing database file.

Returns true if successful.

Parameters:
name name of database. Normally a filename.

Implements SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::close (  )  [virtual]

Close the database.

Returns true if successful.

If the database is currently open then close it. This should flush all data to the file (if the database is on disk).

Implements SAMRAI::tbox::Database.

std::string SAMRAI::tbox::MemoryDatabase::getName (  )  const [inline, virtual]

Return string name of memory database object.

Implements SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::keyExists ( const std::string &  key  )  [virtual]

Return true if the specified key exists in the database and false otherwise.

Implements SAMRAI::tbox::Database.

Array< std::string > SAMRAI::tbox::MemoryDatabase::getAllKeys (  )  [virtual]

Return all keys in the database.

Implements SAMRAI::tbox::Database.

enum Database::DataType SAMRAI::tbox::MemoryDatabase::getArrayType ( const std::string &  key  )  [virtual]

Return the type of data associated with the key.

If the key does not exist, then INVALID is returned

Parameters:
key Key name in database.

Implements SAMRAI::tbox::Database.

int SAMRAI::tbox::MemoryDatabase::getArraySize ( const std::string &  key  )  [virtual]

Return the size of the array associated with the key. If the key does not exist, then zero is returned.

Implements SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::isDatabase ( const std::string &  key  )  [virtual]

Return whether the specified key represents a database entry. If the key does not exist, then false is returned.

Implements SAMRAI::tbox::Database.

Pointer< Database > SAMRAI::tbox::MemoryDatabase::putDatabase ( const std::string &  key  )  [virtual]

Create a new database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Implements SAMRAI::tbox::Database.

Pointer< Database > SAMRAI::tbox::MemoryDatabase::getDatabase ( const std::string &  key  )  [virtual]

Get the database with the specified key name. If the specified key does not exist in the database or it is not a database, then an error message is printed and the program exits.

Implements SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::isBool ( const std::string &  key  )  [virtual]

Return whether the specified key represents a boolean entry. If the key does not exist, then false is returned.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putBool ( const std::string &  key,
const bool &  data 
) [virtual]

Create a boolean scalar entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putBoolArray ( const std::string &  key,
const Array< bool > &  data 
) [virtual]

Create a boolean array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putBoolArray ( const std::string &  key,
const bool *const   data,
const int  nelements 
) [virtual]

Create a boolean array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Implements SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::getBool ( const std::string &  key  )  [virtual]

Get a boolean entry in the database with the specified key name. If the specified key does not exist in the database or is not a boolean scalar, then an error message is printed and the program exits.

Reimplemented from SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::getBoolWithDefault ( const std::string &  key,
const bool &  defaultvalue 
) [virtual]

Get a boolean entry in the database with the specified key name. If the specified key does not exist in the database, then the default value is returned. If the key exists but is not a boolean scalar, then an error message is printed and the program exits.

Reimplemented from SAMRAI::tbox::Database.

Array< bool > SAMRAI::tbox::MemoryDatabase::getBoolArray ( const std::string &  key  )  [virtual]

Get a boolean entry from the database with the specified key name. If the specified key does not exist in the database or is not a boolean array, then an error message is printed and the program exits.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::getBoolArray ( const std::string &  key,
bool *  data,
const int  nelements 
) [virtual]

Get a boolean entry from the database with the specified key name. If the specified key does not exist in the database or is not a boolean array, then an error message is printed and the program exits. The specified number of elements must match exactly the number of elements in the array in the database.

Reimplemented from SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::isDatabaseBox ( const std::string &  key  )  [virtual]

Return whether the specified key represents a box entry. If the key does not exist, then false is returned.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putDatabaseBox ( const std::string &  key,
const DatabaseBox data 
) [virtual]

Create a box scalar entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putDatabaseBoxArray ( const std::string &  key,
const Array< DatabaseBox > &  data 
) [virtual]

Create a box array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putDatabaseBoxArray ( const std::string &  key,
const DatabaseBox *const   data,
const int  nelements 
) [virtual]

Create a box array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Implements SAMRAI::tbox::Database.

DatabaseBox SAMRAI::tbox::MemoryDatabase::getDatabaseBox ( const std::string &  key  )  [virtual]

Get a box entry in the database with the specified key name. If the specified key does not exist in the database or is not a box scalar, then an error message is printed and the program exits.

Reimplemented from SAMRAI::tbox::Database.

DatabaseBox SAMRAI::tbox::MemoryDatabase::getDatabaseBoxWithDefault ( const std::string &  key,
const DatabaseBox defaultvalue 
) [virtual]

Get a box entry in the database with the specified key name. If the specified key does not exist in the database, then the default value is returned. If the key exists but is not a box scalar, then an error message is printed and the program exits.

Reimplemented from SAMRAI::tbox::Database.

Array< DatabaseBox > SAMRAI::tbox::MemoryDatabase::getDatabaseBoxArray ( const std::string &  key  )  [virtual]

Get a box entry from the database with the specified key name. If the specified key does not exist in the database or is not a box array, then an error message is printed and the program exits.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::getDatabaseBoxArray ( const std::string &  key,
DatabaseBox data,
const int  nelements 
) [virtual]

Get a box entry from the database with the specified key name. If the specified key does not exist in the database or is not a box array, then an error message is printed and the program exits. The specified number of elements must match exactly the number of elements in the array in the database.

Reimplemented from SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::isChar ( const std::string &  key  )  [virtual]

Return whether the specified key represents a character entry. If the key does not exist, then false is returned.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putChar ( const std::string &  key,
const char &  data 
) [virtual]

Create a character scalar entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putCharArray ( const std::string &  key,
const Array< char > &  data 
) [virtual]

Create a character array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putCharArray ( const std::string &  key,
const char *const   data,
const int  nelements 
) [virtual]

Create a character array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Implements SAMRAI::tbox::Database.

char SAMRAI::tbox::MemoryDatabase::getChar ( const std::string &  key  )  [virtual]

Get a character entry in the database with the specified key name. If the specified key does not exist in the database or is not an character scalar, then an error message is printed and the program exits.

Reimplemented from SAMRAI::tbox::Database.

char SAMRAI::tbox::MemoryDatabase::getCharWithDefault ( const std::string &  key,
const char &  defaultvalue 
) [virtual]

Get a character entry in the database with the specified key name. If the specified key does not exist in the database, then the default value is returned. If the key exists but is not a character scalar, then an error message is printed and the program exits.

Reimplemented from SAMRAI::tbox::Database.

Array< char > SAMRAI::tbox::MemoryDatabase::getCharArray ( const std::string &  key  )  [virtual]

Get a character entry from the database with the specified key name. If the specified key does not exist in the database or is not a character array, then an error message is printed and the program exits.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::getCharArray ( const std::string &  key,
char *  data,
const int  nelements 
) [virtual]

Get a character entry from the database with the specified key name. If the specified key does not exist in the database or is not a character array, then an error message is printed and the program exits. The specified number of elements must match exactly the number of elements in the array in the database.

Reimplemented from SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::isComplex ( const std::string &  key  )  [virtual]

Return whether the specified key represents a complex entry. If the key does not exist, then false is returned. Complex values may be promoted from integers, floats, or doubles.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putComplex ( const std::string &  key,
const dcomplex data 
) [virtual]

Create a complex scalar entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putComplexArray ( const std::string &  key,
const Array< dcomplex > &  data 
) [virtual]

Create a complex array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putComplexArray ( const std::string &  key,
const dcomplex *const   data,
const int  nelements 
) [virtual]

Create a complex array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Implements SAMRAI::tbox::Database.

dcomplex SAMRAI::tbox::MemoryDatabase::getComplex ( const std::string &  key  )  [virtual]

Get a complex entry in the database with the specified key name. If the specified key does not exist in the database or is not a complex scalar, then an error message is printed and the program exits. Complex values may be promoted from integers, floats, or doubles.

Reimplemented from SAMRAI::tbox::Database.

dcomplex SAMRAI::tbox::MemoryDatabase::getComplexWithDefault ( const std::string &  key,
const dcomplex defaultvalue 
) [virtual]

Get a complex entry in the database with the specified key name. If the specified key does not exist in the database, then the default value is returned. If the key exists but is not a complex scalar, then an error message is printed and the program exits. Complex values may be promoted from integers, floats, or doubles.

Reimplemented from SAMRAI::tbox::Database.

Array< dcomplex > SAMRAI::tbox::MemoryDatabase::getComplexArray ( const std::string &  key  )  [virtual]

Get a complex entry from the database with the specified key name. If the specified key does not exist in the database or is not a complex array, then an error message is printed and the program exits. Complex values may be promoted from integers, floats, or doubles.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::getComplexArray ( const std::string &  key,
dcomplex data,
const int  nelements 
) [virtual]

Get a complex entry from the database with the specified key name. If the specified key does not exist in the database or is not a complex array, then an error message is printed and the program exits. The specified number of elements must match exactly the number of elements in the array in the database. Complex values may be promoted from integers, floats, or doubles.

Reimplemented from SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::isDouble ( const std::string &  key  )  [virtual]

Return whether the specified key represents a double entry. If the key does not exist, then false is returned. Double values may be promoted from integers or floats.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putDouble ( const std::string &  key,
const double &  data 
) [virtual]

Create a double scalar entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putDoubleArray ( const std::string &  key,
const Array< double > &  data 
) [virtual]

Create a double array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putDoubleArray ( const std::string &  key,
const double *const   data,
const int  nelements 
) [virtual]

Create a double array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Implements SAMRAI::tbox::Database.

double SAMRAI::tbox::MemoryDatabase::getDouble ( const std::string &  key  )  [virtual]

Get a double entry in the database with the specified key name. If the specified key does not exist in the database or is not a double scalar, then an error message is printed and the program exits. Double values may be promoted from integers or floats.

Reimplemented from SAMRAI::tbox::Database.

double SAMRAI::tbox::MemoryDatabase::getDoubleWithDefault ( const std::string &  key,
const double &  defaultvalue 
) [virtual]

Get a double entry in the database with the specified key name. If the specified key does not exist in the database, then the default value is returned. If the key exists but is not a double scalar, then an error message is printed and the program exits. Double values may be promoted from integers or floats.

Reimplemented from SAMRAI::tbox::Database.

Array< double > SAMRAI::tbox::MemoryDatabase::getDoubleArray ( const std::string &  key  )  [virtual]

Get a double entry from the database with the specified key name. If the specified key does not exist in the database or is not a double array, then an error message is printed and the program exits. Double values may be promoted from integers or floats.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::getDoubleArray ( const std::string &  key,
double *  data,
const int  nelements 
) [virtual]

Get a double entry from the database with the specified key name. If the specified key does not exist in the database or is not a double array, then an error message is printed and the program exits. The specified number of elements must match exactly the number of elements in the array in the database. Double values may be promoted from integers or floats.

Reimplemented from SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::isFloat ( const std::string &  key  )  [virtual]

Return whether the specified key represents a float entry. If the key does not exist, then false is returned. Float values may be promoted from integers or silently truncated from doubles.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putFloat ( const std::string &  key,
const float &  data 
) [virtual]

Create a float scalar entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putFloatArray ( const std::string &  key,
const Array< float > &  data 
) [virtual]

Create a float array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putFloatArray ( const std::string &  key,
const float *const  data,
const int  nelements 
) [virtual]

Create a float array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Implements SAMRAI::tbox::Database.

float SAMRAI::tbox::MemoryDatabase::getFloat ( const std::string &  key  )  [virtual]

Get a float entry in the database with the specified key name. If the specified key does not exist in the database or is not a float scalar, then an error message is printed and the program exits. Float values may be promoted from integers or silently truncated from doubles.

Reimplemented from SAMRAI::tbox::Database.

float SAMRAI::tbox::MemoryDatabase::getFloatWithDefault ( const std::string &  key,
const float &  defaultvalue 
) [virtual]

Get a float entry in the database with the specified key name. If the specified key does not exist in the database, then the default value is returned. If the key exists but is not a float scalar, then an error message is printed and the program exits. Float values may be promoted from integers or silently truncated from doubles.

Reimplemented from SAMRAI::tbox::Database.

Array< float > SAMRAI::tbox::MemoryDatabase::getFloatArray ( const std::string &  key  )  [virtual]

Get a float entry from the database with the specified key name. If the specified key does not exist in the database or is not a float array, then an error message is printed and the program exits. Float values may be promoted from integers or silently truncated from doubles.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::getFloatArray ( const std::string &  key,
float *  data,
const int  nelements 
) [virtual]

Get a float entry from the database with the specified key name. If the specified key does not exist in the database or is not a float array, then an error message is printed and the program exits. The specified number of elements must match exactly the number of elements in the array in the database. Float values may be promoted from integers or silently truncated from doubles.

Reimplemented from SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::isInteger ( const std::string &  key  )  [virtual]

Return whether the specified key represents an integer entry. If the key does not exist, then false is returned.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putInteger ( const std::string &  key,
const int &  data 
) [virtual]

Create an integer scalar entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putIntegerArray ( const std::string &  key,
const Array< int > &  data 
) [virtual]

Create an integer array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putIntegerArray ( const std::string &  key,
const int *const   data,
const int  nelements 
) [virtual]

Create an integer array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Implements SAMRAI::tbox::Database.

int SAMRAI::tbox::MemoryDatabase::getInteger ( const std::string &  key  )  [virtual]

Get an integer entry in the database with the specified key name. If the specified key does not exist in the database or is not an integer scalar, then an error message is printed and the program exits.

Reimplemented from SAMRAI::tbox::Database.

int SAMRAI::tbox::MemoryDatabase::getIntegerWithDefault ( const std::string &  key,
const int &  defaultvalue 
) [virtual]

Get an integer entry in the database with the specified key name. If the specified key does not exist in the database, then the default value is returned. If the key exists but is not an integer scalar, then an error message is printed and the program exits.

Reimplemented from SAMRAI::tbox::Database.

Array< int > SAMRAI::tbox::MemoryDatabase::getIntegerArray ( const std::string &  key  )  [virtual]

Get an integer entry from the database with the specified key name. If the specified key does not exist in the database or is not an integer array, then an error message is printed and the program exits.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::getIntegerArray ( const std::string &  key,
int *  data,
const int  nelements 
) [virtual]

Get an integer entry from the database with the specified key name. If the specified key does not exist in the database or is not an integer array, then an error message is printed and the program exits. The specified number of elements must match exactly the number of elements in the array in the database.

Reimplemented from SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::isString ( const std::string &  key  )  [virtual]

Return whether the specified key represents a std::string entry. If the key does not exist, then false is returned.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putString ( const std::string &  key,
const std::string &  data 
) [virtual]

Create a string scalar entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putStringArray ( const std::string &  key,
const Array< std::string > &  data 
) [virtual]

Create a string array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Reimplemented from SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::putStringArray ( const std::string &  key,
const std::string *const   data,
const int  nelements 
) [virtual]

Create a string array entry in the database with the specified key name. If the key already exists in the database, then the old key record is deleted and the new one is silently created in its place.

Implements SAMRAI::tbox::Database.

std::string SAMRAI::tbox::MemoryDatabase::getString ( const std::string &  key  )  [virtual]

Get a string entry in the database with the specified key name. If the specified key does not exist in the database or is not an string scalar, then an error message is printed and the program exits.

Reimplemented from SAMRAI::tbox::Database.

std::string SAMRAI::tbox::MemoryDatabase::getStringWithDefault ( const std::string &  key,
const std::string &  defaultvalue 
) [virtual]

Get a string entry in the database with the specified key name. If the specified key does not exist in the database, then the default value is returned. If the key exists but is not a string scalar, then an error message is printed and the program exits.

Reimplemented from SAMRAI::tbox::Database.

Array< std::string > SAMRAI::tbox::MemoryDatabase::getStringArray ( const std::string &  key  )  [virtual]

Get a string entry from the database with the specified key name. If the specified key does not exist in the database or is not a string array, then an error message is printed and the program exits.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::getStringArray ( const std::string &  key,
std::string *  data,
const int  nelements 
) [virtual]

Get a string entry from the database with the specified key name. If the specified key does not exist in the database or is not a string array, then an error message is printed and the program exits. The specified number of elements must match exactly the number of elements in the array in the database.

Reimplemented from SAMRAI::tbox::Database.

virtual std::string SAMRAI::tbox::MemoryDatabase::getName (  )  [virtual]

Returns the name of this database.

The name for the root of the database is the name supplied when creating it. Names for nested databases are the keyname of the database.

Parameters:
os Output stream.

Implements SAMRAI::tbox::Database.

bool SAMRAI::tbox::MemoryDatabase::keyAccessed ( const std::string &  key  )  [inline]

Return whether the specified key has been accessed by one of the lookup member functions. If the key does not exist in the database, then false is returned.

void SAMRAI::tbox::MemoryDatabase::printClassData ( std::ostream &  os = pout  )  [virtual]

Print the current database to the specified output stream. After each key, print whether that key came from the a file and was used, came from the file but was not used (unused), or came from a default key value (default). If no output stream is specified, then data is written to stream pout.

NOTE: under the g++ compiler libraries, printClassData has a maximum output of 4096 characters per line.

Implements SAMRAI::tbox::Database.

void SAMRAI::tbox::MemoryDatabase::printUnusedKeys ( std::ostream &  os = pout  )  const

Print the database keys that were not used to the specified output stream.

void SAMRAI::tbox::MemoryDatabase::printDefaultKeys ( std::ostream &  os = pout  )  const

Print the database keys that were set via default calls to the specified output stream.


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:29:00 2009 for SAMRAI by  doxygen 1.5.1