13 ListEntry entry(tuple,0);
14 TupleList::iterator i=mList.find(entry);
19 if(i->first.mExpiry > now)
36 notifyListeners(tuple,expiry,
mark);
37 ListEntry entry(tuple,expiry);
44 ListEntry entry(tuple, 0);
45 TupleList::iterator i = mList.find(entry);
49 if (markFilter ==
BLACK || markFilter == i->second)
59 mListeners.insert(listener);
65 mListeners.erase(listener);
69TupleMarkManager::removeMark(
const Tuple& tuple, TupleList::iterator i)
75 notifyListeners(tuple, expiry,
mark);
81 for(Listeners::iterator i = mListeners.begin(); i!=mListeners.end(); ++i)
83 (*i)->onMark(tuple,expiry,
mark);
87TupleMarkManager::ListEntry::ListEntry(
const Tuple& tuple,
uint64_t expiry)
92TupleMarkManager::ListEntry::ListEntry(
const TupleMarkManager::ListEntry& orig)
93 : mTuple(orig.mTuple),
97TupleMarkManager::ListEntry::~ListEntry()
101TupleMarkManager::ListEntry::operator<(
const TupleMarkManager::ListEntry& rhs)
const
103 if(mTuple < rhs.mTuple)
107 else if(rhs.mTuple < mTuple)
112 return mTuple.getTargetDomain() < rhs.mTuple.getTargetDomain();
116TupleMarkManager::ListEntry::operator>(
const TupleMarkManager::ListEntry& rhs)
const
118 if(rhs.mTuple < mTuple)
122 else if(mTuple < rhs.mTuple)
127 return mTuple.getTargetDomain() > rhs.mTuple.getTargetDomain();
131TupleMarkManager::ListEntry::operator==(
const TupleMarkManager::ListEntry& rhs)
const
133 return (mTuple==rhs.mTuple && mTuple.getTargetDomain()==rhs.mTuple.getTargetDomain());
static uint64_t getTimeMs()
Returns the current clock time in milliseconds.
void registerMarkListener(MarkListener *)
void mark(const Tuple &tuple, uint64_t expiry, MarkType mark)
void unregisterMarkListener(MarkListener *)
MarkType getMarkType(const Tuple &tuple)
void unmark(const Tuple &tuple, MarkType markFilter)
Represents a network address.
dcm! – add UnusedChecking(_enum) below;
unsigned long long uint64_t
unsigned __int64 uint64_t