Scorum
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
operation_objects.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <fc/shared_buffer.hpp>
6 
10 
13 
14 #include <boost/multi_index/composite_key.hpp>
15 
16 namespace scorum {
17 namespace blockchain_history {
18 
21 
22 class operation_object : public object<operations_history, operation_object>
23 {
24 public:
25  CHAINBASE_DEFAULT_DYNAMIC_CONSTRUCTOR(operation_object, (serialized_op))
26 
27  typedef typename object<operations_history, operation_object>::id_type id_type;
28 
29  id_type id;
30 
32  uint32_t block = 0;
33  uint32_t trx_in_block = 0;
34  uint16_t op_in_trx = 0;
35  fc::time_point_sec timestamp;
36  fc::shared_buffer serialized_op;
37 };
38 
39 struct by_location;
40 struct by_timestamp;
41 struct by_transaction_id;
42 typedef shared_multi_index_container<operation_object,
43  indexed_by<ordered_unique<tag<by_id>,
44  member<operation_object,
46  &operation_object::id>>,
47  ordered_unique<tag<by_location>,
48  composite_key<operation_object,
49  member<operation_object,
50  uint32_t,
52  member<operation_object,
53  uint32_t,
55  member<operation_object,
56  uint16_t,
58  member<operation_object,
60  &operation_object::id>>>,
61  ordered_unique<tag<by_timestamp>,
62  composite_key<operation_object,
63  member<operation_object,
64  fc::time_point_sec,
66  member<operation_object,
68  &operation_object::id>>>
69 #ifndef SKIP_BY_TX_ID
70  ,
71  ordered_unique<tag<by_transaction_id>,
72  composite_key<operation_object,
73  member<operation_object,
76  member<operation_object,
79 #endif
80  >>
82 
83 template <blockchain_history_object_type OperationType>
84 class filtered_operation_object : public object<OperationType, filtered_operation_object<OperationType>>
85 {
86 public:
87  CHAINBASE_DEFAULT_CONSTRUCTOR(filtered_operation_object)
88 
89  typedef typename object<OperationType, filtered_operation_object<OperationType>>::id_type id_type;
90 
91  id_type id;
93 };
94 
95 template <blockchain_history_object_type OperationType>
97  = shared_multi_index_container<filtered_operation_object<OperationType>,
98  indexed_by<ordered_unique<tag<by_id>,
99  member<filtered_operation_object<OperationType>,
100  typename filtered_operation_object<OperationType>::
101  id_type,
102  &filtered_operation_object<OperationType>::id>>>>;
103 
107 
111 }
112 }
113 
114 FC_REFLECT(scorum::blockchain_history::operation_object,
116 CHAINBASE_SET_INDEX_TYPE(scorum::blockchain_history::operation_object, scorum::blockchain_history::operation_index)
117 
118 FC_REFLECT(scorum::blockchain_history::filtered_not_virt_operations_history_object, (id)(op))
119 CHAINBASE_SET_INDEX_TYPE(scorum::blockchain_history::filtered_not_virt_operations_history_object,
121 FC_REFLECT(scorum::blockchain_history::filtered_virt_operations_history_object, (id)(op))
122 CHAINBASE_SET_INDEX_TYPE(scorum::blockchain_history::filtered_virt_operations_history_object,
123  scorum::blockchain_history::filtered_virt_operations_history_index)
124 FC_REFLECT(scorum::blockchain_history::filtered_market_operations_history_object, (id)(op))
125 CHAINBASE_SET_INDEX_TYPE(scorum::blockchain_history::filtered_market_operations_history_object,
object< OperationType, filtered_operation_object< OperationType > >::id_type id_type
object< operations_history, operation_object >::id_type id_type
FC_REFLECT(appender_args,(appender)(stream)) FC_REFLECT_DERIVED(file_appender_args
Definition: game.cpp:4
filtered_operation_index< filtered_market_operations_history > filtered_market_operations_history_index
filtered_operation_index< filtered_virt_operations_history > filtered_virt_operations_history_index
shared_multi_index_container< operation_object, indexed_by< ordered_unique< tag< by_id >, member< operation_object, operation_object::id_type, &operation_object::id > >, ordered_unique< tag< by_location >, composite_key< operation_object, member< operation_object, uint32_t, &operation_object::block >, member< operation_object, uint32_t, &operation_object::trx_in_block >, member< operation_object, uint16_t, &operation_object::op_in_trx >, member< operation_object, operation_object::id_type, &operation_object::id > > >, ordered_unique< tag< by_timestamp >, composite_key< operation_object, member< operation_object, fc::time_point_sec, &operation_object::timestamp >, member< operation_object, operation_object::id_type, &operation_object::id > > >, ordered_unique< tag< by_transaction_id >, composite_key< operation_object, member< operation_object, transaction_id_type, &operation_object::trx_id >, member< operation_object, operation_object::id_type, &operation_object::id > > > > > operation_index
shared_multi_index_container< filtered_operation_object< OperationType >, indexed_by< ordered_unique< tag< by_id >, member< filtered_operation_object< OperationType >, typename filtered_operation_object< OperationType >::id_type, &filtered_operation_object< OperationType >::id > >> > filtered_operation_index
filtered_operation_index< filtered_not_virt_operations_history > filtered_not_virt_operations_history_index
fc::ripemd160 transaction_id_type
Definition: types.hpp:65
fc::static_variant< vote_operation, comment_operation, transfer_operation, transfer_to_scorumpower_operation, withdraw_scorumpower_operation, account_create_by_committee_operation, account_create_operation, account_create_with_delegation_operation, account_update_operation, witness_update_operation, account_witness_vote_operation, account_witness_proxy_operation, delete_comment_operation, comment_options_operation, set_withdraw_scorumpower_route_to_account_operation, set_withdraw_scorumpower_route_to_dev_pool_operation, prove_authority_operation, request_account_recovery_operation, recover_account_operation, change_recovery_account_operation, escrow_approve_operation, escrow_dispute_operation, escrow_release_operation, escrow_transfer_operation, decline_voting_rights_operation, delegate_scorumpower_operation, create_budget_operation, close_budget_operation, proposal_vote_operation, proposal_create_operation, atomicswap_initiate_operation, atomicswap_redeem_operation, atomicswap_refund_operation, close_budget_by_advertising_moderator_operation, update_budget_operation, create_game_operation, cancel_game_operation, update_game_markets_operation, update_game_start_time_operation, post_game_results_operation, post_bet_operation, cancel_pending_bets_operation, delegate_sp_from_reg_pool_operation, create_nft_operation, update_nft_meta_operation, create_game_round_operation, update_game_round_result_operation, adjust_nft_experience_operation, update_nft_name_operation, author_reward_operation, comment_benefficiary_reward_operation, comment_payout_update_operation, comment_reward_operation, curation_reward_operation, hardfork_operation, producer_reward_operation, active_sp_holders_reward_operation, return_scorumpower_delegation_operation, shutdown_witness_operation, witness_miss_block_operation, expired_contract_refund_operation, acc_finished_vesting_withdraw_operation, devpool_finished_vesting_withdraw_operation, acc_to_acc_vesting_withdraw_operation, devpool_to_acc_vesting_withdraw_operation, acc_to_devpool_vesting_withdraw_operation, devpool_to_devpool_vesting_withdraw_operation, proposal_virtual_operation, budget_outgo_operation, budget_owner_income_operation, active_sp_holders_reward_legacy_operation, budget_closing_operation, bets_matched_operation, game_status_changed_operation, bet_resolved_operation, bet_cancelled_operation, bet_restored_operation, bet_updated_operation > operation
Definition: operations.hpp:112
Definition: asset.cpp:15