libROM  v1.0
Data-driven physical simulation library
 All Classes Functions Variables Enumerations
Public Member Functions | List of all members
CAROM::HDFDatabase Class Reference

#include <HDFDatabase.h>

Inheritance diagram for CAROM::HDFDatabase:
CAROM::Database

Public Member Functions

 HDFDatabase ()
 Default constructor.
 
virtual ~HDFDatabase ()
 Destructor.
 
virtual bool create (const std::string &file_name)
 Creates a new HDF5 database file with the supplied name. More...
 
virtual bool open (const std::string &file_name, const std::string &type)
 Opens an existing HDF5 database file with the supplied name. More...
 
virtual bool close ()
 Closes the currently open HDF5 database file. More...
 
virtual void putIntegerArray (const std::string &key, const int *const data, int nelements)
 Writes an array of integers associated with the supplied key to the currently open HDF5 database file. More...
 
virtual void putDoubleArray (const std::string &key, const double *const data, int nelements)
 Writes an array of doubles associated with the supplied key to the currently open HDF5 database file. More...
 
virtual void getIntegerArray (const std::string &key, int *data, int nelements)
 Reads an array of integers associated with the supplied key from the currently open HDF5 database file. More...
 
virtual void getDoubleArray (const std::string &key, double *data, int nelements)
 Reads an array of doubles associated with the supplied key from the currently open HDF5 database file. More...
 
virtual void getDoubleArray (const std::string &key, double *data, int nelements, int block_size, int stride)
 Reads an array of doubles associated with the supplied key from the currently open HDF5 database file. More...
 
- Public Member Functions inherited from CAROM::Database
 Database ()
 Default constructor.
 
virtual ~Database ()
 Destructor.
 
void putInteger (const std::string &key, int data)
 Writes an integer associated with the supplied key to currently open database file. More...
 
void putDouble (const std::string &key, double data)
 Writes a double associated with the supplied key to currently open database file. More...
 
void getInteger (const std::string &key, int &data)
 Reads an integer associated with the supplied key from the currently open database file. More...
 
void getDouble (const std::string &key, double &data)
 Reads a double associated with the supplied key from the currently open database file. More...
 

Additional Inherited Members

- Public Types inherited from CAROM::Database
enum  formats { HDF5 }
 Implemented database file formats. Add to this enum each time a new database format is implemented.
 

Detailed Description

HDFDatabase implements the interface of Database for HDF5 database files.

Member Function Documentation

virtual bool CAROM::HDFDatabase::close ( )
virtual

Closes the currently open HDF5 database file.

Returns
True if the file close was successful.

Implements CAROM::Database.

virtual bool CAROM::HDFDatabase::create ( const std::string &  file_name)
virtual

Creates a new HDF5 database file with the supplied name.

Parameters
[in]file_nameName of HDF5 database file to create.
Returns
True if file create was successful.

Implements CAROM::Database.

virtual void CAROM::HDFDatabase::getDoubleArray ( const std::string &  key,
double *  data,
int  nelements 
)
virtual

Reads an array of doubles associated with the supplied key from the currently open HDF5 database file.

Precondition
!key.empty()
data != 0 || nelements == 0
Parameters
[in]keyThe key associated with the array of values to be read.
[out]dataThe allocated array of double values to be read.
[in]nelementsThe number of doubles in the array.

Implements CAROM::Database.

virtual void CAROM::HDFDatabase::getDoubleArray ( const std::string &  key,
double *  data,
int  nelements,
int  block_size,
int  stride 
)
virtual

Reads an array of doubles associated with the supplied key from the currently open HDF5 database file.

Precondition
!key.empty()
data != 0 || nelements == 0
Parameters
[in]keyThe key associated with the array of values to be read.
[out]dataThe allocated array of double values to be read.
[in]nelementsThe number of doubles in the array.
[in]block_sizeThe block size to read from the HDF5 dataset.
[in]strideThe stride to read from the HDF5 dataset.

Implements CAROM::Database.

virtual void CAROM::HDFDatabase::getIntegerArray ( const std::string &  key,
int *  data,
int  nelements 
)
virtual

Reads an array of integers associated with the supplied key from the currently open HDF5 database file.

Precondition
!key.empty()
data != 0 || nelements == 0
Parameters
[in]keyThe key associated with the array of values to be read.
[out]dataThe allocated array of integer values to be read.
[in]nelementsThe number of integers in the array.

Implements CAROM::Database.

virtual bool CAROM::HDFDatabase::open ( const std::string &  file_name,
const std::string &  type 
)
virtual

Opens an existing HDF5 database file with the supplied name.

Parameters
[in]file_nameName of existing HDF5 database file to open.
[in]typeRead/write type ("r"/"wr")
Returns
True if file open was successful.

Implements CAROM::Database.

virtual void CAROM::HDFDatabase::putDoubleArray ( const std::string &  key,
const double *const  data,
int  nelements 
)
virtual

Writes an array of doubles associated with the supplied key to the currently open HDF5 database file.

Precondition
!key.empty()
data != 0
nelements > 0
Parameters
[in]keyThe key associated with the array of values to be written.
[in]dataThe array of double values to be written.
[in]nelementsThe number of doubles in the array.

Implements CAROM::Database.

virtual void CAROM::HDFDatabase::putIntegerArray ( const std::string &  key,
const int *const  data,
int  nelements 
)
virtual

Writes an array of integers associated with the supplied key to the currently open HDF5 database file.

Precondition
!key.empty()
data != 0
nelements > 0
Parameters
[in]keyThe key associated with the array of values to be written.
[in]dataThe array of integer values to be written.
[in]nelementsThe number of integers in the array.

Implements CAROM::Database.


The documentation for this class was generated from the following file: