Electroneum
serialization Namespace Reference

Namespaces

 detail
 

Functions

template<class T >
bool parse_binary (const std::string &blob, T &v)
 
template<class T >
bool dump_binary (T &v, std::string &blob)
 
template<class T >
std::string dump_json (T &v)
 
template<class Archive >
bool check_stream_state (Archive &ar, bool noeof=false)
 
template<class Archive , class T >
bool serialize (Archive &ar, T &v)
 
template<class Archive , class T >
bool serialize_noeof (Archive &ar, T &v)
 

Function Documentation

◆ check_stream_state()

template<class Archive >
bool serialization::check_stream_state ( Archive &  ar,
bool  noeof = false 
)

Definition at line 350 of file serialization.h.

351  {
352  return detail::do_check_stream_state(ar.stream(), typename Archive::is_saving(), noeof);
353  }
bool do_check_stream_state(Stream &s, boost::mpl::bool_< false >, bool noeof)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump_binary()

template<class T >
bool serialization::dump_binary ( T v,
std::string &  blob 
)

dumps the data in v into the blob string

Definition at line 51 of file binary_utils.h.

52  {
53  std::stringstream ostr;
54  binary_archive<true> oar(ostr);
55  bool success = ::serialization::serialize(oar, v);
56  blob = ostr.str();
57  return success && ostr.good();
58  };
void serialize(Archive &a, unsigned_tx_set &x, const boost::serialization::version_type ver)
expect< void > success() noexcept
Definition: expect.h:397
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump_json()

template<class T >
std::string serialization::dump_json ( T v)

Definition at line 40 of file json_utils.h.

41 {
42  std::stringstream ostr;
43  json_archive<true> oar(ostr);
44  assert(serialization::serialize(oar, v));
45  return ostr.str();
46 };
bool serialize(Archive &ar, T &v)
Here is the call graph for this function:

◆ parse_binary()

template<class T >
bool serialization::parse_binary ( const std::string &  blob,
T v 
)

creates a new archive with the passed blob and serializes it into v

Definition at line 41 of file binary_utils.h.

42  {
43  std::istringstream istr(blob);
44  binary_archive<false> iar(istr);
46  }
void serialize(Archive &a, unsigned_tx_set &x, const boost::serialization::version_type ver)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ serialize()

template<class Archive , class T >
bool serialization::serialize ( Archive &  ar,
T v 
)
inline

Definition at line 360 of file serialization.h.

361  {
362  bool r = do_serialize(ar, v);
363  return r && check_stream_state(ar, false);
364  }
bool check_stream_state(Archive &ar, bool noeof=false)
bool do_serialize(Archive &ar, T &v)
just calls the serialize function defined for ar and v...
Here is the call graph for this function:
Here is the caller graph for this function:

◆ serialize_noeof()

template<class Archive , class T >
bool serialization::serialize_noeof ( Archive &  ar,
T v 
)
inline

Definition at line 371 of file serialization.h.

372  {
373  bool r = do_serialize(ar, v);
374  return r && check_stream_state(ar, true);
375  }
bool check_stream_state(Archive &ar, bool noeof=false)
bool do_serialize(Archive &ar, T &v)
just calls the serialize function defined for ar and v...
Here is the call graph for this function:
Here is the caller graph for this function: