ODMatrix::cell_by_begin_sorter Class Reference

#include <ODMatrix.h>


Detailed Description

Used for sorting the cells by the begin time they describe.

Definition at line 263 of file ODMatrix.h.


Public Member Functions

 cell_by_begin_sorter ()
 constructor
int operator() (ODCell *p1, ODCell *p2) const
 Comparing operator.

Constructor & Destructor Documentation

ODMatrix::cell_by_begin_sorter::cell_by_begin_sorter (  )  [inline, explicit]

constructor

Definition at line 266 of file ODMatrix.h.

00266 { }


Member Function Documentation

int ODMatrix::cell_by_begin_sorter::operator() ( ODCell p1,
ODCell p2 
) const [inline]

Comparing operator.

Compares two cells by the begin of the time they describe. The sort is stabilized (with secondary sort keys being origin and destination) to get comparable results with different platforms / compilers.

Parameters:
[in] p1 First cell to compare
[in] p2 Second cell to compare
Returns:
Whether the begin time of the first cell is lower than the one of the second

Definition at line 279 of file ODMatrix.h.

References ODCell::begin, ODCell::destination, and ODCell::origin.

00279                                                      {
00280             if (p1->begin == p2->begin) {
00281                 if (p1->origin == p2->origin) {
00282                     return p1->destination < p2->destination;
00283                 }
00284                 return p1->origin < p2->origin;
00285             }
00286             return p1->begin<p2->begin;
00287         }


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

Generated on Wed May 5 00:06:57 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6