git-subtree-dir: libs/CommService git-subtree-split: 7ccc0fce88bbc5969df060058cf0fb57abe3bcf9
63 lines
1.8 KiB
C++
63 lines
1.8 KiB
C++
#ifndef __PAYLOADS_JOIN__
|
|
#define __PAYLOADS_JOIN__
|
|
/*
|
|
* 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 BC::Payloads::HotPlugJoin payload
|
|
* @author Dominik Meyer <dmeyer@hsu-hh.de>
|
|
* @date 2019-02-03
|
|
* @copyright 2019 no yet defined
|
|
*/
|
|
#include <CommService/transmittable.hpp>
|
|
#include <cstdint>
|
|
#include <vector>
|
|
|
|
namespace CommService
|
|
{
|
|
namespace PayLoads
|
|
{
|
|
/**
|
|
* @brief class representing the payload of a HotPlugJoin message
|
|
*
|
|
* the HotPlugJoin messages is transmitted by every PubSub Service after connection
|
|
* has been established to the underlying network/transport layer.
|
|
* It provides information about the type of service, the id and the underlying
|
|
* network/transport layer addresses.
|
|
*
|
|
*/
|
|
class Join : public transmittable
|
|
{
|
|
public:
|
|
Join()=default;
|
|
/**
|
|
* @brief constructor to recreate the HotPlugJoin payload from a a std::vector<unsigned char>
|
|
*/
|
|
explicit Join(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
|
|
std::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
|