CatapultServer  v0.5.0.1 (Elephant)
PeersProcessor.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "catapult/ionet/Node.h"
24 #include "catapult/functions.h"
25 
26 namespace catapult { namespace ionet { class NodeContainer; } }
27 
28 namespace catapult { namespace nodediscovery {
29 
32  private:
35 
36  public:
41  const ionet::NodeContainer& nodeContainer,
42  const NodePingRequestInitiator& pingRequestInitiator,
43  model::NetworkIdentifier networkIdentifier,
44  const NodeConsumer& newPartnerNodeConsumer);
45 
46  public:
48  void process(const ionet::NodeSet& candidateNodes) const;
49 
50  private:
51  void process(const ionet::Node& candidateNode) const;
52 
53  private:
58  };
59 }}
catapult::nodediscovery::PeersProcessor::m_networkIdentifier
model::NetworkIdentifier m_networkIdentifier
Definition: PeersProcessor.h:56
catapult::ionet::NodeContainer::view
NodeContainerView view() const
Gets a read only view of the nodes.
Definition: NodeContainer.cpp:249
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
Parser.debug
def debug(*args)
Definition: Parser.py:46
catapult::ionet::Node::identityKey
const Key & identityKey() const
Gets the unique identifier (a public key).
Definition: Node.cpp:60
NodeRequestResult.h
colorPrint.warning
def warning(*args)
Definition: colorPrint.py:10
catapult::nodediscovery::IsNodeCompatible
bool IsNodeCompatible(const ionet::Node &node, model::NetworkIdentifier networkIdentifier, const Key &identityKey)
Determines if node is compatible with expected network (networkIdentifier) and identity (identityKey)...
Definition: NodePingUtils.cpp:52
catapult::nodediscovery::PeersProcessor::m_pingRequestInitiator
NodePingRequestInitiator m_pingRequestInitiator
Definition: PeersProcessor.h:55
functions.h
catapult::nodediscovery::PeersProcessor::NodeConsumer
consumer< const ionet::Node & > NodeConsumer
Definition: PeersProcessor.h:33
catapult::nodediscovery::PeersProcessor::process
void process(const ionet::NodeSet &candidateNodes) const
Processes all candidate nodes (candidateNodes) and forwards newly discovered partner nodes.
Definition: PeersProcessor.cpp:38
catapult::nodediscovery::PeersProcessor::NodePingRequestInitiator
consumer< const ionet::Node &, const consumer< net::NodeRequestResult, const ionet::Node & > & > NodePingRequestInitiator
Definition: PeersProcessor.h:34
catapult::nodediscovery::PeersProcessor
Processes peers received from a partner node.
Definition: PeersProcessor.h:31
catapult::ionet::NodeContainer
A collection of nodes.
Definition: NodeContainer.h:109
catapult::nodediscovery::PeersProcessor::m_nodeContainer
const ionet::NodeContainer & m_nodeContainer
Definition: PeersProcessor.h:54
catapult::ionet::NodeSet
std::unordered_set< Node, NodeHasher > NodeSet
A set of nodes.
Definition: Node.h:128
Node.h
forwardsValidation.info
def info(*args)
Definition: forwardsValidation.py:12
NodeContainer.h
catapult::nodediscovery::PeersProcessor::m_newPartnerNodeConsumer
NodeConsumer m_newPartnerNodeConsumer
Definition: PeersProcessor.h:57
catapult::model::NetworkIdentifier
NetworkIdentifier
Possible network identifiers.
Definition: NetworkInfo.h:45
m_networkIdentifier
NetworkIdentifier m_networkIdentifier
Definition: TransactionUtils.cpp:59
catapult::ionet::Node::endpoint
const NodeEndpoint & endpoint() const
Gets the endpoint.
Definition: Node.cpp:64
catapult
Definition: AddressExtractionExtension.cpp:28
NodePingUtils.h
catapult::ionet::Node
A node in the catapult network.
Definition: Node.h:82
catapult::consumer
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
PeersProcessor.h
catapult::nodediscovery::PeersProcessor::PeersProcessor
PeersProcessor(const ionet::NodeContainer &nodeContainer, const NodePingRequestInitiator &pingRequestInitiator, model::NetworkIdentifier networkIdentifier, const NodeConsumer &newPartnerNodeConsumer)
Definition: PeersProcessor.cpp:27
catapult::nodediscovery::SelectUnknownNodes
ionet::NodeSet SelectUnknownNodes(const ionet::NodeContainerView &view, const ionet::NodeSet &nodes)
Filters nodes by returning all nodes not contained in view.
Definition: NodePingUtils.cpp:56