KPublicTransport::Journey

Search for usage in LXR

#include <journey.h>

Properties

int arrivalDelay
 
int co2Emission
 
int departureDelay
 
KPublicTransport::Disruption::Effect disruptionEffect
 
int distance
 
int duration
 
QDateTime expectedArrivalTime
 
QDateTime expectedDepartureTime
 
bool hasExpectedArrivalTime
 
bool hasExpectedDepartureTime
 
KPublicTransport::Load::Category maximumOccupancy
 
int numberOfChanges
 
QDateTime scheduledArrivalTime
 
QDateTime scheduledDepartureTime
 
QList< KPublicTransport::JourneySectionsections
 

Public Member Functions

void applyMetaData (bool download)
 
int arrivalDelay () const
 
int co2Emission () const
 
int departureDelay () const
 
Disruption::Effect disruptionEffect () const
 
int distance () const
 
int duration () const
 
QDateTime expectedArrivalTime () const
 
QDateTime expectedDepartureTime () const
 
bool hasExpectedArrivalTime () const
 
bool hasExpectedDepartureTime () const
 
Load::Category maximumOccupancy () const
 
int numberOfChanges () const
 
QDateTime scheduledArrivalTime () const
 
QDateTime scheduledDepartureTime () const
 
const std::vector< JourneySection > & sections () const
 
void setSections (std::vector< JourneySection > &&sections)
 
std::vector< JourneySection > && takeSections ()
 

Static Public Member Functions

static std::vector< JourneyfromJson (const QJsonArray &array)
 
static Journey fromJson (const QJsonObject &obj)
 
static bool isSame (const Journey &lhs, const Journey &rhs)
 
static Journey merge (const Journey &lhs, const Journey &rhs)
 
static QJsonObject toJson (const Journey &journey)
 
static QJsonArray toJson (const std::vector< Journey > &journeys)
 

Detailed Description

A journey plan.

Definition at line 286 of file journey.h.

Property Documentation

◆ arrivalDelay

int KPublicTransport::Journey::arrivalDelay
read

Difference to schedule in minutes.

Definition at line 311 of file journey.h.

◆ co2Emission

int KPublicTransport::Journey::co2Emission
read

Total CO2 emissions for the entire journey in gram.

That is, the sum of the emissions of all sections.

Definition at line 327 of file journey.h.

◆ departureDelay

int KPublicTransport::Journey::departureDelay
read

Difference to schedule in minutes.

Definition at line 300 of file journey.h.

◆ disruptionEffect

KPublicTransport::Disruption::Effect KPublicTransport::Journey::disruptionEffect
read

Worst disruption effect of any of the journey sections.

Definition at line 318 of file journey.h.

◆ distance

int KPublicTransport::Journey::distance
read

Total travelled distance of the entire journey in meter.

That is, the sum of the distances of all sections.

Definition at line 323 of file journey.h.

◆ duration

int KPublicTransport::Journey::duration
read

Duration of the entire journey in seconds.

Definition at line 314 of file journey.h.

◆ expectedArrivalTime

QDateTime KPublicTransport::Journey::expectedArrivalTime
read

Actual arrival time, if available.

Set to invalid to indicate real-time data is not available.

Definition at line 309 of file journey.h.

◆ expectedDepartureTime

QDateTime KPublicTransport::Journey::expectedDepartureTime
read

Actual departure time, if available.

Set to invalid to indicate real-time data is not available.

Definition at line 298 of file journey.h.

◆ hasExpectedArrivalTime

bool KPublicTransport::Journey::hasExpectedArrivalTime
read

true if this has real-time data.

Definition at line 305 of file journey.h.

◆ hasExpectedDepartureTime

bool KPublicTransport::Journey::hasExpectedDepartureTime
read

true if this has real-time data.

Definition at line 294 of file journey.h.

◆ maximumOccupancy

KPublicTransport::Load::Category KPublicTransport::Journey::maximumOccupancy
read

Maximum occpancy in all journey sections, over all classes.

Definition at line 330 of file journey.h.

◆ numberOfChanges

int KPublicTransport::Journey::numberOfChanges
read

Number of changes on this journey.

Definition at line 316 of file journey.h.

◆ scheduledArrivalTime

QDateTime KPublicTransport::Journey::scheduledArrivalTime
read

Arrival time of the journey, according to schedule.

Definition at line 303 of file journey.h.

◆ scheduledDepartureTime

QDateTime KPublicTransport::Journey::scheduledDepartureTime
read

Departure time of the journey, according to schedule.

Definition at line 292 of file journey.h.

◆ sections

QList<KPublicTransport::JourneySection> KPublicTransport::Journey::sections
readwrite

Journey sections for consumption by QML.

Definition at line 290 of file journey.h.

Member Function Documentation

◆ applyMetaData()

void Journey::applyMetaData ( bool download)

Augment line meta data.

Parameters
downloadif set to true, trigger the download of locally missing assets.

Definition at line 877 of file journey.cpp.

◆ arrivalDelay()

int Journey::arrivalDelay ( ) const
nodiscard

Definition at line 836 of file journey.cpp.

◆ co2Emission()

int Journey::co2Emission ( ) const
nodiscard

Definition at line 865 of file journey.cpp.

◆ departureDelay()

int Journey::departureDelay ( ) const
nodiscard

Definition at line 813 of file journey.cpp.

◆ disruptionEffect()

Disruption::Effect Journey::disruptionEffect ( ) const
nodiscard

Definition at line 851 of file journey.cpp.

◆ distance()

int Journey::distance ( ) const
nodiscard

Definition at line 860 of file journey.cpp.

◆ duration()

int Journey::duration ( ) const
nodiscard

Definition at line 841 of file journey.cpp.

◆ expectedArrivalTime()

QDateTime Journey::expectedArrivalTime ( ) const
nodiscard

Definition at line 831 of file journey.cpp.

◆ expectedDepartureTime()

QDateTime Journey::expectedDepartureTime ( ) const
nodiscard

Definition at line 808 of file journey.cpp.

◆ fromJson() [1/2]

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

Deserialize a list of journey from JSON.

Definition at line 972 of file journey.cpp.

◆ fromJson() [2/2]

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

Deserialize an object from JSON.

Definition at line 965 of file journey.cpp.

◆ hasExpectedArrivalTime()

bool Journey::hasExpectedArrivalTime ( ) const
nodiscard

Definition at line 826 of file journey.cpp.

◆ hasExpectedDepartureTime()

bool Journey::hasExpectedDepartureTime ( ) const
nodiscard

Definition at line 803 of file journey.cpp.

◆ isSame()

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

Checks if two instances refer to the same journey (which does not necessarily mean they are exactly equal).

Definition at line 891 of file journey.cpp.

◆ maximumOccupancy()

Load::Category Journey::maximumOccupancy ( ) const
nodiscard

Definition at line 870 of file journey.cpp.

◆ merge()

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

Merge two instances.

This assumes isSame(lhs, rhs) and tries to preserve the most detailed information.

Definition at line 923 of file journey.cpp.

◆ numberOfChanges()

int Journey::numberOfChanges ( ) const
nodiscard

Definition at line 846 of file journey.cpp.

◆ scheduledArrivalTime()

QDateTime Journey::scheduledArrivalTime ( ) const
nodiscard

Definition at line 818 of file journey.cpp.

◆ scheduledDepartureTime()

QDateTime Journey::scheduledDepartureTime ( ) const
nodiscard

Definition at line 795 of file journey.cpp.

◆ sections()

const std::vector< JourneySection > & Journey::sections ( ) const
nodiscard

The journey sections.

Definition at line 763 of file journey.cpp.

◆ setSections()

void Journey::setSections ( std::vector< JourneySection > && sections)

Sets the journey sections.

Definition at line 774 of file journey.cpp.

◆ takeSections()

std::vector< JourneySection > && Journey::takeSections ( )
nodiscard

Moves the journey sections out of this object.

Definition at line 768 of file journey.cpp.

◆ toJson() [1/2]

QJsonObject Journey::toJson ( const Journey & journey)
staticnodiscard

Serializes one journey object to JSON.

Definition at line 953 of file journey.cpp.

◆ toJson() [2/2]

QJsonArray Journey::toJson ( const std::vector< Journey > & journeys)
staticnodiscard

Serializes a vector of journey objects to JSON.

Definition at line 960 of file journey.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:50:52 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.