OSDN Git Service

post_officeでやり取りされるmailの実装を追加
[gikomona/libcore.git] / include / communication / mail.hpp
diff --git a/include/communication/mail.hpp b/include/communication/mail.hpp
new file mode 100644 (file)
index 0000000..3cb5d19
--- /dev/null
@@ -0,0 +1,41 @@
+
+#ifndef GIKOMONA_CORE_COMMUNICATION_MAIL_HPP
+#define GIKOMONA_CORE_COMMUNICATION_MAIL_HPP
+
+#include <vector>
+#include <memory>
+
+#include "message.hpp"
+
+namespace monazilla { namespace GikoMona { namespace core { namespace communication {
+
+typedef mona_string post_code;
+
+struct mail {
+    post_code from;
+    post_code to_app_name;
+    post_code to_class_id;
+    
+    message msg;
+};
+
+typedef std::shared_ptr<std::vector<mail>> mailbox;
+
+class mail_container {
+    mail_container();
+    ~mail_container();
+    
+    bool post(const mail&);
+    mail recieve();
+    
+    bool empty();
+    std::size_t size();
+};
+
+mailbox create_mailbox();
+void destroy_mailbox(mailbox&& mb);
+
+
+} } } }
+
+#endif // GIKOMONA_CORE_COMMUNICATION_MAIL_HPP