GlobalRoutingHashMap Class Reference

#include <GlobalRoutingHashMap.h>

List of all members.


Detailed Description

Todo:
doxygen...


Public Types

typedef std::pair< IPvXAddress,
SimpleNodeEntry
RouteEntry

Public Member Functions

void insertNode (const IPvXAddress &addr, const SimpleNodeEntry &entry)
void removeNode (const IPvXAddress &addr)
RouteEntry getEntry (uint i) const
SimpleNodeEntryfindEntryForAddress (const IPvXAddress &addr)
int size ()

Private Types

typedef __gnu_cxx::hash_map<
IPvXAddress, SimpleNodeEntry
RouteHashMap

Private Attributes

RouteHashMap routeHashMap


Member Typedef Documentation

typedef std::pair<IPvXAddress, SimpleNodeEntry> GlobalRoutingHashMap::RouteEntry

typedef __gnu_cxx::hash_map<IPvXAddress, SimpleNodeEntry> GlobalRoutingHashMap::RouteHashMap [private]


Member Function Documentation

SimpleNodeEntry * GlobalRoutingHashMap::findEntryForAddress ( const IPvXAddress &  addr  ) 

00070 {
00071     RouteHashMap::iterator r = routeHashMap.find(addr);
00072     if (r == routeHashMap.end())
00073         return NULL; // host not found
00074     return &(r->second);
00075 }

GlobalRoutingHashMap::RouteEntry GlobalRoutingHashMap::getEntry ( uint  i  )  const

00042 {
00043     if (i > routeHashMap.size())
00044         error("GlobalRoutingHashMap::getEntry(): i > routeHashMap.size()!");
00045 
00046     // FIXME inefficient! is there a better way?
00047     RouteHashMap::const_iterator it = routeHashMap.begin();
00048     while( i-- )
00049         ++it;
00050 
00051     return *it;
00052 }

void GlobalRoutingHashMap::insertNode ( const IPvXAddress &  addr,
const SimpleNodeEntry entry 
)

00056 {
00057     routeHashMap.insert(RouteEntry(addr, entry));
00058 }

void GlobalRoutingHashMap::removeNode ( const IPvXAddress &  addr  ) 

00061 {
00062     if (!routeHashMap.erase(addr)) {
00063         error(("Trying to remove Host " + addr.str() +
00064                ", which is not in the RoutingHashMap").c_str());
00065     }
00066 }

int GlobalRoutingHashMap::size (  )  [inline]

00064     {
00065         return routeHashMap.size();
00066     };


Member Data Documentation

RouteHashMap GlobalRoutingHashMap::routeHashMap [private]


The documentation for this class was generated from the following files:
Generated on Fri May 11 14:52:40 2007 for ITM OverSim by  doxygen 1.4.7