CatapultServer  v0.5.0.1 (Elephant)
AccountActivityBuckets.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "CompactArrayStack.h"
24 #include "catapult/functions.h"
25 
26 namespace catapult { namespace state {
27 
30  public:
35 
37  uint32_t BeneficiaryCount = 0;
38 
40  uint64_t RawScore = 0;
41  };
42 
47  };
48 
49  private:
51 
52  public:
55 
56  public:
60 
64 
66  void pop();
67 
68  public:
70  ActivityBucketStack::const_iterator begin() const;
71 
73  ActivityBucketStack::const_iterator end() const;
74 
75  private:
76  bool tryUpdate(
79  bool shouldCreateNewBucket);
80 
81  private:
83  };
84 }}
ImportanceHeight.h
catapult::state::AccountActivityBuckets::pop
void pop()
Pops the current bucket.
Definition: AccountActivityBuckets.cpp:41
catapult::state::AccountActivityBuckets::m_buckets
ActivityBucketStack m_buckets
Definition: AccountActivityBuckets.h:82
catapult::state::CompactArrayStack::peek
const T & peek() const
Returns a const reference to the element on the top of the stack.
Definition: CompactArrayStack.h:161
catapult::state::AccountActivityBuckets
Stack of account activity buckets.
Definition: AccountActivityBuckets.h:29
CompactArrayStack.h
catapult::state::AccountActivityBuckets::end
ActivityBucketStack::const_iterator end() const
Returns a const iterator to the element following the last element of the underlying container.
Definition: AccountActivityBuckets.cpp:49
functions.h
catapult::state::AccountActivityBuckets::get
ActivityBucket get(model::ImportanceHeight height) const
Gets activity bucket at height.
Definition: AccountActivityBuckets.cpp:25
catapult::state::CompactArrayStack::begin
const_iterator begin() const
Returns a const iterator to the first element of the underlying container.
Definition: CompactArrayStack.h:150
catapult::utils::BaseValue< Height::ValueType, ImportanceHeight_tag >
catapult::state::AccountActivityBuckets::HeightDetachedActivityBucket::TotalFeesPaid
Amount TotalFeesPaid
Total fees paid by account.
Definition: AccountActivityBuckets.h:34
catapult::state::AccountActivityBuckets::ActivityBucket::StartHeight
model::ImportanceHeight StartHeight
Activity start height.
Definition: AccountActivityBuckets.h:46
catapult::state::AccountActivityBuckets::ActivityBucket
Temporal activity information including height.
Definition: AccountActivityBuckets.h:44
catapult::state::AccountActivityBuckets::tryUpdate
bool tryUpdate(model::ImportanceHeight height, const consumer< HeightDetachedActivityBucket & > &consumer)
Definition: AccountActivityBuckets.cpp:37
catapult::state::CompactArrayStack< ActivityBucket, Activity_Bucket_History_Size >
catapult::state::AccountActivityBuckets::begin
ActivityBucketStack::const_iterator begin() const
Returns a const iterator to the first element of the underlying container.
Definition: AccountActivityBuckets.cpp:45
AccountActivityBuckets.h
catapult::state::CompactArrayStack::end
const_iterator end() const
Returns a const iterator to the element following the last element of the underlying container.
Definition: CompactArrayStack.h:155
catapult::state::CompactArrayStack::push
void push(const T &value)
Pushes value onto the stack.
Definition: CompactArrayStack.h:178
CATAPULT_THROW_RUNTIME_ERROR
#define CATAPULT_THROW_RUNTIME_ERROR(MESSAGE)
Macro used to throw a catapult runtime error.
Definition: exceptions.h:167
catapult::state::AccountActivityBuckets::update
void update(model::ImportanceHeight height, const consumer< HeightDetachedActivityBucket & > &consumer)
Definition: AccountActivityBuckets.cpp:33
catapult::state::AccountActivityBuckets::HeightDetachedActivityBucket::RawScore
uint64_t RawScore
Optional user defined score component.
Definition: AccountActivityBuckets.h:40
catapult::state::AccountActivityBuckets::HeightDetachedActivityBucket::BeneficiaryCount
uint32_t BeneficiaryCount
Number of times account has been used as a beneficiary.
Definition: AccountActivityBuckets.h:37
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::state::CompactArrayStack::pop
void pop()
Pops the top value from the stack.
Definition: CompactArrayStack.h:190
catapult::state::AccountActivityBuckets::HeightDetachedActivityBucket
Temporal activity information excluding height.
Definition: AccountActivityBuckets.h:32
catapult::consumer
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35