BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
#include <generic_index.hpp>
Public Types | |
using | index_type = MultiIndexType |
using | object_type = ObjectType |
Public Member Functions | |
const object & | insert (object &&obj) override |
const object & | create (const std::function< void(object &)> &constructor) override |
void | modify (const object &obj, const std::function< void(object &)> &m) override |
void | remove (const object &obj) override |
const object * | find (object_id_type id) const override |
void | inspect_all_objects (std::function< void(const object &)> inspector) const override |
const index_type & | indices () const |
Public Member Functions inherited from graphene::db::index | |
virtual | ~index ()=default |
virtual uint8_t | object_space_id () const =0 |
virtual uint8_t | object_type_id () const =0 |
virtual object_id_type | get_next_id () const =0 |
virtual void | use_next_id ()=0 |
virtual void | set_next_id (object_id_type id)=0 |
virtual const object & | load (const std::vector< char > &data)=0 |
virtual void | open (const fc::path &db)=0 |
virtual void | save (const fc::path &db)=0 |
const object & | get (object_id_type id) const |
template<typename Object , typename Lambda > | |
void | modify (const Object &obj, const Lambda &l) |
virtual void | add_observer (const std::shared_ptr< index_observer > &)=0 |
virtual void | object_from_variant (const fc::variant &var, object &obj, uint32_t max_depth) const =0 |
virtual void | object_default (object &obj) const =0 |
Almost all objects can be tracked and managed via a boost::multi_index container that uses an unordered_unique key on the object ID. This template class adapts the generic index interface to work with arbitrary boost multi_index containers on the same type.
Definition at line 43 of file generic_index.hpp.
using graphene::db::generic_index< ObjectType, MultiIndexType >::index_type = MultiIndexType |
Definition at line 46 of file generic_index.hpp.
using graphene::db::generic_index< ObjectType, MultiIndexType >::object_type = ObjectType |
Definition at line 47 of file generic_index.hpp.
|
inlineoverridevirtual |
Builds a new object and assigns it the next available ID and then initializes it with constructor and lastly inserts it into the index.
Implements graphene::db::index.
Reimplemented in graphene::db::primary_index< graphene::db::generic_index >.
Definition at line 58 of file generic_index.hpp.
|
inlineoverridevirtual |
Implements graphene::db::index.
Reimplemented in graphene::db::primary_index< graphene::db::generic_index >.
Definition at line 98 of file generic_index.hpp.
|
inline |
Definition at line 115 of file generic_index.hpp.
|
inlineoverridevirtual |
Polymorphically insert by moving an object into the index. this should throw if the object is already in the database.
Implements graphene::db::index.
Reimplemented in graphene::db::primary_index< graphene::db::generic_index >.
Definition at line 49 of file generic_index.hpp.
|
inlineoverridevirtual |
Implements graphene::db::index.
Definition at line 107 of file generic_index.hpp.
|
inlineoverridevirtual |
Implements graphene::db::index.
Reimplemented in graphene::db::primary_index< graphene::db::generic_index >.
Definition at line 70 of file generic_index.hpp.
|
inlineoverridevirtual |
Implements graphene::db::index.
Reimplemented in graphene::db::primary_index< graphene::db::generic_index >.
Definition at line 93 of file generic_index.hpp.