Scorum
bucket_object.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <boost/multi_index/composite_key.hpp>
4 
8 #include <fc/shared_containers.hpp>
9 
10 #ifndef BLOCKCHAIN_STATISTICS_SPACE_ID
11 #define BLOCKCHAIN_STATISTICS_SPACE_ID 9
12 #endif
13 
14 namespace scorum {
15 namespace blockchain_monitoring {
16 
17 using namespace scorum::chain;
18 
20 {
22 };
23 
25  public base_metric,
26  public object<bucket_object_type, bucket_object>
27 {
28  CHAINBASE_DEFAULT_DYNAMIC_CONSTRUCTOR(bucket_object, (missed_blocks))
29 
30  id_type id;
31 
32  fc::shared_map<uint32_t, account_name_type> missed_blocks;
33 };
34 
36 
37 struct by_id;
38 typedef shared_multi_index_container<bucket_object,
39  indexed_by<ordered_unique<tag<by_id>,
40  member<bucket_object,
42  &bucket_object::id>>,
43  ordered_unique<tag<common_statistics::by_bucket>,
44  composite_key<bucket_object,
45  member<common_statistics::
46  base_bucket_object,
47  uint32_t,
48  &common_statistics::
49  base_bucket_object::seconds>,
50  member<common_statistics::
51  base_bucket_object,
52  fc::time_point_sec,
53  &common_statistics::
54  base_bucket_object::open>>>>>
56 } // namespace blockchain_monitoring
57 } // namespace scorum
58 
59 FC_REFLECT_DERIVED(scorum::blockchain_monitoring::bucket_object,
60  (scorum::common_statistics::base_bucket_object)(scorum::blockchain_monitoring::base_metric),
61  (id))
62 
63 CHAINBASE_SET_INDEX_TYPE(scorum::blockchain_monitoring::bucket_object, scorum::blockchain_monitoring::bucket_index)
#define BLOCKCHAIN_STATISTICS_SPACE_ID
Definition: game.cpp:4
shared_multi_index_container< bucket_object, indexed_by< ordered_unique< tag< by_id >, member< bucket_object, bucket_id_type, &bucket_object::id > >, ordered_unique< tag< common_statistics::by_bucket >, composite_key< bucket_object, member< common_statistics::base_bucket_object, uint32_t, &common_statistics::base_bucket_object::seconds >, member< common_statistics::base_bucket_object, fc::time_point_sec, &common_statistics::base_bucket_object::open > > > > > bucket_index
fc::fixed_string_16 account_name_type
Definition: types.hpp:62
Definition: asset.cpp:15