CatapultServer  v0.5.0.1 (Elephant)
catapult::utils::ModificationSafeIterableContainer< TContainer > Class Template Reference

Wraps a container type and provides modification-safe iteration support. More...

Collaboration diagram for catapult::utils::ModificationSafeIterableContainer< TContainer >:

Public Types

using value_type = typename TContainer::value_type
 
using iterator = typename TContainer::iterator
 

Public Member Functions

size_t size () const
 Gets the number of elements in the container. More...
 
bool empty () const
 Gets a value indicating whether or not the container is empty. More...
 
auto cbegin () const
 Returns a const iterator that represents the first entity. More...
 
auto cend () const
 Returns a const iterator that represents one past the last entity. More...
 
auto begin ()
 Returns an iterator that represents the first entity. More...
 
auto end ()
 Returns an iterator that represents one past the last entity. More...
 
value_typenext ()
 Gets a pointer to the next value or nullptr if this container is empty. More...
 
template<typename TPredicate >
value_typenextIf (TPredicate predicate)
 
void push_back (const value_type &value)
 Adds a new element at the end of the container. More...
 
void erase (iterator position)
 Removes a single element at position from the container. More...
 
void clear ()
 Removes all elements from the container. More...
 

Private Attributes

TContainer m_container
 
iterator m_iter
 

Detailed Description

template<typename TContainer>
class catapult::utils::ModificationSafeIterableContainer< TContainer >

Wraps a container type and provides modification-safe iteration support.

Member Typedef Documentation

◆ iterator

template<typename TContainer >
using catapult::utils::ModificationSafeIterableContainer< TContainer >::iterator = typename TContainer::iterator

◆ value_type

template<typename TContainer >
using catapult::utils::ModificationSafeIterableContainer< TContainer >::value_type = typename TContainer::value_type

Member Function Documentation

◆ begin()

template<typename TContainer >
auto catapult::utils::ModificationSafeIterableContainer< TContainer >::begin ( )
inline

Returns an iterator that represents the first entity.

◆ cbegin()

template<typename TContainer >
auto catapult::utils::ModificationSafeIterableContainer< TContainer >::cbegin ( ) const
inline

Returns a const iterator that represents the first entity.

◆ cend()

template<typename TContainer >
auto catapult::utils::ModificationSafeIterableContainer< TContainer >::cend ( ) const
inline

Returns a const iterator that represents one past the last entity.

◆ clear()

template<typename TContainer >
void catapult::utils::ModificationSafeIterableContainer< TContainer >::clear ( )
inline

Removes all elements from the container.

◆ empty()

template<typename TContainer >
bool catapult::utils::ModificationSafeIterableContainer< TContainer >::empty ( ) const
inline

Gets a value indicating whether or not the container is empty.

Here is the caller graph for this function:

◆ end()

template<typename TContainer >
auto catapult::utils::ModificationSafeIterableContainer< TContainer >::end ( )
inline

Returns an iterator that represents one past the last entity.

◆ erase()

template<typename TContainer >
void catapult::utils::ModificationSafeIterableContainer< TContainer >::erase ( iterator  position)
inline

Removes a single element at position from the container.

◆ next()

template<typename TContainer >
value_type* catapult::utils::ModificationSafeIterableContainer< TContainer >::next ( )
inline

Gets a pointer to the next value or nullptr if this container is empty.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nextIf()

template<typename TContainer >
template<typename TPredicate >
value_type* catapult::utils::ModificationSafeIterableContainer< TContainer >::nextIf ( TPredicate  predicate)
inline

Gets a pointer to the next value for which predicate returns true or nullptr if this container contains no matching values.

Here is the call graph for this function:

◆ push_back()

template<typename TContainer >
void catapult::utils::ModificationSafeIterableContainer< TContainer >::push_back ( const value_type value)
inline

Adds a new element at the end of the container.

◆ size()

template<typename TContainer >
size_t catapult::utils::ModificationSafeIterableContainer< TContainer >::size ( ) const
inline

Gets the number of elements in the container.

Member Data Documentation

◆ m_container

template<typename TContainer >
TContainer catapult::utils::ModificationSafeIterableContainer< TContainer >::m_container
private

◆ m_iter

template<typename TContainer >
iterator catapult::utils::ModificationSafeIterableContainer< TContainer >::m_iter
private

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