Loading...
Searching...
No Matches
6#include <bond/core/config.h>
8#if !defined(BOND_COMPACT_BINARY_PROTOCOL) \
9 && !defined(BOND_SIMPLE_BINARY_PROTOCOL) \
10 && !defined(BOND_FAST_BINARY_PROTOCOL) \
11 && !defined(BOND_SIMPLE_JSON_PROTOCOL)
12#error None of the built-in protocols are enabled. Either enable one of them or set BOND_LIB_TYPE to BOND_LIB_TYPE_HEADER.
15#include <boost/preprocessor/facilities/expand.hpp>
16#include <boost/preprocessor/seq/for_each_product.hpp>
17#include <boost/preprocessor/seq/pop_front.hpp>
18#include <boost/preprocessor/seq/seq.hpp>
19#include <boost/preprocessor/seq/to_tuple.hpp>
22#ifdef BOND_COMPACT_BINARY_PROTOCOL
23#define BOND_DETAIL_BUILTIN_READER_COMPACT_BINARY (bond::CompactBinaryReader<bond::InputBuffer>)
24#define BOND_DETAIL_BUILTIN_WRITER_COMPACT_BINARY (bond::CompactBinaryWriter<bond::OutputBuffer>) \
25 (bond::CompactBinaryWriter<bond::OutputBuffer>::Pass0)
27#define BOND_DETAIL_BUILTIN_READER_COMPACT_BINARY BOOST_PP_SEQ_NIL
28#define BOND_DETAIL_BUILTIN_WRITER_COMPACT_BINARY BOOST_PP_SEQ_NIL
31#ifdef BOND_SIMPLE_BINARY_PROTOCOL
32#define BOND_DETAIL_BUILTIN_READER_SIMPLE_BINARY (bond::SimpleBinaryReader<bond::InputBuffer>)
33#define BOND_DETAIL_BUILTIN_WRITER_SIMPLE_BINARY (bond::SimpleBinaryWriter<bond::OutputBuffer>)
35#define BOND_DETAIL_BUILTIN_READER_SIMPLE_BINARY BOOST_PP_SEQ_NIL
36#define BOND_DETAIL_BUILTIN_WRITER_SIMPLE_BINARY BOOST_PP_SEQ_NIL
39#ifdef BOND_FAST_BINARY_PROTOCOL
40#define BOND_DETAIL_BUILTIN_READER_FAST_BINARY (bond::FastBinaryReader<bond::InputBuffer>)
41#define BOND_DETAIL_BUILTIN_WRITER_FAST_BINARY (bond::FastBinaryWriter<bond::OutputBuffer>)
43#define BOND_DETAIL_BUILTIN_READER_FAST_BINARY BOOST_PP_SEQ_NIL
44#define BOND_DETAIL_BUILTIN_WRITER_FAST_BINARY BOOST_PP_SEQ_NIL
47#ifdef BOND_SIMPLE_JSON_PROTOCOL
48#define BOND_DETAIL_BUILTIN_READER_SIMPLE_JSON (bond::SimpleJsonReader<bond::InputBuffer>)
49#define BOND_DETAIL_BUILTIN_WRITER_SIMPLE_JSON (bond::SimpleJsonWriter<bond::OutputBuffer>)
51#define BOND_DETAIL_BUILTIN_READER_SIMPLE_JSON BOOST_PP_SEQ_NIL
52#define BOND_DETAIL_BUILTIN_WRITER_SIMPLE_JSON BOOST_PP_SEQ_NIL
55#define BOND_DETAIL_BUILTIN_READERS \
57 BOND_DETAIL_BUILTIN_READER_COMPACT_BINARY \
58 BOND_DETAIL_BUILTIN_READER_SIMPLE_BINARY \
59 BOND_DETAIL_BUILTIN_READER_FAST_BINARY \
63#define BOND_DETAIL_BUILTIN_WRITERS \
65 BOND_DETAIL_BUILTIN_WRITER_COMPACT_BINARY \
66 BOND_DETAIL_BUILTIN_WRITER_SIMPLE_BINARY \
67 BOND_DETAIL_BUILTIN_WRITER_FAST_BINARY \
71#define BOND_DETAIL_BUILTIN_BASIC_TYPES \
89#define BOND_DETAIL_BUILTIN_READERS_WRITERS BOND_DETAIL_BUILTIN_READERS BOND_DETAIL_BUILTIN_WRITERS
91#define BOND_DETAIL_BUILTIN_READERS_WRITERS_BASIC_TYPES \
92 BOND_DETAIL_BUILTIN_READERS BOND_DETAIL_BUILTIN_WRITERS BOND_DETAIL_BUILTIN_BASIC_TYPES
95#define BOND_DETAIL_APPLY_FUNC(_, product) \
96 BOOST_PP_EXPAND(BOOST_PP_SEQ_HEAD(product) BOOST_PP_EXPAND(BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_POP_FRONT(product))))
98#define BOND_DETAIL_DECLARE(func, seq) BOOST_PP_SEQ_FOR_EACH_PRODUCT(BOND_DETAIL_APPLY_FUNC, ((func))seq)
100#define BOND_DETAIL_PREFIX_TEMPLATE(func) template func
101#define BOND_DETAIL_INSTANTIATE(func, seq) BOND_DETAIL_DECLARE(BOND_DETAIL_PREFIX_TEMPLATE(func), seq)
103#define BOND_DETAIL_PREFIX_EXTERN(func) extern BOND_DETAIL_PREFIX_TEMPLATE(func)
104#define BOND_DETAIL_EXTERN(func, seq) BOND_DETAIL_DECLARE(BOND_DETAIL_PREFIX_EXTERN(func), seq)