Flow 1.0.1
Flow project: Public API.
Public Member Functions | Public Attributes | Related Functions | List of all members
flow::net_flow::Remote_endpoint Struct Reference

Represents the remote endpoint of a Flow-protocol connection; identifies the UDP endpoint of the remote Node and the logical Flow-protocol port within that Node. More...

#include <endpoint.hpp>

Public Member Functions

size_t hash () const
 Hash value of this Remote_endpoint for unordered_*<>. More...
 

Public Attributes

util::Udp_endpoint m_udp_endpoint
 UDP address (IP address/UDP port) where the Node identified by this endpoint bound its low-level UDP socket.
 
flow_port_t m_flow_port = 0
 The logical Flow port within the Node for the particular connection identified by this endpoint.
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, const Remote_endpoint &endpoint)
 Prints string representation of the given Remote_endpoint to the given ostream. More...
 
bool operator== (const Remote_endpoint &lhs, const Remote_endpoint &rhs)
 Whether lhs is equal to rhs. More...
 
size_t hash_value (const Remote_endpoint &remote_endpoint)
 Free function that returns remote_endpoint.hash(); has to be a free function named hash_value for boost.hash to pick it up. More...
 

Detailed Description

Represents the remote endpoint of a Flow-protocol connection; identifies the UDP endpoint of the remote Node and the logical Flow-protocol port within that Node.

In particular when performing Node::connect(), one must supply a Remote_endpoint. Constuct this via direct member initialization.

When performing Node::listen(), on the other hand, a Remote_endpoint is unnecessary; the UDP endpoint has already been supplied when starting the overall Node, so only the Flow-protocol port number is needed by Node::listen().

Since the components of a Remote_endpoint should be freely readable and modifiable, I forewent the usual accessors/mutators and simply made those components public data members.

See also
As of this writing, class Node documentation header has a lengthy discussion about whether Remote_endpoint needs m_flow_port at all; if it does not, then Remote_endpoint becomes isomorphic to util::Udp_endpoint and can be thus aliased or eliminated. See the to-dos section of that large doc header. (That discussion has implications for all of net_flow, so it belongs there, not here on this humble struct.)

Member Function Documentation

◆ hash()

size_t flow::net_flow::Remote_endpoint::hash ( ) const

Hash value of this Remote_endpoint for unordered_*<>.

Returns
Ditto.

Friends And Related Function Documentation

◆ hash_value()

size_t hash_value ( const Remote_endpoint remote_endpoint)
related

Free function that returns remote_endpoint.hash(); has to be a free function named hash_value for boost.hash to pick it up.

Parameters
remote_endpointObject to hash.
Returns
remote_endpoint.hash().

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const Remote_endpoint endpoint 
)
related

Prints string representation of the given Remote_endpoint to the given ostream.

Parameters
osStream to which to write.
endpointEndpoint to serialize.
Returns
os.

◆ operator==()

bool operator== ( const Remote_endpoint lhs,
const Remote_endpoint rhs 
)
related

Whether lhs is equal to rhs.

Parameters
lhsObject to compare.
rhsObject to compare.
Returns
See above.

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