13 #ifndef included_Database_h
14 #define included_Database_h
16 #include "Utilities.h"
56 const std::string& file_name,
57 const MPI_Comm comm=MPI_COMM_NULL);
73 const std::string& file_name,
74 const std::string& type,
75 const MPI_Comm comm=MPI_COMM_NULL);
95 const std::string& key,
115 const std::string& key,
116 const int*
const data,
118 const bool distributed=
false) = 0;
129 const std::string& key,
149 const std::string& key,
150 const double*
const data,
152 const bool distributed=
false) = 0;
168 const std::string& key,
169 const std::vector<double>& data,
171 const bool distributed=
false) = 0;
182 const std::string& key,
202 const std::string& key,
205 const bool distributed=
false) = 0;
216 const std::string& key,
250 const std::string& key,
253 const bool distributed=
false) = 0;
273 const std::string& key,
276 const std::vector<int>& idx,
277 const bool distributed=
false) = 0;
299 const std::string& key,
305 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.