e3612a5 FIX: fixed the termination of the processes git-subtree-dir: libs/CommService git-subtree-split: e3612a55032895575a2f3394511d6c09b2a98988
57 lines
1.5 KiB
C++
57 lines
1.5 KiB
C++
#ifndef __PAYLOADS_LEAVE__
|
|
#define __PAYLOADS_LEAVE__
|
|
|
|
/**
|
|
* @file
|
|
* @brief main header file for the Leave payload
|
|
* @author Henry Winkel
|
|
* @date 15.09.2022
|
|
* @copyright
|
|
*/
|
|
#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
|