CatapultServer  v0.5.0.1 (Elephant)
UtCache.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "BasicTransactionsCache.h"
23 #include <vector>
24 
25 namespace catapult { namespace cache {
26 
28  class UtCacheModifier : public BasicTransactionsCacheModifier<model::TransactionInfo> {
29  public:
31  virtual size_t count(const Key& key) const = 0;
32 
34  virtual std::vector<model::TransactionInfo> removeAll() = 0;
35  };
36 
39  class UtCacheModifierProxy final : public BasicTransactionsCacheModifierProxy<model::TransactionInfo, UtCacheModifier> {
40  private:
42 
43  public:
45  size_t count(const Key& key) const {
46  return modifier().count(key);
47  }
48 
50  std::vector<model::TransactionInfo> removeAll() {
51  return modifier().removeAll();
52  }
53  };
54 
56  class UtCache : public BasicTransactionsCache<UtCacheModifierProxy> {};
57 }}
catapult::cache::UtCacheModifier::count
virtual size_t count(const Key &key) const =0
Gets the number of transactions an account with public key has placed into the cache.
catapult::cache::UtCacheModifier::removeAll
virtual std::vector< model::TransactionInfo > removeAll()=0
Removes all transactions from the cache.
catapult::cache::UtCacheModifierProxy::removeAll
std::vector< model::TransactionInfo > removeAll()
Removes all transactions from the cache.
Definition: UtCache.h:50
BasicTransactionsCache.h
catapult::cache::UtCache
An interface for caching unconfirmed transactions.
Definition: UtCache.h:56
catapult::cache::UtCacheModifierProxy
Definition: UtCache.h:39
catapult::cache::BasicTransactionsCacheModifierProxy< model::TransactionInfo, UtCacheModifier >::modifier
UtCacheModifier & modifier()
Gets the modifier.
Definition: BasicTransactionsCache.h:76
catapult::cache::BasicTransactionsCacheModifierProxy
Definition: BasicTransactionsCache.h:50
catapult::cache::BasicTransactionsCacheModifier
An interface for modifying a transactions cache.
Definition: BasicTransactionsCache.h:30
catapult::cache::UtCacheModifierProxy::count
size_t count(const Key &key) const
Gets the number of transactions an account with public key has placed into the cache.
Definition: UtCache.h:45
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::cache::BasicTransactionsCache
An interface for caching transactions.
Definition: BasicTransactionsCache.h:91
catapult::utils::ByteArray< Key_Size, Key_tag >
catapult::cache::UtCacheModifier
An interface for modifying an unconfirmed transactions cache.
Definition: UtCache.h:28