13 #ifndef included_Database_h
14 #define included_Database_h
16 #include "Utilities.h"
23 bool fileExists(
const std::string& name);
57 const std::string& file_name,
58 const MPI_Comm comm=MPI_COMM_NULL);
74 const std::string& file_name,
75 const std::string& type,
76 const MPI_Comm comm=MPI_COMM_NULL);
96 const std::string& key,
116 const std::string& key,
117 const int*
const data,
119 const bool distributed=
false) = 0;
130 const std::string& key,
150 const std::string& key,
151 const double*
const data,
153 const bool distributed=
false) = 0;
169 const std::string& key,
170 const std::vector<double>& data,
172 const bool distributed=
false) = 0;
183 const std::string& key,
203 const std::string& key,
206 const bool distributed=
false) = 0;
217 const std::string& key,
251 const std::string& key,
254 const bool distributed=
false) = 0;
274 const std::string& key,
277 const std::vector<int>& idx,
278 const bool distributed=
false) = 0;
300 const std::string& key,
306 const bool distributed=
false) = 0;
virtual int getDoubleArraySize(const std::string &key)=0
Count the number of elements in an array of doubles associated with the supplied key from the current...
virtual bool create(const std::string &file_name, const MPI_Comm comm=MPI_COMM_NULL)
Creates a new database file with the supplied name.
virtual void getIntegerArray(const std::string &key, int *data, int nelements, const bool distributed=false)=0
Reads an array of integers associated with the supplied key from the currently open database file.
Database()
Default constructor.
void getInteger(const std::string &key, int &data)
Reads an integer associated with the supplied key from the currently open database file.
virtual ~Database()
Destructor.
virtual bool close()=0
Closes the currently open database file.
virtual void putDoubleVector(const std::string &key, const std::vector< double > &data, int nelements, const bool distributed=false)=0
Writes a vector of doubles associated with the supplied key to the currently open database file.
formats
Implemented database file formats. Add to this enum each time a new database format is implemented.
virtual void getDoubleArray(const std::string &key, double *data, int nelements, const std::vector< int > &idx, const bool distributed=false)=0
Reads a sub-array of doubles associated with the supplied key from the currently open database file.
virtual void getDoubleArray(const std::string &key, double *data, int nelements, const bool distributed=false)=0
Reads an array of doubles associated with the supplied key from the currently open database file.
void putDouble(const std::string &key, double data)
Writes a double associated with the supplied key to currently open database file.
void putInteger(const std::string &key, int data)
Writes an integer associated with the supplied key to currently open database file.
virtual void getDoubleArray(const std::string &key, double *data, int nelements, int offset, int block_size, int stride, const bool distributed=false)=0
Reads an array of doubles associated with the supplied key from the currently open database file.
virtual void putIntegerArray(const std::string &key, const int *const data, int nelements, const bool distributed=false)=0
Writes an array of integers associated with the supplied key to the currently open database file.
void getDouble(const std::string &key, double &data)
Reads a double associated with the supplied key from the currently open database file.
virtual void putDoubleArray(const std::string &key, const double *const data, int nelements, const bool distributed=false)=0
Writes an array of doubles associated with the supplied key to the currently open database file.
virtual bool open(const std::string &file_name, const std::string &type, const MPI_Comm comm=MPI_COMM_NULL)
Opens an existing database file with the supplied name.