Key Value Map

Classes

Type Name
struct eosio::kv::detail::elem
This struct represents the data type stored in map.
struct eosio::kv::detail::iterator
This struct represents the iterator for the data type.
class eosio::kv::map
Defines an EOSIO Key Value Map.

Functions

Functions Documentation

function iterator

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 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++

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 find

iterator_t eosio::kv::map< TableName, K, V, IndexName >::find(
    const key_t & k
) const

This will take a key_t 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 lower_bound

iterator_t eosio::kv::map< TableName, K, V, IndexName >::lower_bound(
    const key_t & k
) const

This will take a key_t 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 upper_bound

iterator_t eosio::kv::map< TableName, K, V, IndexName >::upper_bound(
    const key_t & k
) const

This will take a key_t key and find the value that is strictly greater than that key.

If no element is strictly greater than the key the iterator will now hold end.

Parameters:

  • key This is the key which you wish to query with.