--- /dev/null
+
+#ifndef GIKOMONA_CORE_INTERPROCESS_COMMUNICATION_HPP
+#define GIKOMONA_CORE_INTERPROCESS_COMMUNICATION_HPP
+
+#include <boost/optional.hpp>
+
+#include "string.hpp"
+
+namespace monazilla { namespace GikoMona { namespace core {
+
+typedef int communicate_id;
+
+enum class application_type : communicate_id {
+ COMMUNICATE_ID_APP = 0,
+ GM_U2 = 0, // GikoMona Update Utility
+
+ GIKOMONA,
+ PNUTS,
+
+ END_OF_COMMUNICATE_ID_APP = 100,
+
+ /* 100-1000 は予約されている */
+
+ COMMUNICATE_ID_USER = 1000
+};
+
+class communication {
+public:
+ explicit communication(const communicate_id from);
+ ~comunication();
+
+ bool connect(const communicate_id connect_to);
+ bool disconnect(const communicate_id disconnect_from);
+
+ template <class MessageType>
+ bool send(const communicate_id to, MessageType&& msg);
+
+ template <class MessageType>
+ bool send_async(const communicate_id to, MessageType&& msg);
+
+ boost::optional<mona_string> receive();
+
+private:
+ bool send_string(const communicate_id to, mona_string&& src);
+ bool send_string_async(const communicate_id to, mona_string&& src);
+};
+
+template <class MessageType>
+bool communication::send(const communicate_id to, MessageType&& msg) {
+ static_assert(is_satisfied_message_concept<MessageType>(),
+ "`MessageType' does not satisfy the `message_concept'");
+
+ return send_string(to, msg.to_string());
+}
+
+template <class MessageType>
+bool communication::send_async(const communicate_id to, MessageType&& msg) {
+ static_assert(is_satisfied_message_concept<MessageType>(),
+ "`MessageType' does not satisfy the `message_concept'");
+
+ return send_string(to, msg.to_string());
+}
+
+} } }
+
+#endif // GIKOMONA_CORE_INTERPROCESS_COMMUNICATION_HPP