swift
killrequest.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_CORE_FSD_KILLREQUEST_H
7 #define SWIFT_CORE_FSD_KILLREQUEST_H
8 
9 #include "core/fsd/messagebase.h"
10 
11 namespace swift::core::fsd
12 {
16  {
17  public:
19  KillRequest(const QString &sender, const QString &receiver, const QString &reason);
20 
22  QStringList toTokens() const;
23 
25  static KillRequest fromTokens(const QStringList &tokens);
26 
28  static QString pdu() { return "$!!"; }
29 
30  QString m_reason;
31 
32  private:
33  KillRequest();
34  };
35 
37  inline bool operator==(const KillRequest &lhs, const KillRequest &rhs)
38  {
39  return lhs.sender() == rhs.sender() && lhs.receiver() == rhs.receiver() && lhs.m_reason == rhs.m_reason;
40  }
41 
43  inline bool operator!=(const KillRequest &lhs, const KillRequest &rhs) { return !(lhs == rhs); }
44 } // namespace swift::core::fsd
45 
46 #endif // SWIFT_CORE_FSD_KILLREQUEST_H
bool operator!=(const AddAtc &lhs, const AddAtc &rhs)
Not equal operator.
Definition: addatc.h:68
Kill request initiated from the server or supervisor. Client needs to disconnect immediatly upon rece...
Definition: killrequest.h:16
QString m_reason
reason for kill request/kicked
Definition: killrequest.h:30
static QString pdu()
PDU identifier.
Definition: killrequest.h:28
FSD message base class.
Definition: messagebase.h:58
QString sender() const
get message sender
Definition: messagebase.h:73
QString receiver() const
Get message receiver.
Definition: messagebase.h:79
#define SWIFT_CORE_EXPORT
Export a class or function from the library.