24 _time = TimePoint::min();
38 if (group && group <= 8)
39 eventId |= (1 << (group + 15));
41 if (phase && phase <= 8)
42 eventId |= (1 << (phase + 23));
77 EventStore::iterator itr =
_eventMap.begin();
79 if (itr->first >
_time)
81 else if (
_phase && (itr->second & 0xFF000000) && !((itr->second >> 24) &
_phase))
85 uint32 eventId = (itr->second & 0x0000FFFF);
102 for (EventStore::iterator itr = delayed.begin(); itr != delayed.end();)
104 EventStore::node_type node = delayed.extract(itr++);
105 node.key() = node.key() + delay;
112 if (!group || group > 8 ||
Empty())
119 if (itr->second & (1 << (group + 15)))
121 delayed.insert(EventStore::value_type(itr->first + delay, itr->second));
128 _eventMap.insert(delayed.begin(), delayed.end());
138 if (eventId == (itr->second & 0x0000FFFF))
146 if (eventId == (itr->first & 0x0000FFFF))
155 if (!group || group > 8 ||
Empty())
160 if (itr->second & (1 << (group + 15)))
168 if (itr->first & (1 << (group + 15)))
177 for (std::pair<TimePoint const, uint32>
const& itr :
_eventMap)
178 if (eventId == (itr.second & 0x0000FFFF))
179 return std::chrono::duration_cast<Milliseconds>(itr.first -
_time);
181 return Milliseconds::max();
186 EventSeriesStore::iterator itr =
_timerSeries.find(eventData);
190 if (itr->first != eventData)
193 if (itr->second.size() == 0)
204 if (group && group <= 8)
205 eventId |= (1 << (group + 15));
207 if (phase && phase <= 8)
208 eventId |= (1 << (phase + 23));
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Milliseconds randtime(Milliseconds min, Milliseconds max)
void Repeat(Milliseconds time)
void DelayEvents(Milliseconds delay)
void ScheduleEventSeries(uint32 eventId, uint8 group, uint8 phase, std::initializer_list< Milliseconds > const &timeSeries)
void CancelEventGroup(uint32 group)
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
EventSeriesStore _timerSeries
std::multimap< TimePoint, uint32 > EventStore
void CancelEvent(uint32 eventId)
void SetPhase(uint8 phase)
Milliseconds GetTimeUntilEvent(uint32 eventId) const
void ScheduleNextFromSeries(uint32 eventData)
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)