|
Anklang-0.3.0.dev551+gad1415e2 anklang-0.3.0.dev551+gad1415e2
ASE — Anklang Sound Engine (C++)
« « « Anklang Documentation |
Maintain an array of unique Event structures with change notification.
More...
#include "eventlist.hh"
Public Types | |
| using | Notify = std::function< void(const Event &event, int mod)> |
| using | CIter = typename EventVector::const_iterator |
Public Member Functions | |
| EventList (const Notify &n={}, const Compare &c={}) | |
| 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. | |
| const Event * | lookup (const Event &event) const |
Return true if event was removed, notifies. | |
| const Event * | lookup_after (const Event &event) const |
Return pointer to matching event or nullptr. | |
| const Event * | first () const |
Return pointer to element that is >= event or nullptr. | |
| const Event * | last () const |
| Return first element or nullptr. | |
| size_t | size () const |
| Return last element or nullptr. | |
| void | clear_silently () |
| Return the numberof elements. | |
| template<class OrderedEventList > | |
| OrderedEventList::ConstP | ordered_events () |
| Clear list without notification. | |
| CIter | begin () const |
| Create a read-only copy of this EventList (possibly cached). | |
| CIter | end () const |
| 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 |
Maintain an array of unique Event structures with change notification.
Definition at line 25 of file eventlist.hh.
| using Ase::EventList< Event, Compare >::CIter = typename EventVector::const_iterator |
Definition at line 29 of file eventlist.hh.
| using Ase::EventList< Event, Compare >::Notify = std::function<void (const Event &event, int mod)> |
Definition at line 28 of file eventlist.hh.
|
explicit |
Definition at line 58 of file eventlist.hh.
| CIter Ase::EventList< Event, Compare >::begin | ( | ) | const |
Create a read-only copy of this EventList (possibly cached).
Definition at line 42 of file eventlist.hh.
References std::vector::begin().
| void Ase::EventList< Event, Compare >::clear_silently | ( | ) |
Return the numberof elements.
Definition at line 66 of file eventlist.hh.
| EventVector Ase::EventList< Event, Compare >::copy | ( | ) | const |
Const iterator that points one past the last element.
Definition at line 44 of file eventlist.hh.
| CIter Ase::EventList< Event, Compare >::end | ( | ) | const |
Const iterator that points to the first element.
Definition at line 43 of file eventlist.hh.
References std::vector::end().
| bool Ase::EventList< Event, Compare >::equals | ( | const EventVector & | ev | ) | const |
Definition at line 45 of file eventlist.hh.
| const Event * Ase::EventList< Event, Compare >::first | ( | ) | const |
Return pointer to element that is >= event or nullptr.
Definition at line 152 of file eventlist.hh.
References std::vector::empty().
| bool Ase::EventList< Event, Compare >::insert | ( | const Event & | event, |
| Event * | replaced = nullptr |
||
| ) |
Definition at line 79 of file eventlist.hh.
| const Event * Ase::EventList< Event, Compare >::last | ( | ) | const |
Return first element or nullptr.
Definition at line 158 of file eventlist.hh.
References std::vector::empty().
| const Event * Ase::EventList< Event, Compare >::lookup | ( | const Event & | event | ) | const |
Return true if event was removed, notifies.
Definition at line 170 of file eventlist.hh.
References Ase::Aux::binary_lookup().
| const Event * Ase::EventList< Event, Compare >::lookup_after | ( | const Event & | event | ) | const |
Return pointer to matching event or nullptr.
Definition at line 177 of file eventlist.hh.
References Ase::Aux::binary_lookup_insertion_pos().
| OrderedEventList::ConstP Ase::EventList< Event, Compare >::ordered_events | ( | ) |
Clear list without notification.
Definition at line 185 of file eventlist.hh.
References ASE_ASSERT_RETURN.
| bool Ase::EventList< Event, Compare >::remove | ( | const Event & | event, |
| Event * | removed = nullptr |
||
| ) |
Only replace event, notifies.
Definition at line 124 of file eventlist.hh.
References std::vector::back(), Ase::Aux::binary_lookup(), and std::vector::erase().
| bool Ase::EventList< Event, Compare >::replace | ( | const Event & | event, |
| Event * | replaced = nullptr |
||
| ) |
Insert or replace event, notifies.
Definition at line 107 of file eventlist.hh.
References Ase::Aux::binary_lookup_insertion_pos().
| size_t Ase::EventList< Event, Compare >::size | ( | ) | const |
Return last element or nullptr.
Definition at line 164 of file eventlist.hh.