Changed all byte pointers to vectors NetworkMessage: DecodeMessage and EncodeMessage are now static TcpClient: Fixed OnMessage function NetworkMessage: merged both private methods into 1 method
17 lines
327 B
C++
17 lines
327 B
C++
#ifndef SERIALIZER_HPP
|
|
#define SERIALIZER_HPP
|
|
|
|
#ifdef _MSC_VER
|
|
#pragma once
|
|
#endif
|
|
|
|
#include "Defs.hpp"
|
|
#include <vector>
|
|
|
|
struct Serializer
|
|
{
|
|
template<typename T> static const std::vector<byte> &to_bytes(const T &object);
|
|
template<typename T> static const T& from_bytes(const std::vector<byte> &bytes, T& object);
|
|
};
|
|
|
|
#endif |