CatapultServer  v0.5.0.1 (Elephant)
catapult::harvesting::UnlockedAccountsView Class Reference

A read only view on top of unlocked accounts. More...

Inheritance diagram for catapult::harvesting::UnlockedAccountsView:
Collaboration diagram for catapult::harvesting::UnlockedAccountsView:

Public Member Functions

 UnlockedAccountsView (const std::vector< crypto::KeyPair > &keyPairs, utils::SpinReaderWriterLock::ReaderLockGuard &&readLock)
 Creates a view around keyPairs with lock context readLock. More...
 
size_t size () const
 Returns the number of unlocked accounts. More...
 
bool contains (const Key &publicKey) const
 Returns true if the public key belongs to an unlocked account, false otherwise. More...
 
auto begin () const
 Returns a const iterator to the first element of the underlying container. More...
 
auto end () const
 Returns a const iterator to the element following the last element of the underlying container. More...
 

Private Attributes

const std::vector< crypto::KeyPair > & m_keyPairs
 
utils::SpinReaderWriterLock::ReaderLockGuard m_readLock
 

Additional Inherited Members

- Private 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...
 

Detailed Description

A read only view on top of unlocked accounts.

Constructor & Destructor Documentation

◆ UnlockedAccountsView()

catapult::harvesting::UnlockedAccountsView::UnlockedAccountsView ( const std::vector< crypto::KeyPair > &  keyPairs,
utils::SpinReaderWriterLock::ReaderLockGuard &&  readLock 
)
inlineexplicit

Creates a view around keyPairs with lock context readLock.

Member Function Documentation

◆ begin()

auto catapult::harvesting::UnlockedAccountsView::begin ( ) const
inline

Returns a const iterator to the first element of the underlying container.

◆ contains()

bool catapult::harvesting::UnlockedAccountsView::contains ( const Key publicKey) const

Returns true if the public key belongs to an unlocked account, false otherwise.

◆ end()

auto catapult::harvesting::UnlockedAccountsView::end ( ) const
inline

Returns a const iterator to the element following the last element of the underlying container.

◆ size()

size_t catapult::harvesting::UnlockedAccountsView::size ( ) const

Returns the number of unlocked accounts.

Member Data Documentation

◆ m_keyPairs

const std::vector<crypto::KeyPair>& catapult::harvesting::UnlockedAccountsView::m_keyPairs
private

◆ m_readLock

utils::SpinReaderWriterLock::ReaderLockGuard catapult::harvesting::UnlockedAccountsView::m_readLock
private

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