25 #include <co/dispatcher.h>
26 #include <co/connection.h>
27 #include <co/nodeType.h>
32 namespace detail {
class Node; }
68 CO_API uint32_t
getType()
const;
70 bool operator == (
const Node* n )
const;
71 bool isBigEndian()
const;
142 CO_API
OCommand send(
const uint32_t cmd,
const bool multicast =
false);
160 const bool multicast =
false );
164 CO_API int64_t getLastReceiveTime()
const;
167 CO_API std::string serialize()
const;
169 CO_API
bool deserialize( std::string& data );
173 CO_API
virtual ~Node();
196 detail::Node*
const _impl;
197 CO_API
friend std::ostream& operator << ( std::ostream&,
const Node& );
206 void _connectMulticast(
NodePtr node );
208 void _setListening();
213 void _setLastReceive(
const int64_t time );
218 CO_API std::ostream& operator << ( std::ostream& os,
const Node& node );
223 template<>
inline void byteswap(
co::Node*& ) { }
224 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.
Object-oriented network library.
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.