Squashed 'libs/CommService/' content from commit 7ccc0fc

git-subtree-dir: libs/CommService
git-subtree-split: 7ccc0fce88bbc5969df060058cf0fb57abe3bcf9
This commit is contained in:
Henry Winkel
2022-09-15 09:53:53 +02:00
commit cc67e4840f
799 changed files with 179487 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
#ifndef __PAYLOADS_LEAVE__
#define __PAYLOADS_LEAVE__
#include <CommService/transmittable.hpp>
#include <cstdint>
#include <vector>
namespace CommService
{
namespace PayLoads
{
/**
* @brief class representing the payload of a HotPlugLeave message
*
* the HotPlugLeave messages is transmitted by every PubSub Service before disconnecting
* from the network.
* It provides information about the type of service, the id and the underlying
* network/transport layer addresses.
*
*/
class Leave : public transmittable
{
public:
Leave()=default;
/**
* @brief constructor to recreate the HotPlugJoin payload from a a std::vector<unsigned char>
*/
explicit Leave(std::vector<unsigned char> v);
/// the address of the underlying network layer used to join the network
unsigned char networkLayerAddress[16];
/// the address of the underlying transport layer used to join the network
uint32_t transportLayerAddress;
/**
* @brief converts the information of the class (the attributes) to a byte vector
*
* @param byteVector - returns a std::vector of bytes representing the class
*/
std::vector<unsigned char> toByteVector() const override;
};
}; //namespace Payloads
}; //namespace BC
#endif