Galois
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
galois::runtime::DeSerializeBuffer Class Reference

Buffer for deserialization of data. More...

#include <Serialize.h>

Public Member Functions

 DeSerializeBuffer ()
 Constructor initializes offset into buffer to 0. More...
 
 DeSerializeBuffer (DeSerializeBuffer &&)=default
 Disable copy constructor. More...
 
 DeSerializeBuffer (vTy &&v, uint32_t start=0)
 Move constructor. More...
 
 DeSerializeBuffer (vTy &data)
 Constructor that takes an existing vector to use as the deserialize buffer. More...
 
 DeSerializeBuffer (int count)
 Initializes the deserialize buffer with a certain size. More...
 
template<typename Iter >
 DeSerializeBuffer (Iter b, Iter e)
 Initializes the deserialize buffer using vector initialization from 2 iterators. More...
 
 DeSerializeBuffer (SerializeBuffer &&buf)
 Initialize a deserialize buffer from a serialize buffer. More...
 
DeSerializeBufferoperator= (DeSerializeBuffer &&buf)=default
 Disable copy constructor. More...
 
void reset (int count)
 Reset deserialize buffer. More...
 
unsigned getOffset () const
 Gets the current offset into the deserialize buffer. More...
 
void setOffset (unsigned off)
 Sets the offset into the deserialize buffer. More...
 
unsigned size () const
 Gets the size of the deserialize buffer. More...
 
bool empty () const
 Returns true if the deserialize buffer is empty. More...
 
unsigned char pop ()
 Get the next character in the deserialize buffer. More...
 
void pop_back (unsigned x)
 Clears the last x bytes of the deserialize buffer, resizing it as well. More...
 
void extract (uint8_t *dst, size_t num)
 Extracts a certain amount of data from the deserialize buffer. More...
 
vTygetVec ()
 Get the underlying vector storing the data of the deserialize buffer. More...
 
void * linearData ()
 Get a pointer to the underlying data of the deserialize buffer. More...
 
const uint8_t * r_linearData () const
 Get a pointer to the remaining data of the deserialize buffer (as determined by offset) More...
 
size_t r_size () const
 Get the remaining size of the deserialize buffer (as determined by offset) More...
 
bool atAlignment (size_t a)
 Checks if the current location in the deserialize buffer is aligned to some size a. More...
 
void print (std::ostream &o) const
 Utility print of deserialize buffer. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const DeSerializeBuffer &buf)
 Operator for printing deserialize buffer. More...
 

Detailed Description

Buffer for deserialization of data.

Mainly used during network communication.

Constructor & Destructor Documentation

galois::runtime::DeSerializeBuffer::DeSerializeBuffer ( )
inline

Constructor initializes offset into buffer to 0.

galois::runtime::DeSerializeBuffer::DeSerializeBuffer ( DeSerializeBuffer &&  )
default

Disable copy constructor.

galois::runtime::DeSerializeBuffer::DeSerializeBuffer ( vTy &&  v,
uint32_t  start = 0 
)
inline

Move constructor.

Parameters
vvector to act as deserialize buffer
startoffset to start saving data into
galois::runtime::DeSerializeBuffer::DeSerializeBuffer ( vTy data)
inlineexplicit

Constructor that takes an existing vector to use as the deserialize buffer.

galois::runtime::DeSerializeBuffer::DeSerializeBuffer ( int  count)
inlineexplicit

Initializes the deserialize buffer with a certain size.

Parameters
[in]countsize to initialize buffer to
template<typename Iter >
galois::runtime::DeSerializeBuffer::DeSerializeBuffer ( Iter  b,
Iter  e 
)
inline

Initializes the deserialize buffer using vector initialization from 2 iterators.

galois::runtime::DeSerializeBuffer::DeSerializeBuffer ( SerializeBuffer &&  buf)
inlineexplicit

Initialize a deserialize buffer from a serialize buffer.

Member Function Documentation

bool galois::runtime::DeSerializeBuffer::atAlignment ( size_t  a)
inline

Checks if the current location in the deserialize buffer is aligned to some size a.

bool galois::runtime::DeSerializeBuffer::empty ( ) const
inline

Returns true if the deserialize buffer is empty.

Returns
true if the deserialize buffer is empty
void galois::runtime::DeSerializeBuffer::extract ( uint8_t *  dst,
size_t  num 
)
inline

Extracts a certain amount of data from the deserialize buffer.

Parameters
dstbuffer to copy data from deserialize buffer into
numAmount of data to get from deserialize buffer
unsigned galois::runtime::DeSerializeBuffer::getOffset ( ) const
inline

Gets the current offset into the deserialize buffer.

vTy& galois::runtime::DeSerializeBuffer::getVec ( )
inline

Get the underlying vector storing the data of the deserialize buffer.

void* galois::runtime::DeSerializeBuffer::linearData ( )
inline

Get a pointer to the underlying data of the deserialize buffer.

DeSerializeBuffer& galois::runtime::DeSerializeBuffer::operator= ( DeSerializeBuffer &&  buf)
default

Disable copy constructor.

unsigned char galois::runtime::DeSerializeBuffer::pop ( )
inline

Get the next character in the deserialize buffer.

void galois::runtime::DeSerializeBuffer::pop_back ( unsigned  x)
inline

Clears the last x bytes of the deserialize buffer, resizing it as well.

Parameters
xHow many bytes from the end to clear
void galois::runtime::DeSerializeBuffer::print ( std::ostream &  o) const
inline

Utility print of deserialize buffer.

Parameters
ostream to print to
const uint8_t* galois::runtime::DeSerializeBuffer::r_linearData ( ) const
inline

Get a pointer to the remaining data of the deserialize buffer (as determined by offset)

size_t galois::runtime::DeSerializeBuffer::r_size ( ) const
inline

Get the remaining size of the deserialize buffer (as determined by offset)

void galois::runtime::DeSerializeBuffer::reset ( int  count)
inline

Reset deserialize buffer.

Parameters
countnew size of buffer
void galois::runtime::DeSerializeBuffer::setOffset ( unsigned  off)
inline

Sets the offset into the deserialize buffer.

unsigned galois::runtime::DeSerializeBuffer::size ( ) const
inline

Gets the size of the deserialize buffer.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const DeSerializeBuffer buf 
)
friend

Operator for printing deserialize buffer.


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