1 // Asynchronous communicator
12 enum message_type { INFO, CREDIT, LOAD, CLOSE };
14 message(message_type t, double a): type(t), amount(a) { }
16 message_type get_type() const { return type; }
17 double get_amount() const { return amount; }
29 void send(const char* dest, message* msg);
30 bool recv(message*& msg, m_host_t& from);
35 // List of pending send communications
36 std::list<msg_comm_t> sent_comm;
38 // Control channel for receiving
39 std::string ctrl_mbox;
43 // Data channel for receiving
44 std::string data_mbox;
48 const char* get_ctrl_mbox() const { return ctrl_mbox.c_str(); }
49 const char* get_data_mbox() const { return data_mbox.c_str(); }
53 #endif // !COMMUNICATOR_H