diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2009-11-10 13:30:29 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2009-11-10 13:30:29 -0500 |
commit | a97aebb84a8b5b43de01fd3823d1b38e711e6ab7 (patch) | |
tree | f761ddd348af7310b66a4ce1d95af96b97f415e3 /indra/llcommon/lltimer.cpp | |
parent | fc849873abb839b013efbae5e44b150d4be1f236 (diff) |
Enhance LLInstanceTracker variants to be more uniform.
For both the (so far unused) generic KEY form and the KEY = T* form, provide
key_iter, beginKeys(), endKeys().
Change instance_iter so that when dereferenced, it gives you a T& rather than
a T*, to be more harmonious with a typical STL container. (You parameterize
LLInstanceTracker with T, not with T*.)
Fix existing usage in llfasttimer.cpp and lltimer.cpp to agree.
For the KEY = T* specialization, add T* getInstance(T*) so client isn't forced
to know which variant was used.
Add unit tests for uniformity of public operations on both variants.
Diffstat (limited to 'indra/llcommon/lltimer.cpp')
-rw-r--r-- | indra/llcommon/lltimer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index ea5b0c03ef..ef3e8dbc94 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -583,13 +583,13 @@ void LLEventTimer::updateClass() std::list<LLEventTimer*> completed_timers; for (instance_iter iter = beginInstances(); iter != endInstances(); ) { - LLEventTimer* timer = *iter++; - F32 et = timer->mEventTimer.getElapsedTimeF32(); - if (timer->mEventTimer.getStarted() && et > timer->mPeriod) { - timer->mEventTimer.reset(); - if ( timer->tick() ) + LLEventTimer& timer = *iter++; + F32 et = timer.mEventTimer.getElapsedTimeF32(); + if (timer.mEventTimer.getStarted() && et > timer.mPeriod) { + timer.mEventTimer.reset(); + if ( timer.tick() ) { - completed_timers.push_back( timer ); + completed_timers.push_back( &timer ); } } } |