CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
26 namespace catapult {
namespace cache {
29 template<
typename TTransactionInfo>
36 virtual size_t size()
const = 0;
40 virtual bool add(
const TTransactionInfo& transactionInfo) = 0;
49 template<
typename TTransactionInfo,
typename TTransactionsCacheModifier>
65 bool add(
const TTransactionInfo& transactionInfo) {
81 const TTransactionsCacheModifier&
modifier()
const {
90 template<
typename TTransactionsCacheModifierProxy>
97 virtual TTransactionsCacheModifierProxy
modifier() = 0;
BasicTransactionsCacheModifierProxy(std::unique_ptr< TTransactionsCacheModifier > &&pModifier)
Creates a transactions cache modifier around pModifier.
Definition: BasicTransactionsCache.h:53
virtual TTransactionsCacheModifierProxy modifier()=0
Gets a write only view of the cache.
size_t size() const
Returns the number of transactions in the cache.
Definition: BasicTransactionsCache.h:59
virtual size_t size() const =0
Returns the number of transactions in the cache.
bool add(const TTransactionInfo &transactionInfo)
Definition: BasicTransactionsCache.h:65
TTransactionInfo remove(const Hash256 &hash)
Removes the transaction identified by hash from the cache.
Definition: BasicTransactionsCache.h:70
virtual TTransactionInfo remove(const Hash256 &hash)=0
Removes the transaction identified by hash from the cache.
TTransactionsCacheModifier & modifier()
Gets the modifier.
Definition: BasicTransactionsCache.h:76
Definition: BasicTransactionsCache.h:50
A class that can be moved but not copied.
Definition: NonCopyable.h:43
An interface for modifying a transactions cache.
Definition: BasicTransactionsCache.h:30
virtual ~BasicTransactionsCacheModifier() noexcept(false)
Definition: BasicTransactionsCache.h:32
virtual ~BasicTransactionsCache()=default
std::unique_ptr< TTransactionsCacheModifier > m_pModifier
Definition: BasicTransactionsCache.h:86
Definition: AddressExtractionExtension.cpp:28
const TTransactionsCacheModifier & modifier() const
Gets the (const) modifier.
Definition: BasicTransactionsCache.h:81
An interface for caching transactions.
Definition: BasicTransactionsCache.h:91
virtual bool add(const TTransactionInfo &transactionInfo)=0
Base class for wrappers of byte array types, to provide some type-safety.
Definition: ByteArray.h:29
A class that can neither be copied nor moved.
Definition: NonCopyable.h:26