6#include <bond/core/config.h>
10#include "scalar_interface.h"
12#include <boost/static_assert.hpp>
13#include <boost/utility/enable_if.hpp>
22template <
typename T>
struct
24 : std::integral_constant<bool,
25 std::is_signed<T>::value
26 && !std::is_floating_point<T>::value
27 && !std::is_enum<T>::value> {};
31template <
typename T>
struct
33 : std::integral_constant<bool,
34 is_signed_int<T>::value
35 || std::is_enum<T>::value> {};
39template <
typename T,
typename Enable =
void>
struct
42template <
typename T>
struct
43schema<T, typename boost::enable_if<std::is_class<typename T::Schema::fields> >::type>
45 typedef typename T::Schema type;
50template <
typename T,
typename Enable =
void>
struct
55template <
typename T>
struct
56has_schema<T, typename boost::enable_if<std::is_class<typename schema<T>::type> >::type>
61template <
typename Reader,
typename Writer>
struct
66template <
template <
typename T>
class Reader,
typename Input,
template <
typename T>
class Writer,
typename Output>
struct
67is_protocol_same<Reader<Input>, Writer<Output> >
68 : std::is_same<typename Reader<Output>::Writer, Writer<Output> > {};
71template <
template <
typename T,
typename U>
class Reader,
typename Input,
typename MarshaledBondedProtocols,
template <
typename T>
class Writer,
typename Output>
struct
72is_protocol_same<Reader<Input, MarshaledBondedProtocols>, Writer<Output> >
73 : std::is_same<typename Reader<Output, MarshaledBondedProtocols>::Writer, Writer<Output> > {};
77template <
typename Reader>
struct
78protocol_has_multiple_versions
83template <
typename Reader,
typename Writer>
85bool is_protocol_version_same(
const Reader&,
const Writer&)
95template <
typename Reader>
struct
96enable_protocol_versions
101template <
typename Reader,
typename Output>
struct
104template <
template <
typename T>
class Reader,
typename I,
typename Output>
struct
105get_protocol_writer<Reader<I>, Output>
107 typedef typename Reader<Output>::Writer type;
110template <
template <
typename T,
typename U>
class Reader,
typename Input,
typename MarshaledBondedProtocols,
typename Output>
struct
111get_protocol_writer<Reader<Input, MarshaledBondedProtocols>, Output>
113 typedef typename Reader<Output, MarshaledBondedProtocols>::Writer type;
118template <
typename T, T>
struct
123template <
typename T>
struct
125 : std::false_type {};
128template <
typename T,
typename Reader>
struct
129is_bonded<bonded<T, Reader> >
133template <
typename Reader,
typename Unused =
void>
struct
134uses_marshaled_bonded;
138template <
typename T>
struct
140 : std::is_object<typename aliased_type<T>::type> {};
144template <
typename Input,
typename T =
void,
typename Enable =
void>
struct
146 : std::false_type {};
148template <
typename Input,
typename T>
struct
150 : is_reader<Input, T> {};
152template <
typename Input,
typename T>
struct
153is_reader<Input, T, typename boost::enable_if<std::is_class<typename Input::Parser> >::type>
157template <
typename T>
struct
160 BOOST_STATIC_ASSERT_MSG(
161 detail::mpl::always_false<T>::value,
162 "buffer_magic is undefined for this buffer. Make sure buffer_magic is specialized for this buffer type.");
165template <
typename T>
struct
167 : buffer_magic<T> {};
170template <u
int16_t Id>
struct
171unique_buffer_magic_check;
173#define BOND_DEFINE_BUFFER_MAGIC(Buffer, Id) \
174 template <> struct unique_buffer_magic_check<Id> {}; \
175 template <> struct buffer_magic<Buffer> : std::integral_constant<uint16_t, Id> {}
178template <
typename Reader,
typename Enable =
void>
struct
180 : std::false_type {};
182template <
typename Reader>
struct
183uses_static_parser<Reader,
typename boost::enable_if<
184 std::is_same<typename Reader::Parser, StaticParser<Reader&> > >::type>
187template <
typename Reader>
struct
188uses_static_parser<Reader&>
189 : uses_static_parser<Reader> {};
namespace bond
Definition: apply.h:17