struct eosio::kv::detail::iterator
Class List > eosio :: kv :: detail :: iterator
This struct represents the iterator for the data type. More...
Public Types
Type | Name |
---|---|
enum | ok { ok = 0, erased = -1, end = -2 } |
typedef elem< KV > | elem_t |
typedef typename KV::value_t | value_t |
Public Static Attributes
Type | Name |
---|---|
static constexpr static uint32_t | invalidated_iterator |
Public Attributes
Type | Name |
---|---|
elem_t | element |
uint32_t | handle |
status | current_status |
Public Static Functions
Type | Name |
---|---|
static constexpr static bool | query_status (status stat) |
static constexpr static bool | query_status (int32_t stat) |
Public Functions
Type | Name |
---|---|
iterator (name owner) Constructor for the iterator type. |
|
iterator (const iterator &) = delete | |
iterator & | operator= (const iterator &) = delete |
iterator (iterator && o) | |
iterator (iterator<!Reverse, KV > && o) | |
iterator & | operator= (iterator && o) |
iterator & | operator= (iterator<!Reverse, KV > && o) |
~iterator () | |
bool | is_valid () const Utility function which returns true if iterator is valid or false if iterator is not valid. An iterator is not valid if is pointing at end or one past the last or first element. |
iterator & | seek_to_begin () Function to advance the iterator to the beginning of the map's key value pairs. |
iterator & | seek_to_last () Function to advance the iterator to the last element of the map's key value pairs. |
iterator & | seek_to_end () Function to advance the iterator to the element past the last element of the map's key value pairs. |
iterator & | lower_bound (const key_type & k) This will take a key_type key and find the value that is equal to or greater than that key. |
iterator & | find (const key_type & k) This will take a key_type key and find the value that exactly matches that key. |
elem_t & | operator* () |
const elem_t & | operator* () const |
elem_t * | operator-> () |
const elem_t * | operator-> () const |
iterator & | operator++ () Function to increment the iterator to the next element (sorted in lexicographic order). |
iterator & | operator-- () Function to decrement the iterator to the next element (sorted in lexicographic order). |
bool | operator== (const iterator & o) const Function to test equality. |
bool | operator!= (const iterator & o) const Function to test inequality. |
void | materialize () const |
Detailed Description
You will use the set of functions and operations associated with this type to iterate through values in the map and reference them.
Note that this iterator type in is defined as
. There is also a reverse iterator available, it is defined as . The only difference between iterator_t and reverse_iterator_t is the direction the ++ and operators go.
Public Types Documentation
enum status
enum eosio::kv::detail::iterator::status {
ok = 0,
erased = -1,
end = -2,
};
typedef elem_t
using eosio::kv::detail::iterator< Reverse, KV >::elem_t = elem<KV>;
typedef value_t
using eosio::kv::detail::iterator< Reverse, KV >::value_t = typename KV::value_t;
Public Static Attributes Documentation
variable invalidated_iterator
constexpr static uint32_t eosio::kv::detail::iterator< Reverse, KV >::invalidated_iterator;
Public Attributes Documentation
variable element
elem_t eosio::kv::detail::iterator< Reverse, KV >::element;
variable handle
uint32_t eosio::kv::detail::iterator< Reverse, KV >::handle;
variable current_status
status eosio::kv::detail::iterator< Reverse, KV >::current_status;
Public Static Functions Documentation
function query_status (1/2)
template< Stat>
static constexpr static bool eosio::kv::detail::iterator< Reverse, KV >::query_status(
status stat
)
function query_status (2/2)
template< Stat>
static constexpr static bool eosio::kv::detail::iterator< Reverse, KV >::query_status(
int32_t stat
)
Public Functions Documentation
function iterator (1/4)
eosio::kv::detail::iterator< Reverse, KV >::iterator(
name owner
)
Constructor for the iterator type.
Parameters:
- owner This is the owner of the table object.
function iterator (2/4)
eosio::kv::detail::iterator< Reverse, KV >::iterator(
const iterator &
) = delete
function operator= (1/3)
iterator& eosio::kv::detail::iterator< Reverse, KV >::operator=(
const iterator &
) = delete
function iterator (3/4)
eosio::kv::detail::iterator< Reverse, KV >::iterator(
iterator && o
)
function iterator (4/4)
eosio::kv::detail::iterator< Reverse, KV >::iterator(
iterator<!Reverse, KV > && o
)
function operator= (2/3)
iterator& eosio::kv::detail::iterator< Reverse, KV >::operator=(
iterator && o
)
function operator= (3/3)
iterator& eosio::kv::detail::iterator< Reverse, KV >::operator=(
iterator<!Reverse, KV > && o
)
function ~iterator
eosio::kv::detail::iterator< Reverse, KV >::~iterator()
function is_valid
bool eosio::kv::detail::iterator< Reverse, KV >::is_valid() const
Utility function which returns true if iterator is valid or false if iterator is not valid. An iterator is not valid if is pointing at end
or one past the last or first element.
function seek_to_begin
iterator& eosio::kv::detail::iterator< Reverse, KV >::seek_to_begin()
Function to advance the iterator to the beginning of the map's key value pairs.
function seek_to_last
iterator& eosio::kv::detail::iterator< Reverse, KV >::seek_to_last()
Function to advance the iterator to the last element of the map's key value pairs.
function seek_to_end
iterator& eosio::kv::detail::iterator< Reverse, KV >::seek_to_end()
Function to advance the iterator to the element past the last element of the map's key value pairs.
function lower_bound
iterator& eosio::kv::detail::iterator< Reverse, KV >::lower_bound(
const key_type & k
)
This will take a key_type
key and find the value that is equal to or greater than that key.
If no element is greater than or equal to the key the iterator will now hold end
.
Parameters:
- key This is the key which you wish to query with.
function find
iterator& eosio::kv::detail::iterator< Reverse, KV >::find(
const key_type & k
)
This will take a key_type
key and find the value that exactly matches that key.
If no element is equal to the key the iterator will now hold end
.
Parameters:
- key This is the key which you wish to query with.
function operator* (1/2)
elem_t& eosio::kv::detail::iterator< Reverse, KV >::operator*()
function operator* (2/2)
const elem_t& eosio::kv::detail::iterator< Reverse, KV >::operator*() const
function operator-> (1/2)
elem_t* eosio::kv::detail::iterator< Reverse, KV >::operator->()
function operator-> (2/2)
const elem_t* eosio::kv::detail::iterator< Reverse, KV >::operator->() const
function operator++
iterator& eosio::kv::detail::iterator< Reverse, KV >::operator++()
Function to increment the iterator to the next element (sorted in lexicographic order).
Note this is the prefix operator, i.e. ++it
, the it++
operator is explicitly missing because of performance issues. If you increment past the last element this iterator will then be invalid and point to end
.
function operator--
iterator& eosio::kv::detail::iterator< Reverse, KV >::operator--()
Function to decrement the iterator to the next element (sorted in lexicographic order).
Note this is the prefix operator, i.e. --it
, the it--
operator is explicitly missing because of performance issues. If you decrement past the first element this iterator will then be invalid and point to end
.
function operator==
bool eosio::kv::detail::iterator< Reverse, KV >::operator==(
const iterator & o
) const
Function to test equality.
function operator!=
bool eosio::kv::detail::iterator< Reverse, KV >::operator!=(
const iterator & o
) const
Function to test inequality.
function materialize
void eosio::kv::detail::iterator< Reverse, KV >::materialize() const
The documentation for this class was generated from the following file: libraries/eosiolib/contracts/eosio/map.hpp