NDEVR
API Documentation
BufferInsertIterator< t_type, t_buffer >

Used by stl library to insert objects into the buffer. More...

Public Types

using difference_type = ptrdiff_t
 Type used for iterator difference calculations.
using iterator_category = std::random_access_iterator_tag
 STL iterator category tag.
using pointer = t_type*
 Pointer type for the value type.
using reference = t_type&
 Reference type for the value type.
using value_type = t_type
 The type of elements being inserted.

Public Member Functions

 BufferInsertIterator (t_buffer &container, int i)
 Constructs a BufferInsertIterator at a given position.
BufferInsertIterator< t_type, t_buffer > & operator* ()
 Dereference operator.
const BufferInsertIterator< t_type, t_buffer > & operator* () const
 Const dereference operator.
BufferInsertIterator< t_type, t_buffer > & operator++ ()
 Pre-increment operator.
BufferInsertIterator< t_type, t_buffer > & operator++ (int val)
 Post-increment operator.
BufferInsertIterator< t_type, t_buffer > & operator= (const t_type &value)
 Inserts a copy of the given value at the current location and advances the iterator.
BufferInsertIterator< t_type, t_buffer > & operator= (t_type &&value)
 Moves the given value into the buffer at the current location and advances the iterator.

Protected Attributes

t_buffer * m_container
 Pointer to the buffer being inserted into.
uint04 m_location
 Current insertion index within the buffer.

Detailed Description

template<class t_type, class t_buffer>
class BufferInsertIterator< t_type, t_buffer >

Used by stl library to insert objects into the buffer.


Definition at line 48 of file BufferFunctions.h.

Constructor & Destructor Documentation

◆ BufferInsertIterator()

template<class t_type, class t_buffer>
BufferInsertIterator< t_type, t_buffer >::BufferInsertIterator ( t_buffer & container,
int i )
inlineexplicit

Constructs a BufferInsertIterator at a given position.

Parameters
[in]containerThe buffer to insert elements into.
[in]iThe starting insertion index.

Definition at line 65 of file BufferFunctions.h.

References m_container, and m_location.

Referenced by operator*(), operator*(), operator++(), operator++(), operator=(), and operator=().

Member Function Documentation

◆ operator*() [1/2]

template<class t_type, class t_buffer>
BufferInsertIterator< t_type, t_buffer > & BufferInsertIterator< t_type, t_buffer >::operator* ( )
inline

Dereference operator.

Returns a reference to this iterator for STL compatibility.

Returns
A reference to this iterator.

Definition at line 119 of file BufferFunctions.h.

References BufferInsertIterator().

◆ operator*() [2/2]

template<class t_type, class t_buffer>
const BufferInsertIterator< t_type, t_buffer > & BufferInsertIterator< t_type, t_buffer >::operator* ( ) const
inline

Const dereference operator.

Returns a const reference to this iterator for STL compatibility.

Returns
A const reference to this iterator.

Definition at line 127 of file BufferFunctions.h.

References BufferInsertIterator().

◆ operator++() [1/2]

template<class t_type, class t_buffer>
BufferInsertIterator< t_type, t_buffer > & BufferInsertIterator< t_type, t_buffer >::operator++ ( )
inline

Pre-increment operator.

Advances the insertion position by one.

Returns
A reference to this iterator.

Definition at line 96 of file BufferFunctions.h.

References BufferInsertIterator(), getMin(), m_container, and m_location.

◆ operator++() [2/2]

template<class t_type, class t_buffer>
BufferInsertIterator< t_type, t_buffer > & BufferInsertIterator< t_type, t_buffer >::operator++ ( int val)
inline

Post-increment operator.

Advances the insertion position by the given amount.

Parameters
[in]valThe number of positions to advance.
Returns
A reference to this iterator.

Definition at line 108 of file BufferFunctions.h.

References BufferInsertIterator(), cast(), getMin(), m_container, and m_location.

◆ operator=() [1/2]

template<class t_type, class t_buffer>
BufferInsertIterator< t_type, t_buffer > & BufferInsertIterator< t_type, t_buffer >::operator= ( const t_type & value)
inline

Inserts a copy of the given value at the current location and advances the iterator.

Parameters
[in]valueThe value to insert.
Returns
A reference to this iterator.

Definition at line 75 of file BufferFunctions.h.

References BufferInsertIterator(), m_container, and m_location.

◆ operator=() [2/2]

template<class t_type, class t_buffer>
BufferInsertIterator< t_type, t_buffer > & BufferInsertIterator< t_type, t_buffer >::operator= ( t_type && value)
inline

Moves the given value into the buffer at the current location and advances the iterator.

Parameters
[in]valueThe value to move-insert.
Returns
A reference to this iterator.

Definition at line 86 of file BufferFunctions.h.

References BufferInsertIterator(), m_container, and m_location.


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