KPublicTransport::Feature

Search for usage in LXR

#include <feature.h>

Properties

Availability availability
 
QString description
 
QString displayName
 
KPublicTransport::Disruption::Effect disruptionEffect
 
QString name
 
int quantity
 
Type type
 

Public Member Functions

 Feature (Type type, Availability availability=Available)
 
QString displayName () const
 

Static Public Member Functions

static std::vector< FeaturefromJson (const QJsonArray &array)
 
static Feature fromJson (const QJsonObject &obj)
 
static bool isSame (const Feature &lhs, const Feature &rhs)
 
static Feature merge (const Feature &lhs, const Feature &rhs)
 
static QJsonObject toJson (const Feature &feature)
 
static QJsonArray toJson (const std::vector< Feature > &features)
 
static QString typeDisplayName (KPublicTransport::Feature::Type type)
 

Detailed Description

An amenity, facility or other relevant property of a vehicle (train, bus, etc), vehicle part (e.g.

train coach) or location.

Definition at line 20 of file feature.h.

Property Documentation

◆ availability

Availability KPublicTransport::Feature::availability
readwrite

Definition at line 69 of file feature.h.

◆ description

QString KPublicTransport::Feature::description
readwrite

An optional longer human-readable description.

Strongly recommended e.g. for features with limited/condicational availability or with type Other.

Definition at line 37 of file feature.h.

◆ displayName

QString KPublicTransport::Feature::displayName
read

A short humand-readable label for this feature.

Unlike name this returns a default label depending on the type of the feature, even if the data source for this didn't provide a name.

Definition at line 31 of file feature.h.

◆ disruptionEffect

KPublicTransport::Disruption::Effect KPublicTransport::Feature::disruptionEffect
readwrite

Distruption effects on the feature.

Definition at line 72 of file feature.h.

◆ name

QString KPublicTransport::Feature::name
readwrite

A short human-readable label of this feature.

Definition at line 24 of file feature.h.

◆ quantity

int KPublicTransport::Feature::quantity
readwrite

Amount of instances of this feature.

Eg. number of seats/spaces, 0 if unknown.

Definition at line 77 of file feature.h.

◆ type

Type KPublicTransport::Feature::type
readwrite

Definition at line 58 of file feature.h.

Constructor & Destructor Documentation

◆ Feature()

Feature::Feature ( Type type,
Availability availability = Available )
explicit

Convenience constructor for a Feature of type type and availability availability.

Definition at line 36 of file feature.cpp.

Member Function Documentation

◆ displayName()

QString Feature::displayName ( ) const
nodiscard

Definition at line 43 of file feature.cpp.

◆ fromJson() [1/2]

std::vector< Feature > Feature::fromJson ( const QJsonArray & array)
staticnodiscard

Deserialize a vector of features from JSON.

Definition at line 105 of file feature.cpp.

◆ fromJson() [2/2]

Feature Feature::fromJson ( const QJsonObject & obj)
staticnodiscard

Deserialize an object from JSON.

Definition at line 100 of file feature.cpp.

◆ isSame()

bool Feature::isSame ( const Feature & lhs,
const Feature & rhs )
staticnodiscard

Returns true if both features refer to the same thing.

This doesn't mean they are identical, nor does this consider the context a feature belongs to.

Definition at line 110 of file feature.cpp.

◆ merge()

Feature Feature::merge ( const Feature & lhs,
const Feature & rhs )
staticnodiscard

Merge two features referring to the same thing.

Definition at line 135 of file feature.cpp.

◆ toJson() [1/2]

QJsonObject Feature::toJson ( const Feature & feature)
staticnodiscard

Serializes one object to JSON.

Definition at line 86 of file feature.cpp.

◆ toJson() [2/2]

QJsonArray Feature::toJson ( const std::vector< Feature > & features)
staticnodiscard

Serializes a vector of features to JSON.

Definition at line 95 of file feature.cpp.

◆ typeDisplayName()

QString Feature::typeDisplayName ( KPublicTransport::Feature::Type type)
staticnodiscard

Generic display name for feature of type.

Definition at line 48 of file feature.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 11:50:59 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.