13 #ifndef included_CSVDatabase_h
14 #define included_CSVDatabase_h
53 const std::string& file_name,
54 const MPI_Comm comm=MPI_COMM_NULL)
override;
70 const std::string& file_name,
71 const std::string& type,
72 const MPI_Comm comm=MPI_COMM_NULL)
override;
98 const std::string& file_name,
99 const int*
const data,
101 const bool distributed=
false)
override;
119 const std::string& file_name,
120 const double*
const data,
122 const bool distributed=
false)
override;
141 const std::string& file_name,
142 const std::vector<double>& data,
144 const bool distributed=
false)
override;
160 const std::string& file_name,
161 const std::vector<std::complex<double>>& data,
178 const std::string& file_name,
179 const std::vector<std::string>& data,
197 const std::string& file_name,
200 const bool distributed=
false)
override;
214 const std::string& file_name,
215 std::vector<int> &data,
216 bool append =
false);
230 std::vector<double> tmp;
250 const std::string& file_name,
253 const bool distributed=
false)
override;
271 const std::string& file_name,
274 const std::vector<int>& idx,
275 const bool distributed=
false)
override;
295 const std::string& file_name,
301 const bool distributed=
false)
override;
315 const std::string& file_name,
316 std::vector<double> &data,
317 bool append =
false);
331 const std::string& file_name,
332 std::vector<std::string> &data,
333 bool append =
false);
345 const std::string& file_name);
void getIntegerVector(const std::string &file_name, std::vector< int > &data, bool append=false)
Reads a vector of integers associated with the supplied filename.
void putDoubleVector(const std::string &file_name, const std::vector< double > &data, int nelements, const bool distributed=false) override
Writes a vector of doubles associated with the supplied filename to the currently open CSV database f...
void putIntegerArray(const std::string &file_name, const int *const data, int nelements, const bool distributed=false) override
Writes an array of integers associated with the supplied filename.
void getIntegerArray(const std::string &file_name, int *data, int nelements, const bool distributed=false) override
Reads an array of integers associated with the supplied filename.
int getLineCount(const std::string &file_name)
Count the number of lines of CSV database file.
CSVDatabase()
Default constructor.
bool create(const std::string &file_name, const MPI_Comm comm=MPI_COMM_NULL) override
Creates a new CSV database file with the supplied name. NOTE: CSVDatabase does not actually create a ...
bool close()
Closes the currently open CSV database file.
virtual ~CSVDatabase()
Destructor.
int getDoubleArraySize(const std::string &file_name) override
Count the number of elements in an array of doubles associated with the supplied filename.
void getStringVector(const std::string &file_name, std::vector< std::string > &data, bool append=false)
Reads a vector of strings associated with the supplied filename.
void getDoubleVector(const std::string &file_name, std::vector< double > &data, bool append=false)
Reads a vector of doubles associated with the supplied filename.
void putDoubleArray(const std::string &file_name, const double *const data, int nelements, const bool distributed=false) override
Writes an array of doubles associated with the supplied filename.
void getDoubleArray(const std::string &file_name, double *data, int nelements, const bool distributed=false) override
Reads an array of doubles associated with the supplied filename.
void putStringVector(const std::string &file_name, const std::vector< std::string > &data, int nelements)
Writes a vector of strings associated with the supplied filename.
void putComplexVector(const std::string &file_name, const std::vector< std::complex< double >> &data, int nelements)
Writes a vector of complex doubles associated with the supplied filename.
bool open(const std::string &file_name, const std::string &type, const MPI_Comm comm=MPI_COMM_NULL) override
Opens an existing CSV database file with the supplied name. NOTE: CSVDatabase does not actually open ...