Provides functionality to traverse through a collection of elements sequentially, allowing controlled access to each element in the collection.
More...
|
| Iterator (const Budget &budget) |
| Fully initialises the object to point to the budget. Upon successful construction will be pointing just past the end of the budget.
|
|
Iterator | begin () const noexcept |
| Returns an iterator pointing to the first item in the collection within the budget.
|
|
Iterator | end () const noexcept |
| Returns an iterator pointing to the position after the last element in the budget's managed collection.
|
|
const_reference | operator* () const noexcept |
| Star-operator to the current budget item.
|
|
Iterator & | operator++ () |
| Prefix increment operator.
|
|
Iterator | operator++ (int) |
| Postfix increment operator.
|
|
const_pointer | operator-> () const noexcept |
| Arrow-operator to the current budget item.
|
|
bool | operator== (const Iterator &other) const noexcept |
| Equality operator with the same semantics: both being at the end or both observe the same budgt item is considered to be equivalent.
|
|
Provides functionality to traverse through a collection of elements sequentially, allowing controlled access to each element in the collection.
The iterator ensures encapsulation by abstracting the traversal mechanism, making it independent of the collection's internal structure. It can be utilised to iterate through various types of collections, such as lists, arrays, or other custom data structures.
The class provides essential operations for iteration, such as advancing to the next element, checking for the end of the collection, and accessing the current element.
Iterator drn::budgeting::Budget::Iterator::begin |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns an iterator pointing to the first item in the collection within the budget.
This method initializes an iterator to start iterating through the available budget items, starting with the first category containing items. If no items are present in any category, the iterator will be initialized to its final state, indicating the end of the collection.
- Returns
- An iterator initialized to the first budget item or indicating the end of the collection if no items are available.