CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::MemoryPtCacheView Class Reference

A read only view on top of partial transactions cache. More...

Collaboration diagram for catapult::cache::MemoryPtCacheView:

Public Member Functions

 MemoryPtCacheView (uint64_t maxResponseSize, const PtDataContainer &transactionDataContainer, utils::SpinReaderWriterLock::ReaderLockGuard &&readLock)
 
size_t size () const
 Returns the number of partial transactions in the cache. More...
 
model::WeakCosignedTransactionInfo find (const Hash256 &hash) const
 Finds a partial transaction in the cache with associated hash or returns nullptr if no such transaction exists. More...
 
ShortHashPairRange shortHashPairs () const
 
UnknownTransactionInfos unknownTransactions (const ShortHashPairMap &knownShortHashPairs) const
 Gets a vector of all unknown transaction infos in the cache that do not have a short hash pair in knownShortHashPairs. More...
 

Private Types

using UnknownTransactionInfos = std::vector< model::CosignedTransactionInfo >
 

Private Attributes

uint64_t m_maxResponseSize
 
const PtDataContainerm_transactionDataContainer
 
utils::SpinReaderWriterLock::ReaderLockGuard m_readLock
 

Detailed Description

A read only view on top of partial transactions cache.

Member Typedef Documentation

◆ UnknownTransactionInfos

Constructor & Destructor Documentation

◆ MemoryPtCacheView()

catapult::cache::MemoryPtCacheView::MemoryPtCacheView ( uint64_t  maxResponseSize,
const PtDataContainer transactionDataContainer,
utils::SpinReaderWriterLock::ReaderLockGuard &&  readLock 
)
explicit

Creates a view around around a maximum response size (maxResponseSize), a partial transaction data container (transactionDataContainer) with lock context readLock.

Member Function Documentation

◆ find()

model::WeakCosignedTransactionInfo catapult::cache::MemoryPtCacheView::find ( const Hash256 hash) const

Finds a partial transaction in the cache with associated hash or returns nullptr if no such transaction exists.

◆ shortHashPairs()

ShortHashPairRange catapult::cache::MemoryPtCacheView::shortHashPairs ( ) const

Gets a range of short hash pairs of all transactions in the cache. A short hash pair consists of the first 4 bytes of the transaction hash and the first 4 bytes of the cosignature hash.

Here is the call graph for this function:

◆ size()

size_t catapult::cache::MemoryPtCacheView::size ( ) const

Returns the number of partial transactions in the cache.

◆ unknownTransactions()

MemoryPtCacheView::UnknownTransactionInfos catapult::cache::MemoryPtCacheView::unknownTransactions ( const ShortHashPairMap knownShortHashPairs) const

Gets a vector of all unknown transaction infos in the cache that do not have a short hash pair in knownShortHashPairs.

Here is the call graph for this function:

Member Data Documentation

◆ m_maxResponseSize

uint64_t catapult::cache::MemoryPtCacheView::m_maxResponseSize
private

◆ m_readLock

utils::SpinReaderWriterLock::ReaderLockGuard catapult::cache::MemoryPtCacheView::m_readLock
private

◆ m_transactionDataContainer

const PtDataContainer& catapult::cache::MemoryPtCacheView::m_transactionDataContainer
private

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