#ifndef GIKOMONA_CORE_QUERY_HPP_INCLUDED
#define GIKOMONA_CORE_QUERY_HPP_INCLUDED
-#include <tuple>
-#include <vector>
-
+#include <boost/fusion/include/vector.hpp>
#include <boost/mpl/bool.hpp>
#include "GikoMona.hpp"
struct is_satisfied_with_query_concept : public boost::mpl::false_ {};
/**
- * @brief ã\81\93ã\81®ã\82¯ã\83©ã\82¹ã\81§ã\81¯ query_concept ã\81\8cæº\80ã\81\9fã\81\99ã\81¹ã\81\8dç\94¨ä»¶ã\81\8cè¨\98è¿°ã\81\95ã\82\8cã\81¦ã\81\84ã\82\8b。
+ * @brief ã\81\93ã\81®ã\82¯ã\83©ã\82¹ã\81¯ query_concept ã\82\92æº\80ã\81\9fã\81\99å\85¨ã\81¦ã\81®ã\82¯ã\83©ã\82¹ã\81\8cç¶\99æ\89¿ã\81\97ã\81ªã\81\91ã\82\8cã\81°ã\81ªã\82\89ã\81ªã\81\84。
*/
-class query_concept final {
+class query {
public:
/// query_concept を満たすクラスは自分自身の型を self_type として表明しなければならない。
- typedef query_concept self_type;
+ typedef query self_type;
template <typename T, typename U>
using enable_if_T_is_U = typename std::enable_if<std::is_same<T, U>::value>::type;
/// query_concept を満たすクラスは外部から構築可能でなければならない。
- query_concept() {}
+ query() {}
/// query_concept を満たすクラスは外部から解体可能でなければならない。
- ~query_concept() {}
+ ~query() {}
/**
* @breif query_concept を満たすクラスはこの関数と同じ型、名前を持つ関数を持っていなければならない。
* @note さらに、最大限 multi-threading な環境を考慮しなければならない。
*/
template <typename T, typename U, typename ...ValueType>
+ virtual
bool insert(const mona_string& into,
- const std::tuple<T, U, ValueType...>& value) {}
+ const boost::fusion::vector<T, U, ValueType...>& value) override {}
template <typename T>
+ virtual
bool insert(const mona_string& into,
- const std::tuple<T>& value) {}
+ const boost::fusion::vector<T>& value) override {}
template <typename T>
+ virtual
bool insert(const mona_string& into,
const boost::any& value,
- enable_if_T_is_U<T, boost::any>*& = enabler) {}
+ enable_if_T_is_U<T, boost::any>*& = enabler) override {}
/**
* @brief query_concept を満たすクラスはこの関数と同じ型、名前を持つ関数を持っていなければならない。
* @return 引数で指定したテーブルの要素から、テンプレートで指定した方に変換された値が返される。
*/
template <typename T>
+ virtual
T select(const mona_string& column,
- const mona_string& from) const noexcept {}
+ const mona_string& from) const noexcept override {}
template <typename T>
+ virtual
boost::any select(const mona_string& column,
const mona_string& from,
- enable_if_T_is_U<T, boost::any>*& = enabler) {}
+ enable_if_T_is_U<T, boost::any>*& = enabler) const noexcept override {}
template <typename ...ValueType>
- std::tuple<ValueType...>
- select_all(const mona_string& from) const noexcept {}
+ virtual
+ boost::fusion::vector<ValueType...>
+ select_all(const mona_string& from) const noexcept override {}
};
-template <>
-
} } }
#endif
\ No newline at end of file