OSDN Git Service

プロセス間通信を担うクラスの追加
authorcaprice <caprice@users.sourceforge.jp>
Thu, 6 Mar 2014 17:22:39 +0000 (02:22 +0900)
committercaprice <caprice@users.sourceforge.jp>
Thu, 6 Mar 2014 17:22:39 +0000 (02:22 +0900)
include/interprocess-communication.hpp [new file with mode: 0644]

diff --git a/include/interprocess-communication.hpp b/include/interprocess-communication.hpp
new file mode 100644 (file)
index 0000000..2233238
--- /dev/null
@@ -0,0 +1,40 @@
+
+#ifndef GIKOMONA_CORE_INTERPROCESS_COMMUNICATION_HPP
+#define GIKOMONA_CORE_INTERPROCESS_COMMUNICATION_HPP
+
+#include "string.hpp"
+
+namespace monazilla { namespace GikoMona { namespace core { namespace interprocess {
+
+class message_trait {
+public:
+    static mona_string to_string() const;
+};
+
+class communication {
+public:
+    communication();
+    ~comunication();
+    
+    bool connect();
+    
+    template <class MessageTypa>
+    bool send_message(MessageType&& msg);
+    
+    template <class MessageType>
+    bool send_message_async(MessageType&& msg);
+    
+    bool read_message();
+    bool read_message_async();
+    
+private:
+    bool send_string(mona_string&& src);
+    bool send_string_async(mona_string&& src);
+};
+
+template <class MessageType>
+bool communication::send_message(MessageType&& msg);
+
+} } } }
+
+#endif // GIKOMONA_CORE_INTERPROCESS_COMMUNICATION_HPP