summaryrefslogtreecommitdiff
path: root/indra/llcommon/lleventfilter.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2019-10-21 13:10:58 -0400
committerNat Goodspeed <nat@lindenlab.com>2020-03-25 18:59:10 -0400
commit2f866c9d9842a48e4f24b8bfb31de1aadcc6c00e (patch)
tree8f9cce08027158f3b27789c511568b4841c1d810 /indra/llcommon/lleventfilter.cpp
parent95a218fcc0d22cdf02a7c81c555b9c909e24bd40 (diff)
DRTVWR-476: Add LLEventTimer::run_every(), run_at(), run_after().
Also add corresponding LLEventTimeout::post_every(), post_at(), post_after() methods.
Diffstat (limited to 'indra/llcommon/lleventfilter.cpp')
-rw-r--r--indra/llcommon/lleventfilter.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/llcommon/lleventfilter.cpp b/indra/llcommon/lleventfilter.cpp
index 06b3cb769e..ae35fb9c8e 100644
--- a/indra/llcommon/lleventfilter.cpp
+++ b/indra/llcommon/lleventfilter.cpp
@@ -38,6 +38,7 @@
#include "llerror.h" // LL_ERRS
#include "llsdutil.h" // llsd_matches()
#include "stringize.h"
+#include "lldate.h"
/*****************************************************************************
* LLEventFilter
@@ -183,6 +184,27 @@ bool LLEventTimeout::countdownElapsed() const
return mTimer.hasExpired();
}
+LLEventTimer* LLEventTimeout::post_every(F32 period, const std::string& pump, const LLSD& data)
+{
+ return LLEventTimer::run_every(
+ period,
+ [pump, data](){ LLEventPumps::instance().obtain(pump).post(data); });
+}
+
+LLEventTimer* LLEventTimeout::post_at(const LLDate& time, const std::string& pump, const LLSD& data)
+{
+ return LLEventTimer::run_at(
+ time,
+ [pump, data](){ LLEventPumps::instance().obtain(pump).post(data); });
+}
+
+LLEventTimer* LLEventTimeout::post_after(F32 interval, const std::string& pump, const LLSD& data)
+{
+ return LLEventTimer::run_after(
+ interval,
+ [pump, data](){ LLEventPumps::instance().obtain(pump).post(data); });
+}
+
/*****************************************************************************
* LLEventBatch
*****************************************************************************/