blob: e1872d9dac953fd07ca4d915b2330205896c7932 [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001// Copyright (C) 2004 Arkadiy Vertleyb
2// Use, modification and distribution is subject to the Boost Software
3// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
4
Jeff Thompson3d613fd2013-10-15 15:39:04 -07005#ifndef NDNBOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED
6#define NDNBOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED
Jeff Thompsona28eed82013-08-22 16:21:10 -07007
8#include <ndnboost/typeof/encode_decode_params.hpp>
9#include <ndnboost/typeof/encode_decode.hpp>
10
Jeff Thompson3d613fd2013-10-15 15:39:04 -070011#include NDNBOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
Jeff Thompsona28eed82013-08-22 16:21:10 -070012
Jeff Thompson3d613fd2013-10-15 15:39:04 -070013NDNBOOST_TYPEOF_BEGIN_ENCODE_NS
Jeff Thompsona28eed82013-08-22 16:21:10 -070014
Jeff Thompson3d613fd2013-10-15 15:39:04 -070015enum {PTR_DATA_MEM_ID = NDNBOOST_TYPEOF_UNIQUE_ID()};
Jeff Thompsona28eed82013-08-22 16:21:10 -070016
17template<class V, class P0, class P1>
18struct encode_type_impl<V, P0 P1::*>
19{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070020 typedef NDNBOOST_TYPEOF_ENCODE_PARAMS(2, PTR_DATA_MEM_ID) type;
Jeff Thompsona28eed82013-08-22 16:21:10 -070021};
22
23template<class Iter>
24struct decode_type_impl<ndnboost::mpl::size_t<PTR_DATA_MEM_ID>, Iter>
25{
26 typedef Iter iter0;
Jeff Thompson3d613fd2013-10-15 15:39:04 -070027 NDNBOOST_TYPEOF_DECODE_PARAMS(2)
Jeff Thompsona28eed82013-08-22 16:21:10 -070028
29 template<class T> struct workaround{
30 typedef p0 T::* type;
31 };
32 typedef typename decode_type_impl<ndnboost::mpl::size_t<PTR_DATA_MEM_ID>, Iter>::template workaround<p1>::type type;
33 typedef iter2 iter;
34};
35
Jeff Thompson3d613fd2013-10-15 15:39:04 -070036NDNBOOST_TYPEOF_END_ENCODE_NS
Jeff Thompsona28eed82013-08-22 16:21:10 -070037
Jeff Thompson3d613fd2013-10-15 15:39:04 -070038#endif//NDNBOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED