swift
Loading...
Searching...
No Matches
aircraftcategorylist.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_MISC_AVIATION_AIRCRAFTCATEGORYLIST_H
7#define SWIFT_MISC_AVIATION_AIRCRAFTCATEGORYLIST_H
8
9#include <tuple>
10
11#include <QJsonArray>
12#include <QList>
13#include <QMetaType>
14#include <QSet>
15
17#include "misc/collection.h"
19#include "misc/sequence.h"
21
22SWIFT_DECLARE_SEQUENCE_MIXINS(swift::misc::aviation, CAircraftCategory, CAircraftCategoryList)
23
24namespace swift::misc::aviation
25{
28 public CSequence<CAircraftCategory>,
29 public db::IDatastoreObjectList<CAircraftCategory, CAircraftCategoryList, int>,
30 public mixin::MetaType<CAircraftCategoryList>
31 {
32 public:
35
38
41
44
46 void sortByPath();
47
49 void sortByLevel();
50
53
55 QString getLevelsString(const QString &separator = ", ") const;
56
59
62
65
68
70 CAircraftCategoryList findByLevel(const QList<int> &level, bool noRootNode = false) const;
71
74
77
81
85
87 int removeIfLevel(const QList<int> &level);
88
91
94 };
95} // namespace swift::misc::aviation
96
99
100#endif // SWIFT_MISC_AVIATION_AIRCRAFTCATEGORYLIST_H
Generic ordered container with value semantics.
Definition collection.h:113
CSequence()=default
Default constructor.
Value object for aircraft categories.
Value object encapsulating a list of ICAO codes.
CAircraftCategoryList findByLevel(const QList< int > &level, bool noRootNode=false) const
Find by levels.
QList< int > getFirstLevels() const
All levels sorted.
CAircraftCategoryList()=default
Default constructor.
CSequence()=default
Default constructor.
QString getLevelsString(const QString &separator=", ") const
Get all level strings.
int removeIfLevel(const QList< int > &level)
Remove by level.
CAircraftCategoryList findInParallelBranch(const CAircraftCategory &category) const
Find siblings.
CAircraftCategoryList findByFirstLevel(int level) const
Find by first level.
CAircraftCategoryList findFirstLevels() const
Find first levels.
static CAircraftCategoryList fromDatabaseJson(const QJsonArray &array)
From our database JSON format.
CAircraftCategoryList findByName(const QString &name, Qt::CaseSensitivity cs=Qt::CaseInsensitive) const
Find by name.
CAircraftCategory findByFullLevel(const QList< int > &level) const
Find by exact levels.
QList< int > getSecondLevels() const
All levels sorted.
QSet< QString > getLevelStrings() const
Get all level strings.
CAircraftCategoryList removedLevel(const QList< int > &level) const
With removed categories.
CAircraftCategoryList findHighestLevels(const CAircraftCategoryList &categories)
Find highest (top) level of categories.
CAircraftCategoryList findSiblings(const CAircraftCategory &category) const
Find siblings.
List of objects read from database. Such objects should implement.
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
#define SWIFT_MISC_DECLARE_USING_MIXIN_METATYPE(DERIVED)
When a derived class and a base class both inherit from mixin::MetaType, the derived class uses this ...
CaseSensitivity
#define SWIFT_DECLARE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template declaration of mixins for a CSequence subclass to be placed near the top of the hea...
Definition sequence.h:62
#define SWIFT_MISC_EXPORT
Export a class or function from the library.