arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::parsing::dynamic_token_adapter::iterator Class Reference

#include <arg_router/parsing/dynamic_token_adapter.hpp>

Public Types

using difference_type = std::ptrdiff_t
 
using value_type = dynamic_token_adapter::value_type
 
using pointer = const value_type *
 
using reference = const value_type &
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

iteratoroperator+= (difference_type offset) noexcept
 
iteratoroperator-= (difference_type offset) noexcept
 
iteratoroperator++ () noexcept
 
iterator operator++ (int) noexcept
 
iteratoroperator-- () noexcept
 
iterator operator-- (int) noexcept
 
reference operator* () const noexcept
 
pointer operator-> () const noexcept
 
reference operator[] (difference_type offset) const noexcept
 
bool operator== (iterator other) const noexcept
 
bool operator!= (iterator other) const noexcept
 
void set (value_type value)
 

Friends

iterator operator+ (iterator it, difference_type offset) noexcept
 
iterator operator- (iterator it, difference_type offset) noexcept
 
iterator operator+ (difference_type offset, iterator it) noexcept
 
iterator operator- (difference_type offset, iterator it) noexcept
 
iterator operator- (iterator lhs, iterator rhs) noexcept
 
bool operator< (iterator lhs, iterator rhs) noexcept
 
bool operator> (iterator lhs, iterator rhs) noexcept
 
bool operator<= (iterator lhs, iterator rhs) noexcept
 
bool operator>= (iterator lhs, iterator rhs) noexcept
 

Detailed Description

Iterator type.

Definition at line 31 of file dynamic_token_adapter.hpp.

Member Typedef Documentation

◆ difference_type

Difference type.

Definition at line 35 of file dynamic_token_adapter.hpp.

◆ iterator_category

Iterator category.

Definition at line 43 of file dynamic_token_adapter.hpp.

◆ pointer

◆ reference

◆ value_type

Member Function Documentation

◆ operator!=()

bool arg_router::parsing::dynamic_token_adapter::iterator::operator!= ( iterator  other) const
inlinenoexcept

Inequality operator.

Note
The owner's address is used in the comparison, so two identical underlying containers will still return not equal
Parameters
otherInstance to compare against
Returns
True if not equal

Definition at line 268 of file dynamic_token_adapter.hpp.

◆ operator*()

reference arg_router::parsing::dynamic_token_adapter::iterator::operator* ( ) const
inlinenoexcept

Dereference operator.

Note
Undefined if iterator is out of bounds
Returns
Reference to element

Definition at line 210 of file dynamic_token_adapter.hpp.

◆ operator++() [1/2]

iterator& arg_router::parsing::dynamic_token_adapter::iterator::operator++ ( )
inlinenoexcept

Pre-increment operator.

Returns
Reference to this

Definition at line 175 of file dynamic_token_adapter.hpp.

◆ operator++() [2/2]

iterator arg_router::parsing::dynamic_token_adapter::iterator::operator++ ( int  )
inlinenoexcept

Post-increment operator.

Returns
Iterator before the increment

Definition at line 181 of file dynamic_token_adapter.hpp.

◆ operator+=()

iterator& arg_router::parsing::dynamic_token_adapter::iterator::operator+= ( difference_type  offset)
inlinenoexcept

In-place increment operator.

Parameters
offsetIncrement offset (can be negative)
Returns
Reference to this

Definition at line 50 of file dynamic_token_adapter.hpp.

◆ operator--() [1/2]

iterator& arg_router::parsing::dynamic_token_adapter::iterator::operator-- ( )
inlinenoexcept

Pre-decrement operator.

Returns
Reference to this

Definition at line 192 of file dynamic_token_adapter.hpp.

◆ operator--() [2/2]

iterator arg_router::parsing::dynamic_token_adapter::iterator::operator-- ( int  )
inlinenoexcept

Post-decrement operator.

Returns
Iterator before the decrement

Definition at line 198 of file dynamic_token_adapter.hpp.

◆ operator-=()

iterator& arg_router::parsing::dynamic_token_adapter::iterator::operator-= ( difference_type  offset)
inlinenoexcept

In-place decrement operator.

Parameters
offsetDecrement offset (can be negative)
Returns
Reference to this

Definition at line 61 of file dynamic_token_adapter.hpp.

◆ operator->()

pointer arg_router::parsing::dynamic_token_adapter::iterator::operator-> ( ) const
inlinenoexcept

Structure dereference operator.

Note
Undefined if iterator is out of bounds
Returns
Pointer to element

Definition at line 225 of file dynamic_token_adapter.hpp.

◆ operator==()

bool arg_router::parsing::dynamic_token_adapter::iterator::operator== ( iterator  other) const
inlinenoexcept

Equality operator.

Note
The owner's address is used in the comparison, so two identical underlying containers will still return not equal
Parameters
otherInstance to compare against
Returns
True if equal

Definition at line 245 of file dynamic_token_adapter.hpp.

◆ operator[]()

reference arg_router::parsing::dynamic_token_adapter::iterator::operator[] ( difference_type  offset) const
inlinenoexcept

Offset and deference operator.

Note
Undefined if iterator is out of bounds
Parameters
offsetOffset
Returns
Reference to element

Definition at line 233 of file dynamic_token_adapter.hpp.

◆ set()

void arg_router::parsing::dynamic_token_adapter::iterator::set ( value_type  value)
inline

Updates the element with value.

If the iterator is beyond the end of the processed tokens vector, then the elements up to and including the iterator are transferred from the command line token container to the processed container. Then the last transferred element is updated (i.e. the new end last element of the processed container.

Note
Undefined if iterator is out of bounds
Parameters
valueNew value

Definition at line 280 of file dynamic_token_adapter.hpp.

Friends And Related Function Documentation

◆ operator+ [1/2]

iterator operator+ ( difference_type  offset,
iterator  it 
)
friend

Increment operator.

Parameters
it
offset
Returns
Iterator

Definition at line 91 of file dynamic_token_adapter.hpp.

◆ operator+ [2/2]

iterator operator+ ( iterator  it,
difference_type  offset 
)
friend

Increment operator.

Parameters
it
offset
Returns
Iterator

Definition at line 69 of file dynamic_token_adapter.hpp.

◆ operator- [1/3]

iterator operator- ( difference_type  offset,
iterator  it 
)
friend

Decrement operator.

Parameters
it
offset
Returns
Iterator

Definition at line 102 of file dynamic_token_adapter.hpp.

◆ operator- [2/3]

iterator operator- ( iterator  it,
difference_type  offset 
)
friend

Decrement operator.

Parameters
it
offset
Returns
Iterator

Definition at line 80 of file dynamic_token_adapter.hpp.

◆ operator- [3/3]

iterator operator- ( iterator  lhs,
iterator  rhs 
)
friend

Difference operator.

Note
The owning containers are not compared, the resulting iterator uses the owning container of lhs
Parameters
lhsFirst instance
rhsSecond instance
Returns
Iterator

Definition at line 115 of file dynamic_token_adapter.hpp.

◆ operator<

bool operator< ( iterator  lhs,
iterator  rhs 
)
friend

Less than operator.

Note
The owning containers are not compared
Parameters
lhsFirst instance
rhsSecond instance
Returns
True if the index represented by lhs is less than rhs

Definition at line 127 of file dynamic_token_adapter.hpp.

◆ operator<=

bool operator<= ( iterator  lhs,
iterator  rhs 
)
friend

Less than or equal to operator.

Note
The owning containers are not compared
Parameters
lhsFirst instance
rhsSecond instance
Returns
True if the index represented by lhs is less than or equal to rhs

Definition at line 153 of file dynamic_token_adapter.hpp.

◆ operator>

bool operator> ( iterator  lhs,
iterator  rhs 
)
friend

Greater than operator.

Note
The owning containers are not compared
Parameters
lhsFirst instance
rhsSecond instance
Returns
True if the index represented by lhs is greater than rhs

Definition at line 140 of file dynamic_token_adapter.hpp.

◆ operator>=

bool operator>= ( iterator  lhs,
iterator  rhs 
)
friend

Greater than or equal to operator.

Note
The owning containers are not compared
Parameters
lhsFirst instance
rhsSecond instance
Returns
True if the index represented by lhs is greater than or equal to rhs

Definition at line 166 of file dynamic_token_adapter.hpp.


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