Embedded Multicore Building Blocks V1.0.0
Public Member Functions | List of all members
embb::containers::WaitFreeArrayValuePool< Type, Undefined, Allocator >::Iterator Class Reference

Forward iterator to iterate over the allocated elements of the pool. More...

#include <wait_free_array_value_pool.h>

Public Member Functions

 Iterator ()
 Constructs an invalid iterator. More...
 
 Iterator (Iterator const &other)
 Copies an iterator. More...
 
Iteratoroperator= (Iterator const &other)
 Copies an iterator. More...
 
Iteratoroperator++ ()
 Pre-increments an iterator. More...
 
Iterator operator++ (int)
 Post-increments an iterator. More...
 
bool operator== (Iterator const &rhs)
 Compares two iterators for equality. More...
 
bool operator!= (Iterator const &rhs)
 Compares two iterators for inequality. More...
 
std::pair< int, Type > operator* ()
 Dereferences the iterator. More...
 

Detailed Description

template<typename Type, Type Undefined, class Allocator = embb::base::Allocator< embb::base::Atomic<Type> >>
class embb::containers::WaitFreeArrayValuePool< Type, Undefined, Allocator >::Iterator

Forward iterator to iterate over the allocated elements of the pool.

Note
Iterators are invalidated by any change to the pool (Allocate and Free calls).

Constructor & Destructor Documentation

template<typename Type, Type Undefined, class Allocator = embb::base::Allocator< embb::base::Atomic<Type> >>
embb::containers::WaitFreeArrayValuePool< Type, Undefined, Allocator >::Iterator::Iterator ( )

Constructs an invalid iterator.

Concurrency
Thread-safe and wait-free
template<typename Type, Type Undefined, class Allocator = embb::base::Allocator< embb::base::Atomic<Type> >>
embb::containers::WaitFreeArrayValuePool< Type, Undefined, Allocator >::Iterator::Iterator ( Iterator const &  other)

Copies an iterator.

Concurrency
Thread-safe and wait-free
Parameters
[in]otherIterator to copy.

Member Function Documentation

template<typename Type, Type Undefined, class Allocator = embb::base::Allocator< embb::base::Atomic<Type> >>
Iterator& embb::containers::WaitFreeArrayValuePool< Type, Undefined, Allocator >::Iterator::operator= ( Iterator const &  other)

Copies an iterator.

Returns
Reference to this iterator.
Concurrency
Thread-safe and wait-free
Parameters
[in]otherIterator to copy.
template<typename Type, Type Undefined, class Allocator = embb::base::Allocator< embb::base::Atomic<Type> >>
Iterator& embb::containers::WaitFreeArrayValuePool< Type, Undefined, Allocator >::Iterator::operator++ ( )

Pre-increments an iterator.

Returns
Reference to this iterator.
Concurrency
Not thread-safe
template<typename Type, Type Undefined, class Allocator = embb::base::Allocator< embb::base::Atomic<Type> >>
Iterator embb::containers::WaitFreeArrayValuePool< Type, Undefined, Allocator >::Iterator::operator++ ( int  )

Post-increments an iterator.

Returns
Copy of this iterator before increment.
Concurrency
Not thread-safe
template<typename Type, Type Undefined, class Allocator = embb::base::Allocator< embb::base::Atomic<Type> >>
bool embb::containers::WaitFreeArrayValuePool< Type, Undefined, Allocator >::Iterator::operator== ( Iterator const &  rhs)

Compares two iterators for equality.

Returns
true, if the two iterators are equal, false otherwise.
Concurrency
Thread-safe and wait-free
Parameters
[in]rhsIterator to compare to.
template<typename Type, Type Undefined, class Allocator = embb::base::Allocator< embb::base::Atomic<Type> >>
bool embb::containers::WaitFreeArrayValuePool< Type, Undefined, Allocator >::Iterator::operator!= ( Iterator const &  rhs)

Compares two iterators for inequality.

Returns
true, if the two iterators are not equal, false otherwise.
Concurrency
Thread-safe and wait-free
Parameters
[in]rhsIterator to compare to.
template<typename Type, Type Undefined, class Allocator = embb::base::Allocator< embb::base::Atomic<Type> >>
std::pair<int, Type> embb::containers::WaitFreeArrayValuePool< Type, Undefined, Allocator >::Iterator::operator* ( )

Dereferences the iterator.

Returns
A pair consisting of index and value of the element pointed to.
Concurrency
Thread-safe and wait-free