1
#ifndef NODE_H_INCLUDED
2
#define NODE_H_INCLUDED
5
#include <boost/thread.hpp>
7
#include "ip_addressv4.h"
8
#include "node_process.h"
14
typedef boost::shared_ptr<connection> connection_ptr;
20
node(node_process_ptr process);
25
connection_ptr spawn_connection(ip_addressv4 toWhere=ip_addressv4());
26
int get_connection_count() const;
27
connection_ptr get_connection(int id) const;
29
void queue_packet(boost::shared_ptr<packet> packetToSend); ///!< Queues a packet to send via the node_process
30
node_process_ptr _process;
31
boost::shared_ptr<boost::thread> _process_thread;
33
std::vector<connection_ptr> _connections;
35
virtual void on_pre_start() = 0;
36
virtual void on_post_start() = 0;
37
virtual void on_pre_stop() = 0;
38
virtual void on_post_stop() = 0;
40
friend class connection;
43
typedef boost::shared_ptr<node> node_ptr;
47
#endif // NODE_H_INCLUDED