
Both nodes are given as pointers in the second element of two pairs. This functor is helpful for example in the find_if algorithm.
Definition at line 68 of file NIImporter_OpenStreetMap.cpp.
Public Member Functions | |
| CompareNodesInPairs (const std::pair< int, NIOSMNode * > &p0) | |
| Initializes the functor with the fixed comparison partner. | |
| bool | operator() (const std::pair< int, NIOSMNode * > &p1) const |
| Compares the NIOSMNode (p1.second) with the node given in the constructor for equality. | |
Private Attributes | |
| std::pair< int, NIOSMNode * > | myP0 |
| NIImporter_OpenStreetMap::CompareNodesInPairs::CompareNodesInPairs | ( | const std::pair< int, NIOSMNode * > & | p0 | ) | [inline] |
Initializes the functor with the fixed comparison partner.
| [in] | p0 | A pair with the NIOSMNode all other nodes should be compared with. |
Definition at line 77 of file NIImporter_OpenStreetMap.cpp.
00077 : 00078 myP0(p0) { 00079 }
| bool NIImporter_OpenStreetMap::CompareNodesInPairs::operator() | ( | const std::pair< int, NIOSMNode * > & | p1 | ) | const [inline] |
Compares the NIOSMNode (p1.second) with the node given in the constructor for equality.
The geo coordinates (lat and lon) are compared to test the equality.
| [in] | p1 | A pair with the node to compare. |
Definition at line 88 of file NIImporter_OpenStreetMap.cpp.
References myP0.
00088 { 00089 return (p1.second->lat == myP0.second->lat) && (p1.second->lon 00090 == myP0.second->lon); 00091 }
std::pair<int, NIOSMNode*> NIImporter_OpenStreetMap::CompareNodesInPairs::myP0 [private] |
1.5.6