![]() |
|
Array of weight slots for weighted iterators. More...
#include <weightedIterator.h>
Public Types | |
| using | value_type = Vdf_WeightSlot |
| using | reference = Vdf_WeightSlot & |
| using | const_reference = const Vdf_WeightSlot & |
| using | iterator = Vdf_WeightSlot * |
| using | const_iterator = const Vdf_WeightSlot * |
Public Member Functions | |
| Vdf_WeightSlotArray () | |
| Construct an empty array. | |
| ~Vdf_WeightSlotArray () | |
| Destructor. | |
| void | Allocate (uint32_t numInputs) |
Allocate storage for numInputs elements. | |
| size_t | size () const |
| Return the number of slots in the array. | |
| iterator | begin () |
| Return an iterator to the first slot in the array. | |
| iterator | end () |
| Return an iterator to the end of the array. | |
| const_iterator | begin () const |
| Return an iterator to the first slot in the array. | |
| const_iterator | end () const |
| Return an iterator to the end of the array. | |
| reference | operator[] (size_t slot) |
Access the slot at index slot. | |
| const_reference | operator[] (size_t slot) const |
Access the slot at index slot. | |
| int | AdvanceToNextExplicitIndex (int index) |
Returns the next index that has a weight at or after index. | |
Array of weight slots for weighted iterators.
Inline storage is provided for one weight slot to avoid heap allocation in the common case. However, the local storage and remote storage pointer are not overlapped as this results in undesirable overhead when accessing elements. Iterators are almost always stack allocated and VdfWeightedIterator is non-copyable making compactness less valuable.
Definition at line 46 of file weightedIterator.h.
| using const_iterator = const Vdf_WeightSlot * |
Definition at line 56 of file weightedIterator.h.
| using const_reference = const Vdf_WeightSlot & |
Definition at line 54 of file weightedIterator.h.
| using iterator = Vdf_WeightSlot * |
Definition at line 55 of file weightedIterator.h.
| using reference = Vdf_WeightSlot & |
Definition at line 53 of file weightedIterator.h.
| using value_type = Vdf_WeightSlot |
Definition at line 52 of file weightedIterator.h.
|
inline |
Construct an empty array.
Definition at line 60 of file weightedIterator.h.
|
inline |
Destructor.
Definition at line 67 of file weightedIterator.h.
|
inline |
Returns the next index that has a weight at or after index.
Updates the currentIndex.
Definition at line 474 of file weightedIterator.h.
|
inline |
Allocate storage for numInputs elements.
This function may only be called once during the lifetime of the array. The size of the array is fixed the first time it is allocated. Elements in the array are uninitialized.
Definition at line 79 of file weightedIterator.h.
|
inline |
Return an iterator to the first slot in the array.
Definition at line 98 of file weightedIterator.h.
|
inline |
Return an iterator to the first slot in the array.
Definition at line 110 of file weightedIterator.h.
|
inline |
Return an iterator to the end of the array.
Definition at line 104 of file weightedIterator.h.
|
inline |
Return an iterator to the end of the array.
Definition at line 116 of file weightedIterator.h.
|
inline |
Access the slot at index slot.
Definition at line 122 of file weightedIterator.h.
|
inline |
Access the slot at index slot.
Definition at line 128 of file weightedIterator.h.
|
inline |
Return the number of slots in the array.
Definition at line 92 of file weightedIterator.h.