9#ifndef CLASSDESC_POLY_ACCESS_XML_PACK_H
10#define CLASSDESC_POLY_ACCESS_XML_PACK_H
14#ifdef CLASSDESC_XML_PACK_BASE_H
15#ifdef CLASSDESC_POLYXMLBASE_H
19 xml_pack_smart_ptr(
xml_pack_t& x,
const string& d,
const T& a)
26 ::xml_pack(x,d+
".type",a->type());
38 xml_pack_smart_ptr(
xml_pack_t& x,
const string& d,
const T& a)
47 void xml_pack(
xml_pack_t& x,
const string& d, shared_ptr<T>& a)
48 {xml_pack_smart_ptr(x,d,a);}
50#if defined(__cplusplus) && __cplusplus<=201402
51#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
52#pragma GCC diagnostic push
53#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
56 void xml_pack(
xml_pack_t& x,
const string& d, std::auto_ptr<T>& a)
57 {xml_pack_smart_ptr(x,d,a);}
58#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
59#pragma GCC diagnostic pop
63#if defined(__cplusplus) && __cplusplus >= 201103L
64 template<
class T,
class D>
65 void xml_pack(
xml_pack_t& x,
const string& d, std::unique_ptr<T,D>& a)
66 {xml_pack_smart_ptr(x,d,a);}
71#ifdef CLASSDESC_XML_UNPACK_BASE_H
72#ifdef CLASSDESC_POLYXMLBASE_H
79 if (x.exists(d+
".type"))
81 typename T::element_type::Type type;
82 ::xml_unpack(x,d+
".type",type);
83 a.reset(T::element_type::create(type));
102 a.reset(
new typename T::element_type);
103 ::xml_unpack(x,d,*a);
110#ifdef CLASSDESC_POLYXMLBASE_H
114 xml_unpack_smart_ptr(
xml_unpack_t& x,
const string& d,
const T& a,
117 if (x.exists(d+
".type"))
119 typename T::element_type::Type type;
120 ::xml_unpack(x,d+
".type",type);
121 T tmp(T::element_type::create(type));
122 tmp->xml_unpack(x,d);
138 T tmp(
new typename T::element_type);
139 ::xml_unpack(x,d,*tmp);
149#ifdef CLASSDESC_XML_PACK_BASE_H
153 void operator()(cd::xml_pack_t& x,
const cd::string& d,
const cd::shared_ptr<T>& a)
154 {xml_pack_smart_ptr(x,d,a);}
157#if defined(__cplusplus) && __cplusplus<=201402
158#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
159#pragma GCC diagnostic push
160#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
165 void operator()(cd::xml_pack_t& x,
const cd::string& d,
const std::auto_ptr<T>& a)
166 {xml_pack_smart_ptr(x,d,a);}
168#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
169#pragma GCC diagnostic pop
173#if defined(__cplusplus) && __cplusplus >= 201103L
177 void operator()(cd::xml_pack_t& x,
const cd::string& d,
const std::unique_ptr<T>& a)
178 {xml_pack_smart_ptr(x,d,a);}
183#ifdef CLASSDESC_XML_UNPACK_BASE_H
188 void operator()(cd::xml_unpack_t& x,
const cd::string& d, U& a)
189 {xml_unpack_smart_ptr(x,d,a);}
192#if defined(__cplusplus) && __cplusplus<=201402
193#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
194#pragma GCC diagnostic push
195#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
201 void operator()(cd::xml_unpack_t& x,
const cd::string& d, U& a)
202 {xml_unpack_smart_ptr(x,d,a);}
204#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
205#pragma GCC diagnostic pop
209#if defined(__cplusplus) && __cplusplus >= 201103L
214 void operator()(cd::xml_unpack_t& x,
const cd::string& d, U& a)
215 {xml_unpack_smart_ptr(x,d,a);}
<utility structure for handling tag/endtag
Definition xml_pack_base.h:110
Definition xml_pack_base.h:56
Definition xml_unpack_base.h:317
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.
Definition classdesc.h:299
controlled template specialisation: stolen from boost::enable_if.
Definition classdesc.h:282
Definition classdesc_access.h:23
Definition classdesc_access.h:24