swift
revbclientparts.cpp
1 // SPDX-FileCopyrightText: Copyright (C) 2020 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #include "core/fsd/serializer.h"
7 #include "misc/logmessage.h"
8 
9 namespace swift::core::fsd
10 {
11  RevBClientParts::RevBClientParts(const QString &sender, const QString &partsval1, const QString &partsval2,
12  const QString &partsval3)
13  : MessageBase(sender), m_partsval1(partsval1), m_partsval2(partsval2), m_partsval3(partsval3)
14 
15  {}
16 
18  {
19  QStringList tokens;
20  tokens.push_back(m_sender);
21  tokens.push_back(m_partsval1);
22  tokens.push_back(m_partsval2);
23  tokens.push_back(m_partsval3);
24  return tokens;
25  }
26 
28  {
29  if (tokens.size() < 4)
30  {
31  swift::misc::CLogMessage(static_cast<RevBClientParts *>(nullptr)).debug(u"Wrong number of arguments.");
32  return {};
33  }
34  return { tokens[0], tokens[1], tokens[2], tokens[3] };
35  }
36 
37 } // namespace swift::core::fsd
FSD message base class.
Definition: messagebase.h:58
QString m_sender
message sender
Definition: messagebase.h:88
This packet is used to translate client’s parts from RevB IVAO -MD. -MDMDN0104:262396:262396:262396.
static RevBClientParts fromTokens(const QStringList &tokens)
Construct from tokens.
QStringList toTokens() const
Message converted to tokens.
Class for emitting a log message.
Definition: logmessage.h:27
Derived & debug()
Set the severity to debug.
void push_back(QList< T >::parameter_type value)
qsizetype size() const const