fpmas 1.6
Static Public Member Functions | List of all members
fpmas::io::datapack::Serializer< std::string > Struct Reference

#include <datapack.h>

Static Public Member Functions

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

Detailed Description

std::string Serializer specialization.

| Serialization Scheme || | str.size() | str.data() (char array) ||

Member Function Documentation

◆ size()

template<typename PackType >
static std::size_t fpmas::io::datapack::Serializer< std::string >::size ( const PackType &  ,
const std::string &  str 
)
inlinestatic

Returns the buffer size, in bytes, required to serialize an std::string instance, i.e. sizeof(std::size_t)+str.size().

Notice that this does not depend upon the current PackType, since the std::string is directly copied to the internal PackType DataPack buffer.

◆ to_datapack()

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

Writes str to the pack buffer.

Parameters
packdestination BasicObjectPack
strsource string

◆ from_datapack()

template<typename PackType >
static std::string fpmas::io::datapack::Serializer< std::string >::from_datapack ( const PackType &  pack)
inlinestatic

Reads an std::string from the pack buffer.

Parameters
packsource BasicObjectPack
Returns
unserialized std::string

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