From deb50433de507e364be75f2eed778c0ded223c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sat, 26 Nov 2016 13:46:14 +0100 Subject: [PATCH] started work on the interface of chat_messages --- chat_messages.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 chat_messages.h diff --git a/chat_messages.h b/chat_messages.h new file mode 100644 index 0000000..b80f9e8 --- /dev/null +++ b/chat_messages.h @@ -0,0 +1,36 @@ +#pragma once +#include +#include + + + +enum class message +{ + HELLO = 1, NEPTUN = 2, PASSW = 3, + SERVER_DIRECTION = 4, MESSAGE = 5, + PING = 6, PONG = 7, BYE = 8, + LOGIN = 9, LOGOUT = 10 +}; + + +class chat_message +{ +protected: + virtual message get_command() = 0; + virtual std::string get_content() = 0; +public: +}; + + +class client_message : public chat_message +{ +public: + void send(boost::asio::ip::tcp::socket& socket); +}; + + +class server_message : public chat_message +{ +public: + void receive(boost::asio::ip::tcp::socket& socket); +}; \ No newline at end of file