1 //
2 // MessagePack for C++ static resolution routine
3 //
4 // Copyright (C) 2016 KONDO Takatoshi
5 //
6 // Distributed under the Boost Software License, Version 1.0.
7 // (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9 //
10 #ifndef MSGPACK_V1_ADAPTOR_BASE_DECL_HPP
11 #define MSGPACK_V1_ADAPTOR_BASE_DECL_HPP
12
13 #include "msgpack/versioning.hpp"
14 #include "msgpack/object_fwd.hpp"
15 #include "msgpack/pack.hpp"
16
17 namespace msgpack {
18
19 /// @cond
MSGPACK_API_VERSION_NAMESPACE(v1)20 MSGPACK_API_VERSION_NAMESPACE(v1) {
21 /// @endcond
22
23 template <typename Stream>
24 class packer;
25
26 namespace adaptor {
27
28 // Adaptor functors
29
30 template <typename T, typename Enabler = void>
31 struct convert;
32
33 template <typename T, typename Enabler = void>
34 struct pack;
35
36 template <typename T, typename Enabler = void>
37 struct object;
38
39 template <typename T, typename Enabler = void>
40 struct object_with_zone;
41
42 } // namespace adaptor
43
44 // operators
45
46 template <typename T>
47 typename msgpack::enable_if<
48 !is_array<T>::value,
49 msgpack::object const&
50 >::type
51 operator>> (msgpack::object const& o, T& v);
52 template <typename T, std::size_t N>
53 msgpack::object const& operator>> (msgpack::object const& o, T(&v)[N]);
54
55 template <typename Stream, typename T>
56 typename msgpack::enable_if<
57 !is_array<T>::value,
58 msgpack::packer<Stream>&
59 >::type
60 operator<< (msgpack::packer<Stream>& o, T const& v);
61 template <typename Stream, typename T, std::size_t N>
62 msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, const T(&v)[N]);
63
64 template <typename T>
65 typename msgpack::enable_if<
66 !is_array<T>::value
67 >::type
68 operator<< (msgpack::object& o, T const& v);
69 template <typename T, std::size_t N>
70 void operator<< (msgpack::object& o, const T(&v)[N]);
71
72 template <typename T>
73 typename msgpack::enable_if<
74 !is_array<T>::value
75 >::type
76 operator<< (msgpack::object::with_zone& o, T const& v);
77 template <typename T, std::size_t N>
78 void operator<< (msgpack::object::with_zone& o, const T(&v)[N]);
79
80 /// @cond
81 } // MSGPACK_API_VERSION_NAMESPACE(v1)
82 /// @endcond
83
84 } // namespace msgpack
85
86 #endif // MSGPACK_V1_ADAPTOR_BASE_DECL_HPP
87