25 #include <co/dispatcher.h>
26 #include <co/connection.h>
27 #include <co/nodeType.h>
32 namespace detail {
class Node; }
69 CO_API uint32_t
getType()
const;
71 bool operator == (
const Node* n )
const;
72 bool isBigEndian()
const;
144 CO_API
OCommand send(
const uint32_t cmd,
const bool multicast =
false);
162 const bool multicast =
false );
166 CO_API int64_t getLastReceiveTime()
const;
169 CO_API std::string serialize()
const;
171 CO_API
bool deserialize( std::string& data );
175 CO_API
virtual ~Node();
198 detail::Node*
const _impl;
199 CO_API
friend std::ostream& operator << ( std::ostream&,
const Node& );
208 void _connectMulticast(
NodePtr node );
210 void _setListening();
215 void _setLastReceive(
const int64_t time );
220 CO_API std::ostream& operator << ( std::ostream& os,
const Node& node );
225 template<>
inline void byteswap(
co::Node*& ) { }
226 template<>
inline void byteswap(
co::NodePtr& ) { }
CO_API OCommand send(const uint32_t cmd, const bool multicast=false)
Send a command with optional data to the node.
CO_API Node(const uint32_t type=co::NODETYPE_NODE)
Construct a new node proxy.
CO_API bool isConnected() const
CO_API uint32_t getType() const
CO_API void addConnectionDescription(ConnectionDescriptionPtr cd)
Add a new description how this node can be reached.
lunchbox::RefPtr< ConnectionDescription > ConnectionDescriptionPtr
A reference pointer for ConnectionDescription pointers.
CO_API bool isClosed() const
uint128_t NodeID
A unique identifier for nodes.
CO_API bool isReachable() const
Proxy node representing a remote LocalNode.
A class for sending custom commands and data to nodes.
lunchbox::RefPtr< Node > NodePtr
A reference pointer for Node pointers.
CO_API bool removeConnectionDescription(ConnectionDescriptionPtr cd)
Removes a connection description.
ConnectionPtr getMulticast()
Activate and return a multicast connection.
CO_API ConnectionPtr getConnection(const bool multicast=false)
Get an active connection to this node.
CO_API const NodeID & getNodeID() const
Get the node's unique identifier.
Node specialization for a local node.
std::vector< ConnectionDescriptionPtr > ConnectionDescriptions
A vector of ConnectionDescriptionPtr's.
A class for sending commands with data to local and external nodes.
virtual CO_API ~Node()
Destruct this node.
CO_API ConnectionDescriptions getConnectionDescriptions() const
CO_API bool isClosing() const
A class providing command dispatch functionality to networked objects.
CO_API bool isListening() const
lunchbox::RefPtr< Connection > ConnectionPtr
A reference pointer for Connection pointers.