9 #ifndef POLY_ACCESS_JSON_PACK_H 10 #define POLY_ACCESS_JSON_PACK_H 26 json_pack_smart_ptr(
json_pack_t& x,
const string& d, T& a,
43 json_pack_smart_ptr(
json_pack_t& x,
const string& d, T& a,
55 json_unpack_smart_ptr(
json_unpack_t& x,
const string& d, T& a,
58 if (x.type()==json_spirit::obj_type && x.get_obj().count(
"type"))
60 typename T::element_type::Type type;
61 ::json_unpack(x,d+
".type",type);
62 a.reset(T::element_type::create(type));
77 json_unpack_smart_ptr(
json_pack_t& x,
const string& d, T& a,
81 a.reset(
new typename T::element_type);
84 ::json_unpack(x,d,*a);
86 catch (
const std::exception&)
102 cd::shared_ptr<T>& a)
103 {json_pack_smart_ptr(x,d,a);}
110 cd::shared_ptr<T>& a)
111 {json_unpack_smart_ptr(x,d,a);}
114 #if defined(__cplusplus) && __cplusplus<=201402 115 #if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__) 116 #pragma GCC diagnostic push 117 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 124 {json_pack_smart_ptr(x,d,a);}
132 {json_unpack_smart_ptr(x,d,a);}
134 #if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__) 135 #pragma GCC diagnostic pop 139 #if defined(__cplusplus) && __cplusplus >= 201103L 140 template <
class T,
class D>
144 std::unique_ptr<T,D>& a)
145 {json_pack_smart_ptr(x,d,a);}
148 template <
class T,
class D>
152 std::unique_ptr<T,D>& a)
153 {json_unpack_smart_ptr(x,d,a);}
Definition: json_pack_base.h:43
void json_pack(json_pack_t &o, const string &d, T &a)
forward declare generic json operations
Definition: json_pack_epilogue.h:53
Definition: polyAccessJsonPack.h:14
Definition: classdesc_access.h:26
bool throw_on_error
enable exceptions on error conditions
Definition: json_pack_base.h:46
Definition: classdesc_access.h:25
Contains definitions related to classdesc functionality.
Definition: arrays.h:2514
controlled template specialisation: stolen from boost::enable_if.
Definition: classdesc.h:249
Definition: classdesc.h:266
Contains access_* structs, and nothing else. These structs are used to gain access to private members...
Definition: accessor.h:55