9 #ifndef POLY_ACCESS_PACK_H 10 #define POLY_ACCESS_PACK_H 11 #include "polyPackBase.h" 17 typename enable_if<is_base_of<PolyPackBase, typename T::element_type> >::T
18 pack_smart_ptr(pack_t& x,
const string& d,
const T& a,
25 typename T::element_type::Type t=a->type();
32 typename enable_if<Not<is_base_of<PolyPackBase, typename T::element_type> > >::T
37 pack_smart_ptr(pack_t& x,
const string& d,
const T& a,
48 typename enable_if<is_base_of<PolyPackBase, typename T::element_type> >::T
49 unpack_smart_ptr(unpack_t& x,
const string& d, T& a, dummy<0> dum=0)
55 typename T::element_type::Type t;
57 a.reset(T::element_type::create(t));
65 typename enable_if<Not<is_base_of<PolyPackBase, typename T::element_type> > >::T
70 unpack_smart_ptr(pack_t& x,
const string& d, T& a, dummy<1> dum=0)
76 a.reset(
new typename T::element_type);
93 void operator()(
cd::pack_t& x,
const cd::string& d, U& a)
94 {pack_smart_ptr(x,d,a);}
101 void operator()(
cd::unpack_t& x,
const cd::string& d, U& a)
102 {unpack_smart_ptr(x,d,a);}
106 #if defined(__cplusplus) && __cplusplus<=201402 107 #if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__) 108 #pragma GCC diagnostic push 109 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 115 void operator()(
cd::pack_t& x,
const cd::string& d, U& a)
116 {pack_smart_ptr(x,d,a);}
123 void operator()(
cd::unpack_t& x,
const cd::string& d, U& a)
124 {unpack_smart_ptr(x,d,a);}
126 #if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__) 127 #pragma GCC diagnostic pop 131 #if defined(__cplusplus) && __cplusplus >= 201103L 132 template <
class T,
class D>
136 void operator()(
cd::pack_t& x,
const cd::string& d, U& a)
137 {pack_smart_ptr(x,d,a);}
140 template <
class T,
class D>
144 void operator()(
cd::unpack_t& x,
const cd::string& d, U& a)
145 {unpack_smart_ptr(x,d,a);}
class to allow access to private members
Definition: classdesc_access.h:21
class to allow access to private members
Definition: classdesc_access.h:22
void pack(pack_t &targ, const string &desc, is_treenode dum, const T *const &arg)
serialise a tree (or DAG)
Definition: pack_graph.h:28
Contains definitions related to classdesc functionality.
Definition: arrays.h:2514
Definition: pack_base.h:124
Contains access_* structs, and nothing else. These structs are used to gain access to private members...
Definition: accessor.h:55
void unpack(unpack_t &targ, const string &desc, is_treenode dum, T *&arg)
unserialise a tree.
Definition: pack_graph.h:44