swift
clientquery.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_CLIENTQUERY_H
7 #define SWIFT_CORE_FSD_CLIENTQUERY_H
8 
9 #include "core/fsd/enums.h"
10 #include "core/fsd/messagebase.h"
11 
12 namespace swift::core::fsd
13 {
21  {
22  public:
24  ClientQuery(const QString &sender, const QString &clientToBeQueried, ClientQueryType queryType,
25  const QStringList &queryData = {});
26 
28  QStringList toTokens() const;
29 
31  static ClientQuery fromTokens(const QStringList &tokens);
32 
34  static QString pdu() { return "$CQ"; }
35 
38  ClientQueryType m_queryType = ClientQueryType::Unknown;
39  QStringList m_queryData;
41 
42  private:
43  ClientQuery();
44  };
45 
47  inline bool operator==(const ClientQuery &lhs, const ClientQuery &rhs)
48  {
49  return lhs.sender() == rhs.sender() && lhs.receiver() == rhs.receiver() && lhs.m_queryType == rhs.m_queryType &&
50  lhs.m_queryData == rhs.m_queryData;
51  }
52 
54  inline bool operator!=(const ClientQuery &lhs, const ClientQuery &rhs) { return !(lhs == rhs); }
55 } // namespace swift::core::fsd
56 
57 #endif // SWIFT_CORE_FSD_CLIENTQUERY_H
bool operator!=(const AddAtc &lhs, const AddAtc &rhs)
Not equal operator.
Definition: addatc.h:68
This packet is used to query a client’s data.
Definition: clientquery.h:21
static QString pdu()
PDU identifier.
Definition: clientquery.h:34
QStringList m_queryData
Properties.
Definition: clientquery.h:39
ClientQueryType m_queryType
Properties.
Definition: clientquery.h:38
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
ClientQueryType
Client query types.
Definition: enums.h:72
#define SWIFT_CORE_EXPORT
Export a class or function from the library.