xentara-utils v2.0.4
The Xentara Utility Library
|
An object that can be used to keep track of the elements when decoding a CBOR array or map. More...
#include <xentara/utils/cbor/RangeIterator.hpp>
Classes | |
struct | DummyValue |
A dummy value type. More... | |
Public Types | |
using | value_type = DummyValue |
The value type. | |
using | difference_type = std::ptrdiff_t |
Dummy type for non-existend difference type. | |
using | reference = DummyValue |
A “reference” to a value, which is not an actual reference, but the value itself. | |
using | pointer = void |
void type denoting that this class has no pointer type. | |
using | iterator_concept = std::input_iterator_tag |
The iterator concept. | |
using | iterator_category = iterator_concept |
The iterator category, for use in pre-C++20 code. | |
Public Member Functions | |
constexpr | RangeIterator () noexcept=default |
Default constructor. | |
constexpr | RangeIterator (std::default_sentinel_t) noexcept |
Conversion constructor for a sentinel. | |
auto | operator== (const RangeIterator &rhs) const noexcept -> bool |
Equality operator. | |
auto | operator++ () -> RangeIterator & |
Pre-increment operator. | |
auto | operator++ (int) -> DummyValue |
Post-increment operator. | |
auto | operator* () noexcept -> DummyValue |
Indirection operator. | |
Related Symbols | |
(Note that these are not member symbols.) | |
auto | begin (RangeIterator iterator) -> RangeIterator |
Gets a begin iterator for a CBOR range iterator. | |
auto | end (RangeIterator) -> std::default_sentinel_t |
Gets an end iterator for a standard path iterator. | |
An object that can be used to keep track of the elements when decoding a CBOR array or map.
This object has begin() and end() functions to allows it to be used like a stream iterator. However, the object is not used to actually decode the entries, but only to keep track of whether all the entries have been read yet.
Dummy type for non-existend difference type.
The iterator category, for use in pre-C++20 code.
The iterator concept.
using xentara::utils::cbor::RangeIterator::pointer = void |
void type denoting that this class has no pointer type.
A “reference” to a value, which is not an actual reference, but the value itself.
The value type.
|
constexprdefaultnoexcept |
Default constructor.
This constructor creates an invalid iterator. It is suitable as a sentinel for algorithms that require the sentinel to be of the same type as the iterator.
|
constexprnoexcept |
Conversion constructor for a sentinel.
This constructor creates an invalid iterator suitable for use as a sentinel for algorithms that require the sentinel to be of the same type as the iterator.
|
noexcept |
Indirection operator.
auto xentara::utils::cbor::RangeIterator::operator++ | ( | ) | -> RangeIterator & |
Pre-increment operator.
Moves the iterator forward by one position. If the array or map has indefinite length, this operator checks for and consumes the stop code (“break”).
std::runtime_error | The array or map has indefinite length, and an error occurred consuming the stop code |
auto xentara::utils::cbor::RangeIterator::operator++ | ( | int | ) | -> DummyValue |
Post-increment operator.
Moves the iterator forward by one position. If the array or map has indefinite length, this operator checks for and consumes the stop code (“break”).
std::runtime_error | The array or map has indefinite length, and an error occurred consuming the stop code |
|
noexcept |
Equality operator.
This operator is intended to be used to check for the end of an array or map in algorithms that do not support std::default_sentinel_t, but use an invalid iterator as sentinel instead.
This method does not check the position of the iterator within the array or map. Any valid iterator will compare equal to any other valid iterator. An iterator that has gone past the end of the array or map will compare equal to a default constructed iterator, or an iterator that was constructed from std::default_sentinel.
|
related |
Gets a begin iterator for a CBOR range iterator.
This function enables the use of RangeIterator in range-based for loops
iterator | The iterator to iterate over |
|
related |
Gets an end iterator for a standard path iterator.
This function enables the use of RangeIterator in range-based for loops