This commit is contained in:
Roland Rossgotterer
2019-10-11 17:01:32 +02:00
committed by Mat Sutcliffe
parent 2c89275ea6
commit 11ee2413b5
38 changed files with 501 additions and 324 deletions

View File

@@ -17,14 +17,20 @@ namespace BlackCore
{
namespace Fsd
{
//! Ping. Needs to be answered with a pong.
class BLACKCORE_EXPORT Ping : public MessageBase
{
public:
//! Constructor
Ping(const QString &sender, const QString &receiver, const QString &timestamp);
virtual ~Ping() {}
//! Message converted to tokens
QStringList toTokens() const;
//! Construct from tokens
static Ping fromTokens(const QStringList &tokens);
//! PDU identifier
static QString pdu() { return "$PI"; }
QString m_timestamp;
@@ -33,6 +39,7 @@ namespace BlackCore
Ping();
};
//! Equal to operator
inline bool operator==(const Ping &lhs, const Ping &rhs)
{
return lhs.sender() == rhs.sender() &&
@@ -40,6 +47,7 @@ namespace BlackCore
lhs.m_timestamp == rhs.m_timestamp;
}
//! Not equal to operator
inline bool operator!=(const Ping &lhs, const Ping &rhs)
{
return !(lhs == rhs);