Add timer parameter to DeadlineTimer callback

This commit is contained in:
Vinnie Falco
2013-07-09 19:01:05 -07:00
parent 932bc382dc
commit d0ea813515
2 changed files with 18 additions and 2 deletions

View File

@@ -97,7 +97,7 @@ public:
//
// Note that this happens while the lock is held.
//
iter->m_listener->onDeadlineTimer ();
iter->m_listener->onDeadlineTimer (*iter);
// Remove it from the list.
m_items.erase (iter);

View File

@@ -35,7 +35,7 @@ public:
class Listener
{
public:
virtual void onDeadlineTimer () { }
virtual void onDeadlineTimer (DeadlineTimer&) { }
};
public:
@@ -64,6 +64,22 @@ public:
*/
void reset ();
/** Equality comparison.
Timers are equal if they have the same address.
*/
inline bool operator== (DeadlineTimer const& other) const
{
return this == &other;
}
/** Inequality comparison.
*/
inline bool operator!= (DeadlineTimer const& other) const
{
return this != &other;
}
private:
class Manager;