Electroneum
boost::archive::portable_binary_iarchive Class Reference

#include <portable_binary_iarchive.hpp>

Inheritance diagram for boost::archive::portable_binary_iarchive:
Collaboration diagram for boost::archive::portable_binary_iarchive:

Public Types

typedef boost::archive::detail::common_iarchive< portable_binary_iarchivedetail_common_iarchive
 

Public Member Functions

void load_impl (boost::intmax_t &l, char maxsize)
 
template<class T >
void load (T &t)
 
void load (boost::serialization::item_version_type &t)
 
void load (boost::archive::version_type &t)
 
void load (boost::archive::class_id_type &t)
 
void load (std::string &t)
 
void load (std::wstring &t)
 
void load (float &t)
 
void load (double &t)
 
void load (char &t)
 
void load (unsigned char &t)
 
template<class T >
void load_override (T &t, int)
 
void load_override (boost::archive::class_name_type &t, int)
 
void load_override (boost::archive::class_id_optional_type &, int)
 
void init (unsigned int flags)
 
 portable_binary_iarchive (std::istream &is, unsigned flags=0)
 
 portable_binary_iarchive (std::basic_streambuf< std::istream::char_type, std::istream::traits_type > &bsb, unsigned int flags)
 

Public Attributes

unsigned int m_flags
 

Detailed Description

Definition at line 72 of file portable_binary_iarchive.hpp.

Member Typedef Documentation

◆ detail_common_iarchive

Definition at line 156 of file portable_binary_iarchive.hpp.

Constructor & Destructor Documentation

◆ portable_binary_iarchive() [1/2]

boost::archive::portable_binary_iarchive::portable_binary_iarchive ( std::istream &  is,
unsigned  flags = 0 
)
inline

Definition at line 177 of file portable_binary_iarchive.hpp.

177  :
178  primitive_base_t(
179  * is.rdbuf(),
180  0 != (flags & boost::archive::no_codecvt)
181  ),
182  archive_base_t(flags),
183  m_flags(0)
184  {
185  init(flags);
186  }
Here is the call graph for this function:

◆ portable_binary_iarchive() [2/2]

boost::archive::portable_binary_iarchive::portable_binary_iarchive ( std::basic_streambuf< std::istream::char_type, std::istream::traits_type > &  bsb,
unsigned int  flags 
)
inline

Definition at line 188 of file portable_binary_iarchive.hpp.

194  :
195  primitive_base_t(
196  bsb,
197  0 != (flags & boost::archive::no_codecvt)
198  ),
199  archive_base_t(flags),
200  m_flags(0)
201  {
202  init(flags);
203  }
Here is the call graph for this function:

Member Function Documentation

◆ init()

void boost::archive::portable_binary_iarchive::init ( unsigned int  flags)
inline

Definition at line 308 of file portable_binary_iarchive.hpp.

308  {
309  if(0 == (flags & boost::archive::no_header)){
310  // read signature in an archive version independent manner
311  std::string file_signature;
312  * this >> file_signature;
313  if(file_signature != boost::archive::BOOST_ARCHIVE_SIGNATURE())
314  boost::serialization::throw_exception(
315  boost::archive::archive_exception(
316  boost::archive::archive_exception::invalid_signature
317  )
318  );
319  // make sure the version of the reading archive library can
320  // support the format of the archive being read
321  boost::archive::library_version_type input_library_version;
322  * this >> input_library_version;
323 
324  // ignore archive version checking
325  /*
326  // extra little .t is to get around borland quirk
327  if(boost::archive::BOOST_ARCHIVE_VERSION() < input_library_version)
328  boost::serialization::throw_exception(
329  boost::archive::archive_exception(
330  boost::archive::archive_exception::unsupported_version
331  )
332  );
333  */
334 
335  #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
336  this->set_library_version(input_library_version);
337  //#else
338  //#if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
339  //detail::
340  //#endif
341  boost::archive::detail::basic_iarchive::set_library_version(
342  input_library_version
343  );
344 #endif
345  }
346  if (!(m_flags & (endian_little | endian_big)))
348  unsigned char x;
349  load(x);
350  m_flags = x << CHAR_BIT;
351 }
::std::string string
Definition: gtest-port.h:1097
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load() [1/10]

template<class T >
void boost::archive::portable_binary_iarchive::load ( T t)
inline

Definition at line 106 of file portable_binary_iarchive.hpp.

106  {
107  boost::intmax_t l;
108  load_impl(l, sizeof(T));
109  // use cast to avoid compile time warning
110  //t = static_cast< T >(l);
111  t = T(l);
112  }
const uint32_t T[512]
int64_t intmax_t
Definition: stdint.h:169
void load_impl(boost::intmax_t &l, char maxsize)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load() [2/10]

void boost::archive::portable_binary_iarchive::load ( boost::serialization::item_version_type &  t)
inline

Definition at line 113 of file portable_binary_iarchive.hpp.

113  {
114  boost::intmax_t l;
115  load_impl(l, sizeof(boost::serialization::item_version_type));
116  // use cast to avoid compile time warning
117  t = boost::serialization::item_version_type(l);
118  }
int64_t intmax_t
Definition: stdint.h:169
void load_impl(boost::intmax_t &l, char maxsize)
Here is the call graph for this function:

◆ load() [3/10]

void boost::archive::portable_binary_iarchive::load ( boost::archive::version_type &  t)
inline

Definition at line 119 of file portable_binary_iarchive.hpp.

119  {
120  boost::intmax_t l;
121  load_impl(l, sizeof(boost::archive::version_type));
122  // use cast to avoid compile time warning
123  t = boost::archive::version_type(l);
124  }
int64_t intmax_t
Definition: stdint.h:169
void load_impl(boost::intmax_t &l, char maxsize)
Here is the call graph for this function:

◆ load() [4/10]

void boost::archive::portable_binary_iarchive::load ( boost::archive::class_id_type &  t)
inline

Definition at line 125 of file portable_binary_iarchive.hpp.

125  {
126  boost::intmax_t l;
127  load_impl(l, sizeof(boost::archive::class_id_type));
128  // use cast to avoid compile time warning
129  t = boost::archive::class_id_type(static_cast<int>(l));
130  }
int64_t intmax_t
Definition: stdint.h:169
void load_impl(boost::intmax_t &l, char maxsize)
Here is the call graph for this function:

◆ load() [5/10]

void boost::archive::portable_binary_iarchive::load ( std::string &  t)
inline

Definition at line 131 of file portable_binary_iarchive.hpp.

131  {
132  this->primitive_base_t::load(t);
133  }
void load(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
Here is the call graph for this function:

◆ load() [6/10]

void boost::archive::portable_binary_iarchive::load ( std::wstring &  t)
inline

Definition at line 135 of file portable_binary_iarchive.hpp.

135  {
136  this->primitive_base_t::load(t);
137  }
void load(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
Here is the call graph for this function:

◆ load() [7/10]

void boost::archive::portable_binary_iarchive::load ( float &  t)
inline

Definition at line 139 of file portable_binary_iarchive.hpp.

139  {
140  this->primitive_base_t::load(t);
141  // floats not supported
142  //BOOST_STATIC_ASSERT(false);
143  }
void load(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
Here is the call graph for this function:

◆ load() [8/10]

void boost::archive::portable_binary_iarchive::load ( double &  t)
inline

Definition at line 144 of file portable_binary_iarchive.hpp.

144  {
145  this->primitive_base_t::load(t);
146  // doubles not supported
147  //BOOST_STATIC_ASSERT(false);
148  }
void load(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
Here is the call graph for this function:

◆ load() [9/10]

void boost::archive::portable_binary_iarchive::load ( char &  t)
inline

Definition at line 149 of file portable_binary_iarchive.hpp.

149  {
150  this->primitive_base_t::load(t);
151  }
void load(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
Here is the call graph for this function:

◆ load() [10/10]

void boost::archive::portable_binary_iarchive::load ( unsigned char &  t)
inline

Definition at line 152 of file portable_binary_iarchive.hpp.

152  {
153  this->primitive_base_t::load(t);
154  }
void load(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
Here is the call graph for this function:

◆ load_impl()

void boost::archive::portable_binary_iarchive::load_impl ( boost::intmax_t l,
char  maxsize 
)
inline

Definition at line 236 of file portable_binary_iarchive.hpp.

236  {
237  signed char size;
238  l = 0;
239  this->primitive_base_t::load(size);
240 
241  if(0 == size){
242  return;
243  }
244 
245  bool negative = (size < 0);
246  if(negative)
247  size = -size;
248 
249  if(size > maxsize)
250  boost::serialization::throw_exception(
251  portable_binary_iarchive_exception()
252  );
253 
254  char * cptr = reinterpret_cast<char *>(& l);
255 #if BOOST_ENDIAN_BIG_BYTE
256  cptr += (sizeof(boost::intmax_t) - size);
257 #endif
258  this->primitive_base_t::load_binary(cptr, size);
259 
260 #if BOOST_ENDIAN_BIG_BYTE
261  if((m_flags & endian_little) || (!(m_flags & endian_big)))
262 #else
263  if(m_flags & endian_big)
264 #endif
265  reverse_bytes(size, cptr);
266 
267  if(negative)
268  l = -l;
269 }
int64_t intmax_t
Definition: stdint.h:169
void reverse_bytes(signed char size, char *address)
void load(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_override() [1/3]

template<class T >
void boost::archive::portable_binary_iarchive::load_override ( T t,
int   
)
inline

Definition at line 167 of file portable_binary_iarchive.hpp.

167  {
168  this->detail_common_iarchive::load_override(t, 0);
169  }
Here is the caller graph for this function:

◆ load_override() [2/3]

void boost::archive::portable_binary_iarchive::load_override ( boost::archive::class_name_type &  t,
int   
)
inline

Definition at line 290 of file portable_binary_iarchive.hpp.

292  {
293  std::string cn;
294  cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
295  load_override(cn, 0);
296  if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1))
297  boost::serialization::throw_exception(
298  boost::archive::archive_exception(
299  boost::archive::archive_exception::invalid_class_name)
300  );
301  std::memcpy(t, cn.data(), cn.size());
302  // borland tweak
303  t.t[cn.size()] = '\0';
304 }
::std::string string
Definition: gtest-port.h:1097
void * memcpy(void *a, const void *b, size_t c)
Here is the call graph for this function:

◆ load_override() [3/3]

void boost::archive::portable_binary_iarchive::load_override ( boost::archive::class_id_optional_type &  ,
int   
)
inline

Definition at line 172 of file portable_binary_iarchive.hpp.

172 {}

Member Data Documentation

◆ m_flags

unsigned int boost::archive::portable_binary_iarchive::m_flags

Definition at line 101 of file portable_binary_iarchive.hpp.


The documentation for this class was generated from the following file: