BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Member Functions | Public Attributes | List of all members
graphene::db::object Class Referenceabstract

base for all database objects More...

#include <object.hpp>

Inheritance diagram for graphene::db::object:
graphene::db::base_abstract_object< account_balance_object > graphene::db::base_abstract_object< account_history_object > graphene::db::base_abstract_object< account_object > graphene::db::base_abstract_object< account_statistics_object > graphene::db::base_abstract_object< account_storage_object > graphene::db::base_abstract_object< asset_bitasset_data_object > graphene::db::base_abstract_object< asset_dynamic_data_object > graphene::db::base_abstract_object< asset_object > graphene::db::base_abstract_object< balance_object > graphene::db::base_abstract_object< blinded_balance_object > graphene::db::base_abstract_object< block_summary_object > graphene::db::base_abstract_object< bucket_object > graphene::db::base_abstract_object< budget_record_object > graphene::db::base_abstract_object< buyback_object > graphene::db::base_abstract_object< call_order_object > graphene::db::base_abstract_object< chain_property_object > graphene::db::base_abstract_object< collateral_bid_object > graphene::db::base_abstract_object< committee_member_object > graphene::db::base_abstract_object< credit_deal_object > graphene::db::base_abstract_object< credit_deal_summary_object > graphene::db::base_abstract_object< credit_offer_object > graphene::db::base_abstract_object< custom_authority_object > graphene::db::base_abstract_object< dynamic_global_property_object > graphene::db::base_abstract_object< exceeded_account_object > graphene::db::base_abstract_object< fba_accumulator_object > graphene::db::base_abstract_object< force_settlement_object > graphene::db::base_abstract_object< global_property_object > graphene::db::base_abstract_object< htlc_object > graphene::db::base_abstract_object< limit_order_object > graphene::db::base_abstract_object< liquidity_pool_history_object > graphene::db::base_abstract_object< liquidity_pool_object > graphene::db::base_abstract_object< liquidity_pool_ticker_object > graphene::db::base_abstract_object< lp_ticker_meta_object > graphene::db::base_abstract_object< market_ticker_meta_object > graphene::db::base_abstract_object< market_ticker_object > graphene::db::base_abstract_object< operation_history_object > graphene::db::base_abstract_object< order_history_object > graphene::db::base_abstract_object< proposal_object > graphene::db::base_abstract_object< samet_fund_object > graphene::db::base_abstract_object< special_authority_object > graphene::db::base_abstract_object< ticket_object > graphene::db::base_abstract_object< transaction_history_object > graphene::db::base_abstract_object< vesting_balance_object > graphene::db::base_abstract_object< withdraw_permission_object > graphene::db::base_abstract_object< witness_object > graphene::db::base_abstract_object< witness_schedule_object > graphene::db::base_abstract_object< worker_object > graphene::db::base_abstract_object< DerivedClass >

Public Member Functions

 object ()=default
 
 object (uint8_t space_id, uint8_t type_id)
 
virtual ~object ()=default
 
virtual std::unique_ptr< objectclone () const =0
 
virtual void move_from (object &obj)=0
 
virtual fc::variant to_variant () const =0
 
virtual std::vector< char > pack () const =0
 

Public Attributes

object_id_type id
 

Detailed Description

base for all database objects

The object is the fundamental building block of the database and is the level upon which undo/redo operations are performed. Objects are used to track data and their relationships and provide an effecient means to find and update information.

Objects are assigned a unique and sequential object ID by the database within the id_space defined in the object.

All objects must be serializable via FC_REFLECT() and their content must be faithfully restored. Additionally all objects must be copy-constructable and assignable in a relatively efficient manner. In general this means that objects should only refer to other objects by ID and avoid expensive operations when they are copied, especially if they are modified frequently.

Additionally all objects may be annotated by plugins which wish to maintain additional information to an object. There can be at most one annotation per id_space for each object. An example of an annotation would be tracking extra data not required by validation such as the name and description of a user asset. By carefully organizing how information is organized and tracked systems can minimize the workload to only that which is necessary to perform their function.

Note
Do not use multiple inheritance with object because the code assumes a static_cast will work between object and derived types.

Definition at line 61 of file object.hpp.

Constructor & Destructor Documentation

◆ object() [1/2]

graphene::db::object::object ( )
default

◆ object() [2/2]

graphene::db::object::object ( uint8_t  space_id,
uint8_t  type_id 
)
inline

Definition at line 65 of file object.hpp.

◆ ~object()

virtual graphene::db::object::~object ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual std::unique_ptr<object> graphene::db::object::clone ( ) const
pure virtual

these methods are implemented for derived classes by inheriting base_abstract_object<DerivedClass>

Implemented in graphene::db::base_abstract_object< DerivedClass >.

◆ move_from()

virtual void graphene::db::object::move_from ( object obj)
pure virtual

Implemented in graphene::db::base_abstract_object< DerivedClass >, graphene::db::base_abstract_object< committee_member_object >, graphene::db::base_abstract_object< balance_object >, graphene::db::base_abstract_object< call_order_object >, graphene::db::base_abstract_object< dynamic_global_property_object >, graphene::db::base_abstract_object< order_history_object >, graphene::db::base_abstract_object< force_settlement_object >, graphene::db::base_abstract_object< operation_history_object >, graphene::db::base_abstract_object< special_authority_object >, graphene::db::base_abstract_object< asset_bitasset_data_object >, graphene::db::base_abstract_object< chain_property_object >, graphene::db::base_abstract_object< vesting_balance_object >, graphene::db::base_abstract_object< exceeded_account_object >, graphene::db::base_abstract_object< lp_ticker_meta_object >, graphene::db::base_abstract_object< buyback_object >, graphene::db::base_abstract_object< worker_object >, graphene::db::base_abstract_object< collateral_bid_object >, graphene::db::base_abstract_object< market_ticker_meta_object >, graphene::db::base_abstract_object< global_property_object >, graphene::db::base_abstract_object< account_object >, graphene::db::base_abstract_object< htlc_object >, graphene::db::base_abstract_object< account_storage_object >, graphene::db::base_abstract_object< custom_authority_object >, graphene::db::base_abstract_object< liquidity_pool_ticker_object >, graphene::db::base_abstract_object< withdraw_permission_object >, graphene::db::base_abstract_object< samet_fund_object >, graphene::db::base_abstract_object< account_balance_object >, graphene::db::base_abstract_object< witness_object >, graphene::db::base_abstract_object< fba_accumulator_object >, graphene::db::base_abstract_object< proposal_object >, graphene::db::base_abstract_object< ticket_object >, graphene::db::base_abstract_object< credit_offer_object >, graphene::db::base_abstract_object< budget_record_object >, graphene::db::base_abstract_object< liquidity_pool_object >, graphene::db::base_abstract_object< blinded_balance_object >, graphene::db::base_abstract_object< transaction_history_object >, graphene::db::base_abstract_object< bucket_object >, graphene::db::base_abstract_object< market_ticker_object >, graphene::db::base_abstract_object< witness_schedule_object >, graphene::db::base_abstract_object< asset_dynamic_data_object >, graphene::db::base_abstract_object< account_history_object >, graphene::db::base_abstract_object< liquidity_pool_history_object >, graphene::db::base_abstract_object< credit_deal_summary_object >, graphene::db::base_abstract_object< asset_object >, graphene::db::base_abstract_object< credit_deal_object >, graphene::db::base_abstract_object< block_summary_object >, graphene::db::base_abstract_object< account_statistics_object >, and graphene::db::base_abstract_object< limit_order_object >.

◆ pack()

virtual std::vector<char> graphene::db::object::pack ( ) const
pure virtual

◆ to_variant()

virtual fc::variant graphene::db::object::to_variant ( ) const
pure virtual

Member Data Documentation

◆ id

object_id_type graphene::db::object::id

Definition at line 69 of file object.hpp.


The documentation for this class was generated from the following file: