swift
Loading...
Searching...
No Matches
swift::misc::aviation::CCallsignSet Class Reference

Value object for a set of callsigns. More...

#include <callsignset.h>

Inheritance diagram for swift::misc::aviation::CCallsignSet:
[legend]

Public Member Functions

 CCallsignSet ()=default
 Default constructor.
 CCallsignSet (const QStringList &callsigns, CCallsign::TypeHint typeHint=CCallsign::NoHint)
 By string list.
 CCallsignSet (const CCallsign &callsign)
 Construct from single callsign.
 CCallsignSet (const CCollection< CCallsign > &other)
 Construct from a base class object.
bool containsCallsign (const QString &callsign) const
 Contains by string.
QStringList getCallsignStrings (bool sorted=false) const
 The callsign strings.
QString getCallsignsAsString (bool sorted=false, const QString &separator=", ") const
 Callsigns as string.
Public Member Functions inherited from swift::misc::CCollection< CCallsign >
 CCollection ()=default
 Default constructor.
CCollection & operator= (const CCollection &other)=default
 Copy assignment.
 ~CCollection ()=default
 Destructor.
iterator begin ()
 Returns iterator at the beginning of the collection.
const_iterator cbegin () const
 Returns iterator at the beginning of the collection.
iterator end ()
 Returns iterator one past the end of the collection.
const_iterator cend () const
 Returns const iterator one past the end of the collection.
void swap (CCollection &other) noexcept
 Swap this collection with another.
size_type size () const
 Returns number of elements in the collection.
bool empty () const
 Returns true if the collection is empty.
bool isEmpty () const
 Synonym for empty.
void clear ()
 Removes all elements in the collection.
iterator insert (const_iterator hint, const CCallsign &value)
 For compatibility with std::inserter.
iterator push_back (const CCallsign &value)
 Synonym for insert.
CCollection makeUnion (const C &other) const
 Returns a collection which is the union of this collection and another container.
CCollection intersection (const C &other) const
 Returns a collection which is the intersection of this collection and another.
CCollection difference (const C &other) const
 Returns a collection which contains all the elements from this collection which are not in the other collection.
iterator erase (iterator pos)
 Remove the element pointed to by the given iterator.
iterator find (const CCallsign &value)
 Efficient find method using the find of the implementation container. Typically O(log n).
void remove (const CCallsign &object)
 Efficient remove using the find and erase of the implementation container. Typically O(log n).
int removeIf (Predicate p)
 Remove elements for which a given predicate returns true.
QList< CCallsign > toQList () const
 Convert to a QList.
void marshalToDataStream (QDataStream &stream) const
 Marshal a value to a QDataStream.
void unmarshalFromDataStream (QDataStream &stream)
 Unmarshal a value from a QDataStream.
Public Member Functions inherited from swift::misc::CContainerBase< CCollection< CCallsign > >
auto to () const
 Return a new container of a different type, containing the same elements as this one.
int removeIf (K0 k0, V0 v0, KeysValues... keysValues)
 Remove elements matching some particular key/value pair(s).
QJsonObject toJson () const
 Cast to JSON object.
QString toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented) const
 Convenience function JSON as string.
void convertFromJson (const QJsonObject &json)
 Assign from JSON object.
CStatusMessage convertFromJsonNoThrow (const QJsonObject &json, const CLogCategoryList &categories, const QString &prefix)
 Call convertFromJson, catch any CJsonException that is thrown and return it as CStatusMessage.
QString convertToQString (bool i18n=false) const
 Cast as QString.
QStringList toStringList (bool i18n=false) const
 To string list.
void marshallToDbus (QDBusArgument &argument) const
 Marshall without begin/endStructure, for when composed within another object.
void unmarshallFromDbus (const QDBusArgument &argument)
 Unmarshall without begin/endStructure, for when composed within another object.
Public Member Functions inherited from swift::misc::CRangeBase< CCollection< CCallsign > >
auto transform (F function) const
 Return a new container generated by applying some transformation function to all elements of this one.
auto findBy (Predicate p) const
 Return a copy containing only those elements for which a given predicate returns true.
const auto & findFirstBy (Predicate p) const
 Return a reference to the first element for which a given predicate returns true. Undefined if there is none.
auto findFirstByOrDefault (Predicate p, const Value &def) const
 Return a copy of the first element for which a given predicate returns true, or a default value if there is none.
bool containsBy (Predicate p) const
 Return true if there is an element for which a given predicate returns true.
bool contains (const T &object) const
 Return true if there is an element equal to given object. Uses the most efficient implementation available in the derived container.
bool equalsBy (const T &other, Predicate c) const
 Return true if this container equals another container according to the given element equality predicate.
bool equalsByKeys (const T &other, Key0 k0, Keys... keys) const
 Return true if this container equals another container, considering only the given element members.
T randomElement () const
 Pick one random element.
CCollection< CCallsign > randomElements (int n) const
 Copy n elements from the container at random.
CCollection< CCallsign > sampleElements (int n) const
 Copy n elements from the container, randomly selected but evenly distributed.
Public Member Functions inherited from swift::misc::mixin::MetaType< CCollection< CCallsign > >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object.
QString getClassName () const
 Class name.
bool isA (int metaTypeId) const
 Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses.
Public Member Functions inherited from swift::misc::mixin::String< CCollection< CCallsign > >
QString toQString (bool i18n=false) const
 Cast as QString.
std::string toStdString (bool i18n=false) const
 To std string.
QString stringForStreaming () const
 String for streaming operators.
Public Member Functions inherited from swift::misc::mixin::Icon< CCollection< CCallsign > >
CIcons::CIcons::StandardIconUnknown16 toIcon () const
 As icon, not implemented by all classes.
Public Member Functions inherited from swift::misc::mixin::MetaType< CCallsignSet >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object.
QString getClassName () const
 Class name.
bool isA (int metaTypeId) const
 Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses.

Static Public Member Functions

static void registerMetadata ()
 Register metadata.
Static Public Member Functions inherited from swift::misc::CContainerBase< CCollection< CCallsign > >
static CCollection< CCallsign > fromJson (const QJsonObject &json)
 Static version of convertFromJson.
static CCollection< CCallsign > fromJsonNoThrow (const QString &jsonString, bool acceptCacheJson, bool &success, QString &errMsg)
 Static version of convertFromJson.
Static Public Member Functions inherited from swift::misc::mixin::MetaType< CCollection< CCallsign > >
static void registerMetadata ()
 Register metadata.
Static Public Member Functions inherited from swift::misc::mixin::MetaType< CCallsignSet >
static void registerMetadata ()
 Register metadata.

Additional Inherited Members

Public Types inherited from swift::misc::CCollection< CCallsign >
using key_type
 STL compatibility.
using value_type
 STL compatibility.
using reference
 STL compatibility.
using const_reference
 STL compatibility.
using pointer
 STL compatibility.
using const_pointer
 STL compatibility.
using const_iterator
 STL compatibility.
using iterator
 STL compatibility.
using difference_type
 STL compatibility.
using size_type
 STL compatibility.
Protected Member Functions inherited from swift::misc::CContainerBase< CCollection< CCallsign > >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object.
Static Protected Member Functions inherited from swift::misc::CRangeBase< CCollection< CCallsign > >
static bool equalPointers (const T *a, const U *b)
 Efficiently compare addresses of two objects. Return false if types are not compatible.

Detailed Description

Value object for a set of callsigns.

Definition at line 25 of file callsignset.h.

Constructor & Destructor Documentation

◆ CCallsignSet() [1/3]

swift::misc::aviation::CCallsignSet::CCallsignSet ( const QStringList & callsigns,
CCallsign::TypeHint typeHint = CCallsign::NoHint )

By string list.

Definition at line 15 of file callsignset.cpp.

◆ CCallsignSet() [2/3]

swift::misc::aviation::CCallsignSet::CCallsignSet ( const CCallsign & callsign)

Construct from single callsign.

Definition at line 28 of file callsignset.cpp.

◆ CCallsignSet() [3/3]

swift::misc::aviation::CCallsignSet::CCallsignSet ( const CCollection< CCallsign > & other)

Construct from a base class object.

Definition at line 37 of file callsignset.cpp.

Member Function Documentation

◆ containsCallsign()

bool swift::misc::aviation::CCallsignSet::containsCallsign ( const QString & callsign) const

Contains by string.

Definition at line 39 of file callsignset.cpp.

◆ getCallsignsAsString()

QString swift::misc::aviation::CCallsignSet::getCallsignsAsString ( bool sorted = false,
const QString & separator = ", " ) const

Callsigns as string.

Definition at line 55 of file callsignset.cpp.

◆ getCallsignStrings()

QStringList swift::misc::aviation::CCallsignSet::getCallsignStrings ( bool sorted = false) const

The callsign strings.

Definition at line 41 of file callsignset.cpp.

◆ registerMetadata()

void swift::misc::aviation::CCallsignSet::registerMetadata ( )
static

Register metadata.

Definition at line 64 of file callsignset.cpp.


The documentation for this class was generated from the following files: