]> AND Private Git Repository - loba.git/blob - communicator.h
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
ca0d3b2031c5b092078a82a75b4f682167fc46a7
[loba.git] / communicator.h
1 // Asynchronous communicator
2
3 #ifndef COMMUNICATOR_H
4 #define COMMUNICATOR_H
5
6 #include <list>
7 #include <string>
8 #include <msg/msg.h>
9
10 class communicator {
11 public:
12     communicator();
13     ~communicator();
14
15     void send(m_task_t task, const char *dest);
16     void send(m_task_t task, const std::string& dest);
17     m_task_t recv();
18     int sent_count();
19
20 private:
21     typedef std::list<msg_comm_t> comm_list;
22     comm_list   sent_comm;
23     char*       recv_mbox;
24     msg_comm_t  recv_comm;
25     m_task_t    recv_task;
26
27     void send_acknowledge();
28 };
29
30 #endif // !COMMUNICATOR_H
31
32 // Local variables:
33 // mode: c++
34 // End: