#include <database_utils.hpp>
|
template<typename F > |
static void | walk (const chainbase::database &db, F function) |
|
template<typename Secondary , typename Key , typename F > |
static void | walk_range (const chainbase::database &db, const Key &begin_key, const Key &end_key, F function) |
|
template<typename Secondary , typename Key > |
static size_t | size_range (const chainbase::database &db, const Key &begin_key, const Key &end_key) |
|
template<typename F > |
static void | create (chainbase::database &db, F cons) |
|
template<typename Index>
class sysio::chain::index_utils< Index >
Definition at line 13 of file database_utils.hpp.
◆ index_t
template<typename Index >
◆ create()
template<typename Index >
template<typename F >
Definition at line 50 of file database_utils.hpp.
50 {
51 db.
create<
typename index_t::value_type>(cons);
52 }
const ObjectType & create(Constructor &&con)
◆ size_range()
template<typename Index >
template<typename Secondary , typename Key >
Definition at line 38 of file database_utils.hpp.
38 {
39 const auto& idx = db.
get_index<Index, Secondary>();
40 auto begin_itr = idx.lower_bound(begin_key);
41 auto end_itr = idx.lower_bound(end_key);
42 size_t res = 0;
43 while (begin_itr != end_itr) {
44 res++; ++begin_itr;
45 }
46 return res;
47 }
const generic_index< MultiIndexType > & get_index() const
◆ walk()
template<typename Index >
template<typename F >
Definition at line 18 of file database_utils.hpp.
18 {
19 auto const& index = db.
get_index<Index>().indices();
20 const auto& first = index.begin();
21 const auto& last = index.end();
22 for (auto itr = first; itr != last; ++itr) {
23 function(*itr);
24 }
25 }
◆ walk_range()
template<typename Index >
template<typename Secondary , typename Key , typename F >
Definition at line 28 of file database_utils.hpp.
28 {
29 const auto& idx = db.
get_index<Index, Secondary>();
30 auto begin_itr = idx.lower_bound(begin_key);
31 auto end_itr = idx.lower_bound(end_key);
32 for (auto itr = begin_itr; itr != end_itr; ++itr) {
33 function(*itr);
34 }
35 }
The documentation for this class was generated from the following file: