My Project
Loading...
Searching...
No Matches
Opm::Serialization::MemPacker Struct Reference

Struct handling packing of serialization to a memory buffer. More...

#include <MemPacker.hpp>

Public Member Functions

template<class T >
std::size_t packSize (const T &data) const
 Calculates the pack size for a variable.
 
template<class T >
std::size_t packSize (const T *data, std::size_t n) const
 Calculates the pack size for an array.
 
template<class T >
void pack (const T &data, std::vector< char > &buffer, int &position) const
 Pack a variable.
 
template<class T >
void pack (const T *data, std::size_t n, std::vector< char > &buffer, int &position) const
 Pack an array.
 
template<class T >
void unpack (T &data, std::vector< char > &buffer, int &position) const
 Unpack a variable.
 
template<class T >
void unpack (T *data, std::size_t n, std::vector< char > &buffer, int &position) const
 Unpack an array.
 

Detailed Description

Struct handling packing of serialization to a memory buffer.

Member Function Documentation

◆ pack() [1/2]

template<class T >
void Opm::Serialization::MemPacker::pack ( const T &  data,
std::vector< char > &  buffer,
int &  position 
) const
inline

Pack a variable.

Template Parameters
TThe type of the data to be packed
Parameters
dataThe variable to pack
bufferBuffer to pack into
positionPosition in buffer to use

◆ pack() [2/2]

template<class T >
void Opm::Serialization::MemPacker::pack ( const T *  data,
std::size_t  n,
std::vector< char > &  buffer,
int &  position 
) const
inline

Pack an array.

Template Parameters
TThe type of the data to be packed
Parameters
dataThe array to pack
nLength of array
bufferBuffer to pack into
positionPosition in buffer to use

◆ packSize() [1/2]

template<class T >
std::size_t Opm::Serialization::MemPacker::packSize ( const T &  data) const
inline

Calculates the pack size for a variable.

Template Parameters
TThe type of the data to be packed
Parameters
dataThe data to pack

◆ packSize() [2/2]

template<class T >
std::size_t Opm::Serialization::MemPacker::packSize ( const T *  data,
std::size_t  n 
) const
inline

Calculates the pack size for an array.

Template Parameters
TThe type of the data to be packed
Parameters
dataThe array to pack
nLength of array

◆ unpack() [1/2]

template<class T >
void Opm::Serialization::MemPacker::unpack ( T &  data,
std::vector< char > &  buffer,
int &  position 
) const
inline

Unpack a variable.

Template Parameters
TThe type of the data to be unpacked
Parameters
dataThe variable to unpack
bufferBuffer to unpack from
positionPosition in buffer to use

◆ unpack() [2/2]

template<class T >
void Opm::Serialization::MemPacker::unpack ( T *  data,
std::size_t  n,
std::vector< char > &  buffer,
int &  position 
) const
inline

Unpack an array.

Template Parameters
TThe type of the data to be unpacked
Parameters
dataThe array to unpack
nLength of array
bufferBuffer to unpack from
positionPosition in buffer to use

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