summaryrefslogtreecommitdiff
path: root/indra/llcommon/lleventtimer.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2023-08-17 10:03:16 -0400
committerNat Goodspeed <nat@lindenlab.com>2023-08-17 10:03:16 -0400
commit3fbb1a496dd4aaadc11727832f3ab0cc8c64950f (patch)
tree6b544ebcbd4a369a662ecd12ca85ec881605950b /indra/llcommon/lleventtimer.h
parent48759438b747c24b536cd099d65ab0c9ea720a38 (diff)
DRTVWR-588: Remove some unused redundant timer functionality.
LLEventTimer supported static run_every(), run_at() and run_after() methods to schedule future work. This can still be done by deriving from LLEventTimer, but is better accomplished with a WorkSchedule instance. These convenience methods, which encourage use of LLEventTimer insted of WorkSchedule, weren't used except by LLEventTimeout. Remove them and the LLEventTimer::Generic subclass used to implement them. Similarly, LLEventTimeout supported static post_every(), post_at() and post_after() methods based on LLEventTimer::run_every(), run_at() and run_after(). These weren't used either. LLRunner is a very old mechanism to schedule future work that seems to be unused. Research suggests that it's indirectly engaged only by LLDeferredChain, which isn't used. LLIOSleeper is tested but isn't otherwise used. Add a deprecation warning to llrun.h prior to excision. Also replace Boost.Bind with lambdas.
Diffstat (limited to 'indra/llcommon/lleventtimer.h')
-rw-r--r--indra/llcommon/lleventtimer.h69
1 files changed, 1 insertions, 68 deletions
diff --git a/indra/llcommon/lleventtimer.h b/indra/llcommon/lleventtimer.h
index dbbfe0c6e6..b5d40a0622 100644
--- a/indra/llcommon/lleventtimer.h
+++ b/indra/llcommon/lleventtimer.h
@@ -24,7 +24,7 @@
* $/LicenseInfo$
*/
-#ifndef LL_EVENTTIMER_H
+#ifndef LL_EVENTTIMER_H
#define LL_EVENTTIMER_H
#include "stdtypes.h"
@@ -47,76 +47,9 @@ public:
static void updateClass();
- /// Schedule recurring calls to generic callable every period seconds.
- /// Returns a pointer; if you delete it, cancels the recurring calls.
- template <typename CALLABLE>
- static LLEventTimer* run_every(F32 period, const CALLABLE& callable);
-
- /// Schedule a future call to generic callable. Returns a pointer.
- /// CAUTION: The object referenced by that pointer WILL BE DELETED once
- /// the callback has been called! LLEventTimer::getInstance(pointer) (NOT
- /// pointer->getInstance(pointer)!) can be used to test whether the
- /// pointer is still valid. If it is, deleting it will cancel the
- /// callback.
- template <typename CALLABLE>
- static LLEventTimer* run_at(const LLDate& time, const CALLABLE& callable);
-
- /// Like run_at(), but after a time delta rather than at a timestamp.
- /// Same CAUTION.
- template <typename CALLABLE>
- static LLEventTimer* run_after(F32 interval, const CALLABLE& callable);
-
protected:
LLTimer mEventTimer;
F32 mPeriod;
-
-private:
- template <typename CALLABLE>
- class Generic;
};
-template <typename CALLABLE>
-class LLEventTimer::Generic: public LLEventTimer
-{
-public:
- // making TIME generic allows engaging either LLEventTimer constructor
- template <typename TIME>
- Generic(const TIME& time, bool once, const CALLABLE& callable):
- LLEventTimer(time),
- mOnce(once),
- mCallable(callable)
- {}
- BOOL tick() override
- {
- mCallable();
- // true tells updateClass() to delete this instance
- return mOnce;
- }
-
-private:
- bool mOnce;
- CALLABLE mCallable;
-};
-
-template <typename CALLABLE>
-LLEventTimer* LLEventTimer::run_every(F32 period, const CALLABLE& callable)
-{
- // return false to schedule recurring calls
- return new Generic<CALLABLE>(period, false, callable);
-}
-
-template <typename CALLABLE>
-LLEventTimer* LLEventTimer::run_at(const LLDate& time, const CALLABLE& callable)
-{
- // return true for one-shot callback
- return new Generic<CALLABLE>(time, true, callable);
-}
-
-template <typename CALLABLE>
-LLEventTimer* LLEventTimer::run_after(F32 interval, const CALLABLE& callable)
-{
- // one-shot callback after specified interval
- return new Generic<CALLABLE>(interval, true, callable);
-}
-
#endif //LL_EVENTTIMER_H