VPTissue Reference Manual
SimPT_Sim::Container::SVIterator< T, N, P, R, is_const_iterator > Class Template Reference

Implementation of iterator for SegmentedVector. More...

#include <SVIterator.h>

Inheritance diagram for SimPT_Sim::Container::SVIterator< T, N, P, R, is_const_iterator >:
Inheritance graph
Collaboration diagram for SimPT_Sim::Container::SVIterator< T, N, P, R, is_const_iterator >:
Collaboration graph

Public Types

using self_type = SVIterator< T, N, P, R, is_const_iterator >
 

Public Member Functions

 SVIterator ()
 Default constructor.
 
 SVIterator (const self_type &other)
 Copy constructor.
 
bool operator!= (const self_type &other) const
 Iterator inequality.
 
operator* () const
 Element access.
 
self_type operator+ (std::ptrdiff_t n)
 Return iterator pointing to n-th next element.
 
self_typeoperator++ ()
 Pre-increment (returns position after increment)
 
self_type operator++ (int)
 Post-increment (returns position prior to increment)
 
self_typeoperator+= (std::ptrdiff_t n)
 Set iterator to n-th next element.
 
self_type operator- (std::ptrdiff_t)
 Return iterator pointing to n-th previous element.
 
long int operator- (const self_type &other) const
 Return distance between iterators.
 
self_typeoperator-- ()
 Pre-decrement (returns position after decrement)
 
self_type operator-- (int)
 Pre-increment (returns position after decrement)
 
self_typeoperator-= (std::ptrdiff_t n)
 Set iterator to n-th previous element.
 
operator-> () const
 Member of element access.
 
bool operator< (const self_type &other) const
 Returns whether iterator is before other.
 
bool operator<= (const self_type &other) const
 Returns whether iterator is not after other.
 
bool operator== (const self_type &other) const
 Iterator equality.
 
bool operator> (const self_type &other) const
 Returns whether iterator is after other.
 
bool operator>= (const self_type &other) const
 Returns whether iterator is not after other.
 
operator[] (std::size_t n) const
 Direct access to n-th element.
 

Friends

class SegmentedVector< T, N >
 

Detailed Description

template<typename T, std::size_t N, typename P = const T*, typename R = const T&, bool is_const_iterator = true>
class SimPT_Sim::Container::SVIterator< T, N, P, R, is_const_iterator >

Implementation of iterator for SegmentedVector.

It will provide both const and non-const iterators.

Possible states for the iterator are: (a) Default constructed: m_c == nullptr && m_p == m_end. This is the singular state in which the iterator can be assigned, but not incremented or compared. (b) Past-the-end: m_c != nullptr && m_p == m_end. The iterator cannot be dereferenced. (c) Dereferencable: m_c != nullptr && m_p < mc->size(). Notice that m_p is of type size_t and hence always non-negative. Thus the above reuires !m_c->empty().

Template parameters: T value type of iterator and of its container. N block size of its container P pointer-to-T type (can be const qualified). R reference-to-T type (can be const qualified). is_const_iterator to make it a const_iterator

Definition at line 62 of file SVIterator.h.


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