Add timer parameter to DeadlineTimer callback

This commit is contained in:
Vinnie Falco
2013-07-09 19:01:05 -07:00
parent 45bf6820d2
commit 6c9366e9b2
4 changed files with 20 additions and 4 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;

View File

@@ -39,7 +39,7 @@ NetworkOPs::NetworkOPs (LedgerMaster* pLedgerMaster)
{
}
void NetworkOPs::onDeadlineTimer ()
void NetworkOPs::onDeadlineTimer (DeadlineTimer&)
{
ScopedLock sl (getApp().getMasterLock ());

View File

@@ -359,7 +359,7 @@ public:
InfoSub::pointer addRpcSub (const std::string& strUrl, InfoSub::ref rspEntry);
private:
void onDeadlineTimer ();
void onDeadlineTimer (DeadlineTimer&);
void setMode (OperatingMode);