38 return stream <<
"Value: " << entry.
value
39 <<
" Endtime: " << entry.
endtime;
49 cancelAndDelete(periodicTimer);
59 periodicTimer =
new cMessage(
"dhtTestMapTimer");
61 scheduleAt(simTime(), periodicTimer);
73 if (msg == periodicTimer) {
75 "GlobalDhtTestMap: Number of stored DHT entries", dataMap.size()));
76 scheduleAt(simTime() + TEST_MAP_INTERVAL, msg);
77 }
else if ((entryTimer = dynamic_cast<DhtTestEntryTimer*>(msg)) != NULL) {
78 dataMap.erase(entryTimer->
getKey());
81 throw cRuntimeError(
"GlobalDhtTestMap::handleMessage(): "
82 "Unknown message type!");
88 Enter_Method_Silent();
91 dataMap.insert(make_pair(key, entry));
106 std::map<OverlayKey, DHTEntry>::iterator it = dataMap.find(key);
108 if (it == dataMap.end()) {
111 return &(it->second);
117 if (dataMap.size() == 0) {
122 std::map<OverlayKey, DHTEntry>::iterator it = dataMap.end();
126 it = dataMap.find(randomKey);
128 if (it == dataMap.end()) {
129 it = dataMap.insert(make_pair(randomKey, tempEntry)).first;
133 if (it == dataMap.end()) {
134 it = dataMap.begin();