xorp

NetCmp< A > Struct Template Reference

A network comparitor class for the purposes of ordering networks in sorted containers. More...

#include <route_db.hh>

List of all members.

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

Detailed Description

template<typename A>
struct NetCmp< A >

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.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations