fpmas 1.5
Static Public Member Functions | List of all members
fpmas::io::datapack::Serializer< T, typename std::enable_if< std::is_fundamental< T >::value >::type > Struct Template Reference

#include <datapack.h>

Static Public Member Functions

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

Detailed Description

template<typename T>
struct fpmas::io::datapack::Serializer< T, typename std::enable_if< std::is_fundamental< T >::value >::type >

Serializer implementation only available for fundamental types.

Serialization Scheme
raw binary value
Template Parameters
Tfundamental type (std::size_t, std::int32_t, unsigned int...)

Member Function Documentation

◆ size() [1/2]

template<typename T >
template<typename PackType >
static std::size_t fpmas::io::datapack::Serializer< T, typename std::enable_if< std::is_fundamental< T >::value >::type >::size ( const PackType &  )
inlinestatic

Returns the buffer size required to serialize an instance of T.

This fundamental type implementation returns sizeof(T).

◆ size() [2/2]

template<typename T >
template<typename PackType >
static std::size_t fpmas::io::datapack::Serializer< T, typename std::enable_if< std::is_fundamental< T >::value >::type >::size ( const PackType &  ,
const T &   
)
inlinestatic

Equivalent to size(const PackType&).

◆ to_datapack()

template<typename T >
template<typename PackType >
static void fpmas::io::datapack::Serializer< T, typename std::enable_if< std::is_fundamental< T >::value >::type >::to_datapack ( PackType &  pack,
const T &  item 
)
inlinestatic

Writes item to the pack buffer using a pack.write() operation.

Parameters
packdestination BasicObjectPack
itemsource data

◆ from_datapack()

template<typename T >
template<typename PackType >
static T fpmas::io::datapack::Serializer< T, typename std::enable_if< std::is_fundamental< T >::value >::type >::from_datapack ( const PackType &  pack)
inlinestatic

Reads a instance of T from the pack buffer using a pack.read() operation.

Parameters
packsource BasicObjectPack
Returns
read T instance

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