Class _FastBuffer_iterator
Defined in File FastBuffer.h
Class Documentation
-
class _FastBuffer_iterator
This class implements the iterator used to go through a FastBuffer.
Public Functions
-
_FastBuffer_iterator() = default
Default constructor. The iterator points any position.
-
inline explicit _FastBuffer_iterator(char *buffer, size_t index)
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.
-
inline 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.
- Parameters:
iterator – The source iterator. The iterator will use the source iterator’s raw buffer after this operation.
-
inline 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.
- Parameters:
iterator – The source iterator. The iterator will use the source’s iterator index to point to its own raw buffer.
-
template<typename _T>
inline void operator<<(const _T &data) 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.
-
template<typename _T>
inline void operator>>(_T &data) 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.
-
inline void memcopy(const void *src, const size_t size)
This function copies a buffer into the raw buffer.
- Parameters:
src – The source buffer.
size – The number of bytes to be copied.
-
inline void rmemcopy(void *dst, const size_t size)
This function copies from the raw buffer to a external buffer.
- Parameters:
dst – The destination buffer.
size – The size of bytes to be copied.
-
inline void operator+=(size_t num_bytes)
This function increments the position where the iterator points.
- Parameters:
num_bytes – Number of bytes the iterator moves the position.
-
inline void operator-=(size_t num_bytes)
-
inline 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.
- 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.
-
inline _FastBuffer_iterator operator++()
This function increments the iterator in one the position.
- Returns:
The current iterator.
-
inline _FastBuffer_iterator operator++(int)
This function increments the iterator in one the position.
- Returns:
The current iterator.
-
inline char *operator&()
This function returns the current position in the raw buffer.
- Returns:
The current position in the raw buffer.
-
inline bool operator==(const _FastBuffer_iterator &other_iterator) const
-
inline bool operator!=(const _FastBuffer_iterator &other_iterator) const
-
_FastBuffer_iterator() = default