| Fast CDR Version 2.3.5 Fast CDR

Loading...
Searching...
No Matches
_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.
| _FastBuffer_iterator (char *buffer, size_t index)
| Constructor.
void | operator<< (const _FastBuffer_iterator &iterator)
| This operator changes the iterator's raw buffer.
void | operator>> (const _FastBuffer_iterator &iterator)
| This operator changes the position where the iterator points.
template<typename _T>
void | operator<< (const _T &data)
| This operator copies a data in the raw buffer.
template<typename _T>
void | operator>> (_T &data)
| This operator copies data from the raw buffer to a variable.
void | memcopy (const void *src, const size_t size)
| This function copies a buffer into the raw buffer.
void | rmemcopy (void *dst, const size_t size)
| This function copies from the raw buffer to a external buffer.
void | operator+= (size_t num_bytes)
| This function increments the position where the iterator points.
void | operator-= (size_t num_bytes)
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.
_FastBuffer_iterator | operator++ ()
| This function increments the iterator in one the position.
_FastBuffer_iterator | operator++ (int)
| This function increments the iterator in one the position.
char * | operator& ()
| This function returns the current position in the raw buffer.
bool | operator== (const _FastBuffer_iterator &other_iterator) const
bool | operator!= (const _FastBuffer_iterator &other_iterator) const

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ _FastBuffer_iterator() [1/2]

_FastBuffer_iterator | ( |  | ) |

default

Default constructor.

The iterator points any position.

## ◆ _FastBuffer_iterator() [2/2]

_FastBuffer_iterator | ( | char * | buffer,
|  | size_t | index )

inline explicit

Constructor.

The iterator points to the indicated position.

Parameters

  buffer | Pointer to the raw buffer.
  index | Position 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

  src | The source buffer.
  size | The number of bytes to be copied.

## ◆ operator!=()

bool operator!= | ( | const _FastBuffer_iterator & | other_iterator | ) | const

inline

## ◆ 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 | num_bytes | ) |

inline

This function increments the position where the iterator points.

Parameters

  num_bytes | Number 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

  it | Source 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-=()

void operator-= | ( | size_t | num_bytes | ) |

inline

## ◆ 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

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

## ◆ operator<<() [2/2]

template<typename _T>

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

  data | Data to be copied. Cannot be NULL.

## ◆ operator==()

bool operator== | ( | const _FastBuffer_iterator & | other_iterator | ) | const

inline

## ◆ operator>>() [1/2]

template<typename _T>

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

  data | Data 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

  iterator | The 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

  dst | The destination buffer.
  size | The size of bytes to be copied.

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

- include/fastcdr/FastBuffer.h