Skip to main content

ConstIterator Class

Forward iterator over dense bindings. More...

Declaration

class helios::engine::core::container::HandleMultiMap::ConstIterator { ... }

Public Member Typedefs Index

usingiterator_category = std::forward_iterator_tag
usingvalue_type = Binding
usingdifference_type = std::ptrdiff_t
usingpointer = void
usingreference = value_type

Public Constructors Index

ConstIterator (const HandleMultiMap *map, std::size_t start_idx) noexcept

Constructs an iterator at the given dense value index. More...

Public Operators Index

referenceoperator* () const noexcept

Returns the current binding by value. More...

ConstIterator &operator++ () noexcept

Advances to the next dense binding. More...

ConstIteratoroperator++ (int) noexcept

Advances to the next dense binding and returns the previous iterator state. More...

booloperator== (const ConstIterator &other) const noexcept

Checks iterator equality. More...

booloperator!= (const ConstIterator &other) const noexcept

Checks iterator inequality. More...

Private Member Attributes Index

const HandleMultiMap *map_
std::size_tcurrent_idx_

Description

Forward iterator over dense bindings.

Definition at line 69 of file HandleMultiMap.ixx.

Public Member Typedefs

difference_type

using helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::difference_type = std::ptrdiff_t

Definition at line 76 of file HandleMultiMap.ixx.

76 using difference_type = std::ptrdiff_t;

iterator_category

using helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::iterator_category = std::forward_iterator_tag

Definition at line 74 of file HandleMultiMap.ixx.

74 using iterator_category = std::forward_iterator_tag;

pointer

using helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::pointer = void

Definition at line 77 of file HandleMultiMap.ixx.

77 using pointer = void;

reference

using helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::reference = value_type

Definition at line 78 of file HandleMultiMap.ixx.

78 using reference = value_type; // By-Value Return

value_type

using helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::value_type = Binding

Definition at line 75 of file HandleMultiMap.ixx.

Public Constructors

ConstIterator()

helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::ConstIterator (const HandleMultiMap * map, std::size_t start_idx)
inline noexcept

Constructs an iterator at the given dense value index.

Parameters
map

Owning map.

start_idx

Start index within denseValues_.

Definition at line 86 of file HandleMultiMap.ixx.

87 : map_(map), current_idx_(start_idx) {}

Public Operators

operator!=()

bool helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::operator!= (const ConstIterator & other)
inline noexcept

Checks iterator inequality.

Definition at line 125 of file HandleMultiMap.ixx.

125 [[nodiscard]] bool operator!=(const ConstIterator& other) const noexcept {
126 return !(*this == other);
127 }

Reference helios::registerComponents.

operator*()

reference helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::operator* ()
inline noexcept

Returns the current binding by value.

Definition at line 90 of file HandleMultiMap.ixx.

91 assert(current_idx_ < map_->denseValues_.size());
92
93 const auto value = map_->denseValues_[current_idx_];
94 const auto valueIdx = value.entityId;
95
96 assert(valueIdx < map_->keys_.size());
97 assert(map_->keys_[valueIdx].isValid());
98
99 return Binding{
100 map_->keys_[valueIdx],
101 value
102 };
103 }

Reference helios::registerComponents.

operator++()

ConstIterator & helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::operator++ ()
inline noexcept

Advances to the next dense binding.

Definition at line 106 of file HandleMultiMap.ixx.

107 current_idx_++;
108 return *this;
109 }

operator++()

ConstIterator helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::operator++ (int)
inline noexcept

Advances to the next dense binding and returns the previous iterator state.

Definition at line 112 of file HandleMultiMap.ixx.

112 ConstIterator operator++(int) noexcept {
113 ConstIterator tmp = *this;
114 ++(*this);
115 return tmp;
116 }

Reference helios::registerComponents.

operator==()

bool helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::operator== (const ConstIterator & other)
inline noexcept

Checks iterator equality.

Definition at line 119 of file HandleMultiMap.ixx.

119 [[nodiscard]] bool operator==(const ConstIterator& other) const noexcept {
120 return current_idx_ == other.current_idx_
121 && map_ == other.map_;
122 }

Reference helios::registerComponents.

Private Member Attributes

current_idx_

std::size_t helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::current_idx_

Definition at line 71 of file HandleMultiMap.ixx.

71 std::size_t current_idx_;

map_

const HandleMultiMap* helios::engine::core::container::HandleMultiMap< TOneHandle, TManyHandle >::ConstIterator::map_

Definition at line 70 of file HandleMultiMap.ixx.

70 const HandleMultiMap* map_;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.