CatapultServer  v0.5.0.1 (Elephant)
catapult::ionet::NodeContainerView Class Reference

A read only view on top of node container. More...

Inheritance diagram for catapult::ionet::NodeContainerView:
Collaboration diagram for catapult::ionet::NodeContainerView:

Public Member Functions

 NodeContainerView (const NodeContainerData &nodeContainerData, utils::SpinReaderWriterLock::ReaderLockGuard &&readLock)
 Creates a view around nodeContainerData with lock context readLock. More...
 
size_t size () const
 Returns the number of nodes. More...
 
Timestamp time () const
 Gets current container time. More...
 
bool contains (const Key &identityKey) const
 Returns true if the node with identityKey is in the container, false otherwise. More...
 
const NodeInfogetNodeInfo (const Key &identityKey) const
 Gets node info for the node with identityKey. More...
 
void forEach (const consumer< const Node &, const NodeInfo & > &consumer) const
 Iterates over all nodes and passes them to consumer. More...
 

Private Attributes

const NodeContainerDatam_nodeContainerData
 
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 node container.

Constructor & Destructor Documentation

◆ NodeContainerView()

catapult::ionet::NodeContainerView::NodeContainerView ( const NodeContainerData nodeContainerData,
utils::SpinReaderWriterLock::ReaderLockGuard &&  readLock 
)

Creates a view around nodeContainerData with lock context readLock.

Member Function Documentation

◆ contains()

bool catapult::ionet::NodeContainerView::contains ( const Key identityKey) const

Returns true if the node with identityKey is in the container, false otherwise.

Here is the caller graph for this function:

◆ forEach()

void catapult::ionet::NodeContainerView::forEach ( const consumer< const Node &, const NodeInfo & > &  consumer) const

Iterates over all nodes and passes them to consumer.

Here is the caller graph for this function:

◆ getNodeInfo()

const NodeInfo & catapult::ionet::NodeContainerView::getNodeInfo ( const Key identityKey) const

Gets node info for the node with identityKey.

◆ size()

size_t catapult::ionet::NodeContainerView::size ( ) const

Returns the number of nodes.

◆ time()

Timestamp catapult::ionet::NodeContainerView::time ( ) const

Gets current container time.

Member Data Documentation

◆ m_nodeContainerData

const NodeContainerData& catapult::ionet::NodeContainerView::m_nodeContainerData
private

◆ m_readLock

utils::SpinReaderWriterLock::ReaderLockGuard catapult::ionet::NodeContainerView::m_readLock
private

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