diff --git a/Subtrees/beast/modules/beast_basics/events/beast_DeadlineTimer.cpp b/Subtrees/beast/modules/beast_basics/events/beast_DeadlineTimer.cpp index 671d2ff0dc..8475610e5e 100644 --- a/Subtrees/beast/modules/beast_basics/events/beast_DeadlineTimer.cpp +++ b/Subtrees/beast/modules/beast_basics/events/beast_DeadlineTimer.cpp @@ -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); diff --git a/Subtrees/beast/modules/beast_basics/events/beast_DeadlineTimer.h b/Subtrees/beast/modules/beast_basics/events/beast_DeadlineTimer.h index cc4d2d631f..5af0a236aa 100644 --- a/Subtrees/beast/modules/beast_basics/events/beast_DeadlineTimer.h +++ b/Subtrees/beast/modules/beast_basics/events/beast_DeadlineTimer.h @@ -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; diff --git a/src/cpp/ripple/NetworkOPs.cpp b/src/cpp/ripple/NetworkOPs.cpp index 275c735cee..4cbb7dc466 100644 --- a/src/cpp/ripple/NetworkOPs.cpp +++ b/src/cpp/ripple/NetworkOPs.cpp @@ -39,7 +39,7 @@ NetworkOPs::NetworkOPs (LedgerMaster* pLedgerMaster) { } -void NetworkOPs::onDeadlineTimer () +void NetworkOPs::onDeadlineTimer (DeadlineTimer&) { ScopedLock sl (getApp().getMasterLock ()); diff --git a/src/cpp/ripple/NetworkOPs.h b/src/cpp/ripple/NetworkOPs.h index f16ec207c2..dc382f5b83 100644 --- a/src/cpp/ripple/NetworkOPs.h +++ b/src/cpp/ripple/NetworkOPs.h @@ -359,7 +359,7 @@ public: InfoSub::pointer addRpcSub (const std::string& strUrl, InfoSub::ref rspEntry); private: - void onDeadlineTimer (); + void onDeadlineTimer (DeadlineTimer&); void setMode (OperatingMode);