#include <source/toolbox/database/Database.h>
Inheritance diagram for SAMRAI::tbox::Database:
Public Types | |
enum | DataType { SAMRAI_INVALID, SAMRAI_DATABASE, SAMRAI_BOOL, SAMRAI_CHAR, SAMRAI_INT, SAMRAI_COMPLEX, SAMRAI_DOUBLE, SAMRAI_FLOAT, SAMRAI_STRING, SAMRAI_BOX } |
Public Member Functions | |
Database () | |
virtual | ~Database () |
virtual bool | create (const std::string &name)=0 |
virtual bool | open (const std::string &name)=0 |
virtual bool | close ()=0 |
virtual bool | keyExists (const std::string &key)=0 |
virtual Array< std::string > | getAllKeys ()=0 |
virtual enum DataType | getArrayType (const std::string &key)=0 |
Return the type of data associated with the key. | |
virtual int | getArraySize (const std::string &key)=0 |
Return the size of the array associated with the key. | |
virtual bool | isDatabase (const std::string &key)=0 |
virtual Pointer< Database > | putDatabase (const std::string &key)=0 |
virtual Pointer< Database > | getDatabase (const std::string &key)=0 |
virtual bool | isBool (const std::string &key)=0 |
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)=0 |
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)=0 |
virtual void | getBoolArray (const std::string &key, bool *data, const int nelements) |
virtual bool | isDatabaseBox (const std::string &key)=0 |
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)=0 |
virtual DatabaseBox | getDatabaseBox (const std::string &key) |
virtual DatabaseBox | getDatabaseBoxWithDefault (const std::string &key, const DatabaseBox &defaultvalue) |
virtual Array< DatabaseBox > | getDatabaseBoxArray (const std::string &key)=0 |
virtual void | getDatabaseBoxArray (const std::string &key, DatabaseBox *data, const int nelements) |
virtual bool | isChar (const std::string &key)=0 |
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)=0 |
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)=0 |
virtual void | getCharArray (const std::string &key, char *data, const int nelements) |
virtual bool | isComplex (const std::string &key)=0 |
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)=0 |
virtual dcomplex | getComplex (const std::string &key) |
virtual dcomplex | getComplexWithDefault (const std::string &key, const dcomplex &defaultvalue) |
virtual Array< dcomplex > | getComplexArray (const std::string &key)=0 |
virtual void | getComplexArray (const std::string &key, dcomplex *data, const int nelements) |
virtual bool | isDouble (const std::string &key)=0 |
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)=0 |
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)=0 |
virtual void | getDoubleArray (const std::string &key, double *data, const int nelements) |
virtual bool | isFloat (const std::string &key)=0 |
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)=0 |
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)=0 |
virtual void | getFloatArray (const std::string &key, float *data, const int nelements) |
virtual bool | isInteger (const std::string &key)=0 |
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)=0 |
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)=0 |
virtual void | getIntegerArray (const std::string &key, int *data, const int nelements) |
virtual bool | isString (const std::string &key)=0 |
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)=0 |
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)=0 |
virtual void | getStringArray (const std::string &key, std::string *data, const int nelements) |
void | getScalar (const std::string &key, bool &scalar) |
void | putScalar (const std::string &key, const bool scalar) |
void | getArray (const std::string &key, Array< bool > &array) |
void | putArray (const std::string &key, const Array< bool > array) |
void | getScalar (const std::string &key, char &scalar) |
void | putScalar (const std::string &key, const char scalar) |
void | getArray (const std::string &key, Array< char > &array) |
void | putArray (const std::string &key, const Array< char > array) |
void | getScalar (const std::string &key, dcomplex &scalar) |
void | putScalar (const std::string &key, const dcomplex scalar) |
void | getArray (const std::string &key, Array< dcomplex > &array) |
void | putArray (const std::string &key, const Array< dcomplex > array) |
void | getScalar (const std::string &key, float &scalar) |
void | putScalar (const std::string &key, const float scalar) |
void | getArray (const std::string &key, Array< float > &array) |
void | putArray (const std::string &key, const Array< float > array) |
void | getScalar (const std::string &key, double &scalar) |
void | putScalar (const std::string &key, const double scalar) |
void | getArray (const std::string &key, Array< double > &array) |
void | putArray (const std::string &key, const Array< double > array) |
void | getScalar (const std::string &key, int &scalar) |
void | putScalar (const std::string &key, const int scalar) |
void | getArray (const std::string &key, Array< int > &array) |
void | putArray (const std::string &key, const Array< int > array) |
virtual std::string | getName ()=0 |
Returns the name of this database. | |
virtual void | printClassData (std::ostream &os=pout)=0 |
SAMRAI databases store (key,value) pairs in a hierarchical database. Each value may be another database or a boolean, box, character, double complex, double, float, integer, or string. DatabaseBoxes are stored using the toolbox box structure.
Data is entered into the database through methods of the general form putTYPE(key, TYPE) or putTYPEArray(key, TYPE array), where TYPE is the type of value created. If the specified key already exists in the database, then the existing key is silently deleted.
Data is extracted from the database through methods of the general form TYPE = getTYPE(key), where TYPE is the type of value to be returned from the database. There are two general lookup methods. In the first, a default value is provided (for scalars only). If the specified key is not found in the database, then the specified default is returned. In the second form, no default is provided, and the database exists with an error message and program exits if the key is not found. The array version of getTYPE() works in a similar fashion.
Enumerated type indicating what type of values is stored in a database entry. Returned from getType() method.
Note: The SAMRAI_ prefix is needed since some poorly written packages do "#define CHAR" etc.
SAMRAI::tbox::Database::Database | ( | ) | [inline] |
The constructor for the database base class does nothing interesting.
SAMRAI::tbox::Database::~Database | ( | ) | [virtual] |
The virtual destructor for the database base class does nothing interesting.
virtual bool SAMRAI::tbox::Database::create | ( | const std::string & | name | ) | [pure virtual] |
Create a new database file.
Returns true if successful.
name | name of database. Normally a filename. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
virtual bool SAMRAI::tbox::Database::open | ( | const std::string & | name | ) | [pure virtual] |
Open an existing database file.
Returns true if successful.
name | name of database. Normally a filename. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
virtual bool SAMRAI::tbox::Database::close | ( | ) | [pure 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).
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
virtual bool SAMRAI::tbox::Database::keyExists | ( | const std::string & | key | ) | [pure virtual] |
Return true if the specified key exists in the database and false otherwise.
key | Key name to lookup. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
virtual Array<std::string> SAMRAI::tbox::Database::getAllKeys | ( | ) | [pure virtual] |
Return all keys in the database.
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
virtual enum DataType SAMRAI::tbox::Database::getArrayType | ( | const std::string & | key | ) | [pure virtual] |
Return the type of data associated with the key.
If the key does not exist, then INVALID is returned
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
virtual int SAMRAI::tbox::Database::getArraySize | ( | const std::string & | key | ) | [pure virtual] |
Return the size of the array associated with the key.
If the key does not exist, then zero is returned. If the key is a database then zero is returned.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
virtual bool SAMRAI::tbox::Database::isDatabase | ( | const std::string & | key | ) | [pure virtual] |
Return whether the specified key represents a database entry. If the key does not exist, then false is returned.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
virtual Pointer<Database> SAMRAI::tbox::Database::putDatabase | ( | const std::string & | key | ) | [pure 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.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
virtual Pointer<Database> SAMRAI::tbox::Database::getDatabase | ( | const std::string & | key | ) | [pure 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.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
virtual bool SAMRAI::tbox::Database::isBool | ( | const std::string & | key | ) | [pure virtual] |
Return whether the specified key represents a boolean entry. If the key does not exist, then false is returned.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::putBool | ( | const std::string & | key, | |
const bool & | data | |||
) | [virtual] |
Create a boolean scalar entry in the database with the specified key name. If thoe key already exists in the database, then the old key record is deleted and the new one is silently created in its place.
key | Key name in database. | |
data | Value to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual void SAMRAI::tbox::Database::putBoolArray | ( | const std::string & | key, | |
const bool *const | data, | |||
const int | nelements | |||
) | [pure 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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
bool SAMRAI::tbox::Database::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.
key | Key name in database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
bool SAMRAI::tbox::Database::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 in SAMRAI::tbox::MemoryDatabase.
virtual Array<bool> SAMRAI::tbox::Database::getBoolArray | ( | const std::string & | key | ) | [pure 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.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual bool SAMRAI::tbox::Database::isDatabaseBox | ( | const std::string & | key | ) | [pure virtual] |
Return whether the specified key represents a box entry. If the key does not exist, then false is returned.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Data to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual void SAMRAI::tbox::Database::putDatabaseBoxArray | ( | const std::string & | key, | |
const DatabaseBox *const | data, | |||
const int | nelements | |||
) | [pure 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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
DatabaseBox SAMRAI::tbox::Database::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.
key | Key name in database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
DatabaseBox SAMRAI::tbox::Database::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.
key | Key name in database. | |
defaultvalue | Default value to return if not found. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual Array<DatabaseBox> SAMRAI::tbox::Database::getDatabaseBoxArray | ( | const std::string & | key | ) | [pure 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.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual bool SAMRAI::tbox::Database::isChar | ( | const std::string & | key | ) | [pure virtual] |
Return whether the specified key represents a character entry. If the key does not exist, then false is returned.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Value to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
key | Key name in database. | |
data | Array with data to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual void SAMRAI::tbox::Database::putCharArray | ( | const std::string & | key, | |
const char *const | data, | |||
const int | nelements | |||
) | [pure 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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
char SAMRAI::tbox::Database::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.
key | Key name in database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
char SAMRAI::tbox::Database::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.
key | Key name in database. | |
defaultvalue | Default value to return if not found. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual Array<char> SAMRAI::tbox::Database::getCharArray | ( | const std::string & | key | ) | [pure 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.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual bool SAMRAI::tbox::Database::isComplex | ( | const std::string & | key | ) | [pure virtual] |
Return whether the specified key represents a complex entry. If the key does not exist, then false is returned.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Value to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual void SAMRAI::tbox::Database::putComplexArray | ( | const std::string & | key, | |
const dcomplex *const | data, | |||
const int | nelements | |||
) | [pure 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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
dcomplex SAMRAI::tbox::Database::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.
key | Key name in database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
dcomplex SAMRAI::tbox::Database::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.
key | Key name in database. | |
defaultvalue | Default value to return if not found. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual Array<dcomplex> SAMRAI::tbox::Database::getComplexArray | ( | const std::string & | key | ) | [pure 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.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual bool SAMRAI::tbox::Database::isDouble | ( | const std::string & | key | ) | [pure virtual] |
Return whether the specified key represents a double entry. If the key does not exist, then false is returned.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Value to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual void SAMRAI::tbox::Database::putDoubleArray | ( | const std::string & | key, | |
const double *const | data, | |||
const int | nelements | |||
) | [pure 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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
double SAMRAI::tbox::Database::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.
key | Key name in database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
double SAMRAI::tbox::Database::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.
key | Key name in database. | |
defaultvalue | Default value to return if not found. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual Array<double> SAMRAI::tbox::Database::getDoubleArray | ( | const std::string & | key | ) | [pure 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.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual bool SAMRAI::tbox::Database::isFloat | ( | const std::string & | key | ) | [pure virtual] |
Return whether the specified key represents a float entry. If the key does not exist, then false is returned.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Value to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual void SAMRAI::tbox::Database::putFloatArray | ( | const std::string & | key, | |
const float *const | data, | |||
const int | nelements | |||
) | [pure 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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
float SAMRAI::tbox::Database::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.
key | Key name in database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
float SAMRAI::tbox::Database::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.
key | Key name in database. | |
defaultvalue | Default value to return if not found. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual Array<float> SAMRAI::tbox::Database::getFloatArray | ( | const std::string & | key | ) | [pure 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.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual bool SAMRAI::tbox::Database::isInteger | ( | const std::string & | key | ) | [pure virtual] |
Return whether the specified key represents an integer entry. If the key does not exist, then false is returned.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Value to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual void SAMRAI::tbox::Database::putIntegerArray | ( | const std::string & | key, | |
const int *const | data, | |||
const int | nelements | |||
) | [pure 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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
int SAMRAI::tbox::Database::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.
key | Key name in database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
int SAMRAI::tbox::Database::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.
key | Key name in database. | |
defaultvalue | Default value to return if not found. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual Array<int> SAMRAI::tbox::Database::getIntegerArray | ( | const std::string & | key | ) | [pure 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.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual bool SAMRAI::tbox::Database::isString | ( | const std::string & | key | ) | [pure virtual] |
Return whether the specified key represents a std::string entry. If the key does not exist, then false is returned.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Value to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual void SAMRAI::tbox::Database::putStringArray | ( | const std::string & | key, | |
const std::string *const | data, | |||
const int | nelements | |||
) | [pure 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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
std::string SAMRAI::tbox::Database::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.
key | Key name in database. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
std::string SAMRAI::tbox::Database::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.
key | Key name in database. | |
defaultvalue | Default value to return if not found. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
virtual Array<std::string> SAMRAI::tbox::Database::getStringArray | ( | const std::string & | key | ) | [pure 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.
key | Key name in database. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
void SAMRAI::tbox::Database::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.
key | Key name in database. | |
data | Array with data to put into database. | |
nelements | Number of elements to write from array. |
Reimplemented in SAMRAI::tbox::MemoryDatabase.
void SAMRAI::tbox::Database::getScalar | ( | const std::string & | key, | |
bool & | scalar | |||
) |
Get a bool entry in the database with the specified key name. If the specified key does not exist in the database or is not an bool scalar, then an error message is printed and the program exits.
key | Key name in database. | |
scalar | Returns scalar that was read. |
void SAMRAI::tbox::Database::putScalar | ( | const std::string & | key, | |
const bool | scalar | |||
) |
Get a bool entry from the database with the specified key name. If the specified key does not exist in the database or is not a bool array, then an error message is printed and the program exits.
key | Key name in database. | |
scalar | Value to put into database. |
void SAMRAI::tbox::Database::getArray | ( | const std::string & | key, | |
Array< bool > & | array | |||
) |
Get a bool entry from the database with the specified key name. If the specified key does not exist in the database or is not a bool array, then an error message is printed and the program exits.
key | Key name in database. | |
array | Returns array that was read. |
void SAMRAI::tbox::Database::putArray | ( | const std::string & | key, | |
const Array< bool > | array | |||
) |
Create an bool 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.
key | Key name in database. | |
array | Array to put into database. |
void SAMRAI::tbox::Database::getScalar | ( | const std::string & | key, | |
char & | scalar | |||
) |
Get a char entry in the database with the specified key name. If the specified key does not exist in the database or is not an char scalar, then an error message is printed and the program exits.
key | Key name in database. | |
scalar | Returns scalar that was read. |
void SAMRAI::tbox::Database::putScalar | ( | const std::string & | key, | |
const char | scalar | |||
) |
Get a char entry from the database with the specified key name. If the specified key does not exist in the database or is not a char array, then an error message is printed and the program exits.
key | Key name in database. | |
scalar | Value to put into database. |
void SAMRAI::tbox::Database::getArray | ( | const std::string & | key, | |
Array< char > & | array | |||
) |
Get a char entry from the database with the specified key name. If the specified key does not exist in the database or is not a char array, then an error message is printed and the program exits.
key | Key name in database. | |
array | Returns array that was read. |
void SAMRAI::tbox::Database::putArray | ( | const std::string & | key, | |
const Array< char > | array | |||
) |
Create an char 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.
key | Key name in database. | |
array | Array to put into database. |
void SAMRAI::tbox::Database::getScalar | ( | const std::string & | key, | |
dcomplex & | scalar | |||
) |
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 an complex scalar, then an error message is printed and the program exits.
key | Key name in database. | |
scalar | Returns scalar that was read. |
void SAMRAI::tbox::Database::putScalar | ( | const std::string & | key, | |
const dcomplex | scalar | |||
) |
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.
key | Key name in database. | |
scalar | Value to put into database. |
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.
key | Key name in database. | |
array | Returns array that was read. |
Create an 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.
key | Key name in database. | |
array | Array to put into database. |
void SAMRAI::tbox::Database::getScalar | ( | const std::string & | key, | |
float & | scalar | |||
) |
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 an float scalar, then an error message is printed and the program exits.
key | Key name in database. | |
scalar | Returns scalar that was read. |
void SAMRAI::tbox::Database::putScalar | ( | const std::string & | key, | |
const float | scalar | |||
) |
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.
key | Key name in database. | |
scalar | Value to put into database. |
void SAMRAI::tbox::Database::getArray | ( | const std::string & | key, | |
Array< float > & | array | |||
) |
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.
key | Key name in database. | |
array | Returns array that was read. |
void SAMRAI::tbox::Database::putArray | ( | const std::string & | key, | |
const Array< float > | array | |||
) |
Create an 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.
key | Key name in database. | |
array | Array to put into database. |
void SAMRAI::tbox::Database::getScalar | ( | const std::string & | key, | |
double & | scalar | |||
) |
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 an double scalar, then an error message is printed and the program exits.
key | Key name in database. | |
scalar | Returns scalar that was read. |
void SAMRAI::tbox::Database::putScalar | ( | const std::string & | key, | |
const double | scalar | |||
) |
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.
key | Key name in database. | |
scalar | Value to put into database. |
void SAMRAI::tbox::Database::getArray | ( | const std::string & | key, | |
Array< double > & | array | |||
) |
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.
key | Key name in database. | |
array | Returns array that was read. |
void SAMRAI::tbox::Database::putArray | ( | const std::string & | key, | |
const Array< double > | array | |||
) |
Create an 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.
key | Key name in database. | |
array | Array to put into database. |
void SAMRAI::tbox::Database::getScalar | ( | const std::string & | key, | |
int & | scalar | |||
) |
Get a 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.
key | Key name in database. | |
scalar | Returns scalar that was read. |
void SAMRAI::tbox::Database::putScalar | ( | const std::string & | key, | |
const int | scalar | |||
) |
Get a integer entry from the database with the specified key name. If the specified key does not exist in the database or is not a integer array, then an error message is printed and the program exits.
key | Key name in database. | |
scalar | Value to put into database. |
void SAMRAI::tbox::Database::getArray | ( | const std::string & | key, | |
Array< int > & | array | |||
) |
Get a integer entry from the database with the specified key name. If the specified key does not exist in the database or is not a integer array, then an error message is printed and the program exits.
key | Key name in database. | |
array | Returns array that was read. |
void SAMRAI::tbox::Database::putArray | ( | const std::string & | key, | |
const Array< int > | array | |||
) |
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.
key | Key name in database. | |
array | Array to put into database. |
virtual std::string SAMRAI::tbox::Database::getName | ( | ) | [pure 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.
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.
virtual void SAMRAI::tbox::Database::printClassData | ( | std::ostream & | os = pout |
) | [pure virtual] |
Print the current database to the specified output stream. If no output stream is specified, then data is written to stream pout.
os | Output stream. |
Implemented in SAMRAI::tbox::MemoryDatabase, SAMRAI::tbox::HDFDatabase, and SAMRAI::tbox::NullDatabase.