TCPSPSuite
db_factory.hpp
1 #ifndef DB_FACTORY_HPP
2 #define DB_FACTORY_HPP
3 
4 #include "../util/log.hpp"
5 
6 #include <string>
7 #include <memory>
8 
9 namespace odb {
10  class database;
11 }
12 
13 class DBFactory {
14 public:
15  DBFactory();
16 
17  std::unique_ptr<odb::database> get(std::string uri, bool rw=true, bool create=true);
18 
19 private:
20 
21  std::unique_ptr<odb::database> try_get_sqlite(std::string uri, bool rw, bool create);
22  std::unique_ptr<odb::database> try_get_mysql(std::string uri, bool rw, bool create);
23 
24  Log l;
25 };
26 
27 #endif