1 // Asynchronous communicator
10 #include "msg_thread.h"
17 // Send a message to the "dest" mailbox
18 void send(const char* dest, message* msg);
20 // Try to flush pending sending communications.
21 // If "wait" is true, blocks until success.
22 void flush(bool wait);
24 // Try to get a message. Returns true on success.
25 // Parameter "timeout" may be 0 for non-blocking operation, -1 for
26 // infinite waiting, or any positive timeout.
27 bool recv(message*& msg, m_host_t& from, double timeout);
33 // List of pending send communications
34 std::list<msg_comm_t> sent_comm;
36 // Queue of received messages
37 message_queue received;
39 // Handling of receiving thread
40 msg_thread* receiver_thread;
43 // Used to chek if a communication is successfull before destroying it
44 static void comm_check_n_destroy(msg_comm_t comm);
45 // If comm is over, call comm_check_n_destroy(comm), and return true
46 static bool comm_test_n_destroy(msg_comm_t comm);
49 #endif // !COMMUNICATOR_H