Argentum Online - Servidor
protocol.h
1 #ifndef __PROTOCOL_H__
2 #define __PROTOCOL_H__
3 
4 #include <cinttypes>
5 #include <functional>
6 #include <string>
7 #include <vector>
8 
9 #include "../event.h"
10 #include "socket.h"
11 
12 class Protocol {
13  private:
14  std::reference_wrapper<Socket> socket_ref;
15 
16  public:
17  explicit Protocol(Socket& socket);
18 
19  Protocol(const Protocol& other);
20  Protocol& operator=(const Protocol& other);
21 
22  const Socket& get_socket();
23 
24  // Los datos de tipo int son comunicados en BIG ENDIAN
25  Protocol& operator<<(const uint32_t num);
26  Protocol& operator>>(uint32_t& num);
27 
28  Protocol& operator<<(const Event& ev);
29  Protocol& operator>>(Event& ev);
30 
31  ~Protocol();
32 };
33 
34 #endif //__PROTOCOL_H__
Socket
Definition: socket.h:12
Protocol
Definition: protocol.h:12
Event
Definition: event.h:55