BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
Public Member Functions | Public Attributes | Static 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::abstract_object< account_balance_object > graphene::db::abstract_object< account_object > graphene::db::abstract_object< account_statistics_object > graphene::db::abstract_object< account_storage_object > graphene::db::abstract_object< account_transaction_history_object > graphene::db::abstract_object< asset_bitasset_data_object > graphene::db::abstract_object< asset_dynamic_data_object > graphene::db::abstract_object< asset_object > graphene::db::abstract_object< balance_object > graphene::db::abstract_object< blinded_balance_object > graphene::db::abstract_object< block_summary_object > graphene::db::abstract_object< bucket_object > graphene::db::abstract_object< budget_record_object > graphene::db::abstract_object< buyback_object > graphene::db::abstract_object< call_order_object > graphene::db::abstract_object< chain_property_object > graphene::db::abstract_object< collateral_bid_object > graphene::db::abstract_object< committee_member_object > graphene::db::abstract_object< custom_authority_object > graphene::db::abstract_object< dynamic_global_property_object > graphene::db::abstract_object< fba_accumulator_object > graphene::db::abstract_object< force_settlement_object > graphene::db::abstract_object< global_property_object > graphene::db::abstract_object< htlc_object > graphene::db::abstract_object< limit_order_object > graphene::db::abstract_object< market_ticker_meta_object > graphene::db::abstract_object< market_ticker_object > graphene::db::abstract_object< operation_history_object > graphene::db::abstract_object< order_history_object > graphene::db::abstract_object< proposal_object > graphene::db::abstract_object< special_authority_object > graphene::db::abstract_object< ticket_object > graphene::db::abstract_object< transaction_history_object > graphene::db::abstract_object< vesting_balance_object > graphene::db::abstract_object< withdraw_permission_object > graphene::db::abstract_object< witness_object > graphene::db::abstract_object< witness_schedule_object > graphene::db::abstract_object< worker_object > graphene::db::abstract_object< DerivedClass >

Public Member Functions

 object ()
 
virtual ~object ()
 
virtual unique_ptr< objectclone () const =0
 these methods are implemented for derived classes by inheriting abstract_object<DerivedClass> More...
 
virtual void move_from (object &obj)=0
 
virtual variant to_variant () const =0
 
virtual vector< char > pack () const =0
 

Public Attributes

object_id_type id
 

Static Public Attributes

static const uint8_t space_id = 0
 
static const uint8_t type_id = 0
 

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 62 of file object.hpp.

Constructor & Destructor Documentation

graphene::db::object::object ( )
inline

Definition at line 65 of file object.hpp.

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

Definition at line 66 of file object.hpp.

Member Function Documentation

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

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

Implemented in graphene::db::abstract_object< DerivedClass >, graphene::db::abstract_object< dynamic_global_property_object >, graphene::db::abstract_object< committee_member_object >, graphene::db::abstract_object< call_order_object >, graphene::db::abstract_object< balance_object >, graphene::db::abstract_object< order_history_object >, graphene::db::abstract_object< operation_history_object >, graphene::db::abstract_object< special_authority_object >, graphene::db::abstract_object< force_settlement_object >, graphene::db::abstract_object< asset_bitasset_data_object >, graphene::db::abstract_object< chain_property_object >, graphene::db::abstract_object< account_transaction_history_object >, graphene::db::abstract_object< vesting_balance_object >, graphene::db::abstract_object< collateral_bid_object >, graphene::db::abstract_object< worker_object >, graphene::db::abstract_object< market_ticker_meta_object >, graphene::db::abstract_object< buyback_object >, graphene::db::abstract_object< account_storage_object >, graphene::db::abstract_object< account_object >, graphene::db::abstract_object< global_property_object >, graphene::db::abstract_object< htlc_object >, graphene::db::abstract_object< custom_authority_object >, graphene::db::abstract_object< withdraw_permission_object >, graphene::db::abstract_object< ticket_object >, graphene::db::abstract_object< fba_accumulator_object >, graphene::db::abstract_object< witness_object >, graphene::db::abstract_object< proposal_object >, graphene::db::abstract_object< account_balance_object >, graphene::db::abstract_object< budget_record_object >, graphene::db::abstract_object< bucket_object >, graphene::db::abstract_object< transaction_history_object >, graphene::db::abstract_object< blinded_balance_object >, graphene::db::abstract_object< market_ticker_object >, graphene::db::abstract_object< asset_dynamic_data_object >, graphene::db::abstract_object< witness_schedule_object >, graphene::db::abstract_object< asset_object >, graphene::db::abstract_object< limit_order_object >, graphene::db::abstract_object< account_statistics_object >, and graphene::db::abstract_object< block_summary_object >.

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

Implemented in graphene::db::abstract_object< DerivedClass >, graphene::db::abstract_object< dynamic_global_property_object >, graphene::db::abstract_object< committee_member_object >, graphene::db::abstract_object< call_order_object >, graphene::db::abstract_object< balance_object >, graphene::db::abstract_object< order_history_object >, graphene::db::abstract_object< operation_history_object >, graphene::db::abstract_object< special_authority_object >, graphene::db::abstract_object< force_settlement_object >, graphene::db::abstract_object< asset_bitasset_data_object >, graphene::db::abstract_object< chain_property_object >, graphene::db::abstract_object< account_transaction_history_object >, graphene::db::abstract_object< vesting_balance_object >, graphene::db::abstract_object< collateral_bid_object >, graphene::db::abstract_object< worker_object >, graphene::db::abstract_object< market_ticker_meta_object >, graphene::db::abstract_object< buyback_object >, graphene::db::abstract_object< account_storage_object >, graphene::db::abstract_object< account_object >, graphene::db::abstract_object< global_property_object >, graphene::db::abstract_object< htlc_object >, graphene::db::abstract_object< custom_authority_object >, graphene::db::abstract_object< withdraw_permission_object >, graphene::db::abstract_object< ticket_object >, graphene::db::abstract_object< fba_accumulator_object >, graphene::db::abstract_object< witness_object >, graphene::db::abstract_object< proposal_object >, graphene::db::abstract_object< account_balance_object >, graphene::db::abstract_object< budget_record_object >, graphene::db::abstract_object< bucket_object >, graphene::db::abstract_object< transaction_history_object >, graphene::db::abstract_object< blinded_balance_object >, graphene::db::abstract_object< market_ticker_object >, graphene::db::abstract_object< asset_dynamic_data_object >, graphene::db::abstract_object< witness_schedule_object >, graphene::db::abstract_object< asset_object >, graphene::db::abstract_object< limit_order_object >, graphene::db::abstract_object< account_statistics_object >, and graphene::db::abstract_object< block_summary_object >.

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

Implemented in graphene::db::abstract_object< DerivedClass >, graphene::db::abstract_object< dynamic_global_property_object >, graphene::db::abstract_object< committee_member_object >, graphene::db::abstract_object< call_order_object >, graphene::db::abstract_object< balance_object >, graphene::db::abstract_object< order_history_object >, graphene::db::abstract_object< operation_history_object >, graphene::db::abstract_object< special_authority_object >, graphene::db::abstract_object< force_settlement_object >, graphene::db::abstract_object< asset_bitasset_data_object >, graphene::db::abstract_object< chain_property_object >, graphene::db::abstract_object< account_transaction_history_object >, graphene::db::abstract_object< vesting_balance_object >, graphene::db::abstract_object< collateral_bid_object >, graphene::db::abstract_object< worker_object >, graphene::db::abstract_object< market_ticker_meta_object >, graphene::db::abstract_object< buyback_object >, graphene::db::abstract_object< account_storage_object >, graphene::db::abstract_object< account_object >, graphene::db::abstract_object< global_property_object >, graphene::db::abstract_object< htlc_object >, graphene::db::abstract_object< custom_authority_object >, graphene::db::abstract_object< withdraw_permission_object >, graphene::db::abstract_object< ticket_object >, graphene::db::abstract_object< fba_accumulator_object >, graphene::db::abstract_object< witness_object >, graphene::db::abstract_object< proposal_object >, graphene::db::abstract_object< account_balance_object >, graphene::db::abstract_object< budget_record_object >, graphene::db::abstract_object< bucket_object >, graphene::db::abstract_object< transaction_history_object >, graphene::db::abstract_object< blinded_balance_object >, graphene::db::abstract_object< market_ticker_object >, graphene::db::abstract_object< asset_dynamic_data_object >, graphene::db::abstract_object< witness_schedule_object >, graphene::db::abstract_object< asset_object >, graphene::db::abstract_object< limit_order_object >, graphene::db::abstract_object< account_statistics_object >, and graphene::db::abstract_object< block_summary_object >.

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

Implemented in graphene::db::abstract_object< DerivedClass >, graphene::db::abstract_object< dynamic_global_property_object >, graphene::db::abstract_object< committee_member_object >, graphene::db::abstract_object< call_order_object >, graphene::db::abstract_object< balance_object >, graphene::db::abstract_object< order_history_object >, graphene::db::abstract_object< operation_history_object >, graphene::db::abstract_object< special_authority_object >, graphene::db::abstract_object< force_settlement_object >, graphene::db::abstract_object< asset_bitasset_data_object >, graphene::db::abstract_object< chain_property_object >, graphene::db::abstract_object< account_transaction_history_object >, graphene::db::abstract_object< vesting_balance_object >, graphene::db::abstract_object< collateral_bid_object >, graphene::db::abstract_object< worker_object >, graphene::db::abstract_object< market_ticker_meta_object >, graphene::db::abstract_object< buyback_object >, graphene::db::abstract_object< account_storage_object >, graphene::db::abstract_object< account_object >, graphene::db::abstract_object< global_property_object >, graphene::db::abstract_object< htlc_object >, graphene::db::abstract_object< custom_authority_object >, graphene::db::abstract_object< withdraw_permission_object >, graphene::db::abstract_object< ticket_object >, graphene::db::abstract_object< fba_accumulator_object >, graphene::db::abstract_object< witness_object >, graphene::db::abstract_object< proposal_object >, graphene::db::abstract_object< account_balance_object >, graphene::db::abstract_object< budget_record_object >, graphene::db::abstract_object< bucket_object >, graphene::db::abstract_object< transaction_history_object >, graphene::db::abstract_object< blinded_balance_object >, graphene::db::abstract_object< market_ticker_object >, graphene::db::abstract_object< asset_dynamic_data_object >, graphene::db::abstract_object< witness_schedule_object >, graphene::db::abstract_object< asset_object >, graphene::db::abstract_object< limit_order_object >, graphene::db::abstract_object< account_statistics_object >, and graphene::db::abstract_object< block_summary_object >.

Member Data Documentation

object_id_type graphene::db::object::id

Definition at line 73 of file object.hpp.

const uint8_t graphene::db::object::space_id = 0
static

Definition at line 68 of file object.hpp.

const uint8_t graphene::db::object::type_id = 0
static

Definition at line 69 of file object.hpp.


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