|
1 /* |
|
2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * See class description below |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef TPOSLMNEARESTLANDMARK_H |
|
21 #define TPOSLMNEARESTLANDMARK_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <EPos_Landmarks.h> |
|
25 |
|
26 /** |
|
27 * This is a helper class for sorting landmarks in ascending distance order. |
|
28 */ |
|
29 class TPosLmNearestLandmark |
|
30 { |
|
31 public: |
|
32 |
|
33 /** |
|
34 * C++ default constructor. |
|
35 */ |
|
36 TPosLmNearestLandmark(); |
|
37 |
|
38 /** |
|
39 * Function to be used as a @ref TLinearOrder. |
|
40 * It compares the distance to the two landmarks. |
|
41 * |
|
42 * @param[in] aFirst The first landmark to compare. |
|
43 * @param[in] aSecond The second landmark to compare. |
|
44 * @return 0 if the two distances are equal, -1 if the distance to the |
|
45 * first landmark is less than the distance to the second landmark, |
|
46 * 1 if the distance to the first landmark is greater than the |
|
47 * distance to the second landmark. |
|
48 */ |
|
49 static TInt Compare( |
|
50 const TPosLmNearestLandmark& aFirst, |
|
51 const TPosLmNearestLandmark& aSecond ); |
|
52 |
|
53 /** |
|
54 * Function to be used as a @ref TLinearOrder. |
|
55 * It compares the ID to the two landmarks. |
|
56 * |
|
57 * @param[in] aFirst The first landmark to compare. |
|
58 * @param[in] aSecond The second landmark to compare. |
|
59 * @return 0 if the two IDs are equal, -1 if the ID of the |
|
60 * first landmark is less than the ID of the second landmark, |
|
61 * 1 if the ID of the first landmark is greater than the |
|
62 * ID of the second landmark. |
|
63 */ |
|
64 static TInt CompareByID( |
|
65 const TPosLmNearestLandmark& aFirst, |
|
66 const TPosLmNearestLandmark& aSecond ); |
|
67 |
|
68 public: |
|
69 |
|
70 /** The id of the landmark. */ |
|
71 TPosLmItemId iLmId; |
|
72 |
|
73 /** The distance to the landmark. */ |
|
74 TReal32 iDistance; |
|
75 }; |
|
76 |
|
77 #endif // TPOSLMNEARESTLANDMARK_H |
|
78 |
|
79 // End of File |