CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits > Class Template Reference
Inheritance diagram for catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >:
Collaboration diagram for catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >:

Public Member Functions

 BasicAggregateTransactionsCacheModifier (CacheModifierProxyType &&modifier, ChangeSubscriberType &subscriber)
 Creates an aggregate transactions cache modifier around modifier and subscriber. More...
 
 ~BasicAggregateTransactionsCacheModifier () noexcept(false) override
 Destroys the modifier and notifies subscribers of changes. More...
 
size_t size () const override
 
bool add (const TransactionInfoType &transactionInfo) override
 
TransactionInfoType remove (const Hash256 &hash) override
 

Protected Member Functions

CacheModifierProxyTypemodifier ()
 Gets the modifier. More...
 
const CacheModifierProxyTypemodifier () const
 Gets the (const) modifier. More...
 
ChangeSubscriberTypesubscriber ()
 Gets the subscriber. More...
 
void remove (const TransactionInfoType &transactionInfo)
 Removes transactionInfo from the cache. More...
 

Private Types

using ChangeSubscriberType = typename TCacheTraits::ChangeSubscriberType
 
using CacheModifierProxyType = typename TCacheTraits::CacheModifierProxyType
 
using TransactionInfoType = typename TChangeSubscriberTraits::TransactionInfoType
 

Private Member Functions

void flush ()
 

Private Attributes

CacheModifierProxyType m_modifier
 
ChangeSubscriberTypem_subscriber
 
model::TransactionChangeTracker m_transactionChangeTracker
 

Detailed Description

template<typename TCacheTraits, typename TChangeSubscriberTraits>
class catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >

A basic aggregate transactions cache modifier that supports adding and removing of transaction infos.

Note
Subscribers are only notified of net changes.

Member Typedef Documentation

◆ CacheModifierProxyType

template<typename TCacheTraits , typename TChangeSubscriberTraits >
using catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::CacheModifierProxyType = typename TCacheTraits::CacheModifierProxyType
private

◆ ChangeSubscriberType

template<typename TCacheTraits , typename TChangeSubscriberTraits >
using catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::ChangeSubscriberType = typename TCacheTraits::ChangeSubscriberType
private

◆ TransactionInfoType

template<typename TCacheTraits , typename TChangeSubscriberTraits >
using catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::TransactionInfoType = typename TChangeSubscriberTraits::TransactionInfoType
private

Constructor & Destructor Documentation

◆ BasicAggregateTransactionsCacheModifier()

template<typename TCacheTraits , typename TChangeSubscriberTraits >
catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::BasicAggregateTransactionsCacheModifier ( CacheModifierProxyType &&  modifier,
ChangeSubscriberType subscriber 
)
inline

Creates an aggregate transactions cache modifier around modifier and subscriber.

◆ ~BasicAggregateTransactionsCacheModifier()

template<typename TCacheTraits , typename TChangeSubscriberTraits >
catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::~BasicAggregateTransactionsCacheModifier ( )
inlineoverridenoexcept

Destroys the modifier and notifies subscribers of changes.

Here is the call graph for this function:

Member Function Documentation

◆ add()

template<typename TCacheTraits , typename TChangeSubscriberTraits >
bool catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::add ( const TransactionInfoType transactionInfo)
inlineoverride
Here is the call graph for this function:

◆ flush()

template<typename TCacheTraits , typename TChangeSubscriberTraits >
void catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::flush ( )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ modifier() [1/2]

template<typename TCacheTraits , typename TChangeSubscriberTraits >
CacheModifierProxyType& catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::modifier ( )
inlineprotected

Gets the modifier.

◆ modifier() [2/2]

template<typename TCacheTraits , typename TChangeSubscriberTraits >
const CacheModifierProxyType& catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::modifier ( ) const
inlineprotected

Gets the (const) modifier.

◆ remove() [1/2]

template<typename TCacheTraits , typename TChangeSubscriberTraits >
TransactionInfoType catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::remove ( const Hash256 hash)
inlineoverride

◆ remove() [2/2]

template<typename TCacheTraits , typename TChangeSubscriberTraits >
void catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::remove ( const TransactionInfoType transactionInfo)
inlineprotected

Removes transactionInfo from the cache.

Here is the call graph for this function:

◆ size()

template<typename TCacheTraits , typename TChangeSubscriberTraits >
size_t catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::size ( ) const
inlineoverride

◆ subscriber()

template<typename TCacheTraits , typename TChangeSubscriberTraits >
ChangeSubscriberType& catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::subscriber ( )
inlineprotected

Gets the subscriber.

Member Data Documentation

◆ m_modifier

template<typename TCacheTraits , typename TChangeSubscriberTraits >
CacheModifierProxyType catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::m_modifier
private

◆ m_subscriber

template<typename TCacheTraits , typename TChangeSubscriberTraits >
ChangeSubscriberType& catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::m_subscriber
private

◆ m_transactionChangeTracker

template<typename TCacheTraits , typename TChangeSubscriberTraits >
model::TransactionChangeTracker catapult::cache::BasicAggregateTransactionsCacheModifier< TCacheTraits, TChangeSubscriberTraits >::m_transactionChangeTracker
private

The documentation for this class was generated from the following file: