class
TRTTIIterator
template<class DataType, bool IsContainer>Wraps a container that can be used for sequentially reading container contents, inserting new elements in the container, and retrieving container element count.
Template parameters
DataType | Data type to iterate over. |
|---|---|
IsContainer | Set to true if you wish to iterate over DataType as a container with multiple elements. If false, the iterator acts as a faux iterator with a single entry, directly referencing the provided data type. |
Public
Constructors
TRTTIIterator<DataType, IsContainer>
TRTTIIterator<DataType, IsContainer>
Methods
IsValid
Returns true if the iterator points to a valid value.
SeekToBeginning
Resets the iterator to the beginning of the container.
SeekToEnd
Resets the iterator to the end of the container.
GetElementCount
Returns the number of elements in the container.
GetValue
Returns the current value of the iterator.
Clone
Makes a copy of this iterator at its current location.
Clear
Clears all the entries from the underlying container.
Erase
Removes the current iterator element.
SeekToIndex
Seeks the iterator to a particular index.
If the index is out of range, or seeking to index is not supported, the iterator is marked as invalid and false is returned.
SeekToKey
Seeks the iterator to a particular key.
The provided value should be a pointer to the key value, or to a tuple. In case the value is a tuple, the first element is considered to be the key. If the kye is not found, or seeking to key is not supported, the iterator is marked as invalid and false is returned.
staticSupportsSeekToIndex
Returns true if SeekToIndex() may be called on the iterator.
Generally true for array containers.
staticSupportsSeekToKey
Returns true if SeekToKey() may be called on the iterator.
Generally true for set/map containers.
Operators
operator=
Assigns (copies) the value at the current iterator location, or if the iterator is not valid inserts the value at the end of the container.
operator=
Assigns (moves) the value at the current iterator location, or if the iterator is not valid inserts the value at the end of the container.
operator*
Returns the current value of the iterator.