mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-24 09:54:16 +08:00
Use nested namespaces (C++17 feature)
This commit is contained in:
@@ -11,47 +11,44 @@
|
||||
#ifndef BLACKCORE_FSD_PONG_H
|
||||
#define BLACKCORE_FSD_PONG_H
|
||||
|
||||
#include "messagebase.h"
|
||||
#include "blackcore/fsd/messagebase.h"
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackCore::Fsd
|
||||
{
|
||||
namespace Fsd
|
||||
//! Sent or received as reply to a ping.
|
||||
class BLACKCORE_EXPORT Pong : public MessageBase
|
||||
{
|
||||
//! Sent or received as reply to a ping.
|
||||
class BLACKCORE_EXPORT Pong : public MessageBase
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
Pong(const QString &sender, const QString &receiver, const QString ×tamp);
|
||||
public:
|
||||
//! Constructor
|
||||
Pong(const QString &sender, const QString &receiver, const QString ×tamp);
|
||||
|
||||
//! Message converted to tokens
|
||||
QStringList toTokens() const;
|
||||
//! Message converted to tokens
|
||||
QStringList toTokens() const;
|
||||
|
||||
//! Construct from tokens
|
||||
static Pong fromTokens(const QStringList &tokens);
|
||||
//! Construct from tokens
|
||||
static Pong fromTokens(const QStringList &tokens);
|
||||
|
||||
//! PDU identifier
|
||||
static QString pdu() { return "$PO"; }
|
||||
//! PDU identifier
|
||||
static QString pdu() { return "$PO"; }
|
||||
|
||||
QString m_timestamp; //!< timestamp
|
||||
QString m_timestamp; //!< timestamp
|
||||
|
||||
private:
|
||||
Pong();
|
||||
};
|
||||
private:
|
||||
Pong();
|
||||
};
|
||||
|
||||
//! Equal to operator
|
||||
inline bool operator==(const Pong &lhs, const Pong &rhs)
|
||||
{
|
||||
return lhs.sender() == rhs.sender() &&
|
||||
lhs.receiver() == rhs.receiver() &&
|
||||
lhs.m_timestamp == rhs.m_timestamp;
|
||||
}
|
||||
//! Equal to operator
|
||||
inline bool operator==(const Pong &lhs, const Pong &rhs)
|
||||
{
|
||||
return lhs.sender() == rhs.sender() &&
|
||||
lhs.receiver() == rhs.receiver() &&
|
||||
lhs.m_timestamp == rhs.m_timestamp;
|
||||
}
|
||||
|
||||
//! Not equal to operator
|
||||
inline bool operator!=(const Pong &lhs, const Pong &rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
//! Not equal to operator
|
||||
inline bool operator!=(const Pong &lhs, const Pong &rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user