CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace cache {
29 template<
typename TCacheTraits,
typename TChangeSubscriberTraits>
37 using TCacheTraits::CacheModifierType::add;
52 size_t size()
const override {
65 auto transactionInfo =
m_modifier.remove(hash);
69 return transactionInfo;
96 if (!removedTransactionInfos.empty())
100 if (!addedTransactionInfos.empty())
101 TChangeSubscriberTraits::NotifyAdds(
m_subscriber, addedTransactionInfos);
114 template<
typename TCacheTraits,
typename TAggregateCacheModifier>
void reset()
Clears all added and removed transactions.
Definition: TransactionChangeTracker.h:65
model::TransactionChangeTracker m_transactionChangeTracker
Definition: BasicAggregateTransactionsCache.h:110
Tracks transaction changes and keeps track of net changes.
Definition: TransactionChangeTracker.h:28
const TransactionInfosSet & addedTransactionInfos() const
Gets the infos of net added transactions.
Definition: TransactionChangeTracker.h:31
typename TCacheTraits::CacheModifierProxyType CacheModifierProxyType
Definition: BasicAggregateTransactionsCache.h:33
typename TCacheTraits::CacheModifierProxyType CacheModifierProxyType
Definition: BasicAggregateTransactionsCache.h:119
void flush()
Definition: BasicAggregateTransactionsCache.h:94
std::unique_ptr< ChangeSubscriberType > m_pChangeSubscriber
Definition: BasicAggregateTransactionsCache.h:135
TransactionInfoType remove(const Hash256 &hash) override
Definition: BasicAggregateTransactionsCache.h:64
void remove(const TransactionInfo &transactionInfo)
Marks transaction info (transactionInfo) as removed.
Definition: TransactionChangeTracker.h:53
CacheType & m_cache
Definition: BasicAggregateTransactionsCache.h:134
bool add(const TransactionInfoType &transactionInfo) override
Definition: BasicAggregateTransactionsCache.h:56
BasicAggregateTransactionsCache(CacheType &cache, std::unique_ptr< ChangeSubscriberType > &&pChangeSubscriber)
Creates an aggregate transactions cache that delegates to cache and publishes transaction changes to ...
Definition: BasicAggregateTransactionsCache.h:123
CacheModifierProxyType m_modifier
Definition: BasicAggregateTransactionsCache.h:108
void remove(const TransactionInfoType &transactionInfo)
Removes transactionInfo from the cache.
Definition: BasicAggregateTransactionsCache.h:89
typename TCacheTraits::ChangeSubscriberType ChangeSubscriberType
Definition: BasicAggregateTransactionsCache.h:32
ChangeSubscriberType & m_subscriber
Definition: BasicAggregateTransactionsCache.h:109
Definition: BasicAggregateTransactionsCache.h:30
ChangeSubscriberType & subscriber()
Gets the subscriber.
Definition: BasicAggregateTransactionsCache.h:84
Definition: AddressExtractionExtension.cpp:28
typename TChangeSubscriberTraits::TransactionInfoType TransactionInfoType
Definition: BasicAggregateTransactionsCache.h:34
const CacheModifierProxyType & modifier() const
Gets the (const) modifier.
Definition: BasicAggregateTransactionsCache.h:79
void add(const TransactionInfo &transactionInfo)
Marks transaction info (transactionInfo) as added.
Definition: TransactionChangeTracker.h:42
A basic aggregate transactions cache that delegates to a wrapped cache and raises notifications on a ...
Definition: BasicAggregateTransactionsCache.h:115
typename TCacheTraits::CacheType CacheType
Definition: BasicAggregateTransactionsCache.h:117
~BasicAggregateTransactionsCacheModifier() noexcept(false) override
Destroys the modifier and notifies subscribers of changes.
Definition: BasicAggregateTransactionsCache.h:47
CacheModifierProxyType modifier() override
Definition: BasicAggregateTransactionsCache.h:129
size_t size() const override
Definition: BasicAggregateTransactionsCache.h:52
CacheModifierProxyType & modifier()
Gets the modifier.
Definition: BasicAggregateTransactionsCache.h:74
const TransactionInfosSet & removedTransactionInfos() const
Gets the infos of net removed transactions.
Definition: TransactionChangeTracker.h:36
typename TCacheTraits::ChangeSubscriberType ChangeSubscriberType
Definition: BasicAggregateTransactionsCache.h:118
BasicAggregateTransactionsCacheModifier(CacheModifierProxyType &&modifier, ChangeSubscriberType &subscriber)
Creates an aggregate transactions cache modifier around modifier and subscriber.
Definition: BasicAggregateTransactionsCache.h:41