class eosio::kv::table

Class List > eosio :: kv :: table

Defines an EOSIO Key Value Table. More...

Classes

Type Name
class base_iterator
class index
Defines an index on an EOSIO Key Value Table.
class iterator
class reverse_iterator

Public Types

Type Name
typedef table::iterator iterator
typedef T value_type

Public Functions

Type Name
table (const table &) = delete
table (table &&) = delete
table & operator= (const table &) = delete
table & operator= (table &&) = delete
void put (const T & value, eosio::name payer)
void erase (const T & value)

Protected Functions

Type Name
table () = default
void setup_indices (I & index)
void init (eosio::name contract, PrimaryIndex & prim_index, SecondaryIndices &... indices)

Detailed Description

EOSIO Key Value API provides a C++ interface to the EOSIO Key Value database. Key Value Tables require 1 primary index, of any type that can be serialized to a binary representation. Key Value Tables support 0 or more secondary index, of any type that can be serialized to a binary representation. Indexes must be a member variable or a member function.

Template parameters:

  • T - the type of the data stored as the value in the table

Public Types Documentation

typedef iterator (2/2)

using eosio::kv::table< T, TableName >::iterator =  table::iterator;

typedef value_type

using eosio::kv::table< T, TableName >::value_type =  T;

Public Functions Documentation

function table (1/3)

eosio::kv::table< T, TableName >::table(
    const table & 
) = delete

function table (2/3)

eosio::kv::table< T, TableName >::table(
    table && 
) = delete

function operator= (1/2)

table& eosio::kv::table< T, TableName >::operator=(
    const table & 
) = delete

function operator= (2/2)

table& eosio::kv::table< T, TableName >::operator=(
    table && 
) = delete

function put

void eosio::kv::table< T, TableName >::put(
    const T & value,
    eosio::name payer
)

Puts a value into the table. If the value already exists, it updates the existing entry. The key is determined from the defined primary index. If the put attempts to store over an existing secondary index, the transaction will be aborted.

Parameters:

  • value - The entry to be stored in the table.
  • payer - The payer for the entry.

function erase

void eosio::kv::table< T, TableName >::erase(
    const T & value
)

Removes a value from the table.

Parameters:

  • key - The key of the value to be removed.

Protected Functions Documentation

function table (3/3)

eosio::kv::table< T, TableName >::table() = default

function setup_indices

template<typename I>
void eosio::kv::table< T, TableName >::setup_indices(
    I & index
)

function init

template<typename PrimaryIndex, typename... SecondaryIndices>
void eosio::kv::table< T, TableName >::init(
    eosio::name contract,
    PrimaryIndex & prim_index,
    SecondaryIndices &... indices
)

The documentation for this class was generated from the following file: libraries/eosiolib/contracts/eosio/table.hpp