Functions

NeighborCache.cc File Reference

#include <cassert>
#include <TransportAddress.h>
#include <NodeHandle.h>
#include <PeerInfo.h>
#include <GlobalStatisticsAccess.h>
#include <CoordMessages_m.h>
#include <GlobalNodeListAccess.h>
#include <hashWatch.h>
#include "NeighborCache.h"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const NeighborCache::NeighborCacheEntry &entry)
 Define_Module (NeighborCache)

Detailed Description

Author:
Antonio Zea
Bernhard Heep

Definition in file NeighborCache.cc.


Function Documentation

Define_Module ( NeighborCache   ) 
std::ostream& operator<< ( std::ostream &  os,
const NeighborCache::NeighborCacheEntry entry 
)

Definition at line 40 of file NeighborCache.cc.

{
    if (entry.rttState == NeighborCache::RTTSTATE_VALID) {
        os << entry.rtt;
    } else {
        if (entry.rttState == NeighborCache::RTTSTATE_TIMEOUT) os << "TIMEOUT";
        else if (entry.rttState == NeighborCache::RTTSTATE_UNKNOWN) os << "UNKNOWN";
        else if (entry.rttState == NeighborCache::RTTSTATE_WAITING) os << "WAITING";
    }
    os << " (inserted: " << entry.insertTime;

    os << ", #contexts: "
       << entry.waitingContexts.size();

    if (!entry.nodeRef.isUnspecified()) os <<  ", <KEY>";

    //TODO entry.coordsInfo

    os << ")";

    return os;
}