swift
clientresponse.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_ClientResponse_H
7 #define SWIFT_CORE_FSD_ClientResponse_H
8 
9 #include "core/fsd/enums.h"
10 #include "core/fsd/messagebase.h"
11 
12 namespace swift::core::fsd
13 {
16  {
17  public:
19  ClientResponse(const QString &sender, const QString &receiver, ClientQueryType queryType,
20  const QStringList &responseData);
21 
23  bool isUnknownQuery() const { return m_queryType == ClientQueryType::Unknown; }
24 
26  QStringList toTokens() const;
27 
29  static ClientResponse fromTokens(const QStringList &tokens);
30 
32  static QString pdu() { return "$CR"; }
33 
36  ClientQueryType m_queryType {};
37  QStringList m_responseData;
39 
40  private:
42  };
43 
45  inline bool operator==(const ClientResponse &lhs, const ClientResponse &rhs)
46  {
47  return lhs.sender() == rhs.sender() && lhs.receiver() == rhs.receiver() && lhs.m_queryType == rhs.m_queryType &&
48  lhs.m_responseData == rhs.m_responseData;
49  }
50 
52  inline bool operator!=(const ClientResponse &lhs, const ClientResponse &rhs) { return !(lhs == rhs); }
53 } // namespace swift::core::fsd
54 
55 #endif // SWIFT_CORE_FSD_ClientResponse_H
bool operator!=(const AddAtc &lhs, const AddAtc &rhs)
Not equal operator.
Definition: addatc.h:68
This packet is used to respond to a client data request.
ClientQueryType m_queryType
Properties.
static QString pdu()
PDU identifier.
QStringList m_responseData
Properties.
bool isUnknownQuery() const
Unknow query?
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.