9#ifndef CLASSDESC_POLY_ACCESS_PACK_H
10#define CLASSDESC_POLY_ACCESS_PACK_H
11#include "polyPackBase.h"
15#ifdef CLASSDESC_POLYPACKBASE_H
18 pack_smart_ptr(
pack_t& x,
const string& d,
const T& a,
25 typename T::element_type::Type t=a->type();
37 pack_smart_ptr(
pack_t& x,
const string& d,
const T& a,
46#ifdef CLASSDESC_POLYPACKBASE_H
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));
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);}
109 void operator()(cd::pack_t& x,
const cd::string& d, U& a)
110 {pack_smart_ptr(x,d,a.lock());}
117 void operator()(cd::unpack_t& x,
const cd::string& d, U& a)
120 cd::shared_ptr<T> tmp;
121 unpack_smart_ptr(x,d,tmp);
122 if (cd::shared_ptr<T> target=a.lock())
128#if defined(__cplusplus) && __cplusplus<=201402
129#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
130#pragma GCC diagnostic push
131#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
137 void operator()(cd::pack_t& x,
const cd::string& d, U& a)
138 {pack_smart_ptr(x,d,a);}
145 void operator()(cd::unpack_t& x,
const cd::string& d, U& a)
146 {unpack_smart_ptr(x,d,a);}
148#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
149#pragma GCC diagnostic pop
153#if defined(__cplusplus) && __cplusplus >= 201103L
154 template <
class T,
class D>
158 void operator()(cd::pack_t& x,
const cd::string& d, U& a)
159 {pack_smart_ptr(x,d,a);}
162 template <
class T,
class D>
166 void operator()(cd::unpack_t& x,
const cd::string& d, U& a)
167 {unpack_smart_ptr(x,d,a);}
Definition pack_base.h:138
Contains access_* structs, and nothing else. These structs are used to gain access to private members...
Definition classdesc_access.h:20
Contains definitions related to classdesc functionality.
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
void unpack(unpack_t &targ, const string &desc, is_treenode dum, T *&arg)
unserialise a tree.
Definition pack_graph.h:44
Definition classdesc.h:299
controlled template specialisation: stolen from boost::enable_if.
Definition classdesc.h:282
class to allow access to private members
Definition classdesc_access.h:21
class to allow access to private members
Definition classdesc_access.h:22