CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::BasicTransactionsCacheModifierProxy< TTransactionInfo, TTransactionsCacheModifier > Class Template Reference
Inheritance diagram for catapult::cache::BasicTransactionsCacheModifierProxy< TTransactionInfo, TTransactionsCacheModifier >:
Collaboration diagram for catapult::cache::BasicTransactionsCacheModifierProxy< TTransactionInfo, TTransactionsCacheModifier >:

Public Member Functions

 BasicTransactionsCacheModifierProxy (std::unique_ptr< TTransactionsCacheModifier > &&pModifier)
 Creates a transactions cache modifier around pModifier. More...
 
size_t size () const
 Returns the number of transactions in the cache. More...
 
bool add (const TTransactionInfo &transactionInfo)
 
TTransactionInfo remove (const Hash256 &hash)
 Removes the transaction identified by hash from the cache. More...
 
- Public Member Functions inherited from catapult::utils::MoveOnly
constexpr MoveOnly ()=default
 Default constructor. More...
 
 ~MoveOnly ()=default
 Default destructor. More...
 
 MoveOnly (const NonCopyable &)=delete
 Disabled copy constructor. More...
 
 MoveOnly (MoveOnly &&)=default
 Default move constructor. More...
 
MoveOnlyoperator= (const MoveOnly &)=delete
 Disabled assignment operator. More...
 
MoveOnlyoperator= (MoveOnly &&)=default
 Default move assignment operator. More...
 

Protected Member Functions

TTransactionsCacheModifier & modifier ()
 Gets the modifier. More...
 
const TTransactionsCacheModifier & modifier () const
 Gets the (const) modifier. More...
 

Private Attributes

std::unique_ptr< TTransactionsCacheModifier > m_pModifier
 

Detailed Description

template<typename TTransactionInfo, typename TTransactionsCacheModifier>
class catapult::cache::BasicTransactionsCacheModifierProxy< TTransactionInfo, TTransactionsCacheModifier >

A delegating proxy around a transactions cache modifier.

Note
This is returned by value by BasicTransactionsCache::modifier in order to allow it to be consistent with other modifier functions.

Constructor & Destructor Documentation

◆ BasicTransactionsCacheModifierProxy()

template<typename TTransactionInfo, typename TTransactionsCacheModifier>
catapult::cache::BasicTransactionsCacheModifierProxy< TTransactionInfo, TTransactionsCacheModifier >::BasicTransactionsCacheModifierProxy ( std::unique_ptr< TTransactionsCacheModifier > &&  pModifier)
inlineexplicit

Creates a transactions cache modifier around pModifier.

Member Function Documentation

◆ add()

template<typename TTransactionInfo, typename TTransactionsCacheModifier>
bool catapult::cache::BasicTransactionsCacheModifierProxy< TTransactionInfo, TTransactionsCacheModifier >::add ( const TTransactionInfo &  transactionInfo)
inline

Adds the transaction info (transactionInfo) to the cache. Returns true if the transaction info was successfully added.

Here is the caller graph for this function:

◆ modifier() [1/2]

template<typename TTransactionInfo, typename TTransactionsCacheModifier>
TTransactionsCacheModifier& catapult::cache::BasicTransactionsCacheModifierProxy< TTransactionInfo, TTransactionsCacheModifier >::modifier ( )
inlineprotected

Gets the modifier.

◆ modifier() [2/2]

template<typename TTransactionInfo, typename TTransactionsCacheModifier>
const TTransactionsCacheModifier& catapult::cache::BasicTransactionsCacheModifierProxy< TTransactionInfo, TTransactionsCacheModifier >::modifier ( ) const
inlineprotected

Gets the (const) modifier.

◆ remove()

template<typename TTransactionInfo, typename TTransactionsCacheModifier>
TTransactionInfo catapult::cache::BasicTransactionsCacheModifierProxy< TTransactionInfo, TTransactionsCacheModifier >::remove ( const Hash256 hash)
inline

Removes the transaction identified by hash from the cache.

Here is the caller graph for this function:

◆ size()

template<typename TTransactionInfo, typename TTransactionsCacheModifier>
size_t catapult::cache::BasicTransactionsCacheModifierProxy< TTransactionInfo, TTransactionsCacheModifier >::size ( ) const
inline

Returns the number of transactions in the cache.

Member Data Documentation

◆ m_pModifier

template<typename TTransactionInfo, typename TTransactionsCacheModifier>
std::unique_ptr<TTransactionsCacheModifier> catapult::cache::BasicTransactionsCacheModifierProxy< TTransactionInfo, TTransactionsCacheModifier >::m_pModifier
private

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