Monero
keyvalue_serialization_overloads.h
Go to the documentation of this file.
1 // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name of the Andrey N. Sabelnikov nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY
19 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 //
26 
27 #pragma once
28 
29 #include <set>
30 #include <list>
31 #include <vector>
32 #include <deque>
33 #include <boost/mpl/vector.hpp>
34 #include <boost/mpl/contains_fwd.hpp>
35 
36 #undef MONERO_DEFAULT_LOG_CATEGORY
37 #define MONERO_DEFAULT_LOG_CATEGORY "serialization"
38 
39 namespace epee
40 {
41  namespace
42  {
43  template<class C> void hint_resize(C &container, size_t size) {}
44  template<class C> void hint_resize(std::vector<C> &container, size_t size) { container.reserve(size); }
45  }
46  namespace serialization
47  {
48 
49  //-------------------------------------------------------------------------------------------------------------------
50  template<class t_type, class t_storage>
51  static bool serialize_t_val_as_blob(const t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
52  {
53  std::string blob((const char *)&d, sizeof(d));
54  return stg.set_value(pname, std::move(blob), hparent_section);
55  }
56  //-------------------------------------------------------------------------------------------------------------------
57  template<class t_type, class t_storage>
58  static bool unserialize_t_val_as_blob(t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
59  {
60  std::string blob;
61  if(!stg.get_value(pname, blob, hparent_section))
62  return false;
63  CHECK_AND_ASSERT_MES(blob.size() == sizeof(d), false, "unserialize_t_val_as_blob: size of " << typeid(t_type).name() << " = " << sizeof(t_type) << ", but stored blod size = " << blob.size() << ", value name = " << pname);
64  d = *(const t_type*)blob.data();
65  return true;
66  }
67  //-------------------------------------------------------------------------------------------------------------------
68  template<class serializible_type, class t_storage>
69  static bool serialize_t_obj(const serializible_type& obj, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
70  {
71  typename t_storage::hsection hchild_section = stg.open_section(pname, hparent_section, true);
72  CHECK_AND_ASSERT_MES(hchild_section, false, "serialize_t_obj: failed to open/create section " << pname);
73  return obj.store(stg, hchild_section);
74  }
75  //-------------------------------------------------------------------------------------------------------------------
76  template<class serializible_type, class t_storage>
77  static bool unserialize_t_obj(serializible_type& obj, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
78  {
79  typename t_storage::hsection hchild_section = stg.open_section(pname, hparent_section, false);
80  if(!hchild_section) return false;
81  return obj._load(stg, hchild_section);
82  }
83  //-------------------------------------------------------------------------------------------------------------------
84  template<class stl_container, class t_storage>
85  static bool serialize_stl_container_t_val (const stl_container& container, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
86  {
87  using value_type = typename stl_container::value_type;
88 
89  if(!container.size()) return true;
90  typename stl_container::const_iterator it = container.begin();
91  typename t_storage::harray hval_array = stg.insert_first_value(pname, value_type(*it), hparent_section);
92  CHECK_AND_ASSERT_MES(hval_array, false, "failed to insert first value to storage");
93  it++;
94  for(;it!= container.end();it++)
95  stg.insert_next_value(hval_array, value_type(*it));
96 
97  return true;
98  }
99  //--------------------------------------------------------------------------------------------------------------------
100  template<class stl_container, class t_storage>
101  static bool unserialize_stl_container_t_val(stl_container& container, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
102  {
103  container.clear();
104  typename stl_container::value_type exchange_val;
105  typename t_storage::harray hval_array = stg.get_first_value(pname, exchange_val, hparent_section);
106  if(!hval_array) return false;
107  container.insert(container.end(), std::move(exchange_val));
108  while(stg.get_next_value(hval_array, exchange_val))
109  container.insert(container.end(), std::move(exchange_val));
110  return true;
111  }//--------------------------------------------------------------------------------------------------------------------
112  template<class stl_container, class t_storage>
113  static bool serialize_stl_container_pod_val_as_blob(const stl_container& container, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
114  {
115  if(!container.size()) return true;
116  std::string mb;
117  mb.resize(sizeof(typename stl_container::value_type)*container.size());
118  typename stl_container::value_type* p_elem = (typename stl_container::value_type*)mb.data();
119  BOOST_FOREACH(const typename stl_container::value_type& v, container)
120  {
121  *p_elem = v;
122  p_elem++;
123  }
124  return stg.set_value(pname, std::move(mb), hparent_section);
125  }
126  //--------------------------------------------------------------------------------------------------------------------
127  template<class stl_container, class t_storage>
128  static bool unserialize_stl_container_pod_val_as_blob(stl_container& container, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
129  {
130  container.clear();
131  std::string buff;
132  bool res = stg.get_value(pname, buff, hparent_section);
133  if(res)
134  {
135  size_t loaded_size = buff.size();
136  typename stl_container::value_type* pelem = (typename stl_container::value_type*)buff.data();
137  CHECK_AND_ASSERT_MES(!(loaded_size%sizeof(typename stl_container::value_type)),
138  false,
139  "size in blob " << loaded_size << " not have not zero modulo for sizeof(value_type) = " << sizeof(typename stl_container::value_type) << ", type " << typeid(typename stl_container::value_type).name());
140  size_t count = (loaded_size/sizeof(typename stl_container::value_type));
141  hint_resize(container, count);
142  for(size_t i = 0; i < count; i++)
143  container.insert(container.end(), *(pelem++));
144  }
145  return res;
146  }
147  //--------------------------------------------------------------------------------------------------------------------
148  template<class stl_container, class t_storage>
149  static bool serialize_stl_container_t_obj (const stl_container& container, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
150  {
151  bool res = false;
152  if(!container.size()) return true;
153  typename stl_container::const_iterator it = container.begin();
154  typename t_storage::hsection hchild_section = nullptr;
155  typename t_storage::harray hsec_array = stg.insert_first_section(pname, hchild_section, hparent_section);
156  CHECK_AND_ASSERT_MES(hsec_array && hchild_section, false, "failed to insert first section with section name " << pname);
157  res = it->store(stg, hchild_section);
158  it++;
159  for(;it!= container.end();it++)
160  {
161  stg.insert_next_section(hsec_array, hchild_section);
162  res |= it->store(stg, hchild_section);
163  }
164  return res;
165  }
166  //--------------------------------------------------------------------------------------------------------------------
167  template<class stl_container, class t_storage>
168  static bool unserialize_stl_container_t_obj(stl_container& container, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
169  {
170  bool res = false;
171  container.clear();
172  typename stl_container::value_type val = typename stl_container::value_type();
173  typename t_storage::hsection hchild_section = nullptr;
174  typename t_storage::harray hsec_array = stg.get_first_section(pname, hchild_section, hparent_section);
175  if(!hsec_array || !hchild_section) return false;
176  res = val._load(stg, hchild_section);
177  container.insert(container.end(), val);
178  while(stg.get_next_section(hsec_array, hchild_section))
179  {
180  typename stl_container::value_type val_l = typename stl_container::value_type();
181  res |= val_l._load(stg, hchild_section);
182  container.insert(container.end(), std::move(val_l));
183  }
184  return res;
185  }
186  //--------------------------------------------------------------------------------------------------------------------
187  template<bool>
189 
190  template<>
192  {
193  template<class t_type, class t_storage>
194  static bool kv_serialize(const t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
195  {
196  return stg.set_value(pname, t_type(d), hparent_section);
197  }
198  //-------------------------------------------------------------------------------------------------------------------
199  template<class t_type, class t_storage>
200  static bool kv_unserialize(t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
201  {
202  return stg.get_value(pname, d, hparent_section);
203  }
204  //-------------------------------------------------------------------------------------------------------------------
205  template<class t_type, class t_storage>
206  static bool kv_serialize(const std::vector<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
207  {
208  return serialize_stl_container_t_val(d, stg, hparent_section, pname);
209  }
210  //-------------------------------------------------------------------------------------------------------------------
211  template<class t_type, class t_storage>
212  static bool kv_unserialize(std::vector<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
213  {
214  return unserialize_stl_container_t_val(d, stg, hparent_section, pname);
215  }
216  //-------------------------------------------------------------------------------------------------------------------
217  template<class t_type, class t_storage>
218  static bool kv_serialize(const std::deque<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
219  {
220  return serialize_stl_container_t_val(d, stg, hparent_section, pname);
221  }
222  //-------------------------------------------------------------------------------------------------------------------
223  template<class t_type, class t_storage>
224  static bool kv_unserialize(std::deque<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
225  {
226  return unserialize_stl_container_t_val(d, stg, hparent_section, pname);
227  }
228  //-------------------------------------------------------------------------------------------------------------------
229  template<class t_type, class t_storage>
230  static bool kv_serialize(const std::list<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
231  {
232  return serialize_stl_container_t_val(d, stg, hparent_section, pname);
233  }
234  //-------------------------------------------------------------------------------------------------------------------
235  template<class t_type, class t_storage>
236  static bool kv_unserialize(std::list<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
237  {
238  return unserialize_stl_container_t_val(d, stg, hparent_section, pname);
239  }
240  //-------------------------------------------------------------------------------------------------------------------
241  template<class t_type, class t_storage>
242  static bool kv_serialize(const std::set<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
243  {
244  return serialize_stl_container_t_val(d, stg, hparent_section, pname);
245  }
246  //-------------------------------------------------------------------------------------------------------------------
247  template<class t_type, class t_storage>
248  static bool kv_unserialize(std::set<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
249  {
250  return unserialize_stl_container_t_val(d, stg, hparent_section, pname);
251  }
252  //-------------------------------------------------------------------------------------------------------------------
253  };
254  template<>
256  {
257  template<class t_type, class t_storage>
258  static bool kv_serialize(const t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
259  {
260  return serialize_t_obj(d, stg, hparent_section, pname);
261  }
262  //-------------------------------------------------------------------------------------------------------------------
263  template<class t_type, class t_storage>
264  static bool kv_unserialize(t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
265  {
266  return unserialize_t_obj(d, stg, hparent_section, pname);
267  }
268 
269  //-------------------------------------------------------------------------------------------------------------------
270  template<class t_type, class t_storage>
271  static bool kv_serialize(const std::vector<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
272  {
273  return serialize_stl_container_t_obj(d, stg, hparent_section, pname);
274  }
275  //-------------------------------------------------------------------------------------------------------------------
276  template<class t_type, class t_storage>
277  static bool kv_unserialize(std::vector<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
278  {
279  return unserialize_stl_container_t_obj(d, stg, hparent_section, pname);
280  }
281  //-------------------------------------------------------------------------------------------------------------------
282  template<class t_type, class t_storage>
283  static bool kv_serialize(const std::deque<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
284  {
285  return serialize_stl_container_t_obj(d, stg, hparent_section, pname);
286  }
287  //-------------------------------------------------------------------------------------------------------------------
288  template<class t_type, class t_storage>
289  static bool kv_unserialize(std::deque<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
290  {
291  return unserialize_stl_container_t_obj(d, stg, hparent_section, pname);
292  }
293  //-------------------------------------------------------------------------------------------------------------------
294  template<class t_type, class t_storage>
295  static bool kv_serialize(const std::list<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
296  {
297  return serialize_stl_container_t_obj(d, stg, hparent_section, pname);
298  }
299  //-------------------------------------------------------------------------------------------------------------------
300  template<class t_type, class t_storage>
301  static bool kv_unserialize(std::list<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
302  {
303  return unserialize_stl_container_t_obj(d, stg, hparent_section, pname);
304  }
305  //-------------------------------------------------------------------------------------------------------------------
306  template<class t_type, class t_storage>
307  static bool kv_serialize(const std::set<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
308  {
309  return serialize_stl_container_t_obj(d, stg, hparent_section, pname);
310  }
311  //-------------------------------------------------------------------------------------------------------------------
312  template<class t_type, class t_storage>
313  static bool kv_unserialize(std::set<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
314  {
315  return unserialize_stl_container_t_obj(d, stg, hparent_section, pname);
316  }
317  };
318  template<class t_storage>
319  struct base_serializable_types: public boost::mpl::vector<uint64_t, uint32_t, uint16_t, uint8_t, int64_t, int32_t, int16_t, int8_t, double, bool, std::string, typename t_storage::meta_entry>::type
320  {};
321  //-------------------------------------------------------------------------------------------------------------------
322  template<bool> struct selector;
323  template<>
324  struct selector<true>
325  {
326  template<class t_type, class t_storage>
327  static bool serialize(const t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
328  {
329  return kv_serialize(d, stg, hparent_section, pname);
330  }
331 
332  template<class t_type, class t_storage>
333  static bool serialize_stl_container_pod_val_as_blob(const t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
334  {
335  return epee::serialization::serialize_stl_container_pod_val_as_blob(d, stg, hparent_section, pname);
336  }
337 
338  template<class t_type, class t_storage>
339  static bool serialize_t_val_as_blob(const t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
340  {
341  return epee::serialization::serialize_t_val_as_blob(d, stg, hparent_section, pname);
342  }
343 
344 
345  };
346  template<>
347  struct selector<false>
348  {
349  template<class t_type, class t_storage>
350  static bool serialize(t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
351  {
352  return kv_unserialize(d, stg, hparent_section, pname);
353  }
354  template<class t_type, class t_storage>
355  static bool serialize_stl_container_pod_val_as_blob(t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
356  {
357  return epee::serialization::unserialize_stl_container_pod_val_as_blob(d, stg, hparent_section, pname);
358  }
359 
360  template<class t_type, class t_storage>
361  static bool serialize_t_val_as_blob(t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
362  {
363  return epee::serialization::unserialize_t_val_as_blob(d, stg, hparent_section, pname);
364  }
365  };
366 
367  template<class t_type, class t_storage>
368  bool kv_serialize(const t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
369  {
371  }
372  //-------------------------------------------------------------------------------------------------------------------
373  template<class t_type, class t_storage>
374  bool kv_unserialize(t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
375  {
377  }
378  //-------------------------------------------------------------------------------------------------------------------
379  template<class t_type, class t_storage>
380  bool kv_serialize(const std::vector<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
381  {
383  }
384  //-------------------------------------------------------------------------------------------------------------------
385  template<class t_type, class t_storage>
386  bool kv_unserialize(std::vector<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
387  {
389  }
390  //-------------------------------------------------------------------------------------------------------------------
391  template<class t_type, class t_storage>
392  bool kv_serialize(const std::deque<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
393  {
395  }
396  //-------------------------------------------------------------------------------------------------------------------
397  template<class t_type, class t_storage>
398  bool kv_unserialize(std::deque<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
399  {
401  }
402  //-------------------------------------------------------------------------------------------------------------------
403  template<class t_type, class t_storage>
404  bool kv_serialize(const std::list<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
405  {
407  }
408  //-------------------------------------------------------------------------------------------------------------------
409  template<class t_type, class t_storage>
410  bool kv_unserialize(std::list<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
411  {
413  }
414  //-------------------------------------------------------------------------------------------------------------------
415  template<class t_type, class t_storage>
416  bool kv_serialize(const std::set<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
417  {
419  }
420  //-------------------------------------------------------------------------------------------------------------------
421  template<class t_type, class t_storage>
422  bool kv_unserialize(std::set<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
423  {
425  }
426  }
427 }
const char * res
Definition: hmac_keccak.cpp:42
Definition: binary_utils.h:36
static bool kv_unserialize(std::list< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:301
static bool kv_serialize(const std::list< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:230
array_entry * harray
Definition: portable_storage_base.h:175
bool kv_serialize(const t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:368
int * count
Definition: gmock_stress_test.cc:176
int i
Definition: pymoduletest.py:23
static bool kv_serialize(const std::deque< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:283
::std::string string
Definition: gtest-port.h:1097
static bool serialize(const t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:327
int type
Definition: superscalar.cpp:50
Definition: keyvalue_serialization_overloads.h:319
static bool serialize_t_val_as_blob(const t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:51
static bool kv_unserialize(std::list< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:236
bool kv_unserialize(t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:374
Definition: keyvalue_serialization_overloads.h:322
static bool serialize(t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:350
section * hsection
Definition: portable_storage_base.h:174
Definition: d.py:1
static bool kv_unserialize(std::deque< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:289
static bool kv_unserialize(t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:264
static bool kv_unserialize(std::deque< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:224
static bool unserialize_t_val_as_blob(t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:58
static bool unserialize_t_obj(serializible_type &obj, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:77
static bool kv_serialize(const t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:258
static bool unserialize_stl_container_pod_val_as_blob(stl_container &container, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:128
static bool kv_serialize(const std::list< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:295
static bool kv_unserialize(std::set< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:313
static bool unserialize_stl_container_t_val(stl_container &container, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:101
static bool serialize_stl_container_pod_val_as_blob(const t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:333
#define false
Definition: stdbool.h:37
static bool serialize_stl_container_pod_val_as_blob(const stl_container &container, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:113
static bool serialize_stl_container_pod_val_as_blob(t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:355
static bool unserialize_stl_container_t_obj(stl_container &container, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:168
TODO: (mj-xmr) This will be reduced in an another PR.
Definition: byte_slice.h:39
static bool kv_serialize(const std::set< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:307
const T & move(const T &t)
Definition: gtest-port.h:1317
static bool kv_unserialize(std::set< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:248
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
static bool kv_unserialize(std::vector< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:277
static bool serialize_stl_container_t_obj(const stl_container &container, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:149
static bool kv_serialize(const t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:194
d
Definition: pymoduletest.py:79
static bool serialize_t_obj(const serializible_type &obj, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:69
static bool kv_serialize(const std::deque< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:218
static bool serialize_t_val_as_blob(const t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:339
const char * name
Definition: options.c:30
static bool kv_unserialize(t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:200
static bool kv_serialize(const std::set< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:242
static bool serialize_stl_container_t_val(const stl_container &container, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:85
#define true
Definition: stdbool.h:36
static bool serialize_t_val_as_blob(t_type &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:361
static bool kv_serialize(const std::vector< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:271
static bool kv_serialize(const std::vector< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:206
static bool kv_unserialize(std::vector< t_type > &d, t_storage &stg, typename t_storage::hsection hparent_section, const char *pname)
Definition: keyvalue_serialization_overloads.h:212