CatapultServer  v0.5.0.1 (Elephant)
catapult::ionet::NodeInfo Struct Reference

Information about a node and its interactions. More...

Collaboration diagram for catapult::ionet::NodeInfo:

Public Types

using ServiceIdentifiers = std::unordered_set< ServiceIdentifier, utils::BaseValueHasher< ServiceIdentifier > >
 A container of service identifiers. More...
 

Public Member Functions

 NodeInfo (NodeSource source)
 Creates a node info with source. More...
 
NodeSource source () const
 Gets the node source. More...
 
NodeInteractions interactions (Timestamp timestamp) const
 Gets the node interactions at timestamp. More...
 
size_t numConnectionStates () const
 Gets the number of connection states. More...
 
ServiceIdentifiers services () const
 Gets the associated service ids. More...
 
bool hasActiveConnection () const
 Returns true if at least one connection is active. More...
 
const ConnectionStategetConnectionState (ServiceIdentifier serviceId) const
 Gets connection state for the service identified by serviceId or nullptr if no state exists. More...
 
void source (NodeSource source)
 Sets the node source to source. More...
 
void incrementSuccesses (Timestamp timestamp)
 Increments the number of successful interactions at timestamp. More...
 
void incrementFailures (Timestamp timestamp)
 Increments the number of failed interactions at timestamp. More...
 
ConnectionStateprovisionConnectionState (ServiceIdentifier serviceId)
 Gets connection state for the service identified by serviceId and creates zeroed state if no state exists. More...
 
void clearAge (ServiceIdentifier serviceId)
 Clears the age of the connection for the service identified by serviceId. More...
 
void updateBan (ServiceIdentifier serviceId, uint32_t maxConnectionBanAge, uint32_t numConsecutiveFailuresBeforeBanning)
 

Private Attributes

NodeSource m_source
 
NodeInteractionsContainer m_interactions
 
std::vector< std::pair< ServiceIdentifier, ConnectionState > > m_connectionStates
 

Detailed Description

Information about a node and its interactions.

Member Typedef Documentation

◆ ServiceIdentifiers

A container of service identifiers.

Constructor & Destructor Documentation

◆ NodeInfo()

catapult::ionet::NodeInfo::NodeInfo ( NodeSource  source)
explicit

Creates a node info with source.

Member Function Documentation

◆ clearAge()

void catapult::ionet::NodeInfo::clearAge ( ServiceIdentifier  serviceId)

Clears the age of the connection for the service identified by serviceId.

◆ getConnectionState()

const ConnectionState * catapult::ionet::NodeInfo::getConnectionState ( ServiceIdentifier  serviceId) const

Gets connection state for the service identified by serviceId or nullptr if no state exists.

Here is the caller graph for this function:

◆ hasActiveConnection()

bool catapult::ionet::NodeInfo::hasActiveConnection ( ) const

Returns true if at least one connection is active.

◆ incrementFailures()

void catapult::ionet::NodeInfo::incrementFailures ( Timestamp  timestamp)

Increments the number of failed interactions at timestamp.

Here is the call graph for this function:

◆ incrementSuccesses()

void catapult::ionet::NodeInfo::incrementSuccesses ( Timestamp  timestamp)

Increments the number of successful interactions at timestamp.

Here is the call graph for this function:

◆ interactions()

NodeInteractions catapult::ionet::NodeInfo::interactions ( Timestamp  timestamp) const

Gets the node interactions at timestamp.

Here is the call graph for this function:

◆ numConnectionStates()

size_t catapult::ionet::NodeInfo::numConnectionStates ( ) const

Gets the number of connection states.

◆ provisionConnectionState()

ConnectionState & catapult::ionet::NodeInfo::provisionConnectionState ( ServiceIdentifier  serviceId)

Gets connection state for the service identified by serviceId and creates zeroed state if no state exists.

◆ services()

NodeInfo::ServiceIdentifiers catapult::ionet::NodeInfo::services ( ) const

Gets the associated service ids.

◆ source() [1/2]

NodeSource catapult::ionet::NodeInfo::source ( ) const

Gets the node source.

Here is the caller graph for this function:

◆ source() [2/2]

void catapult::ionet::NodeInfo::source ( NodeSource  source)

Sets the node source to source.

Here is the call graph for this function:

◆ updateBan()

void catapult::ionet::NodeInfo::updateBan ( ServiceIdentifier  serviceId,
uint32_t  maxConnectionBanAge,
uint32_t  numConsecutiveFailuresBeforeBanning 
)

Updates the connection ban (if applicable) for the service identified by serviceId given maxConnectionBanAge and numConsecutiveFailuresBeforeBanning.

Member Data Documentation

◆ m_connectionStates

std::vector<std::pair<ServiceIdentifier, ConnectionState> > catapult::ionet::NodeInfo::m_connectionStates
private

◆ m_interactions

NodeInteractionsContainer catapult::ionet::NodeInfo::m_interactions
private

◆ m_source

NodeSource catapult::ionet::NodeInfo::m_source
private

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