FleCSI Core API Version: 2.4.2
Loading...
Searching...
No Matches
Serialization

Serialization without default constructibility. More...

Classes

struct  cast
 Aggregate helper that converts to any type via get. More...
struct  convert< T >
 Defines a serialization in terms of a representation type. More...
struct  traits< T, E >
 Extension point for serialization. More...
struct  value< T >
 Convenience for stateless types. More...

Functions

template<class F>
std::vector< std::byte > buffer (F &&f)
 Serialize into a buffer.
template<class T>
get (const std::byte *&p)
 Reconstruct an object, advancing past its serialized form.
template<class... TT>
auto get_tuple (const std::byte *p, const std::byte *e=nullptr)
 Construct a tuple of objects.
template<class T, class S = typename std::vector<T>::size_type>
auto get_vector (const std::byte *&p)
 Construct a std::vector from a size and then elements.
template<class... TT, class P>
void put (P &p, const TT &... tt)
 Store objects and advance past their serialized form.
template<class... TT>
auto put_tuple (const TT &... tt)
 Serialize a fixed set of objects into a buffer.
template<class... TT>
std::size_t size (const TT &... tt)
 Compute the serialized size of a fixed set of objects.

Detailed Description

Serialization without default constructibility.

Supported types:

  • any default-constructible, trivially-move-assignable, non-pointer type
  • any type that supports the Legion return-value serialization interface
  • std::string
  • any type with an appropriate specialization of traits or convert
  • any std::pair, std::tuple, std::array, std::vector, std::set, std::map, std::unordered_map of a supported type

Contents are in flecsi::util::serial unless otherwise specified.

Function Documentation

◆ put()

template<class... TT, class P>
void put ( P & p,
const TT &... tt )

Store objects and advance past their serialized form.

Template Parameters
Pstd::size_t for calculating sizes, or std::byte* for actual serialization
Parameters
ppointer or size
ttobjects

◆ size()

template<class... TT>
std::size_t size ( const TT &... tt)

Compute the serialized size of a fixed set of objects.

◆ get()

template<class T>
T get ( const std::byte *& p)

Reconstruct an object, advancing past its serialized form.

◆ buffer()

template<class F>
std::vector< std::byte > buffer ( F && f)

Serialize into a buffer.

Parameters
fa function that accepts an argument for put

◆ put_tuple()

template<class... TT>
auto put_tuple ( const TT &... tt)

Serialize a fixed set of objects into a buffer.

Reconstruct with get_tuple.

◆ get_tuple()

template<class... TT>
auto get_tuple ( const std::byte * p,
const std::byte * e = nullptr )

Construct a tuple of objects.

Parameters
epointer to end of representation, if known

◆ get_vector()

template<class T, class S = typename std::vector<T>::size_type>
auto get_vector ( const std::byte *& p)

Construct a std::vector from a size and then elements.

Template Parameters
Ssize type
Warning
get<std::vector<T>> is not guaranteed to be equivalent.