CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::LockedCacheView< TCacheView > Class Template Reference
Inheritance diagram for catapult::cache::LockedCacheView< TCacheView >:
Collaboration diagram for catapult::cache::LockedCacheView< TCacheView >:

Public Member Functions

 LockedCacheView (TCacheView &&cacheView, utils::SpinReaderWriterLock::ReaderLockGuard &&readLock)
 Creates a view around cacheView and readLock. More...
 
 LockedCacheView (LockedCacheView &&rhs)
 
- Public Member Functions inherited from catapult::cache::detail::CacheViewAccessor< TCacheView >
 CacheViewAccessor (TCacheView *pCacheView)
 Creates an accessor around pCacheView;. More...
 
 operator bool () const
 Returns true if the underlying cache view is valid. More...
 
const TCacheView * operator-> () const
 Gets a const pointer to the underlying cache view. More...
 
const TCacheView & operator* () const
 Gets a const reference to the underlying cache view. More...
 
TCacheView * operator-> ()
 Gets a pointer to the underlying cache view. More...
 
TCacheView & operator* ()
 Gets a reference to the underlying cache view. More...
 

Private Attributes

TCacheView m_cacheView
 
utils::SpinReaderWriterLock::ReaderLockGuard m_readLock
 

Detailed Description

template<typename TCacheView>
class catapult::cache::LockedCacheView< TCacheView >

A cache-view, read-lock pair.

Note
This is similar to but provides a better interface than detail::CacheViewReadLockPair.

Constructor & Destructor Documentation

◆ LockedCacheView() [1/2]

template<typename TCacheView >
catapult::cache::LockedCacheView< TCacheView >::LockedCacheView ( TCacheView &&  cacheView,
utils::SpinReaderWriterLock::ReaderLockGuard &&  readLock 
)
inline

Creates a view around cacheView and readLock.

◆ LockedCacheView() [2/2]

template<typename TCacheView >
catapult::cache::LockedCacheView< TCacheView >::LockedCacheView ( LockedCacheView< TCacheView > &&  rhs)
inline

Move constructs a view from rhs.

Note
Default move constructor will not work because pointer in CacheViewAccessor needs to be updated.

Member Data Documentation

◆ m_cacheView

template<typename TCacheView >
TCacheView catapult::cache::LockedCacheView< TCacheView >::m_cacheView
private

◆ m_readLock

template<typename TCacheView >
utils::SpinReaderWriterLock::ReaderLockGuard catapult::cache::LockedCacheView< TCacheView >::m_readLock
private

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