Subversionによるバージョン管理は終了しました。
このレポジトリでは、
1) libcore
2) pnuts
3) gikomona
の3つのソースコードが管理されています。
libcoreは、pnutsとgikomonaで共通する処理を一手に担うライブラリです。
pnutsは2chの閲覧に特化したブラウザです。
gikomonaは2chのみならずtwitterといった他のソーシャルメディアサービスの閲覧も可能なブラウザです。
Revision | 1b936a9f7fceb82fd3fdd689ff8d7be98d5ce8a3 (tree) |
---|---|
Time | 2013-08-09 01:15:23 |
Author | caprice <caprice@user...> |
Commiter | caprice |
[core] : query_conceptの変更に伴って、その要件を満たすような定義を追加した。
@@ -2,6 +2,8 @@ | ||
2 | 2 | #define GIKOMONA_CORE_MODEL_HPP |
3 | 3 | |
4 | 4 | #include <unistd.h> |
5 | +#include <memory> | |
6 | +#include <tuple> | |
5 | 7 | |
6 | 8 | #include <boost/any.hpp> |
7 | 9 | #include <boost/lockfree/queue.hpp> |
@@ -20,11 +22,8 @@ public: | ||
20 | 22 | typedef std::tuple<mona_string, boost::any> inserted_query_type; |
21 | 23 | typedef inserted_query_type *inserted_query_triv_copyable_type; |
22 | 24 | |
23 | - model() noexcept { | |
24 | - instance = this; | |
25 | - } | |
26 | - | |
27 | - ~model() {} | |
25 | + model() noexcept; | |
26 | + ~model(); | |
28 | 27 | |
29 | 28 | static |
30 | 29 | model *get_instance() { |
@@ -34,11 +33,20 @@ public: | ||
34 | 33 | template <typename ...ValueType> |
35 | 34 | bool insert(const mona_string& into, |
36 | 35 | const std::tuple<ValueType...>& values) { |
37 | - return inserted_query_queue.push(new inserted_query_type(into, boost::any(values))); | |
36 | + /* | |
37 | + auto any_value = boost::any(values); | |
38 | + auto obj = std::make_tuple(into, any_value); | |
39 | + return inserted_query_queue.push(); | |
40 | + */ | |
38 | 41 | } |
39 | 42 | |
40 | 43 | template <typename T> |
41 | - T select() {} | |
44 | + T select(const mona_string& column, | |
45 | + const mona_string& from) const noexcept {} | |
46 | + | |
47 | + template <typename ...ValueType> | |
48 | + std::tuple<ValueType...> | |
49 | + select_all(const mona_string& from) const noexcept {} | |
42 | 50 | |
43 | 51 | void exec_inserted_query(); |
44 | 52 | bool load_file(const boost::filesystem::path& file_path, |
@@ -48,8 +56,9 @@ public: | ||
48 | 56 | |
49 | 57 | private: |
50 | 58 | static self_type *instance; |
51 | - database history_db; | |
52 | - config app_config; | |
59 | + struct model_pimpl; | |
60 | + | |
61 | + std::shared_ptr<model_pimpl> pimpl; | |
53 | 62 | boost::lockfree::queue<inserted_query_triv_copyable_type> inserted_query_queue; |
54 | 63 | }; |
55 | 64 |
@@ -57,7 +66,7 @@ template <> | ||
57 | 66 | struct is_satisfied_with_query_concept<model> : public boost::mpl::true_ {}; |
58 | 67 | |
59 | 68 | void exec_insert_query() { |
60 | - model::get_instance()->exec_insert_query(); | |
69 | + model::get_instance()->exec_inserted_query(); | |
61 | 70 | } |
62 | 71 | |
63 | 72 | } } } |