28 return registry_.
append(std::move(event));
40 return registry_.
select(
id);
51 return afterEffects_.
select(
id);
63 return afterEffects_.
append(std::move(event));
71 return itemWithId.
item.value()(itemWithId.
id);
80 return itemWithId.
item.value()(itemWithId.
id);
85 return itemWithId.
item.value()(itemWithId.
id);
91 std::vector<EventIdType> invalidIds;
92 for (
auto const& itemWithId : registry_.
rawRange())
96 if (!
static_cast<bool>(itemWithId.item.value()))
97 invalidIds.push_back(itemWithId.id);
100 for (
auto const&
id : invalidIds)
106 afterEffects_.
erase(
id);
112 afterEffects_.
clear();
Definition event_registry.hpp:12
EventRegistry(EventRegistry &&)=default
EventIdType registerAfterEffect(Event event)
After effects are used to cause something to happen after all other events have been processed.
Definition event_registry.hpp:61
void executeEvent(EventIdType id)
Definition event_registry.hpp:66
void clear()
Definition event_registry.hpp:109
RegistryType::SelectionResult activateEvent(EventIdType id)
Returns a pointer to the selected event (only valid until the next activation or event execution).
Definition event_registry.hpp:38
SelectablesRegistry< Event >::IdType EventIdType
Definition event_registry.hpp:15
SelectablesRegistry< Event > RegistryType
Definition event_registry.hpp:14
EventRegistry & operator=(const EventRegistry &)=delete
EventRegistry & operator=(EventRegistry &&)=default
void cleanInvalidEvents()
Definition event_registry.hpp:89
void removeAfterEffect(EventIdType id)
Definition event_registry.hpp:104
void executeActiveEvents()
Definition event_registry.hpp:75
EventRegistry(const EventRegistry &)=delete
static constexpr EventIdType invalidEventId
Definition event_registry.hpp:16
RegistryType::SelectionResult activateAfterEffect(EventIdType id)
Activate an after effect.
Definition event_registry.hpp:49
EventIdType registerEvent(Event event)
Definition event_registry.hpp:26
IteratorType erase(IdType id)
Erase/Remove an item from the container.
Definition selectables_registry.hpp:312
std::size_t IdType
Id type used to identify items.
Definition selectables_registry.hpp:34
std::size_t deselectAll(std::invocable< ItemWithId const & > auto const &callback)
Deselects all items.
Definition selectables_registry.hpp:390
bool deselect(IdType id, std::invocable< ItemWithId const & > auto const &callback)
Deselects item with id.
Definition selectables_registry.hpp:423
SelectionResult select(IdType id)
Select an item.
Definition selectables_registry.hpp:363
RawRangeWrap< SelectablesRegistry< T > * > rawRange()
Helper for range based for loops.
Definition selectables_registry.hpp:642
IdType append(T const &element)
Append an item to the container.
Definition selectables_registry.hpp:259
void clear()
Definition selectables_registry.hpp:445
Definition file_dialog.hpp:6
Wrapper around items that associates them with an id.
Definition selectables_registry.hpp:40
std::optional< T > item
The item.
Definition selectables_registry.hpp:49
IdType id
Id of the item.
Definition selectables_registry.hpp:42