#include <source/toolbox/restartdb/HDFDatabase.h>
Inheritance diagram for SAMRAI::tbox::HDFDatabase:
Public Member Functions | |
HDFDatabase (const std::string &name) | |
virtual | ~HDFDatabase () |
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< Database > | putDatabase (const std::string &key) |
virtual Pointer< Database > | getDatabase (const std::string &key) |
virtual bool | isBool (const std::string &key) |
virtual void | putBoolArray (const std::string &key, const bool *const data, const int nelements) |
virtual Array< bool > | getBoolArray (const std::string &key) |
virtual bool | isDatabaseBox (const std::string &key) |
virtual void | putDatabaseBoxArray (const std::string &key, const DatabaseBox *const data, const int nelements) |
virtual Array< DatabaseBox > | getDatabaseBoxArray (const std::string &key) |
virtual bool | isChar (const std::string &key) |
virtual void | putCharArray (const std::string &key, const char *const data, const int nelements) |
virtual Array< char > | getCharArray (const std::string &key) |
virtual bool | isComplex (const std::string &key) |
virtual void | putComplexArray (const std::string &key, const dcomplex *const data, const int nelements) |
virtual Array< dcomplex > | getComplexArray (const std::string &key) |
virtual bool | isDouble (const std::string &key) |
virtual void | putDoubleArray (const std::string &key, const double *const data, const int nelements) |
virtual Array< double > | getDoubleArray (const std::string &key) |
virtual bool | isFloat (const std::string &key) |
virtual void | putFloatArray (const std::string &key, const float *const data, const int nelements) |
virtual Array< float > | getFloatArray (const std::string &key) |
virtual bool | isInteger (const std::string &key) |
virtual void | putIntegerArray (const std::string &key, const int *const data, const int nelements) |
virtual Array< int > | getIntegerArray (const std::string &key) |
virtual bool | isString (const std::string &key) |
virtual void | putStringArray (const std::string &key, const std::string *const data, const int nelements) |
virtual Array< std::string > | getStringArray (const std::string &key) |
virtual void | printClassData (std::ostream &os=pout) |
virtual bool | create (const std::string &name) |
virtual bool | open (const std::string &name) |
virtual bool | attachToFile (hid_t group_id) |
Attach the Database to an existing HDF file. | |
virtual bool | close () |
virtual std::string | getName () |
Returns the name of this database. | |
hid_t | getGroupId () |
It is assumed that all processors will access the database in the same manner. Error reporting is done using the SAMRAI error reporting macros.
SAMRAI::tbox::HDFDatabase::HDFDatabase | ( | const std::string & | name | ) |
The HDF database constructor creates an empty database with the specified name. By default the database will not be associated with a file until it is mounted, using the mount() member function.
When assertion checking is active, the name string must be non-empty.
SAMRAI::tbox::HDFDatabase::~HDFDatabase | ( | ) | [virtual] |
The database destructor closes the HDF5 group or data file.
bool SAMRAI::tbox::HDFDatabase::keyExists | ( | const std::string & | key | ) | [virtual] |
Return true if the specified key exists in the database and false otherwise.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
Array< std::string > SAMRAI::tbox::HDFDatabase::getAllKeys | ( | ) | [virtual] |
Return an array of all keys in the current database. Note that no keys from subdatabases contained in the current database will appear in the array. To get the keys of any other database, you must call this routine for that database.
Implements SAMRAI::tbox::Database.
enum Database::DataType SAMRAI::tbox::HDFDatabase::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
key | Key name in database. |
Implements SAMRAI::tbox::Database.
int SAMRAI::tbox::HDFDatabase::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.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::isDatabase | ( | const std::string & | key | ) | [virtual] |
Return true or false depending on whether the specified key represents a database entry. If the key does not exist or if the string is empty, then false is returned.
Implements SAMRAI::tbox::Database.
Create a new database with the specified key name and return a pointer to it. A new group with the key name is also created in the data file.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
Get the database with the specified key name. If the specified key does not represent a database entry in the database, then an error message is printed and the program exits.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::isBool | ( | const std::string & | key | ) | [virtual] |
Return true or false depending on whether the specified key represents a boolean entry. If the key does not exist or if the string is empty, then false is returned.
Implements SAMRAI::tbox::Database.
void SAMRAI::tbox::HDFDatabase::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.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
Array< bool > SAMRAI::tbox::HDFDatabase::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, then an error message is printed and the program exits.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::isDatabaseBox | ( | const std::string & | key | ) | [virtual] |
Return true or false depending on whether the specified key represents a box entry. If the key does not exist or if the string is empty, then false is returned.
Implements SAMRAI::tbox::Database.
void SAMRAI::tbox::HDFDatabase::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.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
Array< DatabaseBox > SAMRAI::tbox::HDFDatabase::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, then an error message is printed and the program exits.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::isChar | ( | const std::string & | key | ) | [virtual] |
Return true or false depending on whether the specified key represents a char entry. If the key does not exist or if the string is empty, then false is returned.
Implements SAMRAI::tbox::Database.
void SAMRAI::tbox::HDFDatabase::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.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
Array< char > SAMRAI::tbox::HDFDatabase::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, then an error message is printed and the program exits.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::isComplex | ( | const std::string & | key | ) | [virtual] |
Return true or false depending on whether the specified key represents a complex entry. If the key does not exist or if the string is empty, then false is returned.
Implements SAMRAI::tbox::Database.
void SAMRAI::tbox::HDFDatabase::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.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
Get a complex entry from the database with the specified key name. If the specified key does not exist in the database then an error message is printed and the program exits.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::isDouble | ( | const std::string & | key | ) | [virtual] |
Return true or false depending on whether the specified key represents a double entry. If the key does not exist or if the string is empty, then false is returned.
Implements SAMRAI::tbox::Database.
void SAMRAI::tbox::HDFDatabase::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.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
Array< double > SAMRAI::tbox::HDFDatabase::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 then an error message is printed and the program exits.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::isFloat | ( | const std::string & | key | ) | [virtual] |
Return true or false depending on whether the specified key represents a float entry. If the key does not exist or if the string is empty, then false is returned.
Implements SAMRAI::tbox::Database.
void SAMRAI::tbox::HDFDatabase::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.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
Array< float > SAMRAI::tbox::HDFDatabase::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 then an error message is printed and the program exits.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::isInteger | ( | const std::string & | key | ) | [virtual] |
Return true or false depending on whether the specified key represents an integer entry. If the key does not exist or if the string is empty, then false is returned.
Implements SAMRAI::tbox::Database.
void SAMRAI::tbox::HDFDatabase::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.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
Array< int > SAMRAI::tbox::HDFDatabase::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 then an error message is printed and the program exits.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::isString | ( | const std::string & | key | ) | [virtual] |
Return true or false depending on whether the specified key represents a string entry. If the key does not exist or if the string is empty, then false is returned.
Implements SAMRAI::tbox::Database.
void SAMRAI::tbox::HDFDatabase::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.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
Array< std::string > SAMRAI::tbox::HDFDatabase::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 then an error message is printed and the program exits.
When assertion checking is active, the key string must be non-empty.
Implements SAMRAI::tbox::Database.
void SAMRAI::tbox::HDFDatabase::printClassData | ( | std::ostream & | os = pout |
) | [virtual] |
Print contents of current database to the specified output stream. If no output stream is specified, then data is written to stream pout. Note that none of the subdatabases contained in the current database will have their contents printed. To view the contents of any other database, you must call this print routine for that database.
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::create | ( | const std::string & | name | ) | [virtual] |
Create a new database file.
Returns true if successful.
name | name of database. Normally a filename. |
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::open | ( | const std::string & | name | ) | [virtual] |
Open an existing database file.
Returns true if successful.
name | name of database. Normally a filename. |
Implements SAMRAI::tbox::Database.
bool SAMRAI::tbox::HDFDatabase::attachToFile | ( | hid_t | group_id | ) | [virtual] |
Attach the Database to an existing HDF file.
If an application has an existing HDF file used for restart this method can be used to write SAMRAI restart information to the existing file instead of SAMRAI creating a distinct file.
The group_id should be a hid returned from a H5Gcreate call. SAMRAI data will be written within this group.
Returns true if attach was successful.
bool SAMRAI::tbox::HDFDatabase::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::HDFDatabase::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.
Implements SAMRAI::tbox::Database.
hid_t SAMRAI::tbox::HDFDatabase::getGroupId | ( | ) |
Return the group_id so VisIt can access an object's HDF database.