git-subtree-dir: libs/CommService git-subtree-split: 7ccc0fce88bbc5969df060058cf0fb57abe3bcf9
61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
#ifndef __LIBBC_BC_PAYLOADS_PONG_HPP__
|
|
#define __LIBBC_BC_PAYLOADS_PONG_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 BC::Payloads::Pong payload
|
|
* @author Dominik Meyer <dmeyer@hsu-hh.de>
|
|
* @date 2019-02-06
|
|
* @copyright 2019 no yet defined
|
|
*/
|
|
#include <BC/BC.hpp>
|
|
#include <BC/transmittable.hpp>
|
|
#include <cstdint>
|
|
#include <vector>
|
|
|
|
namespace BC
|
|
{
|
|
namespace Payloads
|
|
{
|
|
/**
|
|
* @brief class representing the payload of a Pong message
|
|
*
|
|
* the Pong messages is the reply to a ping message.
|
|
*
|
|
*/
|
|
class Pong : public BC::transmittable
|
|
{
|
|
public:
|
|
Pong()=default;
|
|
/**
|
|
* @brief constructor to recreate the HotPlugJoin payload from a a std::vector<unsigned char>
|
|
*/
|
|
explicit Pong(std::vector<unsigned char> v);
|
|
|
|
/// message id uniqly identifying one ping message
|
|
uint64_t pingMessageID;
|
|
|
|
/// ping transmission time
|
|
BC::DataTypes::BCTimeType pingTransmissionTime;
|
|
|
|
/// the sequence number of the ping
|
|
uint64_t sequenceNr;
|
|
|
|
/**
|
|
* @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
|