blob: d5a1160c84006098ef933347566a756b85befdda [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001// Copyright (C) 2004 Arkadiy Vertleyb
2
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6// boostinspect:nounnamed
7
Jeff Thompson3d613fd2013-10-15 15:39:04 -07008#ifndef NDNBOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED
9#define NDNBOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED
Jeff Thompsona28eed82013-08-22 16:21:10 -070010
11#include <ndnboost/mpl/deref.hpp>
12#include <ndnboost/mpl/next.hpp>
13
Jeff Thompson3d613fd2013-10-15 15:39:04 -070014#ifndef NDNBOOST_TYPEOF_SUPPRESS_UNNAMED_NAMESPACE
Jeff Thompsona28eed82013-08-22 16:21:10 -070015
Jeff Thompson3d613fd2013-10-15 15:39:04 -070016# define NDNBOOST_TYPEOF_BEGIN_ENCODE_NS namespace { namespace ndnboost_typeof {
17# define NDNBOOST_TYPEOF_END_ENCODE_NS }}
18# define NDNBOOST_TYPEOF_ENCODE_NS_QUALIFIER ndnboost_typeof
Jeff Thompsona28eed82013-08-22 16:21:10 -070019
20#else
21
Jeff Thompson3d613fd2013-10-15 15:39:04 -070022# define NDNBOOST_TYPEOF_BEGIN_ENCODE_NS namespace ndnboost { namespace type_of {
23# define NDNBOOST_TYPEOF_END_ENCODE_NS }}
24# define NDNBOOST_TYPEOF_ENCODE_NS_QUALIFIER ndnboost::type_of
Jeff Thompsona28eed82013-08-22 16:21:10 -070025
Jeff Thompson3d613fd2013-10-15 15:39:04 -070026# define NDNBOOST_TYPEOF_TEXT "unnamed namespace is off"
Jeff Thompsona28eed82013-08-22 16:21:10 -070027# include <ndnboost/typeof/message.hpp>
28
29#endif
30
Jeff Thompson3d613fd2013-10-15 15:39:04 -070031NDNBOOST_TYPEOF_BEGIN_ENCODE_NS
Jeff Thompsona28eed82013-08-22 16:21:10 -070032
33template<class V, class Type_Not_Registered_With_Typeof_System>
34struct encode_type_impl;
35
36template<class T, class Iter>
37struct decode_type_impl
38{
39 typedef int type; // MSVC ETI workaround
40};
41
42template<class T>
43struct decode_nested_template_helper_impl;
44
Jeff Thompson3d613fd2013-10-15 15:39:04 -070045NDNBOOST_TYPEOF_END_ENCODE_NS
Jeff Thompsona28eed82013-08-22 16:21:10 -070046
47namespace ndnboost { namespace type_of {
48
49 template<class V, class T>
Jeff Thompson3d613fd2013-10-15 15:39:04 -070050 struct encode_type : NDNBOOST_TYPEOF_ENCODE_NS_QUALIFIER::encode_type_impl<V, T>
Jeff Thompsona28eed82013-08-22 16:21:10 -070051 {};
52
53 template<class Iter>
Jeff Thompson3d613fd2013-10-15 15:39:04 -070054 struct decode_type : NDNBOOST_TYPEOF_ENCODE_NS_QUALIFIER::decode_type_impl<
Jeff Thompsona28eed82013-08-22 16:21:10 -070055 typename Iter::type,
56 typename Iter::next
57 >
58 {};
59}}
60
Jeff Thompson3d613fd2013-10-15 15:39:04 -070061#endif//NDNBOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED