Squashed 'libs/CommService/' content from commit 7ccc0fc
git-subtree-dir: libs/CommService git-subtree-split: 7ccc0fce88bbc5969df060058cf0fb57abe3bcf9
This commit is contained in:
44
libs/libbattle-com/include/BC/transmittable.hpp
Normal file
44
libs/libbattle-com/include/BC/transmittable.hpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef __LIBBC_BC_TRANSMITTABLE_HPP__
|
||||
#define __LIBBC_BC_TRANSMITTABLE_HPP__
|
||||
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief main header file for the transmittable interface
|
||||
* @author Dominik Meyer <dmeyer@hsu-hh.de>
|
||||
* @date 2019-01-08
|
||||
* @copyright 2019 no yet defined
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
namespace BC
|
||||
{
|
||||
/**
|
||||
* @brief abstract class providing the interface for classes being transmittable through a network
|
||||
*
|
||||
* the developer has to make sure that the correct endianess is used in the toByteVector function
|
||||
* and in the Factory for each Class
|
||||
*/
|
||||
class transmittable
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief converts the information of the class (the attributes) to a byte vector
|
||||
*
|
||||
* @param byteVector - returns a std::vector of bytes representing the class
|
||||
*/
|
||||
virtual std::vector<unsigned char> toByteVector() const = 0;
|
||||
};
|
||||
|
||||
}; //namespace BC
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user