ZIO
Python and C++ interface to ZeroMQ and Zyre
|
An identified vertex in a ported, directed graph. More...
#include <node.hpp>
Public Member Functions | |
Node (nickname_t nick="", origin_t origin=0, const std::string &hostname="") | |
Create a node. More... | |
~Node () | |
nickname_t | nick () const |
Return a previously set node nickname. More... | |
origin_t | origin () const |
Return a previously set node origin. More... | |
const std::vector< std::string > & | portnames () const |
Return names of all ports in order of their creation. More... | |
void | set_nick (const nickname_t &nick) |
Set the node nickname. More... | |
void | set_origin (origin_t origin) |
Set the node origin. More... | |
void | set_verbose (bool verbose=true) |
Set verbose for underlying Zyre and internal debug messages. More... | |
bool | verbose () const |
portptr_t | port (const std::string &name, int stype) |
Create a named port with the given socket type. More... | |
portptr_t | port (const std::string &name) |
Return a previously created port. More... | |
void | online (const headerset_t &extra_headers={}) |
Bring the node online. More... | |
void | offline () |
Bring the node offline. More... | |
An identified vertex in a ported, directed graph.
Each port (a zio::Port) is named uniquely within the node and has a ZeroMQ socket which may (simultaneously) bind and connect.
Every bind is advertised for discovery by a zio::Peer.
Each connect may be direct which completes immediately or indirect (given based on node/port names) which waits for peer discovery to resolve.
Nodes start in "offline" state. During that state, ports may be created. The ports also start in "offline" state and while offline they may bind() or connect(). When a node is brought "online" it brings all ports "online" and it is then when any bind() or connect() and associated discovery are performed. A node and its ports may be taken subsequently "offline" and the cycle repeated.
zio::Node::Node | ( | nickname_t | nick = "" , |
origin_t | origin = 0 , |
||
const std::string & | hostname = "" |
||
) |
|
inline |
void zio::Node::online | ( | const headerset_t & | extra_headers = {} | ) |
|
inline |
zio::portptr_t zio::Node::port | ( | const std::string & | name, |
int | stype | ||
) |
zio::portptr_t zio::Node::port | ( | const std::string & | name | ) |
|
inline |
|
inline |
void zio::Node::set_origin | ( | origin_t | origin | ) |
void zio::Node::set_verbose | ( | bool | verbose = true | ) |