CatapultServer  v0.5.0.1 (Elephant)
NodePacketIoPair.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "Node.h"
23 #include "PacketIo.h"
24 #include <memory>
25 
26 namespace catapult { namespace ionet {
27 
30  public:
33  {}
34 
36  explicit NodePacketIoPair(const Node& node, const std::shared_ptr<PacketIo>& pPacketIo)
37  : m_node(node)
38  , m_pPacketIo(pPacketIo)
39  {}
40 
41  public:
43  const Node& node() const {
44  return m_node;
45  }
46 
48  const std::shared_ptr<PacketIo>& io() const {
49  return m_pPacketIo;
50  }
51 
52  public:
54  explicit operator bool() const {
55  return !!m_pPacketIo;
56  }
57 
58  private:
60  std::shared_ptr<PacketIo> m_pPacketIo;
61  };
62 }}
catapult::ionet::NodePacketIoPair::node
const Node & node() const
Gets the node.
Definition: NodePacketIoPair.h:43
catapult::ionet::NodePacketIoPair::m_node
Node m_node
Definition: NodePacketIoPair.h:59
catapult::ionet::NodePacketIoPair::NodePacketIoPair
NodePacketIoPair()
Creates an empty pair.
Definition: NodePacketIoPair.h:32
Node.h
catapult::ionet::NodePacketIoPair::NodePacketIoPair
NodePacketIoPair(const Node &node, const std::shared_ptr< PacketIo > &pPacketIo)
Creates a pair around node and pPacketIo.
Definition: NodePacketIoPair.h:36
catapult::ionet::NodePacketIoPair::io
const std::shared_ptr< PacketIo > & io() const
Gets the io.
Definition: NodePacketIoPair.h:48
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::ionet::NodePacketIoPair
A node and packet io pair.
Definition: NodePacketIoPair.h:29
catapult::ionet::Node
A node in the catapult network.
Definition: Node.h:82
catapult::ionet::NodePacketIoPair::m_pPacketIo
std::shared_ptr< PacketIo > m_pPacketIo
Definition: NodePacketIoPair.h:60
PacketIo.h