SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSE2Collector::by_vehicle_position_sorter Class Reference

A class used to sort known vehicles by their position. More...

#include <MSE2Collector.h>

Public Member Functions

 by_vehicle_position_sorter (const MSLane *const lane)
 constructor More...
 
 by_vehicle_position_sorter (const by_vehicle_position_sorter &s)
 copy constructor More...
 
int operator() (const SUMOVehicle *v1, const SUMOVehicle *v2)
 Comparison funtcion. More...
 

Private Member Functions

by_vehicle_position_sorteroperator= (const by_vehicle_position_sorter &)
 

Private Attributes

const MSLane *const myLane
 The lane the detector is placed at. More...
 

Detailed Description

A class used to sort known vehicles by their position.

Sorting is needed, because the order may change if a vehicle has entered the lane by lane changing.

We need to have the lane, because the vehicle's position - used for the sorting - may be beyond the lane's end (the vehicle may be on a new lane) and we have to ask for the vehicle's position using this information.

Definition at line 288 of file MSE2Collector.h.

Constructor & Destructor Documentation

MSE2Collector::by_vehicle_position_sorter::by_vehicle_position_sorter ( const MSLane *const  lane)
inline

constructor

Parameters
[in]laneThe lane the detector is placed at

Definition at line 294 of file MSE2Collector.h.

MSE2Collector::by_vehicle_position_sorter::by_vehicle_position_sorter ( const by_vehicle_position_sorter s)
inline

copy constructor

Parameters
[in]sThe instance to copy

Definition at line 302 of file MSE2Collector.h.

Member Function Documentation

int MSE2Collector::by_vehicle_position_sorter::operator() ( const SUMOVehicle v1,
const SUMOVehicle v2 
)

Comparison funtcion.

Parameters
[in]v1First vehicle to compare
[in]v2Second vehicle to compare
Returns
Whether the position of the first vehicles is smaller than the one of the second

Definition at line 457 of file MSE2Collector.cpp.

References MSLane::getPartialOccupator(), SUMOVehicle::getPositionOnLane(), and myLane.

by_vehicle_position_sorter& MSE2Collector::by_vehicle_position_sorter::operator= ( const by_vehicle_position_sorter )
private

Field Documentation

const MSLane* const MSE2Collector::by_vehicle_position_sorter::myLane
private

The lane the detector is placed at.

Definition at line 318 of file MSE2Collector.h.

Referenced by operator()().


The documentation for this class was generated from the following files: