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
 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...
 
bool operator!= (const _FastBuffer_iterator &other_iterator) const
 
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 num_bytes)
 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-= (size_t num_bytes)
 
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...
 
bool operator== (const _FastBuffer_iterator &other_iterator) const
 
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 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...
 
void rmemcopy (void *dst, const size_t size)
 This function copies from the raw buffer to a external buffer. More...
 

Private Attributes

char * buffer_ {nullptr}
 Pointer to the raw buffer. More...
 
char * current_position_ {nullptr}
 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 ( )
default

Default constructor. The iterator points any position.

◆ _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 58 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 126 of file FastBuffer.h.

◆ operator!=()

bool eprosima::fastcdr::_FastBuffer_iterator::operator!= ( const _FastBuffer_iterator other_iterator) const
inline

Definition at line 222 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 211 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 187 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 198 of file FastBuffer.h.

◆ operator+=()

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

This function increments the position where the iterator points.

Parameters
num_bytesNumber of bytes the iterator moves the position.

Definition at line 157 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 176 of file FastBuffer.h.

◆ operator-=()

void eprosima::fastcdr::_FastBuffer_iterator::operator-= ( size_t  num_bytes)
inline

Definition at line 164 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 73 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 101 of file FastBuffer.h.

◆ operator==()

bool eprosima::fastcdr::_FastBuffer_iterator::operator== ( const _FastBuffer_iterator other_iterator) const
inline

Definition at line 216 of file FastBuffer.h.

◆ operator>>() [1/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 114 of file FastBuffer.h.

◆ operator>>() [2/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 87 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 142 of file FastBuffer.h.

Member Data Documentation

◆ buffer_

char* eprosima::fastcdr::_FastBuffer_iterator::buffer_ {nullptr}
private

Pointer to the raw buffer.

Definition at line 231 of file FastBuffer.h.

◆ current_position_

char* eprosima::fastcdr::_FastBuffer_iterator::current_position_ {nullptr}
private

Current position in the raw buffer.

Definition at line 234 of file FastBuffer.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:30