--- /dev/null
+
+#ifndef GIKOMONA_CORE_POST_OFFICE_HPP
+#define GIKOMONA_CORE_POST_OFFICE_HPP
+
+#include <boost/optional.hpp>
+#include <boost/interprocess/managed_shared_memory.hpp>
+#include <boost/interprocess/containers/vector.hpp>
+#include <boost/interprocess/allocators/allocator.hpp>
+
+#include "GikoMona.hpp"
+#include "string.hpp"
+#include "communication.hpp"
+#include "message.hpp"
+#include "application-type.hpp"
+
+namespace monazilla { namespace GikoMona { namespace core { namespace communication {
+
+class post_office {
+public:
+ explicit post_office(const communicate_id self_id);
+ ~post_office();
+
+ bool connect(const communicate_id connect_to);
+ bool disconnect(const communicate_id disconnect_from);
+ bool disconnect_all();
+
+ template <class MessageType>
+ bool send(const communicate_id to, MessageType&& msg);
+
+ mona_string receive(const communicate_id originator_id);
+
+private:
+ bool send_string(const communicate_id to, mona_string&& src);
+ std::string create_mailbox_name(const communicate_id mb_user_id);
+
+ const communicate_id self;
+ shared_memory gm_shmem; // GikoMona全体で共有されているメモリ
+ mailbox *my_mailbox;
+ std::unordered_map<communicate_id, mailbox> mailbox_map;
+ boost::interprocess::named_mutex my_mailbox_mutex;
+
+ const char *shared_memory_name = "monazilla.GikoMona.shared-memory";
+ const char *ref_counter_name = "monazilla.GikoMona.reference-counter";
+};
+
+} } } }
+
+#endif // GIKOMONA_CORE_POST_OFFICE_HPP