Public Member Functions | Private Attributes | List of all members
eprosima::fastcdr::_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. The iterator points any position. More...
 
 _FastBuffer_iterator (char *buffer, size_t index)
 Constructor. The iterator points to the indicated position. More...
 
void memcopy (const void *src, const size_t size)
 This function copies a buffer into the raw buffer. More...
 
char * operator& ()
 This function returns the current position in the raw buffer. 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...
 
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...
 
void operator<< (const _FastBuffer_iterator &iterator)
 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. More...
 
template<typename _T >
void operator<< (const _T &data)
 This operator copies a data in the raw buffer. The copy uses the size of the data type. More...
 
void operator>> (const _FastBuffer_iterator &iterator)
 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. More...
 
template<typename _T >
void operator>> (_T &data)
 This operator copies data from the raw buffer to a variable. The copy uses the size of the data type. More...
 
void rmemcopy (void *dst, const size_t size)
 This function copies from the raw buffer to a external buffer. More...
 

Private Attributes

char * m_buffer
 Pointer to the raw buffer. More...
 
char * m_currentPosition
 Current position in the raw buffer. More...
 

Detailed Description

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

Definition at line 42 of file FastBuffer.h.

Constructor & Destructor Documentation

◆ _FastBuffer_iterator() [1/2]

eprosima::fastcdr::_FastBuffer_iterator::_FastBuffer_iterator ( )
inline

Default constructor. The iterator points any position.

Definition at line 50 of file FastBuffer.h.

◆ _FastBuffer_iterator() [2/2]

eprosima::fastcdr::_FastBuffer_iterator::_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.

Definition at line 62 of file FastBuffer.h.

Member Function Documentation

◆ memcopy()

void eprosima::fastcdr::_FastBuffer_iterator::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.

Definition at line 130 of file FastBuffer.h.

◆ operator&()

char* eprosima::fastcdr::_FastBuffer_iterator::operator & ( )
inline

This function returns the current position in the raw buffer.

Returns
The current position in the raw buffer.

Definition at line 208 of file FastBuffer.h.

◆ operator++() [1/2]

_FastBuffer_iterator eprosima::fastcdr::_FastBuffer_iterator::operator++ ( )
inline

This function increments the iterator in one the position.

Returns
The current iterator.

Definition at line 184 of file FastBuffer.h.

◆ operator++() [2/2]

_FastBuffer_iterator eprosima::fastcdr::_FastBuffer_iterator::operator++ ( int  )
inline

This function increments the iterator in one the position.

Returns
The current iterator.

Definition at line 195 of file FastBuffer.h.

◆ operator+=()

void eprosima::fastcdr::_FastBuffer_iterator::operator+= ( size_t  numBytes)
inline

This function increments the position where the iterator points.

Parameters
numBytesNumber of bytes the iterator moves the position.

Definition at line 161 of file FastBuffer.h.

◆ operator-()

size_t eprosima::fastcdr::_FastBuffer_iterator::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.

Definition at line 173 of file FastBuffer.h.

◆ operator<<() [1/2]

void eprosima::fastcdr::_FastBuffer_iterator::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.

Definition at line 77 of file FastBuffer.h.

◆ operator<<() [2/2]

template<typename _T >
void eprosima::fastcdr::_FastBuffer_iterator::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.

Definition at line 105 of file FastBuffer.h.

◆ operator>>() [1/2]

void eprosima::fastcdr::_FastBuffer_iterator::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.

Definition at line 91 of file FastBuffer.h.

◆ operator>>() [2/2]

template<typename _T >
void eprosima::fastcdr::_FastBuffer_iterator::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.

Definition at line 118 of file FastBuffer.h.

◆ rmemcopy()

void eprosima::fastcdr::_FastBuffer_iterator::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.

Definition at line 146 of file FastBuffer.h.

Member Data Documentation

◆ m_buffer

char* eprosima::fastcdr::_FastBuffer_iterator::m_buffer
private

Pointer to the raw buffer.

Definition at line 216 of file FastBuffer.h.

◆ m_currentPosition

char* eprosima::fastcdr::_FastBuffer_iterator::m_currentPosition
private

Current position in the raw buffer.

Definition at line 219 of file FastBuffer.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:12:56