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 );
166 CO_API
void setHostname(
const std::string& host );
172 CO_API
virtual std::string
getWorkDir()
const;
179 CO_API int64_t getLastReceiveTime()
const;
182 CO_API std::string serialize()
const;
184 CO_API
bool deserialize( std::string& data );
188 CO_API
virtual ~Node();
211 detail::Node*
const _impl;
212 CO_API
friend std::ostream& operator << ( std::ostream&,
const Node& );
221 void _connectMulticast(
NodePtr node );
223 void _setListening();
228 void _setLastReceive(
const int64_t time );
233 CO_API std::ostream& operator << ( std::ostream& os,
const Node& node );
238 template<>
inline void byteswap(
co::Node*& ) { }
239 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
CO_API const std::string & getHostname() const
virtual CO_API std::string getWorkDir() 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 void setHostname(const std::string &host)
Set the host name for the launch command.
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.
virtual CO_API std::string getLaunchQuote() const