Fast CDR  Version 1.0.23
Fast CDR
_FastBuffer_iterator Class Reference

This class implements the iterator used to go through a FastBuffer. More...

#include <FastBuffer.h>

Public Member Functions

 _FastBuffer_iterator ()
 Default constructor. More...
 
 _FastBuffer_iterator (char *buffer, size_t index)
 Constructor. More...
 
void operator<< (const _FastBuffer_iterator &iterator)
 This operator changes the iterator's raw buffer. More...
 
void operator>> (const _FastBuffer_iterator &iterator)
 This operator changes the position where the iterator points. More...
 
template<typename _T >
void operator<< (const _T &data)
 This operator copies a data in the raw buffer. More...
 
template<typename _T >
void operator>> (_T &data)
 This operator copies data from the raw buffer to a variable. More...
 
void memcopy (const void *src, const size_t size)
 This function copies a buffer into the raw buffer. More...
 
void rmemcopy (void *dst, const size_t size)
 This function copies from the raw buffer to a external buffer. More...
 
void operator+= (size_t numBytes)
 This function increments the position where the iterator points. More...
 
size_t operator- (const _FastBuffer_iterator &it) const
 This operator returns the subtraction of the current interator's position and the source iterator's position. More...
 
_FastBuffer_iterator operator++ ()
 This function increments the iterator in one the position. More...
 
_FastBuffer_iterator operator++ (int)
 This function increments the iterator in one the position. More...
 
char * operator& ()
 This function returns the current position in the raw buffer. More...
 

Detailed Description

This class implements the iterator used to go through a FastBuffer.

Constructor & Destructor Documentation

◆ _FastBuffer_iterator() [1/2]

Default constructor.

The iterator points any position.

◆ _FastBuffer_iterator() [2/2]

_FastBuffer_iterator ( char *  buffer,
size_t  index 
)
inlineexplicit

Constructor.

The iterator points to the indicated position.

Parameters
bufferPointer to the raw buffer.
indexPosition of the raw buffer where the iterator will point.

Member Function Documentation

◆ memcopy()

void memcopy ( const void *  src,
const size_t  size 
)
inline

This function copies a buffer into the raw buffer.

Parameters
srcThe source buffer.
sizeThe number of bytes to be copied.

◆ operator&()

char* operator& ( )
inline

This function returns the current position in the raw buffer.

Returns
The current position in the raw buffer.

◆ operator++() [1/2]

_FastBuffer_iterator operator++ ( )
inline

This function increments the iterator in one the position.

Returns
The current iterator.

◆ operator++() [2/2]

_FastBuffer_iterator operator++ ( int  )
inline

This function increments the iterator in one the position.

Returns
The current iterator.

◆ operator+=()

void operator+= ( size_t  numBytes)
inline

This function increments the position where the iterator points.

Parameters
numBytesNumber of bytes the iterator moves the position.

◆ operator-()

size_t operator- ( const _FastBuffer_iterator it) const
inline

This operator returns the subtraction of the current interator's position and the source iterator's position.

Parameters
itSource iterator whose position is subtracted to the current iterator's position.
Returns
The result of subtract the current iterator's position and the source iterator's position.

◆ operator<<() [1/2]

void operator<< ( const _FastBuffer_iterator iterator)
inline

This operator changes the iterator's raw buffer.

This operator makes the iterator point to the same position but in another raw buffer. The new raw buffer is the same than the source iterator's.

Parameters
iteratorThe source iterator. The iterator will use the source iterator's raw buffer after this operation.

◆ operator<<() [2/2]

void operator<< ( const _T &  data)
inline

This operator copies a data in the raw buffer.

The copy uses the size of the data type.

Parameters
dataData to be copied. Cannot be NULL.

◆ operator>>() [1/2]

void operator>> ( _T &  data)
inline

This operator copies data from the raw buffer to a variable.

The copy uses the size of the data type.

Parameters
dataData to be filled.

◆ operator>>() [2/2]

void operator>> ( const _FastBuffer_iterator iterator)
inline

This operator changes the position where the iterator points.

This operator takes the index of the source iterator, but the iterator continues using its raw buffer.

Parameters
iteratorThe source iterator. The iterator will use the source's iterator index to point to its own raw buffer.

◆ rmemcopy()

void rmemcopy ( void *  dst,
const size_t  size 
)
inline

This function copies from the raw buffer to a external buffer.

Parameters
dstThe destination buffer.
sizeThe size of bytes to be copied.

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