|
swift
|
Value object encapsulating information of software distributor. More...
#include <distributor.h>
Public Types | |
| enum | ColumnIndex { IndexDescription = CPropertyIndexRef::GlobalIndexCDistributor , IndexAlias1 , IndexAlias2 , IndexSimulator } |
| Property indexes. More... | |
| Public Types inherited from swift::misc::CValueObject< CDistributor > | |
| using | base_type |
| Base class. | |
| Public Types inherited from swift::misc::CEmpty | |
| using | base_type = CEmpty |
| Base class is alias of itself. | |
| Public Types inherited from swift::misc::mixin::Index< CDistributor > | |
| enum | ColumnIndex |
| Base class enums. More... | |
| Public Types inherited from swift::misc::db::IDatastoreObjectWithStringKey | |
| enum | ColumnIndex { IndexDbStringKey = CPropertyIndexRef::GlobalIndexIDatastoreString , IndexDbKeyAsString , IndexIsLoadedFromDb , IndexDatabaseIcon , IndexVersion , IndexEndMarker } |
| Property index. More... | |
| Public Types inherited from swift::misc::ITimestampBased | |
| enum | ColumnIndex { IndexUtcTimestamp = CPropertyIndexRef::GlobalIndexITimestampBased , IndexUtcTimestampFormattedYmdhms , IndexUtcTimestampFormattedYmdhmsz , IndexUtcTimestampFormattedMdhms , IndexUtcTimestampFormattedMdhmsz , IndexUtcTimestampFormattedDhms , IndexUtcTimestampFormattedHms , IndexUtcTimestampFormattedHm , IndexMSecsSinceEpoch } |
| Properties by index. More... | |
| Public Types inherited from swift::misc::IOrderable | |
| enum | ColumnIndex { IndexOrder = CPropertyIndexRef::GlobalIndexIOrderable , IndexOrderString } |
| Properties by index. More... | |
Public Member Functions | |
| CDistributor ()=default | |
| Default constructor. | |
| CDistributor (const QString &key) | |
| Constructor. | |
| CDistributor (const QString &id, const QString &description, const QString &alias1, const QString &alias2, const swift::misc::simulation::CSimulatorInfo &simulator=swift::misc::simulation::CSimulatorInfo()) | |
| Constructor. | |
| const QString & | getDescription () const |
| Get description. | |
| QString | getIdAndDescription () const |
| Get id and description. | |
| void | setDescription (const QString &description) |
| Set description. | |
| bool | hasDescription () const |
| Has description. | |
| const QString & | getAlias1 () const |
| Get alias1. | |
| const QString & | getAlias2 () const |
| Get alias2. | |
| void | setAlias1 (const QString &alias) |
| Set alias1. | |
| void | setAlias2 (const QString &alias) |
| Set alias2. | |
| bool | hasAlias1 () const |
| Alias 1? | |
| bool | hasAlias2 () const |
| Alias 2? | |
| const swift::misc::simulation::CSimulatorInfo & | getSimulator () const |
| Simulator. | |
| void | setSimulator (const swift::misc::simulation::CSimulatorInfo &simulator) |
| Set simulator. | |
| bool | matchesKeyOrAlias (const QString &keyOrAlias) const |
| Matches key or alias. | |
| bool | matchesKeyOrAlias (const CDistributor &distributor) const |
| Matches key or alias. | |
| bool | matchesSimulator (const CSimulatorInfo &simulator) const |
| Matches simulator. | |
| QVariant | propertyByIndex (swift::misc::CPropertyIndexRef index) const |
| Property by index. | |
| void | setPropertyByIndex (swift::misc::CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const CDistributor &compareValue) const |
| Compare for index. | |
| QString | convertToQString (bool i18n=false) const |
| Cast as QString. | |
| bool | hasCompleteData () const |
| Complete data? | |
| swift::misc::CStatusMessageList | validate () const |
| Validate data. | |
| void | updateMissingParts (const CDistributor &otherDistributor) |
| Update missing parts. | |
| Public Member Functions inherited from swift::misc::mixin::MetaType< CDistributor > | |
| 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::DBusByMetaClass< CDistributor > | |
| void | marshallToDbus (QDBusArgument &arg, Tags...) const |
| Marshall without begin/endStructure, for when composed within another object. | |
| void | unmarshallFromDbus (const QDBusArgument &arg, Tags...) |
| Unmarshall without begin/endStructure, for when composed within another object. | |
| Public Member Functions inherited from swift::misc::mixin::DataStreamByMetaClass< CDistributor > | |
| 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::mixin::JsonByMetaClass< CDistributor > | |
| 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. | |
| Public Member Functions inherited from swift::misc::mixin::String< CDistributor > | |
| 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::Index< CDistributor > | |
| CPropertyIndexList | apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false) |
| Update by variant map. | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const CDistributor &compareValue) const |
| Compare for index. | |
| bool | equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const |
| Is given variant equal to value of property index? | |
| Public Member Functions inherited from swift::misc::mixin::Icon< CDistributor > | |
| CIcons::CIcons::StandardIconUnknown16 | toIcon () const |
| As icon, not implemented by all classes. | |
| Public Member Functions inherited from swift::misc::db::IDatastoreObjectWithStringKey | |
| const QString & | getDbKey () const |
| Get DB key. | |
| QString | getDbKeyAsString () const |
| DB key as string. | |
| QJsonValue | getDbKeyAsJsonValue () const |
| Key as JSON value, or null. | |
| QString | getDbKeyAsStringInParentheses (const QString &prefix={}) const |
| Db key in parentheses, e.g. "(3)". | |
| void | setDbKey (const QString &key) |
| Set the DB key. | |
| bool | hasValidDbKey () const |
| Has valid DB key. | |
| bool | isDbEqual (const IDatastoreObjectWithStringKey &other) const |
| Same DB key and hence equal. | |
| bool | isLoadedFromDb () const |
| Loaded from DB. | |
| void | setLoadedFromDb (bool loaded) |
| Mark as loaded from DB. | |
| bool | matchesDbKeyState (db::DbKeyStateFilter filter) const |
| Matches filter? | |
| const CIcon & | toDatabaseIcon () const |
| Database icon if this has valid key, otherwise empty. | |
| Public Member Functions inherited from swift::misc::db::IDatastoreObject | |
| const QString & | getVersion () const |
| Version info. | |
| QVersionNumber | getQVersion () const |
| Version as QVersion. | |
| bool | hasVersion () const |
| Having a version?s. | |
| void | setVersion (const QString &version) |
| Version info. | |
| Public Member Functions inherited from swift::misc::ITimestampBased | |
| QDateTime | getUtcTimestamp () const |
| Get timestamp. | |
| qint64 | getMSecsSinceEpoch () const |
| Timestamp as ms value. | |
| qint64 | getTimeDifferenceMs (qint64 compareTime) const |
| Time difference in ms. | |
| qint64 | getTimeDifferenceAbsMs (qint64 compareTime) const |
| Time difference in ms. | |
| qint64 | getTimeDifferenceToNowMs () const |
| Time difference to now. | |
| qint64 | getTimeDifferenceMs (const ITimestampBased &compare) const |
| Time difference in ms. | |
| qint64 | getAbsTimeDifferenceMs (qint64 compareTime) const |
| Time difference in ms. | |
| qint64 | getAbsTimeDifferenceMs (const ITimestampBased &compare) const |
| Time difference in ms. | |
| void | setTimestampToNull () |
| Set to null. | |
| void | setMSecsSinceEpoch (qint64 mSecsSinceEpoch) |
| Timestamp as ms value. | |
| void | setByYearMonthDayHourMinute (const QString &yyyyMMddhhmmss) |
| Set by value such as "20141003231045". | |
| void | setUtcTimestamp (const QDateTime ×tamp) |
| Set timestamp. | |
| bool | isNewerThan (const ITimestampBased &otherTimestampObj) const |
| Is this newer than other? | |
| bool | isNewerThan (qint64 mSecsSinceEpoch) const |
| Is newer than epoch value? | |
| bool | isOlderThan (const ITimestampBased &otherTimestampObj) const |
| Is this older than other? | |
| bool | isOlderThan (qint64 mSecsSinceEpoch) const |
| Is this older than other? | |
| bool | isOlderThanNowMinusOffset (int offsetMs) const |
| Older than now-offset. | |
| bool | isSame (const ITimestampBased &otherTimestampObj) const |
| Same timestamp. | |
| qint64 | msecsTo (const ITimestampBased &otherTimestampObj) const |
| Time difference. | |
| qint64 | absMsecsTo (const ITimestampBased &otherTimestampObj) const |
| Time difference. | |
| qint64 | msecsToNow () const |
| Milliseconds to now. | |
| void | setCurrentUtcTime () |
| Set the current time as timestamp. | |
| void | addMsecs (qint64 ms) |
| Add the given number of milliseconds to the timestamp. | |
| QString | getFormattedUtcTimestampHms () const |
| As hh:mm:ss. | |
| QString | getFormattedUtcTimestampHmsz () const |
| As hh:mm:ss.zzz. | |
| QString | getFormattedUtcTimestampHm () const |
| As hh:mm. | |
| QString | getFormattedUtcTimestampDhms () const |
| As dd HH mm ss. | |
| QString | getFormattedUtcTimestampMdhms () const |
| As MM dd HH mm ss. | |
| QString | getFormattedUtcTimestampMdhmsz () const |
| As MM dd HH mm ss.zzz. | |
| QString | getFormattedUtcTimestampYmdhms () const |
| As yyyy MM dd HH mm ss. | |
| QString | getFormattedUtcTimestampYmdhmsz () const |
| As yyyy MM dd HH mm ss.zzz. | |
| bool | hasValidTimestamp () const |
| Valid timestamp? | |
| Public Member Functions inherited from swift::misc::IOrderable | |
| int | getOrder () const |
| Order. | |
| QString | getOrderAsString () const |
| Order as string. | |
| void | setOrder (int order) |
| Set order. | |
| bool | hasValidOrder () const |
| Valid order set? | |
Static Public Member Functions | |
| static CDistributor | fromDatabaseJson (const QJsonObject &json, const QString &prefix=QString()) |
| Object from JSON. | |
| static const QString & | standardFSX () |
| Hardcoded keys for standard models. | |
| static const QString & | standardP3D () |
| Hardcoded keys for standard models. | |
| static const QString & | standardFS9 () |
| Hardcoded keys for standard models. | |
| static const QString & | standardXPlane () |
| Hardcoded keys for standard models. | |
| static const QString & | standardFlightGear () |
| Hardcoded keys for standard models. | |
| static const QSet< QString > & | standardAllFsFamily () |
| Hardcoded keys for standard models. | |
| static const QSet< QString > & | xplaneMostPopular () |
| Hardcoded keys for standard models. | |
| static const QString & | xplaneBlueBell () |
| Hardcoded keys for standard models. | |
| static const QString & | xplaneXcsl () |
| Hardcoded keys for standard models. | |
| static const QString & | standardMsfs () |
| Hardcoded keys for standard models. | |
| static const QString & | standardMsfs2024 () |
| Hardcoded keys for standard models. | |
| Static Public Member Functions inherited from swift::misc::mixin::MetaType< CDistributor > | |
| static void | registerMetadata () |
| Register metadata. | |
| Static Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CDistributor > | |
| static DerivedObj | fromJson (const QJsonObject &json) |
| Get object from QJsonObject. | |
| static DerivedObj | fromJsonNoThrow (const QString &jsonString, bool acceptCacheJson, bool &success, QString &errMsg) |
| Get object from JSON string. | |
| Static Public Member Functions inherited from swift::misc::db::IDatastoreObjectWithStringKey | |
| static QString | invalidDbKey () |
| Invalid key. | |
| static const CPropertyIndex & | keyIndex () |
| The key index. | |
| Static Public Member Functions inherited from swift::misc::ITimestampBased | |
| static bool | isAnyTimestampIndex (int index) |
| Any of the timestamp indexes. | |
| static bool | canHandleIndex (CPropertyIndexRef index) |
| Can given index be handled. | |
| Static Public Member Functions inherited from swift::misc::IOrderable | |
| static bool | isAnyOrderIndex (int index) |
| Any order index. | |
Additional Inherited Members | |
| Protected Member Functions inherited from swift::misc::CValueObject< CDistributor > | |
| CEmpty ()=default | |
| Inheriting constructors. | |
| CEmpty (const CEmpty &)=default | |
| Inheriting constructors. | |
| CValueObject ()=default | |
| Default constructor. | |
| CValueObject & | operator= (const CValueObject &)=default |
| Copy assignment operator. | |
| ~CValueObject ()=default | |
| Destructor. | |
| Protected Member Functions inherited from swift::misc::CEmpty | |
| CEmpty ()=default | |
| Protected default constructor. | |
| CEmpty (const CEmpty &)=default | |
| Protected copy constructor. | |
| CEmpty & | operator= (const CEmpty &)=default |
| Protected copy assignment operator. | |
| ~CEmpty ()=default | |
| Non-virtual protected destructor. | |
| Protected Member Functions inherited from swift::misc::db::IDatastoreObjectWithStringKey | |
| IDatastoreObjectWithStringKey () | |
| Constructor. | |
| IDatastoreObjectWithStringKey (const QString &key) | |
| Constructor. | |
| void | setKeyVersionTimestampFromDatabaseJson (const QJsonObject &json, const QString &prefix=QString()) |
| Set key and timestamp values. | |
| QVariant | propertyByIndex (swift::misc::CPropertyIndexRef index) const |
| Property by index. | |
| void | setPropertyByIndex (swift::misc::CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| int | comparePropertyByIndex (swift::misc::CPropertyIndexRef index, const IDatastoreObjectWithStringKey &compareValue) const |
| Compare for index. | |
| Protected Member Functions inherited from swift::misc::db::IDatastoreObject | |
| void | setTimestampVersionFromDatabaseJson (const QJsonObject &json, const QString &prefix=QString()) |
| Set versionn and timestamp values. | |
| Protected Member Functions inherited from swift::misc::ITimestampBased | |
| ITimestampBased ()=default | |
| Constructor. | |
| ITimestampBased (qint64 msSincePoch) | |
| Constructor. | |
| ITimestampBased (const QDateTime ×tamp) | |
| Constructor. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const ITimestampBased &compareValue) const |
| Compare for index. | |
| void | updateMissingParts (const ITimestampBased &other) |
| Update missing parts. | |
| Protected Member Functions inherited from swift::misc::IOrderable | |
| IOrderable ()=default | |
| Constructor. | |
| IOrderable (int order) | |
| Constructor. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const IOrderable &compareValue) const |
| Compare for index. | |
| Static Protected Member Functions inherited from swift::misc::db::IDatastoreObjectWithStringKey | |
| static bool | existsKey (const QJsonObject &json, const QString &prefix=QString()) |
| Is a key available? | |
| static bool | canHandleIndex (swift::misc::CPropertyIndexRef index) |
| Can given index be handled. | |
| Static Protected Member Functions inherited from swift::misc::IOrderable | |
| static bool | canHandleIndex (CPropertyIndexRef index) |
| Can given index be handled. | |
| Protected Attributes inherited from swift::misc::db::IDatastoreObjectWithStringKey | |
| QString | m_dbKey |
| key | |
| bool | m_loadedFromDb |
| as we have no artificial key, it can happen key is set, but not loaded from DB | |
| Protected Attributes inherited from swift::misc::db::IDatastoreObject | |
| QString | m_version |
| version info | |
| Protected Attributes inherited from swift::misc::ITimestampBased | |
| qint64 | m_timestampMSecsSinceEpoch = -1 |
| timestamp value | |
| Protected Attributes inherited from swift::misc::IOrderable | |
| int | m_order = -1 |
| order number | |
Value object encapsulating information of software distributor.
Definition at line 29 of file distributor.h.
Property indexes.
Definition at line 36 of file distributor.h.
| swift::misc::simulation::CDistributor::CDistributor | ( | const QString & | key | ) |
Constructor.
Definition at line 19 of file distributor.cpp.
| swift::misc::simulation::CDistributor::CDistributor | ( | const QString & | id, |
| const QString & | description, | ||
| const QString & | alias1, | ||
| const QString & | alias2, | ||
| const swift::misc::simulation::CSimulatorInfo & | simulator = swift::misc::simulation::CSimulatorInfo() ) |
Constructor.
Definition at line 21 of file distributor.cpp.
| int swift::misc::simulation::CDistributor::comparePropertyByIndex | ( | CPropertyIndexRef | index, |
| const CDistributor & | compareValue ) const |
Compare for index.
Definition at line 124 of file distributor.cpp.
| QString swift::misc::simulation::CDistributor::convertToQString | ( | bool | i18n = false | ) | const |
Cast as QString.
Definition at line 149 of file distributor.cpp.
|
static |
Object from JSON.
Definition at line 207 of file distributor.cpp.
|
inline |
Get alias1.
Definition at line 68 of file distributor.h.
|
inline |
Get alias2.
Definition at line 71 of file distributor.h.
|
inline |
Get description.
Definition at line 56 of file distributor.h.
| QString swift::misc::simulation::CDistributor::getIdAndDescription | ( | ) | const |
Get id and description.
Definition at line 28 of file distributor.cpp.
|
inline |
Simulator.
Definition at line 86 of file distributor.h.
|
inline |
Alias 1?
Definition at line 80 of file distributor.h.
|
inline |
Alias 2?
Definition at line 83 of file distributor.h.
| bool swift::misc::simulation::CDistributor::hasCompleteData | ( | ) | const |
Complete data?
Definition at line 164 of file distributor.cpp.
|
inline |
Has description.
Definition at line 65 of file distributor.h.
| bool swift::misc::simulation::CDistributor::matchesKeyOrAlias | ( | const CDistributor & | distributor | ) | const |
Matches key or alias.
Definition at line 51 of file distributor.cpp.
| bool swift::misc::simulation::CDistributor::matchesKeyOrAlias | ( | const QString & | keyOrAlias | ) | const |
Matches key or alias.
Definition at line 41 of file distributor.cpp.
| bool swift::misc::simulation::CDistributor::matchesSimulator | ( | const CSimulatorInfo & | simulator | ) | const |
Matches simulator.
Definition at line 64 of file distributor.cpp.
| QVariant swift::misc::simulation::CDistributor::propertyByIndex | ( | swift::misc::CPropertyIndexRef | index | ) | const |
Property by index.
Definition at line 69 of file distributor.cpp.
|
inline |
Set alias1.
Definition at line 74 of file distributor.h.
|
inline |
Set alias2.
Definition at line 77 of file distributor.h.
|
inline |
Set description.
Definition at line 62 of file distributor.h.
| void swift::misc::simulation::CDistributor::setPropertyByIndex | ( | swift::misc::CPropertyIndexRef | index, |
| const QVariant & | variant ) |
Set property by index.
Definition at line 95 of file distributor.cpp.
|
inline |
Set simulator.
Definition at line 89 of file distributor.h.
Hardcoded keys for standard models.
Definition at line 252 of file distributor.cpp.
|
static |
Hardcoded keys for standard models.
Definition at line 246 of file distributor.cpp.
|
static |
Hardcoded keys for standard models.
Definition at line 276 of file distributor.cpp.
|
static |
Hardcoded keys for standard models.
Definition at line 282 of file distributor.cpp.
|
static |
Hardcoded keys for standard models.
Definition at line 234 of file distributor.cpp.
|
static |
Hardcoded keys for standard models.
Definition at line 240 of file distributor.cpp.
| void swift::misc::simulation::CDistributor::updateMissingParts | ( | const CDistributor & | otherDistributor | ) |
Update missing parts.
Definition at line 181 of file distributor.cpp.
| CStatusMessageList swift::misc::simulation::CDistributor::validate | ( | ) | const |
Validate data.
Definition at line 166 of file distributor.cpp.
|
static |
Hardcoded keys for standard models.
Definition at line 264 of file distributor.cpp.
Hardcoded keys for standard models.
Definition at line 258 of file distributor.cpp.
|
static |
Hardcoded keys for standard models.
Definition at line 270 of file distributor.cpp.