CatapultServer  v0.5.0.1 (Elephant)
catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::ReaderLockGuard Struct Reference

A reader lock guard. More...

Inheritance diagram for catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::ReaderLockGuard:
Collaboration diagram for catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::ReaderLockGuard:

Public Member Functions

 ReaderLockGuard (std::atomic< uint16_t > &value, TReaderNotificationPolicy &notificationPolicy)
 Creates a guard around value and notificationPolicy. More...
 
 ReaderLockGuard (ReaderLockGuard &&)=default
 Default move constructor. More...
 
WriterLockGuard promoteToWriter ()
 
- Public Member Functions inherited from catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::LockGuard
 LockGuard (LockGuard &&rhs)
 

Private Member Functions

void markActiveWriter ()
 

Private Attributes

std::atomic< uint16_t > & m_value
 
bool m_isWriterActive
 

Additional Inherited Members

- Protected Member Functions inherited from catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::LockGuard
 LockGuard (const action &resetFunc)
 
 ~LockGuard ()
 

Detailed Description

template<typename TReaderNotificationPolicy>
struct catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::ReaderLockGuard

A reader lock guard.

Constructor & Destructor Documentation

◆ ReaderLockGuard() [1/2]

template<typename TReaderNotificationPolicy >
catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::ReaderLockGuard::ReaderLockGuard ( std::atomic< uint16_t > &  value,
TReaderNotificationPolicy &  notificationPolicy 
)
inlineexplicit

Creates a guard around value and notificationPolicy.

◆ ReaderLockGuard() [2/2]

template<typename TReaderNotificationPolicy >
catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::ReaderLockGuard::ReaderLockGuard ( ReaderLockGuard &&  )
default

Default move constructor.

Member Function Documentation

◆ markActiveWriter()

template<typename TReaderNotificationPolicy >
void catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::ReaderLockGuard::markActiveWriter ( )
inlineprivate
Here is the caller graph for this function:

◆ promoteToWriter()

template<typename TReaderNotificationPolicy >
WriterLockGuard catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::ReaderLockGuard::promoteToWriter ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_isWriterActive

template<typename TReaderNotificationPolicy >
bool catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::ReaderLockGuard::m_isWriterActive
private

◆ m_value

template<typename TReaderNotificationPolicy >
std::atomic<uint16_t>& catapult::utils::BasicSpinReaderWriterLock< TReaderNotificationPolicy >::ReaderLockGuard::m_value
private

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