SUNphi  1.0
SUNphi::Binarizer Class Reference

Class to convert objects to and from binary. More...

#include <Binarize.hpp>

Public Member Functions

size_t size () const
 Used size.
 
auto begin ()
 
auto end ()
 
const auto begin () const
 
const auto end () const
 
template<typename T , TypeIf<(hasMember_binarize< T >), void * > = nullptr>
Binarizerbinarize (const T &rhs)
 Write on the binarizer, if the type has a member binarize.
 
template<typename T , TypeIf<(hasMember_deBinarize< T >), void * > = nullptr>
BinarizerdeBinarize (T &rhs)
 Read from the binarizer, if the type has a member deBinarize.
 
template<typename T , TypeIf<(std::is_trivially_copyable_v< T >), void * > = nullptr>
Binarizerbinarize (const T &rhs)
 Write on the binarizer.
 
template<typename T , TypeIf<(std::is_trivially_copyable_v< T >), void * > = nullptr>
BinarizerdeBinarize (T &rhs)
 Read from the binarizer.
 
template<typename T , TypeIf<(isTupleLike< T >), void * > = nullptr>
Binarizerbinarize (T &&rhs)
 Binarize a tuple-like. More...
 
template<typename T , TypeIf<(isTupleLike< T >), void * > = nullptr>
BinarizerdeBinarize (T &&rhs)
 DeBinarize a tuple-like. More...
 
template<typename T , TypeIf<(isVectorLike< T >), void * > = nullptr>
Binarizerbinarize (T &&rhs)
 Binarize a vector-like. More...
 
template<typename T , TypeIf<(isVectorLike< T >), void * > = nullptr>
BinarizerdeBinarize (T &&rhs)
 DeBinarize a vector-like. More...
 
void restartReading ()
 Restart from head.
 
void clear ()
 Restart to write.
 

Private Member Functions

BinarizerpushBack (const void *data, const size_t &size)
 Push data on the back. More...
 
BinarizerreadAdvancing (void *out, const size_t &size)
 Push data on the back. More...
 

Private Attributes

std::vector< char > buf
 Buffer.
 
size_t readPos {0}
 Reading position.
 

Detailed Description

Class to convert objects to and from binary.

Definition at line 29 of file Binarize.hpp.

Member Function Documentation

auto SUNphi::Binarizer::begin ( )
inline

Pointer to the beginning of the buffer

Definition at line 88 of file Binarize.hpp.

const auto SUNphi::Binarizer::begin ( ) const
inline

Pointer to the beginning of the buffer

Definition at line 89 of file Binarize.hpp.

template<typename T , TypeIf<(isTupleLike< T >), void * > = nullptr>
Binarizer& SUNphi::Binarizer::binarize ( T &&  rhs)
inline

Binarize a tuple-like.

Parameters
rhsInput

Definition at line 132 of file Binarize.hpp.

template<typename T , TypeIf<(isVectorLike< T >), void * > = nullptr>
Binarizer& SUNphi::Binarizer::binarize ( T &&  rhs)
inline

Binarize a vector-like.

Number of elements

Parameters
rhsInput

Definition at line 162 of file Binarize.hpp.

template<typename T , TypeIf<(isTupleLike< T >), void * > = nullptr>
Binarizer& SUNphi::Binarizer::deBinarize ( T &&  rhs)
inline

DeBinarize a tuple-like.

Parameters
rhsOutput

Definition at line 147 of file Binarize.hpp.

template<typename T , TypeIf<(isVectorLike< T >), void * > = nullptr>
Binarizer& SUNphi::Binarizer::deBinarize ( T &&  rhs)
inline

DeBinarize a vector-like.

Number of elements

Parameters
rhsOutput

Definition at line 180 of file Binarize.hpp.

auto SUNphi::Binarizer::end ( )
inline

Pointer to the end of the buffer

Definition at line 88 of file Binarize.hpp.

const auto SUNphi::Binarizer::end ( ) const
inline

Pointer to the end of the buffer

Definition at line 89 of file Binarize.hpp.

Binarizer& SUNphi::Binarizer::pushBack ( const void *  data,
const size_t &  size 
)
inlineprivate

Push data on the back.

Parameters
dataData to be pushed
sizeData size

Definition at line 38 of file Binarize.hpp.

Binarizer& SUNphi::Binarizer::readAdvancing ( void *  out,
const size_t &  size 
)
inlineprivate

Push data on the back.

Parameters
outData to be filled
sizeData size

Definition at line 48 of file Binarize.hpp.


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