From 2b7d1ad54a10314e148d3759ad0191564e12ce6a Mon Sep 17 00:00:00 2001 From: niXman Date: Sat, 31 Jan 2015 01:26:18 +0200 Subject: [PATCH 1/7] BOOST_PP_TUPLE_POP_FRONT() added & files reorganized --- include/sqlpp11/ppgen.h | 45 ++++++++++--------- .../ppgen/{ => colops}/auto_increment.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/blob.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/bool.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/comment.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/datetime.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/default.h | 6 +-- .../ppgen/{ => colops}/floating_point.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/index.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/integer.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/key.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/not_null.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/null.h | 6 +-- .../sqlpp11/ppgen/{ => colops}/primary_key.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/text.h | 6 +-- .../sqlpp11/ppgen/{ => colops}/timestamp.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/unique.h | 6 +-- include/sqlpp11/ppgen/{ => colops}/varchar.h | 6 +-- .../ppgen/{ => tblops}/character_set.h | 6 +-- include/sqlpp11/ppgen/tblops/comment.h | 35 +++++++++++++++ include/sqlpp11/ppgen/tblops/default.h | 35 +++++++++++++++ include/sqlpp11/ppgen/{ => tblops}/engine.h | 6 +-- include/sqlpp11/ppgen/tools/tuple_pop_front.h | 44 ++++++++++++++++++ include/sqlpp11/ppgen/{ => tools}/wrap_seq.h | 6 +-- 24 files changed, 197 insertions(+), 82 deletions(-) rename include/sqlpp11/ppgen/{ => colops}/auto_increment.h (91%) rename include/sqlpp11/ppgen/{ => colops}/blob.h (94%) rename include/sqlpp11/ppgen/{ => colops}/bool.h (92%) rename include/sqlpp11/ppgen/{ => colops}/comment.h (92%) rename include/sqlpp11/ppgen/{ => colops}/datetime.h (92%) rename include/sqlpp11/ppgen/{ => colops}/default.h (92%) rename include/sqlpp11/ppgen/{ => colops}/floating_point.h (92%) rename include/sqlpp11/ppgen/{ => colops}/index.h (92%) rename include/sqlpp11/ppgen/{ => colops}/integer.h (94%) rename include/sqlpp11/ppgen/{ => colops}/key.h (93%) rename include/sqlpp11/ppgen/{ => colops}/not_null.h (92%) rename include/sqlpp11/ppgen/{ => colops}/null.h (93%) rename include/sqlpp11/ppgen/{ => colops}/primary_key.h (92%) rename include/sqlpp11/ppgen/{ => colops}/text.h (92%) rename include/sqlpp11/ppgen/{ => colops}/timestamp.h (92%) rename include/sqlpp11/ppgen/{ => colops}/unique.h (92%) rename include/sqlpp11/ppgen/{ => colops}/varchar.h (92%) rename include/sqlpp11/ppgen/{ => tblops}/character_set.h (91%) create mode 100644 include/sqlpp11/ppgen/tblops/comment.h create mode 100644 include/sqlpp11/ppgen/tblops/default.h rename include/sqlpp11/ppgen/{ => tblops}/engine.h (92%) create mode 100644 include/sqlpp11/ppgen/tools/tuple_pop_front.h rename include/sqlpp11/ppgen/{ => tools}/wrap_seq.h (92%) diff --git a/include/sqlpp11/ppgen.h b/include/sqlpp11/ppgen.h index a05a80f7..2b553e45 100644 --- a/include/sqlpp11/ppgen.h +++ b/include/sqlpp11/ppgen.h @@ -36,29 +36,30 @@ #endif // defined(__clang__) // tools -#include +#include +#include // table props -#include -#include +#include +#include // col props -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // boost.preprocessor #include @@ -81,7 +82,7 @@ BOOST_PP_TUPLE_ELEM(0, BOOST_PP_EXPAND table) #define SQLPP_DECLARE_TABLE_GET_TABLE_PROPS(table) \ - BOOST_PP_TUPLE_POP_FRONT(BOOST_PP_EXPAND table) + SQLPP_BOOST_PP_TUPLE_POP_FRONT(BOOST_PP_EXPAND table) #define SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(col) \ BOOST_PP_TUPLE_ELEM(0, col) @@ -123,7 +124,7 @@ }; /* struct _alias_t */ \ \ using _traits = sqlpp::make_traits< \ - SQLPP_DECLARE_COLUMN_GEN_TRAITS(BOOST_PP_TUPLE_POP_FRONT(elem)) \ + SQLPP_DECLARE_COLUMN_GEN_TRAITS(SQLPP_BOOST_PP_TUPLE_POP_FRONT(elem)) \ >; \ \ }; /* struct SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem) */ @@ -141,7 +142,7 @@ BOOST_PP_SEQ_FOR_EACH( \ SQLPP_DECLARE_TABLE_GEN_PROPS_AUX \ ,~ \ - ,BOOST_PP_TUPLE_TO_SEQ(BOOST_PP_TUPLE_POP_FRONT(table)) \ + ,BOOST_PP_TUPLE_TO_SEQ(SQLPP_BOOST_PP_TUPLE_POP_FRONT(table)) \ ) /***************************************************************************/ diff --git a/include/sqlpp11/ppgen/auto_increment.h b/include/sqlpp11/ppgen/colops/auto_increment.h similarity index 91% rename from include/sqlpp11/ppgen/auto_increment.h rename to include/sqlpp11/ppgen/colops/auto_increment.h index 2ecc2cda..7f88a5ec 100644 --- a/include/sqlpp11/ppgen/auto_increment.h +++ b/include/sqlpp11/ppgen/colops/auto_increment.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__auto_increment_h -#define _sqlpp__ppgen__auto_increment_h +#ifndef _sqlpp__ppgen__colops__auto_increment_h +#define _sqlpp__ppgen__colops__auto_increment_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_AUTO_INCREMENT \ PROC_SQLPP_AUTO_INCREMENT #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_AUTO_INCREMENT(...) \ sqlpp::tag::must_not_update -#endif // _sqlpp__ppgen__auto_increment_h +#endif // _sqlpp__ppgen__colops__auto_increment_h diff --git a/include/sqlpp11/ppgen/blob.h b/include/sqlpp11/ppgen/colops/blob.h similarity index 94% rename from include/sqlpp11/ppgen/blob.h rename to include/sqlpp11/ppgen/colops/blob.h index d8994fc2..26c124e6 100644 --- a/include/sqlpp11/ppgen/blob.h +++ b/include/sqlpp11/ppgen/colops/blob.h @@ -24,8 +24,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__blob_h -#define _sqlpp__ppgen__blob_h +#ifndef _sqlpp__ppgen__colops__blob_h +#define _sqlpp__ppgen__colops__blob_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyblob \ PROC_tinyblob @@ -47,4 +47,4 @@ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_longblob(...) \ sqlpp::blob -#endif // _sqlpp__ppgen__blob_h +#endif // _sqlpp__ppgen__colops__blob_h diff --git a/include/sqlpp11/ppgen/bool.h b/include/sqlpp11/ppgen/colops/bool.h similarity index 92% rename from include/sqlpp11/ppgen/bool.h rename to include/sqlpp11/ppgen/colops/bool.h index 62ae4bfc..08521bd3 100644 --- a/include/sqlpp11/ppgen/bool.h +++ b/include/sqlpp11/ppgen/colops/bool.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__bool_h -#define _sqlpp__ppgen__bool_h +#ifndef _sqlpp__ppgen__colops__bool_h +#define _sqlpp__ppgen__colops__bool_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bool \ PROC_bool #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bool(...) \ sqlpp::boolean -#endif // _sqlpp__ppgen__bool_h +#endif // _sqlpp__ppgen__colops__bool_h diff --git a/include/sqlpp11/ppgen/comment.h b/include/sqlpp11/ppgen/colops/comment.h similarity index 92% rename from include/sqlpp11/ppgen/comment.h rename to include/sqlpp11/ppgen/colops/comment.h index 55161c0f..f019b732 100644 --- a/include/sqlpp11/ppgen/comment.h +++ b/include/sqlpp11/ppgen/colops/comment.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__comment_h -#define _sqlpp__ppgen__comment_h +#ifndef _sqlpp__ppgen__colops__comment_h +#define _sqlpp__ppgen__colops__comment_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_COMMENT(str) \ PROC_SQLPP_COMMENT #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_COMMENT(str) \ [COMMENT is not implemented] -#endif // _sqlpp__ppgen__comment_h +#endif // _sqlpp__ppgen__colops__comment_h diff --git a/include/sqlpp11/ppgen/datetime.h b/include/sqlpp11/ppgen/colops/datetime.h similarity index 92% rename from include/sqlpp11/ppgen/datetime.h rename to include/sqlpp11/ppgen/colops/datetime.h index c1cc6e73..aec6bb04 100644 --- a/include/sqlpp11/ppgen/datetime.h +++ b/include/sqlpp11/ppgen/colops/datetime.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__datetime_h -#define _sqlpp__ppgen__datetime_h +#ifndef _sqlpp__ppgen__colops__datetime_h +#define _sqlpp__ppgen__colops__datetime_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_datetime \ PROC_datetime #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_datetime(...) \ [datetime is not implemented] -#endif // _sqlpp__ppgen__datetime_h +#endif // _sqlpp__ppgen__colops__datetime_h diff --git a/include/sqlpp11/ppgen/default.h b/include/sqlpp11/ppgen/colops/default.h similarity index 92% rename from include/sqlpp11/ppgen/default.h rename to include/sqlpp11/ppgen/colops/default.h index 8bc60f70..b7fbdeeb 100644 --- a/include/sqlpp11/ppgen/default.h +++ b/include/sqlpp11/ppgen/colops/default.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__default_h -#define _sqlpp__ppgen__default_h +#ifndef _sqlpp__ppgen__colops__default_h +#define _sqlpp__ppgen__colops__default_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_DEFAULT(value) \ PROC_SQLPP_DEFAULT #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) \ [DEFAULT is not implemented] -#endif // _sqlpp__ppgen__default_h +#endif // _sqlpp__ppgen__colops__default_h diff --git a/include/sqlpp11/ppgen/floating_point.h b/include/sqlpp11/ppgen/colops/floating_point.h similarity index 92% rename from include/sqlpp11/ppgen/floating_point.h rename to include/sqlpp11/ppgen/colops/floating_point.h index 77ab121e..ea25560c 100644 --- a/include/sqlpp11/ppgen/floating_point.h +++ b/include/sqlpp11/ppgen/colops/floating_point.h @@ -24,8 +24,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__floating_point_h -#define _sqlpp__ppgen__floating_point_h +#ifndef _sqlpp__ppgen__colops__floating_point_h +#define _sqlpp__ppgen__colops__floating_point_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_float \ PROC_float @@ -37,4 +37,4 @@ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_double(...) \ sqlpp::floating_point -#endif // _sqlpp__ppgen__floating_point_h +#endif // _sqlpp__ppgen__colops__floating_point_h diff --git a/include/sqlpp11/ppgen/index.h b/include/sqlpp11/ppgen/colops/index.h similarity index 92% rename from include/sqlpp11/ppgen/index.h rename to include/sqlpp11/ppgen/colops/index.h index 97a886d3..37a1fee1 100644 --- a/include/sqlpp11/ppgen/index.h +++ b/include/sqlpp11/ppgen/colops/index.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__index_h -#define _sqlpp__ppgen__index_h +#ifndef _sqlpp__ppgen__colops__index_h +#define _sqlpp__ppgen__colops__index_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_INDEX(name) \ PROC_SQLPP_INDEX #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_INDEX(name) \ [INDEX is not implemented] -#endif // _sqlpp__ppgen__index_h +#endif // _sqlpp__ppgen__colops__index_h diff --git a/include/sqlpp11/ppgen/integer.h b/include/sqlpp11/ppgen/colops/integer.h similarity index 94% rename from include/sqlpp11/ppgen/integer.h rename to include/sqlpp11/ppgen/colops/integer.h index 934930d0..d913e441 100644 --- a/include/sqlpp11/ppgen/integer.h +++ b/include/sqlpp11/ppgen/colops/integer.h @@ -24,8 +24,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__integer_h -#define _sqlpp__ppgen__integer_h +#ifndef _sqlpp__ppgen__colops__integer_h +#define _sqlpp__ppgen__colops__integer_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyint \ PROC_tinyint @@ -47,4 +47,4 @@ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bigint(...) \ sqlpp::bigint -#endif // _sqlpp__ppgen__integer_h +#endif // _sqlpp__ppgen__colops__integer_h diff --git a/include/sqlpp11/ppgen/key.h b/include/sqlpp11/ppgen/colops/key.h similarity index 93% rename from include/sqlpp11/ppgen/key.h rename to include/sqlpp11/ppgen/colops/key.h index 7192b1d9..1791c30c 100644 --- a/include/sqlpp11/ppgen/key.h +++ b/include/sqlpp11/ppgen/colops/key.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__key_h -#define _sqlpp__ppgen__key_h +#ifndef _sqlpp__ppgen__colops__key_h +#define _sqlpp__ppgen__colops__key_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_KEY(name) \ PROC_SQLPP_KEY #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_KEY(name) \ [KEY is not implemented] -#endif // _sqlpp__ppgen__key_h +#endif // _sqlpp__ppgen__colops__key_h diff --git a/include/sqlpp11/ppgen/not_null.h b/include/sqlpp11/ppgen/colops/not_null.h similarity index 92% rename from include/sqlpp11/ppgen/not_null.h rename to include/sqlpp11/ppgen/colops/not_null.h index fadff0db..0a2b029e 100644 --- a/include/sqlpp11/ppgen/not_null.h +++ b/include/sqlpp11/ppgen/colops/not_null.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__not_null_h -#define _sqlpp__ppgen__not_null_h +#ifndef _sqlpp__ppgen__colops__not_null_h +#define _sqlpp__ppgen__colops__not_null_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NOT_NULL \ PROC_SQLPP_NOT_NULL #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NOT_NULL(...) \ sqlpp::tag::require_insert -#endif // _sqlpp__ppgen__not_null_h +#endif // _sqlpp__ppgen__colops__not_null_h diff --git a/include/sqlpp11/ppgen/null.h b/include/sqlpp11/ppgen/colops/null.h similarity index 93% rename from include/sqlpp11/ppgen/null.h rename to include/sqlpp11/ppgen/colops/null.h index 94269b01..bd7d33d6 100644 --- a/include/sqlpp11/ppgen/null.h +++ b/include/sqlpp11/ppgen/colops/null.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__null_h -#define _sqlpp__ppgen__null_h +#ifndef _sqlpp__ppgen__colops__null_h +#define _sqlpp__ppgen__colops__null_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NULL \ PROC_SQLPP_NULL #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NULL(...) \ sqlpp::tag::can_be_null -#endif // _sqlpp__ppgen__null_h +#endif // _sqlpp__ppgen__colops__null_h diff --git a/include/sqlpp11/ppgen/primary_key.h b/include/sqlpp11/ppgen/colops/primary_key.h similarity index 92% rename from include/sqlpp11/ppgen/primary_key.h rename to include/sqlpp11/ppgen/colops/primary_key.h index 2bf82e05..916f752b 100644 --- a/include/sqlpp11/ppgen/primary_key.h +++ b/include/sqlpp11/ppgen/colops/primary_key.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__primary_key_h -#define _sqlpp__ppgen__primary_key_h +#ifndef _sqlpp__ppgen__colops__primary_key_h +#define _sqlpp__ppgen__colops__primary_key_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_PRIMARY_KEY \ PROC_SQLPP_PRIMARY_KEY #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_PRIMARY_KEY(...) \ [PRIMARY_KEY is not implemented] -#endif // _sqlpp__ppgen__primary_key_h +#endif // _sqlpp__ppgen__colops__primary_key_h diff --git a/include/sqlpp11/ppgen/text.h b/include/sqlpp11/ppgen/colops/text.h similarity index 92% rename from include/sqlpp11/ppgen/text.h rename to include/sqlpp11/ppgen/colops/text.h index 2880a602..7329a986 100644 --- a/include/sqlpp11/ppgen/text.h +++ b/include/sqlpp11/ppgen/colops/text.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__text_h -#define _sqlpp__ppgen__text_h +#ifndef _sqlpp__ppgen__colops__text_h +#define _sqlpp__ppgen__colops__text_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_text \ PROC_text #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_text(...) \ sqlpp::text -#endif // _sqlpp__ppgen__text_h +#endif // _sqlpp__ppgen__colops__text_h diff --git a/include/sqlpp11/ppgen/timestamp.h b/include/sqlpp11/ppgen/colops/timestamp.h similarity index 92% rename from include/sqlpp11/ppgen/timestamp.h rename to include/sqlpp11/ppgen/colops/timestamp.h index 6592b88b..130e005b 100644 --- a/include/sqlpp11/ppgen/timestamp.h +++ b/include/sqlpp11/ppgen/colops/timestamp.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__timestamp_h -#define _sqlpp__ppgen__timestamp_h +#ifndef _sqlpp__ppgen__colops__timestamp_h +#define _sqlpp__ppgen__colops__timestamp_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_timestamp \ PROC_timestamp #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_timestamp(...) \ [timestamp is not implemented] -#endif // _sqlpp__ppgen__timestamp_h +#endif // _sqlpp__ppgen__colops__timestamp_h diff --git a/include/sqlpp11/ppgen/unique.h b/include/sqlpp11/ppgen/colops/unique.h similarity index 92% rename from include/sqlpp11/ppgen/unique.h rename to include/sqlpp11/ppgen/colops/unique.h index 56f83102..34b43792 100644 --- a/include/sqlpp11/ppgen/unique.h +++ b/include/sqlpp11/ppgen/colops/unique.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__unique_h -#define _sqlpp__ppgen__unique_h +#ifndef _sqlpp__ppgen__colops__unique_h +#define _sqlpp__ppgen__colops__unique_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_UNIQUE \ PROC_SQLPP_UNIQUE #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_UNIQUE(...) \ [UNIQUE is not implemented] -#endif // _sqlpp__ppgen__unique_h +#endif // _sqlpp__ppgen__colops__unique_h diff --git a/include/sqlpp11/ppgen/varchar.h b/include/sqlpp11/ppgen/colops/varchar.h similarity index 92% rename from include/sqlpp11/ppgen/varchar.h rename to include/sqlpp11/ppgen/colops/varchar.h index 6561c27d..c4de3235 100644 --- a/include/sqlpp11/ppgen/varchar.h +++ b/include/sqlpp11/ppgen/colops/varchar.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__varchar_h -#define _sqlpp__ppgen__varchar_h +#ifndef _sqlpp__ppgen__colops__varchar_h +#define _sqlpp__ppgen__colops__varchar_h #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_varchar(str) \ PROC_varchar #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_varchar(str) \ sqlpp::varchar -#endif // _sqlpp__ppgen__varchar_h +#endif // _sqlpp__ppgen__colops__varchar_h diff --git a/include/sqlpp11/ppgen/character_set.h b/include/sqlpp11/ppgen/tblops/character_set.h similarity index 91% rename from include/sqlpp11/ppgen/character_set.h rename to include/sqlpp11/ppgen/tblops/character_set.h index de02ee91..8b5026b2 100644 --- a/include/sqlpp11/ppgen/character_set.h +++ b/include/sqlpp11/ppgen/tblops/character_set.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__character_set_h -#define _sqlpp__ppgen__character_set_h +#ifndef _sqlpp__ppgen__tblops__character_set_h +#define _sqlpp__ppgen__tblops__character_set_h #define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_CHARACTER_SET(str) \ PROC_SQLPP_CHARACTER_SET #define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_CHARACTER_SET(str) \ [CHARACTER_SET is not implemented] -#endif // _sqlpp__ppgen__character_set_h +#endif // _sqlpp__ppgen__tblops__character_set_h diff --git a/include/sqlpp11/ppgen/tblops/comment.h b/include/sqlpp11/ppgen/tblops/comment.h new file mode 100644 index 00000000..6df2784b --- /dev/null +++ b/include/sqlpp11/ppgen/tblops/comment.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) + * 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__ppgen__tblops__comment_h +#define _sqlpp__ppgen__tblops__comment_h + +#define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_COMMENT(str) \ + PROC_SQLPP_COMMENT +#define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_COMMENT(str) \ + [COMMENT is not implemented] + +#endif // _sqlpp__ppgen__tblops__comment_h diff --git a/include/sqlpp11/ppgen/tblops/default.h b/include/sqlpp11/ppgen/tblops/default.h new file mode 100644 index 00000000..7e70bf8f --- /dev/null +++ b/include/sqlpp11/ppgen/tblops/default.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) + * 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__ppgen__tblops__default_h +#define _sqlpp__ppgen__tblops__default_h + +#define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_DEFAULT(value) \ + PROC_SQLPP_DEFAULT +#define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) \ + [DEFAULT is not implemented] + +#endif // _sqlpp__ppgen__tblops__default_h diff --git a/include/sqlpp11/ppgen/engine.h b/include/sqlpp11/ppgen/tblops/engine.h similarity index 92% rename from include/sqlpp11/ppgen/engine.h rename to include/sqlpp11/ppgen/tblops/engine.h index 5b40e881..24b2e8aa 100644 --- a/include/sqlpp11/ppgen/engine.h +++ b/include/sqlpp11/ppgen/tblops/engine.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__engine_h -#define _sqlpp__ppgen__engine_h +#ifndef _sqlpp__ppgen__tblops__engine_h +#define _sqlpp__ppgen__tblops__engine_h #define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_ENGINE(str) \ PROC_SQLPP_ENGINE #define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_ENGINE(str) \ [ENGINE is not implemented] -#endif // _sqlpp__ppgen__engine_h +#endif // _sqlpp__ppgen__tblops__engine_h diff --git a/include/sqlpp11/ppgen/tools/tuple_pop_front.h b/include/sqlpp11/ppgen/tools/tuple_pop_front.h new file mode 100644 index 00000000..c958fb89 --- /dev/null +++ b/include/sqlpp11/ppgen/tools/tuple_pop_front.h @@ -0,0 +1,44 @@ +/* ************************************************************************** + * * + * (C) Copyright Edward Diener 2013. + * Distributed under the Boost Software License, Version 1.0. (See + * accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * * + ************************************************************************** */ + +/* See http://www.boost.org for most recent version. */ + +# ifndef SQLPP_BOOST_PREPROCESSOR_TUPLE_POP_FRONT_HPP +# define SQLPP_BOOST_PREPROCESSOR_TUPLE_POP_FRONT_HPP + +# include + +# if BOOST_PP_VARIADICS + +# include +# include +# include +# include +# include +# include + + +/* BOOST_PP_TUPLE_POP_FRONT */ +# define SQLPP_BOOST_PP_TUPLE_POP_FRONT(tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \ + SQLPP_BOOST_PP_TUPLE_POP_FRONT_EXEC, \ + SQLPP_BOOST_PP_TUPLE_POP_FRONT_RETURN \ + ) \ + (tuple) + +# define SQLPP_BOOST_PP_TUPLE_POP_FRONT_EXEC(tuple) \ + BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_POP_FRONT(BOOST_PP_TUPLE_TO_ARRAY(tuple))) + +# define SQLPP_BOOST_PP_TUPLE_POP_FRONT_RETURN(tuple) tuple + +# endif // BOOST_PP_VARIADICS + +# endif // SQLPP_BOOST_PREPROCESSOR_TUPLE_POP_FRONT_HPP diff --git a/include/sqlpp11/ppgen/wrap_seq.h b/include/sqlpp11/ppgen/tools/wrap_seq.h similarity index 92% rename from include/sqlpp11/ppgen/wrap_seq.h rename to include/sqlpp11/ppgen/tools/wrap_seq.h index 741e9a62..9f9451f9 100644 --- a/include/sqlpp11/ppgen/wrap_seq.h +++ b/include/sqlpp11/ppgen/tools/wrap_seq.h @@ -24,8 +24,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__wrap_seq_h -#define _sqlpp__ppgen__wrap_seq_h +#ifndef _sqlpp__ppgen__tools__wrap_seq_h +#define _sqlpp__ppgen__tools__wrap_seq_h #define SQLPP_WRAP_SEQUENCE_X(...) \ ((__VA_ARGS__)) SQLPP_WRAP_SEQUENCE_Y @@ -35,4 +35,4 @@ #define SQLPP_WRAP_SEQUENCE_X0 #define SQLPP_WRAP_SEQUENCE_Y0 -#endif // _sqlpp__ppgen__wrap_seq_h +#endif // _sqlpp__ppgen__tools__wrap_seq_h From 504bf961a622328b287561e6c303bfc24db6203a Mon Sep 17 00:00:00 2001 From: niXman Date: Sat, 31 Jan 2015 01:36:39 +0200 Subject: [PATCH 2/7] fix for previous commit --- examples/CMakeLists.txt | 2 +- include/sqlpp11/ppgen.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e2642b87..1746d99e 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -11,7 +11,7 @@ build(insert) build(update) build(remove) build(select) -find_package(Boost 1.56) +find_package(Boost 1.54) if(Boost_FOUND) MESSAGE(${Boost_INCLUDE_DIRS}) include_directories(${Boost_INCLUDE_DIRS}) diff --git a/include/sqlpp11/ppgen.h b/include/sqlpp11/ppgen.h index 2b553e45..50141bc1 100644 --- a/include/sqlpp11/ppgen.h +++ b/include/sqlpp11/ppgen.h @@ -72,7 +72,6 @@ #include #include #include -#include #include /***************************************************************************/ From df0429058cae84f41106af328b41fc491aa91766 Mon Sep 17 00:00:00 2001 From: niXman Date: Sat, 31 Jan 2015 16:05:53 +0200 Subject: [PATCH 3/7] boost.preprocessor hack & some cosmetic fixes --- .travis.yml | 8 +++++++- examples/CMakeLists.txt | 2 +- examples/ppgen.cpp | 14 ++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 39ee5821..608e8985 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,11 +15,17 @@ notifications: before_install: - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - sudo apt-get update - - if [ "$CXX" = "g++" ]; then sudo apt-get install g++-4.8; fi + - if [ "$CXX" = "g++" ]; then sudo apt-get install g++-4.8 libboost-dev-all; fi - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi install: + - git clone https://github.com/boostorg/preprocessor.git + - cd preprocessor + - git checkout tags/boost-1.50.0 + - cp -rf include/boost/* /usr/include/boost/ + - ls -l /usr/include/boost/preprocessor/tuple + - sed 's|104600|105000|' -i /usr/include/boost/version.hpp - "mkdir -p $TRAVIS_BUILD_DIR/build/scripts" - "cd $TRAVIS_BUILD_DIR/build/scripts" - "cmake $TRAVIS_BUILD_DIR" diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1746d99e..4db91ca9 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -11,7 +11,7 @@ build(insert) build(update) build(remove) build(select) -find_package(Boost 1.54) +find_package(Boost 1.50) if(Boost_FOUND) MESSAGE(${Boost_INCLUDE_DIRS}) include_directories(${Boost_INCLUDE_DIRS}) diff --git a/examples/ppgen.cpp b/examples/ppgen.cpp index 4c4d01a5..68889893 100644 --- a/examples/ppgen.cpp +++ b/examples/ppgen.cpp @@ -26,11 +26,17 @@ #if 0 // syntax example SQLPP_DECLARE_TABLE( - (table, DROP_IF_EXISTS, CREATE_IF_NOT_EXISTS, ENGINE("InnoDB"), CHARACTER_SET("utf-8"), COMMENT("table comments")) + (table, \ + SQLPP_DROP_IF_EXISTS \ + ,SQLPP_CREATE_IF_NOT_EXISTS \ + ,SQLPP_ENGINE("InnoDB") \ + ,SQLPP_CHARACTER_SET("utf-8") \ + ,SQLPP_COMMENT("table comments") \ + ) , - (id, int, NOT_NULL, PRIMARY_KEY, AUTO_INCREMENT) - (name, varchar(64), NOT_NULL, INDEX("name_index"), DEFAULT("any name")) - (age, int, NOT_NULL, INDEX("age_index"), UNIQUE, COMMENT("some comments")) + (id, int, SQLPP_NOT_NULL, SQLPP_PRIMARY_KEY, SQLPP_AUTO_INCREMENT) + (name, varchar(64), SQLPP_NOT_NULL, SQLPP_INDEX("name_index"), SQLPP_DEFAULT("any name")) + (age, int, SQLPP_NOT_NULL, SQLPP_INDEX("age_index"), SQLPP_UNIQUE, SQLPP_COMMENT("some comments")) ) #endif From ed5c123c977ff1cf2a053c299590e115eeef1cac Mon Sep 17 00:00:00 2001 From: niXman Date: Sat, 31 Jan 2015 16:40:40 +0200 Subject: [PATCH 4/7] travis.ci configuration testing... --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 608e8985..087e20e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ notifications: before_install: - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - sudo apt-get update - - if [ "$CXX" = "g++" ]; then sudo apt-get install g++-4.8 libboost-dev-all; fi + - if [ "$CXX" = "g++" ]; then sudo apt-get install g++-4.8 libboost-dev; fi - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi From 76032093e151cb1e853022faae838ded0cecd045 Mon Sep 17 00:00:00 2001 From: niXman Date: Sat, 31 Jan 2015 16:44:47 +0200 Subject: [PATCH 5/7] travis.ci configuration testing... --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 087e20e8..9e47f122 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ install: - git clone https://github.com/boostorg/preprocessor.git - cd preprocessor - git checkout tags/boost-1.50.0 - - cp -rf include/boost/* /usr/include/boost/ + - sudo cp -rf include/boost/* /usr/include/boost/ - ls -l /usr/include/boost/preprocessor/tuple - sed 's|104600|105000|' -i /usr/include/boost/version.hpp - "mkdir -p $TRAVIS_BUILD_DIR/build/scripts" From e88e7a2050b5c2335b765ae1ae6ed7ddb4f0168a Mon Sep 17 00:00:00 2001 From: niXman Date: Sat, 31 Jan 2015 16:47:40 +0200 Subject: [PATCH 6/7] travis.ci configuration testing... --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9e47f122..7048167d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ install: - git checkout tags/boost-1.50.0 - sudo cp -rf include/boost/* /usr/include/boost/ - ls -l /usr/include/boost/preprocessor/tuple - - sed 's|104600|105000|' -i /usr/include/boost/version.hpp + - sudo sed 's|104600|105000|' -i /usr/include/boost/version.hpp - "mkdir -p $TRAVIS_BUILD_DIR/build/scripts" - "cd $TRAVIS_BUILD_DIR/build/scripts" - "cmake $TRAVIS_BUILD_DIR" From b8ca8c467151265b3baccdb5c2fdd6d4f9573149 Mon Sep 17 00:00:00 2001 From: niXman Date: Sat, 31 Jan 2015 16:51:36 +0200 Subject: [PATCH 7/7] revert travis.ci changes --- .travis.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7048167d..39ee5821 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,17 +15,11 @@ notifications: before_install: - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - sudo apt-get update - - if [ "$CXX" = "g++" ]; then sudo apt-get install g++-4.8 libboost-dev; fi + - if [ "$CXX" = "g++" ]; then sudo apt-get install g++-4.8; fi - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi install: - - git clone https://github.com/boostorg/preprocessor.git - - cd preprocessor - - git checkout tags/boost-1.50.0 - - sudo cp -rf include/boost/* /usr/include/boost/ - - ls -l /usr/include/boost/preprocessor/tuple - - sudo sed 's|104600|105000|' -i /usr/include/boost/version.hpp - "mkdir -p $TRAVIS_BUILD_DIR/build/scripts" - "cd $TRAVIS_BUILD_DIR/build/scripts" - "cmake $TRAVIS_BUILD_DIR"