fpmas 1.5
Static Public Member Functions | List of all members
fpmas::io::datapack::Serializer< std::pair< T1, T2 > > Struct Template Reference

#include <datapack.h>

Static Public Member Functions

template<typename PackType >
static std::size_t size (const PackType &p, const std::pair< T1, T2 > &pair)
 
template<typename PackType >
static void to_datapack (PackType &pack, const std::pair< T1, T2 > &pair)
 
template<typename PackType >
static std::pair< T1, T2 > from_datapack (const PackType &pack)
 

Detailed Description

template<typename T1, typename T2>
struct fpmas::io::datapack::Serializer< std::pair< T1, T2 > >

std::pair Serializer specialization.

Serialization scheme
pair.first pair.second
Template Parameters
T1pair first type
T2pair second type

Member Function Documentation

◆ size()

template<typename T1 , typename T2 >
template<typename PackType >
static std::size_t fpmas::io::datapack::Serializer< std::pair< T1, T2 > >::size ( const PackType &  p,
const std::pair< T1, T2 > &  pair 
)
inlinestatic

Returns the buffer size, in bytes, required to serialize the specified pair, i.e. p.size(pair.first)+p.size(pair.second).

◆ to_datapack()

template<typename T1 , typename T2 >
template<typename PackType >
static void fpmas::io::datapack::Serializer< std::pair< T1, T2 > >::to_datapack ( PackType &  pack,
const std::pair< T1, T2 > &  pair 
)
inlinestatic

Serializes pair to pack.

pair.first and pair.second are serialized using the PackType::put(const T1&) and PackType::put(const T2&) methods.

Parameters
packdestination BasicObjectPack
pairpair to serialize

◆ from_datapack()

template<typename T1 , typename T2 >
template<typename PackType >
static std::pair< T1, T2 > fpmas::io::datapack::Serializer< std::pair< T1, T2 > >::from_datapack ( const PackType &  pack)
inlinestatic

Unserializes a pair from pack.

pair.first and pair.second are serialized using the PackType::get<T1>() and PackType::get<T2>() methods.

Parameters
packsource BasicObjectPack
Returns
unserialized pair

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