mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
67 lines
2.0 KiB
C++
67 lines
2.0 KiB
C++
/* Copyright (C) 2013
|
|
* swift project Community / Contributors
|
|
*
|
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
|
* directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated,
|
|
* or distributed except according to the terms contained in the LICENSE file.
|
|
*/
|
|
|
|
//! \file
|
|
|
|
#ifndef BLACKMISC_AVIATION_CALLSIGNSET_H
|
|
#define BLACKMISC_AVIATION_CALLSIGNSET_H
|
|
|
|
#include "blackmisc/aviation/callsign.h"
|
|
#include "blackmisc/blackmiscexport.h"
|
|
#include "blackmisc/collection.h"
|
|
#include "blackmisc/mixin/mixincompare.h"
|
|
#include "blackmisc/sequence.h"
|
|
|
|
#include <QMetaType>
|
|
#include <QStringList>
|
|
#include <tuple>
|
|
|
|
BLACK_DECLARE_COLLECTION_MIXINS(BlackMisc::Aviation, CCallsign, CCallsignSet)
|
|
|
|
namespace BlackMisc::Aviation
|
|
{
|
|
//! Value object for a set of callsigns.
|
|
class BLACKMISC_EXPORT CCallsignSet :
|
|
public CCollection<CCallsign>,
|
|
public Mixin::MetaType<CCallsignSet>
|
|
{
|
|
using CCollection::CCollection;
|
|
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CCallsignSet)
|
|
|
|
public:
|
|
//! Default constructor
|
|
CCallsignSet();
|
|
|
|
//! By string list
|
|
CCallsignSet(const QStringList &callsigns, CCallsign::TypeHint typeHint = CCallsign::NoHint);
|
|
|
|
//! Construct from single callsign
|
|
CCallsignSet(const CCallsign &callsign);
|
|
|
|
//! Construct from a base class object.
|
|
CCallsignSet(const CCollection<CCallsign> &other);
|
|
|
|
//! Contains by string
|
|
bool containsCallsign(const QString &callsign) const;
|
|
|
|
//! The callsign strings
|
|
QStringList getCallsignStrings(bool sorted = false) const;
|
|
|
|
//! Callsigns as string
|
|
QString getCallsignsAsString(bool sorted = false, const QString &separator = ", ") const;
|
|
|
|
//! Register metadata
|
|
static void registerMetadata();
|
|
};
|
|
} // namespace
|
|
|
|
Q_DECLARE_METATYPE(BlackMisc::Aviation::CCallsignSet)
|
|
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Aviation::CCallsign>)
|
|
|
|
#endif //guard
|