CatapultServer  v0.5.0.1 (Elephant)
AggregateNodeSubscriber.h
Go to the documentation of this file.
1 
21 #pragma once
23 #include "NodeSubscriber.h"
24 
25 namespace catapult { namespace subscribers {
26 
28  template<typename TNodeSubscriber = NodeSubscriber>
29  class AggregateNodeSubscriber : public BasicAggregateSubscriber<TNodeSubscriber>, public NodeSubscriber {
30  public:
32 
33  public:
34  void notifyNode(const ionet::Node& node) override {
35  this->forEach([&node](auto& subscriber) { subscriber.notifyNode(node); });
36  }
37 
38  void notifyIncomingNode(const Key& identityKey, ionet::ServiceIdentifier serviceId) override {
39  this->forEach([&identityKey, serviceId](auto& subscriber) { subscriber.notifyIncomingNode(identityKey, serviceId); });
40  }
41  };
42 }}
catapult::subscribers::NodeSubscriber
Node subscriber.
Definition: NodeSubscriber.h:30
catapult::subscribers::AggregateNodeSubscriber::notifyIncomingNode
void notifyIncomingNode(const Key &identityKey, ionet::ServiceIdentifier serviceId) override
Indicates a new incoming connection for node with identityKey connected to serviceId.
Definition: AggregateNodeSubscriber.h:38
BasicAggregateSubscriber.h
catapult::utils::BaseValue< uint32_t, ServiceIdentifier_tag >
catapult::subscribers::AggregateNodeSubscriber::notifyNode
void notifyNode(const ionet::Node &node) override
Indicates a new node was found.
Definition: AggregateNodeSubscriber.h:34
catapult::subscribers::BasicAggregateSubscriber< TNodeSubscriber >::forEach
void forEach(TAction action) const
Definition: BasicAggregateSubscriber.h:38
NodeSubscriber.h
catapult::subscribers::BasicAggregateSubscriber
Basic aggregate subscriber.
Definition: BasicAggregateSubscriber.h:29
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::subscribers::AggregateNodeSubscriber
Aggregate node subscriber.
Definition: AggregateNodeSubscriber.h:29
catapult::utils::ByteArray< Key_Size, Key_tag >
catapult::ionet::Node
A node in the catapult network.
Definition: Node.h:82