#include "eventlist.hh"
Public Types | |
using | CIter = typename EventVector::const_iterator |
using | Notify = std::function< void(const Event &event, int mod)> |
Public Member Functions | |
CIter | begin () const |
void | clear_silently () |
EventVector | copy () const |
CIter | end () const |
bool | equals (const EventVector &ev) const |
EventList (const Notify &n={}, const Compare &c={}) | |
const Event * | first () const |
bool | insert (const Event &event, Event *replaced=nullptr) |
const Event * | last () const |
const Event * | lookup (const Event &event) const |
const Event * | lookup_after (const Event &event) const |
template<class OrderedEventList > | |
OrderedEventList::ConstP | ordered_events () |
bool | remove (const Event &event, Event *removed=nullptr) |
bool | replace (const Event &event, Event *replaced=nullptr) |
size_t | size () const |
Maintain an array of unique `Event` structures with change notification.
using Notify = std::function<void (const Event &event, int mod)> |
|
explicit |
bool insert | ( | const Event & | event, |
Event * | replaced = nullptr |
||
) |
bool replace | ( | const Event & | event, |
Event * | replaced = nullptr |
||
) |
Insert or replace `event`, notifies.
bool remove | ( | const Event & | event, |
Event * | removed = nullptr |
||
) |
Only replace `event`, notifies.
Return true if `event` was removed, notifies.
Return pointer to matching `event` or nullptr.
Return pointer to element that is >= `event` or nullptr.
Return first element or nullptr.
size_t size | ( | ) | const |
Return last element or nullptr.
void clear_silently | ( | ) |
Return the numberof elements.
OrderedEventList::ConstP ordered_events | ( | ) |
Clear list without notification.
Create a read-only copy of this EventList (possibly cached).
Const iterator that points to the first element.
EventVector copy | ( | ) | const |
Const iterator that points one past the last element.
bool equals | ( | const EventVector & | ev | ) | const |