GMTSTrip Class Reference


Overview

Object that contains logistical information about a trip such as `vehicleId`, type of trip, pickup or dropoff times, and route.

Inherits GMTCImmutableData.

Public Member Functions

(nullable
GMTCFleetEngineIDString *) 
- tripID
 Returns the tripID for the current trip, converted from tripName.
(nullable GMTSTripWaypoint *) - nextTripWaypoint
 Returns the first waypoint in the remaining waypoints list.
(nullable GMTSTripWaypoint *) - nextWaypoint
 Returns the next waypoint to be visited.
(nullable NSArray< GMTSLatLng * > *) - activeRoute
 Returns the active route of the given trip.
(nullable NSArray< GMTSLatLng * > *) - remainingRoute
 Returns the remaining route of the given trip.
(nullable GMTSTrafficData *) - activeRouteTraffic
 Returns the traffic data for the active route of this trip.
(nullable GMTSTrafficData *) - remainingRouteTraffic
 Returns the traffic data for the remaining route of this trip.
(int32_t) - remainingDistanceOfActiveRouteInMeters
 Returns the remaining distance of the active route.
(int32_t) - distanceOfRemainingRouteInMeters
 Returns the distance of the remaining route.
(instancetype) - initWithTripName:vehicleID:tripType:tripStatus:pickupLocation:pickupTime:dropoffLocation:dropoffTime:lastVehicleLocation:numberOfPassengers:remainingWaypoints:intermediateDestinations:intermediateDestinationIndex:
 Instantiates an instance of this class.

Static Public Member Functions

(GMTSTripPropertyFields+ propertyValueDifferencesBetweenTrip1:andTrip2:
 Calculate the difference between two given trips.

Properties

NSString * tripName
 Name of the trip.
GMTCFleetEngineIDStringvehicleID
 ID of vehicle servicing the trip.
GMTSTripType tripType
 The current trip type, see GMTSTripType for all the options.
GMTSTripStatus tripStatus
 The current trip status, GMTSTripStatus listed for all the possible statuses.
GMTSTerminalLocationpickupLocation
 The pickup location of the trip.
NSTimeInterval pickupTime
 The estimated time of arrival at the pickup location.
GMTSTerminalLocationdropoffLocation
 The drop off location of the trip.
NSTimeInterval dropoffTime
 The estimated time of arrival at the drop off location.
GMTSVehicleLocationlastVehicleLocation
 The last location information of the vehicle for the trip.
NSUInteger numberOfPassengers
 The number of passengers allowed for the current trip.
NSArray< GMTSTripWaypoint * > * remainingWaypoints
 Array of waypoints on the trip route.
NSArray< GMTSTerminalLocation * > * intermediateDestinations
 The array of the consumer's remaining waypoints.
int32_t intermediateDestinationIndex
 Index of the intermediate waypoint that the vehicle will arrive at next.

Member Function Documentation

Returns the tripID for the current trip, converted from tripName.

Returns the first waypoint in the remaining waypoints list.

Returns the next waypoint to be visited.

The next waypoint might not belong to this trip if this trip is chained or shared.

- (nullable NSArray<GMTSLatLng *> *) activeRoute

Returns the active route of the given trip.

This route is from the current location of the vehicle to the current user's next destination. Unlike the next waypoint in a back-to-back or carpool trip, the next waypoint may not be related to the current user. The return value is generated the first time it is accessed, and then cached.

- (nullable NSArray<GMTSLatLng *> *) remainingRoute

Returns the remaining route of the given trip.

The remaining route is the route segment from the current user's next destination to the user's final destination.

Returns the traffic data for the active route of this trip.

This route is from the current location of the vehicle to the current user's next destination. Unlike the next waypoint in a back-to-back or carpool trip, the next waypoint may not be related to the current user. The return value is generated the first time it is accessed, and then cached.

Returns the traffic data for the remaining route of this trip.

The remaining route is the route segment from the current user's next destination to the user's final destination.

Returns the remaining distance of the active route.

The active route means the route segment from the vehicle's location to the current user's next destination.

Returns the distance of the remaining route.

The remaining route means the route segment from the current user's next destination to their last destination.

+ (GMTSTripPropertyFields) propertyValueDifferencesBetweenTrip1: (GMTSTrip *)  trip1
andTrip2: (GMTSTrip *)  trip2 

Calculate the difference between two given trips.

Each property difference will be accumulated into the return result.

Parameters:
trip1The first trip candidate.
trip2The second trip candidate.
- (instancetype) initWithTripName: (nullable NSString *)  tripName
vehicleID: (nullable GMTCFleetEngineIDString *)  vehicleID
tripType: (GMTSTripType tripType
tripStatus: (GMTSTripStatus tripStatus
pickupLocation: (nullable GMTSTerminalLocation *)  pickupLocation
pickupTime: (NSTimeInterval)  pickupTime
dropoffLocation: (nullable GMTSTerminalLocation *)  dropoffLocation
dropoffTime: (NSTimeInterval)  dropoffTime
lastVehicleLocation: (nullable GMTSVehicleLocation *)  lastVehicleLocation
numberOfPassengers: (NSUInteger)  numberOfPassengers
remainingWaypoints: (nullable NSArray< GMTSTripWaypoint * > *)  remainingWaypoints
intermediateDestinations: (nullable NSArray< GMTSTerminalLocation * > *)  intermediateDestinations
intermediateDestinationIndex: (int32_t)  intermediateDestinationIndex 

Instantiates an instance of this class.

Parameters:
tripNameName of the trip.
vehicleIDThe ID of vehicle servicing the trip.
tripTypeTrip type, see enum GMTSTripType for all the options.
tripStatusTrip status, see enum GMTSTripStatus for all the possible statuses.
pickupLocationThe target pickup location.
pickupTimeThe estimated time for arriving at the pickup location.
dropoffLocationThe target drop off location.
dropoffTimeThe estimated time for arriving at the drop off location.
lastVehicleLocationThe last vehicle location information.
numberOfPassengersThe number of passengers allowed in the trip.
remainingWaypointsThe array of waypoints remaining on the trip.
intermediateDestinationsThe array of the consumer's remaining waypoints.
intermediateDestinationIndexIndex of the intermediate waypoint that the vehicle will arrive at next.

Property Documentation

- (NSString*) tripName [read, assign]

Name of the trip.

- (GMTCFleetEngineIDString*) vehicleID [read, assign]

ID of vehicle servicing the trip.

- (GMTSTripType) tripType [read, assign]

The current trip type, see GMTSTripType for all the options.

- (GMTSTripStatus) tripStatus [read, assign]

The current trip status, GMTSTripStatus listed for all the possible statuses.

- (GMTSTerminalLocation*) pickupLocation [read, assign]

The pickup location of the trip.

- (NSTimeInterval) pickupTime [read, assign]

The estimated time of arrival at the pickup location.

The drop off location of the trip.

- (NSTimeInterval) dropoffTime [read, assign]

The estimated time of arrival at the drop off location.

The last location information of the vehicle for the trip.

- (NSUInteger) numberOfPassengers [read, assign]

The number of passengers allowed for the current trip.

- (NSArray<GMTSTripWaypoint *>*) remainingWaypoints [read, assign]

Array of waypoints on the trip route.

- (NSArray<GMTSTerminalLocation *>*) intermediateDestinations [read, assign]

The array of the consumer's remaining waypoints.

- (int32_t) intermediateDestinationIndex [read, assign]

Index of the intermediate waypoint that the vehicle will arrive at next.

If there are no intermediate waypoints, this field is ignored.