OSDN Git Service

[core] : 実装方法迷い中…
[gikomona/GikoMona.git] / core / include / query.hpp
1 #ifndef GIKOMONA_CORE_QUERY_HPP_INCLUDED
2 #define GIKOMONA_CORE_QUERY_HPP_INCLUDED
3
4 #include <vector>
5
6 #include <boost/mpl/bool.hpp>
7
8 #include "GikoMona.hpp"
9
10 namespace monazilla { namespace GikoMona { namespace core {
11    
12 /**
13  * @note このクラスは boost::lockfree::queue<> の制約から
14  *       trivially copyable の要件を満たす必要がある。
15  *       (参考:http://d.hatena.ne.jp/faith_and_brave/20130213/1360737911 )
16  */
17
18 template <typename ValueType>
19 class query final {
20 public:
21     // query order
22     class select_ final {
23         friend class query;
24         select_() {}
25         ~select_() {}
26     public:
27         struct select_all_column {} all_columnes;
28     
29         select_& distinct() {}
30         select_& group_by() {}
31         select_& where() {}
32         select_& having() {}
33     };
34
35 public:
36     typedef std::vector<mona_string> column_name_list;
37     
38     query(mona_string) {}
39     ~query() = default;
40     
41     query& define() { return (*this); }
42     select_ select(const column_name_list& columnes,
43                     const mona_string& from) {
44         return select_(*this);
45     }
46     select_ select(typename select_::select_all_column dummy,
47                     const mona_string& from) {
48         return select_(*this);
49     }
50     query& insert(const mona_string& into) {}
51
52 private:
53
54 };
55
56 template <typename T>
57 struct is_responsible_to_query : public boost::mpl::false_ {};
58
59 } } }
60
61 #endif