struct
#include <src/vt/timetrigger/trigger.h>
Trigger A time-based trigger that fires with some time period.
Constructors, destructors, conversion operators
- Trigger(std::chrono::milliseconds in_period, ActionType in_trigger, int in_id)
- Create a new time-based trigger.
Public functions
- auto getLastTriggerTime() const -> TimeType
- Get the last trigger time.
- auto nextTriggerTime() const -> TimeType
- Get the next trigger time.
- void runAction(TimeType current_time)
- Run the trigger.
- auto getID() const -> int
- Get the ID for the trigger.
- auto ready(TimeType current_time) const -> bool
- Check if the trigger is ready to be fired.
- void setLastTriggerTime(TimeType trigger_time)
- Update last trigger time—used the first time to set up the trigger.
-
template<typename Serializer>void serialize(Serializer& s)
Friends
Function documentation
vt:: timetrigger:: Trigger:: Trigger(std::chrono::milliseconds in_period,
ActionType in_trigger,
int in_id)
Create a new time-based trigger.
Parameters | |
---|---|
in_period in | the period to trigger |
in_trigger in | the action |
in_id in | the id for the trigger |
TimeType vt:: timetrigger:: Trigger:: getLastTriggerTime() const
Get the last trigger time.
Returns | the last time this was triggered |
---|
TimeType vt:: timetrigger:: Trigger:: nextTriggerTime() const
Get the next trigger time.
Returns | the next time this should be triggered |
---|
void vt:: timetrigger:: Trigger:: setLastTriggerTime(TimeType trigger_time)
Update last trigger time—used the first time to set up the trigger.
Parameters | |
---|---|
trigger_time in | the last trigger time |