KPublicTransport::Journey

Search for usage in LXR

#include <journey.h>

Properties

int arrivalDelay
 
int departureDelay
 
KPublicTransport::Disruption::Effect disruptionEffect
 
int duration
 
QDateTime expectedArrivalTime
 
QDateTime expectedDepartureTime
 
bool hasExpectedArrivalTime
 
bool hasExpectedDepartureTime
 
int numberOfChanges
 
QDateTime scheduledArrivalTime
 
QDateTime scheduledDepartureTime
 
QVariantList sections
 

Public Member Functions

void applyMetaData (bool download)
 
int arrivalDelay () const
 
int departureDelay () const
 
Disruption::Effect disruptionEffect () const
 
int duration () const
 
QDateTime expectedArrivalTime () const
 
QDateTime expectedDepartureTime () const
 
bool hasExpectedArrivalTime () const
 
bool hasExpectedDepartureTime () 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 234 of file journey.h.

Property Documentation

◆ arrivalDelay

int Journey::arrivalDelay
read

Difference to schedule in minutes.

Definition at line 259 of file journey.h.

◆ departureDelay

int Journey::departureDelay
read

Difference to schedule in minutes.

Definition at line 248 of file journey.h.

◆ disruptionEffect

Disruption::Effect Journey::disruptionEffect
read

Worst disruption effect of any of the journey sections.

Definition at line 266 of file journey.h.

◆ duration

int Journey::duration
read

Duration of the entire journey in seconds.

Definition at line 262 of file journey.h.

◆ expectedArrivalTime

QDateTime Journey::expectedArrivalTime
read

Actual arrival time, if available.

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

Definition at line 257 of file journey.h.

◆ expectedDepartureTime

QDateTime Journey::expectedDepartureTime
read

Actual departure time, if available.

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

Definition at line 246 of file journey.h.

◆ hasExpectedArrivalTime

bool Journey::hasExpectedArrivalTime
read

true if this has real-time data.

Definition at line 253 of file journey.h.

◆ hasExpectedDepartureTime

bool Journey::hasExpectedDepartureTime
read

true if this has real-time data.

Definition at line 242 of file journey.h.

◆ numberOfChanges

int Journey::numberOfChanges
read

Number of changes on this journey.

Definition at line 264 of file journey.h.

◆ scheduledArrivalTime

QDateTime Journey::scheduledArrivalTime
read

Arrival time of the journey, according to schedule.

Definition at line 251 of file journey.h.

◆ scheduledDepartureTime

QDateTime Journey::scheduledDepartureTime
read

Departure time of the journey, according to schedule.

Definition at line 240 of file journey.h.

◆ sections

const std::vector< JourneySection > & Journey::sections
read

Journey sections for consumption by QML.

Definition at line 238 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 638 of file journey.cpp.

◆ fromJson() [1/2]

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

Deserialize a list of journey from JSON.

Definition at line 733 of file journey.cpp.

◆ fromJson() [2/2]

Journey Journey::fromJson ( const QJsonObject obj)
static

Deserialize an object from JSON.

Definition at line 726 of file journey.cpp.

◆ isSame()

bool Journey::isSame ( const Journey lhs,
const Journey rhs 
)
static

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

Definition at line 652 of file journey.cpp.

◆ merge()

Journey Journey::merge ( const Journey lhs,
const Journey rhs 
)
static

Merge two instances.

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

Definition at line 684 of file journey.cpp.

◆ sections()

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

The journey sections.

◆ setSections()

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

Sets the journey sections.

Definition at line 559 of file journey.cpp.

◆ takeSections()

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

Moves the journey sections out of this object.

Definition at line 553 of file journey.cpp.

◆ toJson() [1/2]

QJsonObject Journey::toJson ( const Journey journey)
static

Serializes one journey object to JSON.

Definition at line 714 of file journey.cpp.

◆ toJson() [2/2]

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

Serializes a vector of journey objects to JSON.

Definition at line 721 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-2022 The KDE developers.
Generated on Wed Aug 17 2022 04:18:36 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.