libER 0.1.4.2
ELDEN RING API library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
from::param::param_iterator< Def > Class Template Reference

The bidirectional param table iterator. More...

#include <param_iterator.hpp>

Public Types

using iterator_concept = std::bidirectional_iterator_tag
 Bidirectional iterator concept tag.
 
using iterator_category = std::bidirectional_iterator_tag
 Bidirectional iterator category tag.
 
using value_type = std::pair< row_index_type, Def & >
 Dereferencing returns a row index/row pair.
 
using difference_type = ptrdiff_t
 Iterator difference type.
 
using pointer = value_type *
 Iterator pointer type.
 
using reference = value_type &
 Iterator reference type.
 

Public Member Functions

 param_iterator () noexcept
 Default construct a param iterator.
 
 param_iterator (const param_file &file, difference_type pos) noexcept
 Construct a param iterator at a given row entry position.
 
 param_iterator (const param_iterator &other) noexcept
 Construct a new param iterator (copy constructor).
 
 param_iterator (const param_iterator< std::remove_const_t< Def > > &other) noexcept
 Construct a new param iterator (const iterator promotion).
 
value_type operator* () const noexcept
 Dereference the iterator at the current position to get a row index/row pair.
 
param_iteratoroperator++ () noexcept
 Advance the iterator forwards by one entry (precrement).
 
param_iterator operator++ (int) noexcept
 Advance the iterator forwards by one entry (postcrement).
 
param_iteratoroperator-- () noexcept
 Advance the iterator backwards by one entry (predecrement).
 
param_iterator operator-- (int) noexcept
 Advance the iterator backwards by one entry (postdecrement).
 
param_iteratoroperator+= (difference_type offset) noexcept
 Advance the iterator forwards by offset entries.
 
param_iterator operator+ (difference_type offset) const noexcept
 Add offset entries to the iterator.
 
param_iteratoroperator-= (difference_type offset) noexcept
 Advance the iterator backwards by offset entries.
 
param_iterator operator- (difference_type offset) const noexcept
 Subtract offset entries from the iterator.
 
template<typename OtherDef >
requires (std::is_same_v<const Def, const OtherDef>)
difference_type operator- (const param_iterator< OtherDef > &rhs) const noexcept
 How many steps would it take from this iterator to reach iterator rhs?
 
value_type operator[] (difference_type offset) const noexcept
 Param table iterator subscript.
 
template<typename OtherDef >
requires (std::is_same_v<const Def, const OtherDef>)
bool operator== (const param_iterator< OtherDef > &rhs) const noexcept
 The iterator equality comparison operator.
 
template<typename OtherDef >
requires (std::is_same_v<const Def, const OtherDef>)
std::strong_ordering operator<=> (const param_iterator< OtherDef > &rhs) const noexcept
 The iterator relation operator in terms of row indices.
 

Friends

template<typename >
class param_table
 

Detailed Description

template<typename Def>
class from::param::param_iterator< Def >

The bidirectional param table iterator.

Template Parameters
Defparamdef type being iterated

Constructor & Destructor Documentation

◆ param_iterator() [1/2]

template<typename Def >
from::param::param_iterator< Def >::param_iterator ( )
inlinenoexcept

Default construct a param iterator.

All default constructed param iterators are equal.

◆ param_iterator() [2/2]

template<typename Def >
from::param::param_iterator< Def >::param_iterator ( const param_file file,
difference_type  pos 
)
inlinenoexcept

Construct a param iterator at a given row entry position.

Parameters
filethe param file
posthe entry index in the range [0, file.row_count)

Member Function Documentation

◆ operator*()

template<typename Def >
value_type from::param::param_iterator< Def >::operator* ( ) const
inlinenoexcept

Dereference the iterator at the current position to get a row index/row pair.

Returns
value_type the row index/row pair at the current iterator position

◆ operator+()

template<typename Def >
param_iterator from::param::param_iterator< Def >::operator+ ( difference_type  offset) const
inlinenoexcept

Add offset entries to the iterator.

Parameters
offsetsigned offset to add
Returns
param_iterator the new iterator

◆ operator++() [1/2]

Advance the iterator forwards by one entry (precrement).

Returns
param_iterator& the new iterator position

◆ operator++() [2/2]

Advance the iterator forwards by one entry (postcrement).

Returns
param_iterator the old iterator position

◆ operator+=()

Advance the iterator forwards by offset entries.

Parameters
offsetsigned offset to advance by
Returns
param_iterator& the new iterator position

◆ operator-() [1/2]

template<typename Def >
template<typename OtherDef >
requires (std::is_same_v<const Def, const OtherDef>)
difference_type from::param::param_iterator< Def >::operator- ( const param_iterator< OtherDef > &  rhs) const
inlinenoexcept

How many steps would it take from this iterator to reach iterator rhs?

The result is only valid if the iterators point to the same param range.

Template Parameters
OtherDefoptionally const matching paramdef type
Parameters
rhsanother iterator (can be a const iterator) to the same range
Returns
difference_type the entry difference

◆ operator-() [2/2]

template<typename Def >
param_iterator from::param::param_iterator< Def >::operator- ( difference_type  offset) const
inlinenoexcept

Subtract offset entries from the iterator.

Parameters
offsetsigned offset to subtract
Returns
param_iterator the new iterator

◆ operator--() [1/2]

Advance the iterator backwards by one entry (predecrement).

Returns
param_iterator& the new iterator position

◆ operator--() [2/2]

Advance the iterator backwards by one entry (postdecrement).

Returns
param_iterator the old iterator position

◆ operator-=()

Advance the iterator backwards by offset entries.

Parameters
offsetsigned offset to advance by
Returns
param_iterator& the new iterator position

◆ operator<=>()

template<typename Def >
template<typename OtherDef >
requires (std::is_same_v<const Def, const OtherDef>)
std::strong_ordering from::param::param_iterator< Def >::operator<=> ( const param_iterator< OtherDef > &  rhs) const
inlinenoexcept

The iterator relation operator in terms of row indices.

Template Parameters
OtherDefoptionally const matching paramdef type
Parameters
rhsanother iterator (can be a const iterator)
Returns
std::strong_ordering the relation

◆ operator==()

template<typename Def >
template<typename OtherDef >
requires (std::is_same_v<const Def, const OtherDef>)
bool from::param::param_iterator< Def >::operator== ( const param_iterator< OtherDef > &  rhs) const
inlinenoexcept

The iterator equality comparison operator.

Any iterators pointing to the same param row are equal, as are any default constructed iterators.

Operator != is synthesized from this operator.

Template Parameters
OtherDefoptionally const matching paramdef type
Parameters
rhsanother iterator (can be a const iterator)
Returns
true iterators are equal
false iterators are not equal

◆ operator[]()

template<typename Def >
value_type from::param::param_iterator< Def >::operator[] ( difference_type  offset) const
inlinenoexcept

Param table iterator subscript.

Parameters
offsetthe param entry offset from the current iterator position
Returns
value_type the row index/row pair

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