BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
A simple index uses a vector<unique_ptr<T>> to store data. More...
#include <simple_index.hpp>
Classes | |
class | const_iterator |
Public Types | |
using | object_type = T |
Public Member Functions | |
virtual const object & | create (const std::function< void(object &)> &constructor) override |
virtual void | modify (const object &obj, const std::function< void(object &)> &modify_callback) override |
virtual const object & | insert (object &&obj) override |
virtual void | remove (const object &obj) override |
virtual const object * | find (object_id_type id) const override |
virtual void | inspect_all_objects (std::function< void(const object &)> inspector) const override |
const_iterator | begin () const |
const_iterator | end () const |
size_t | size () 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 |
A simple index uses a vector<unique_ptr<T>> to store data.
This index is preferred in situations where the data will never be removed from main memory and when access by ID is the only kind of access that is necessary.
Definition at line 38 of file simple_index.hpp.
using graphene::db::simple_index< T >::object_type = T |
Definition at line 41 of file simple_index.hpp.
|
inline |
Definition at line 134 of file simple_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.
Definition at line 43 of file simple_index.hpp.
|
inline |
Definition at line 135 of file simple_index.hpp.
|
inlineoverridevirtual |
Implements graphene::db::index.
Definition at line 81 of file simple_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.
Definition at line 62 of file simple_index.hpp.
|
inlineoverridevirtual |
Implements graphene::db::index.
Definition at line 91 of file simple_index.hpp.
|
inlineoverridevirtual |
Implements graphene::db::index.
Definition at line 56 of file simple_index.hpp.
|
inlineoverridevirtual |
Implements graphene::db::index.
Definition at line 72 of file simple_index.hpp.
|
inline |
Definition at line 137 of file simple_index.hpp.