libROM  v1.0
Data-driven physical simulation library
Database.cpp
1 
11 // Description: The abstract database class defines interface for databases.
12 
13 #include "Database.h"
14 #include <iostream>
15 #include <fstream>
16 
17 namespace CAROM {
18 
19 bool fileExists(const std::string& name)
20 {
21  std::ifstream f(name.c_str());
22  return f.good();
23  // ifstream f will be closed upon the end of the function.
24 }
25 
27 {
28 }
29 
31 {
32 }
33 
34 bool
36  const std::string& file_name,
37  const MPI_Comm comm)
38 {
39  std::cout << "Creating file: " << file_name << std::endl;
40  return true;
41 }
42 
43 bool
45  const std::string& file_name,
46  const std::string& type,
47  const MPI_Comm comm)
48 {
49  std::cout << "Opening file: " << file_name << std::endl;
50  return true;
51 }
52 
53 }
virtual bool create(const std::string &file_name, const MPI_Comm comm=MPI_COMM_NULL)
Creates a new database file with the supplied name.
Definition: Database.cpp:35
Database()
Default constructor.
Definition: Database.cpp:26
virtual ~Database()
Destructor.
Definition: Database.cpp:30
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.
Definition: Database.cpp:44