#include <AddressCache.h>
Used by the CacheRecursiveOverlayRoute service to remember frequently used node's addresses, to support O(1) node lookups and communication.
Definition at line 85 of file AddressCache.h.
Public Member Functions | |
void | insert (const MaceKey &start, const MaceKey &end, const MaceKey &address) |
inserts entries into the address cache. | |
void | remove (const MaceKey &address) |
Removes address from the cache. | |
MaceKey | query (const MaceKey &) |
Return the address associated with a hash address (if any, MaceKey::null otherwise). | |
void | verify (const MaceKey &hash, const MaceKey &address) |
Ensure only the range of address contains hash hash . |
void mace::AddressCache::insert | ( | const MaceKey & | start, | |
const MaceKey & | end, | |||
const MaceKey & | address | |||
) |
inserts entries into the address cache.
Note:
start | the inclusive beginning of the address space | |
end | the exclusive end of the address space | |
address | the node's address |
Definition at line 61 of file AddressCache.cc.
References mace::NodeCollection< NodeType, MaxSize >::add(), mace::NodeCollection< NodeType, MaxSize >::contains(), mace::KeyRange::containsKey(), mace::AddressCacheEntry::end, Log::endl, mace::NodeCollection< NodeType, MaxSize >::erase(), mace::NodeCollection< NodeType, MaxSize >::get(), mace::MapIterator< M >::hasNext(), mace::NodeCollection< NodeType, MaxSize >::leastScore(), Log::log(), mace::NodeCollection< NodeType, MaxSize >::mapIterator(), mace::MapIterator< M >::next(), mace::MapIterator< M >::remove(), mace::NodeCollection< NodeType, MaxSize >::space(), mace::AddressCacheEntry::start, mace::AddressCacheEntry::time, and TimeUtil::timeu().