mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
Removed the dreaded crtp_wrapper and the policy_wrapper
This commit is contained in:
parent
22c43358f2
commit
82bcd63efd
@ -44,8 +44,6 @@
|
||||
#include <sqlpp11/vendor/expression.h>
|
||||
#include <sqlpp11/vendor/interpreter.h>
|
||||
#include <sqlpp11/vendor/wrong.h>
|
||||
#include <sqlpp11/vendor/crtp_wrapper.h>
|
||||
#include <sqlpp11/vendor/policy.h>
|
||||
#include <sqlpp11/vendor/policy_update.h>
|
||||
|
||||
#include <sqlpp11/detail/copy_tuple_args.h>
|
||||
|
@ -34,8 +34,6 @@
|
||||
#include <sqlpp11/vendor/update_list.h>
|
||||
#include <sqlpp11/vendor/noop.h>
|
||||
#include <sqlpp11/vendor/where.h>
|
||||
#include <sqlpp11/vendor/crtp_wrapper.h>
|
||||
#include <sqlpp11/vendor/policy.h>
|
||||
#include <sqlpp11/vendor/policy_update.h>
|
||||
|
||||
namespace sqlpp
|
||||
|
57
include/sqlpp11/vendor/crtp_wrapper.h
vendored
57
include/sqlpp11/vendor/crtp_wrapper.h
vendored
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013, Roland Bock
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef SQLPP_VENDOR_CRTP_WRAPPER_H
|
||||
#define SQLPP_VENDOR_CRTP_WRAPPER_H
|
||||
|
||||
#include <sqlpp11/vendor/wrong.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename T>
|
||||
struct get_database_impl;
|
||||
|
||||
template<template<typename, typename...> class Statement, typename Database, typename... Policies>
|
||||
struct get_database_impl<Statement<Database, Policies...>>
|
||||
{
|
||||
using type = Database;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
using get_database_t = typename get_database_impl<T>::type;
|
||||
|
||||
template<typename Derived, typename Policy>
|
||||
struct crtp_wrapper_t
|
||||
{
|
||||
static_assert(wrong_t<Derived, Policy>::value, "missing crtp policy specialization");
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
7
include/sqlpp11/vendor/from.h
vendored
7
include/sqlpp11/vendor/from.h
vendored
@ -32,7 +32,6 @@
|
||||
#include <sqlpp11/vendor/interpret_tuple.h>
|
||||
#include <sqlpp11/detail/logic.h>
|
||||
#include <sqlpp11/vendor/policy_update.h>
|
||||
#include <sqlpp11/vendor/crtp_wrapper.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
@ -82,12 +81,6 @@ namespace sqlpp
|
||||
using _is_noop = std::true_type;
|
||||
};
|
||||
|
||||
// CRTP Wrappers
|
||||
template<typename Derived, typename Database, typename... Args>
|
||||
struct crtp_wrapper_t<Derived, from_t<Database, Args...>>
|
||||
{
|
||||
};
|
||||
|
||||
// Interpreters
|
||||
template<typename Context, typename Database, typename... Tables>
|
||||
struct interpreter_t<Context, from_t<Database, Tables...>>
|
||||
|
1
include/sqlpp11/vendor/group_by.h
vendored
1
include/sqlpp11/vendor/group_by.h
vendored
@ -33,7 +33,6 @@
|
||||
#include <sqlpp11/vendor/interpret_tuple.h>
|
||||
#include <sqlpp11/vendor/interpretable_list.h>
|
||||
#include <sqlpp11/vendor/policy_update.h>
|
||||
#include <sqlpp11/vendor/crtp_wrapper.h>
|
||||
#include <sqlpp11/detail/logic.h>
|
||||
|
||||
namespace sqlpp
|
||||
|
1
include/sqlpp11/vendor/having.h
vendored
1
include/sqlpp11/vendor/having.h
vendored
@ -32,7 +32,6 @@
|
||||
#include <sqlpp11/vendor/interpret_tuple.h>
|
||||
#include <sqlpp11/vendor/interpretable_list.h>
|
||||
#include <sqlpp11/vendor/policy_update.h>
|
||||
#include <sqlpp11/vendor/crtp_wrapper.h>
|
||||
#include <sqlpp11/detail/logic.h>
|
||||
|
||||
namespace sqlpp
|
||||
|
1
include/sqlpp11/vendor/limit.h
vendored
1
include/sqlpp11/vendor/limit.h
vendored
@ -29,7 +29,6 @@
|
||||
|
||||
#include <sqlpp11/type_traits.h>
|
||||
#include <sqlpp11/vendor/policy_update.h>
|
||||
#include <sqlpp11/vendor/crtp_wrapper.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
|
1
include/sqlpp11/vendor/offset.h
vendored
1
include/sqlpp11/vendor/offset.h
vendored
@ -29,7 +29,6 @@
|
||||
|
||||
#include <sqlpp11/type_traits.h>
|
||||
#include <sqlpp11/vendor/policy_update.h>
|
||||
#include <sqlpp11/vendor/crtp_wrapper.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
|
1
include/sqlpp11/vendor/order_by.h
vendored
1
include/sqlpp11/vendor/order_by.h
vendored
@ -32,7 +32,6 @@
|
||||
#include <sqlpp11/vendor/interpret_tuple.h>
|
||||
#include <sqlpp11/vendor/interpretable.h>
|
||||
#include <sqlpp11/vendor/policy_update.h>
|
||||
#include <sqlpp11/vendor/crtp_wrapper.h>
|
||||
#include <sqlpp11/detail/logic.h>
|
||||
|
||||
namespace sqlpp
|
||||
|
62
include/sqlpp11/vendor/policy.h
vendored
62
include/sqlpp11/vendor/policy.h
vendored
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013, Roland Bock
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef SQLPP_VENDOR_POLICY_H
|
||||
#define SQLPP_VENDOR_POLICY_H
|
||||
|
||||
#include <sqlpp11/vendor/wrong.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename PolicyImpl>
|
||||
struct policy_t: public PolicyImpl
|
||||
{
|
||||
policy_t()
|
||||
{}
|
||||
|
||||
template<typename Whatever>
|
||||
policy_t(const Whatever&, policy_t policy):
|
||||
PolicyImpl(policy)
|
||||
{}
|
||||
|
||||
template<typename Whatever>
|
||||
policy_t(const Whatever&, PolicyImpl impl):
|
||||
PolicyImpl(impl)
|
||||
{}
|
||||
|
||||
template<typename Derived, typename Whatever>
|
||||
policy_t(Derived derived, const Whatever&):
|
||||
PolicyImpl(derived)
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
1
include/sqlpp11/vendor/select_column_list.h
vendored
1
include/sqlpp11/vendor/select_column_list.h
vendored
@ -37,7 +37,6 @@
|
||||
#include <sqlpp11/vendor/named_interpretable.h>
|
||||
#include <sqlpp11/vendor/interpret_tuple.h>
|
||||
#include <sqlpp11/vendor/policy_update.h>
|
||||
#include <sqlpp11/vendor/crtp_wrapper.h>
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
namespace sqlpp
|
||||
|
1
include/sqlpp11/vendor/select_flag_list.h
vendored
1
include/sqlpp11/vendor/select_flag_list.h
vendored
@ -33,7 +33,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
#include <sqlpp11/vendor/interpret_tuple.h>
|
||||
#include <sqlpp11/vendor/policy_update.h>
|
||||
#include <sqlpp11/vendor/crtp_wrapper.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
|
1
include/sqlpp11/vendor/using.h
vendored
1
include/sqlpp11/vendor/using.h
vendored
@ -32,7 +32,6 @@
|
||||
#include <sqlpp11/vendor/interpret_tuple.h>
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
#include <sqlpp11/vendor/policy_update.h>
|
||||
#include <sqlpp11/vendor/crtp_wrapper.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user