OSDN Git Service

driver.hpp: constants / variables
[roast/roast.git] / roast / include / roast / db / nitro / driver.hpp
1 //      Roast+ License
2
3 /*
4         Roast+ C++ Library
5         Copyright 2012 myun2, Roast+ Project http://sourceforge.jp/projects/roast/
6         
7         Distributed under the Roast+ License
8         See: http://sourceforge.jp/projects/roast/wiki/License
9         
10         ----------------------------------------------------------------------
11         
12         Tiny DB -> driver
13 */
14 #ifndef __SFJP_ROAST_db__nitro__driver_HPP__
15 #define __SFJP_ROAST_db__nitro__driver_HPP__
16
17 #include <string>
18 #include "roast/db/nitro/constants.hpp"
19 #include "roast/db/nitro/variables.hpp"
20
21 namespace roast
22 {
23         namespace tiny_db
24         {
25                 ///////////////////////////////////////////////////
26                 
27                 template <typename TableType>
28                 class driver
29                 {
30                 public:
31                         struct types
32                         {
33                                 static const int file = 0;
34                                 static const int memory = 1;
35                         };
36                         
37                 private:
38                         int m_type;
39                         ::std::string m_table_name;
40                         
41                         constants m_constants;
42                         variables m_variables;
43                 public:
44                         driver(int type) : m_type(type) {}      //      no-name of table name (for memory table)
45                         driver(int type, const char* table_name) : m_type(type), m_table_name(table_name) {}
46                         
47                         //////
48                         
49                         int append(const TableType& data){}
50                         TableType read(int id){}
51                         bool remove(int id){}
52                         bool update(int id, const TableType& data){}
53                 };
54                 
55                 ////////////
56                 
57                 class file_driver
58                 {
59                 
60                 };
61                 
62                 ////////////
63                 
64                 class memory_driver
65                 {
66                 
67                 };
68                 
69                 ///////////////////////////////////////////////////
70         }
71 }
72
73 #endif//__SFJP_ROAST_db__nitro__driver_HPP__