|
xorp
|
A network comparitor class for the purposes of ordering networks in sorted containers. More...
#include <route_db.hh>
Public Types | |
| typedef IPNet< A > | Net |
Public Member Functions | |
| bool | operator() (const Net &l, const Net &r) const |
| bool | operator() (const IPNet< A > &l, const IPNet< A > &r) const |
A network comparitor class for the purposes of ordering networks in sorted containers.
A comparitor for the purposes of sorting containers of RouteEntry objects.
It examines the data rather than using the address of pointers. The latter approach makes testing difficult on different platforms since the tests may inadvertantly make assumptions about the memory layout. The comparison is arbitrary, it just has to be consistent and reversible.
IFF speed proves to be an issue, RouteEntry can be changed to be an element in an intrusive linked list that has a sentinel embedded in the RouteEntryOrigin.