swift
Loading...
Searching...
No Matches
platformset.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2017 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_PLATFORMSET_H
7#define SWIFT_MISC_PLATFORMSET_H
8
9#include <QMetaType>
10
11#include "misc/collection.h"
12#include "misc/platform.h"
13#include "misc/sequence.h"
15
16SWIFT_DECLARE_COLLECTION_MIXINS(swift::misc, CPlatform, CPlatformSet)
17
18namespace swift::misc
19{
21 class SWIFT_MISC_EXPORT CPlatformSet : public CCollection<CPlatform>, public mixin::MetaType<CPlatformSet>
22 {
25
26 public:
28 CPlatformSet() = default;
29
31 CPlatformSet(const CCollection<CPlatform> &other);
32
35
37 CPlatformSet matchesAny(CPlatform::Platform platform) const;
38
40 CPlatformSet exactMatch(CPlatform::Platform platform) const;
41
43 bool containsName(const QString &platformName) const;
44
46 static const CPlatformSet &allPlatforms();
47
49 static void registerMetadata();
50 };
51} // namespace swift::misc
52
53Q_DECLARE_METATYPE(swift::misc::CPlatformSet)
55
56#endif // SWIFT_MISC_PLATFORMSET_H
Generic ordered container with value semantics.
Definition collection.h:113
CCollection()=default
Default constructor.
Value object for a set of platforms.
Definition platformset.h:22
CPlatformSet()=default
Default constructor.
bool containsName(const QString &platformName) const
Contains name?
static void registerMetadata()
Register metadata.
CPlatformSet exactMatch(CPlatform::Platform platform) const
Matches given platform.
static const CPlatformSet & allPlatforms()
All platforms.
CPlatformSet matchesAny(CPlatform::Platform platform) const
Matches any given platform.
QStringList getPlatformNames() const
All platform names.
CPlatformSet(const CCollection< CPlatform > &other)
Construct from a base class object.
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
#define SWIFT_DECLARE_COLLECTION_MIXINS(Namespace, T, Set)
Explicit template declaration of mixins for a CCollection subclass to be placed near the top of the h...
Definition collection.h:61
#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 ...
Free functions in swift::misc.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.