fpmas 1.5
Static Public Member Functions | List of all members
fpmas::io::datapack::Serializer< std::array< T, N > > Struct Template Reference

#include <datapack.h>

Static Public Member Functions

template<typename PackType >
static std::size_t size (const PackType &p, const std::array< T, N > &array)
 
template<typename PackType >
static void to_datapack (PackType &pack, const std::array< T, N > &array)
 
template<typename PackType >
static std::array< T, N > from_datapack (const PackType &pack)
 

Detailed Description

template<typename T, std::size_t N>
struct fpmas::io::datapack::Serializer< std::array< T, N > >

std::array Serializer specialization.

Serialization scheme
item_1 item_2 ... item_n
Template Parameters
Tvalue type
Narray size

Member Function Documentation

◆ size()

template<typename T , std::size_t N>
template<typename PackType >
static std::size_t fpmas::io::datapack::Serializer< std::array< T, N > >::size ( const PackType &  p,
const std::array< T, N > &  array 
)
inlinestatic

Returns the buffer size required to serialize the specified array, i.e. the sum of p.size(item) for each item in array.

◆ to_datapack()

template<typename T , std::size_t N>
template<typename PackType >
static void fpmas::io::datapack::Serializer< std::array< T, N > >::to_datapack ( PackType &  pack,
const std::array< T, N > &  array 
)
inlinestatic

Serializes array to pack.

Each item is serialized using the PackType::put(const T&) method.

Parameters
packdestination BasicObjectPack
arrayarray to serialize

◆ from_datapack()

template<typename T , std::size_t N>
template<typename PackType >
static std::array< T, N > fpmas::io::datapack::Serializer< std::array< T, N > >::from_datapack ( const PackType &  pack)
inlinestatic

Unserializes an array from pack.

Each item of the array is unserialized using the PackType::get<T>() method.

Parameters
packsource BasicObjectPack
Returns
unserialized array

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