swift
rawfsdmessagelist.cpp
1 // SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 SWIFT_DEFINE_SEQUENCE_MIXINS(swift::misc::network, CRawFsdMessage, CRawFsdMessageList)
7 
8 namespace swift::misc::network
9 {
11 
13 
15  {
16  return this->findBy([&](const CRawFsdMessage &rawFsdMessage) { return rawFsdMessage.isPacketType(type); });
17  }
18 
20  {
21  return this->findBy([&](const CRawFsdMessage &rawFsdMessage) { return rawFsdMessage.containsString(str); });
22  }
23 } // namespace swift::misc::network
Generic sequential container with value semantics.
Definition: sequence.h:86
CSequence findBy(Predicate p) const
Return a copy containing only those elements for which a given predicate returns true.
Definition: sequence.h:398
Value object for a raw FSD message.
Definition: rawfsdmessage.h:25
bool containsString(const QString &str) const
Does the raw message contain str?
bool isPacketType(const QString &type) const
Returns true if the raw message is from the given PDU packet type.
Value object encapsulating a list raw FSD messages.
CRawFsdMessageList findByPacketType(const QString &type) const
Find by a given list of raw messages which are type.
CRawFsdMessageList findByContainsString(const QString &str) const
Find by a given list of models by strings.
#define SWIFT_DEFINE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template definition of mixins for a CSequence subclass.
Definition: sequence.h:63