15#include <egt/detail/cow.h>
16#include <egt/detail/meta.h>
18#include <egt/flagsbase.h>
42 EGT_NODISCARD const std::
string& name()
const {
return m_name; }
52 void name(
const std::string& name) { m_name =
name; }
128 : callback(std::move(c)),
Base object class with fundamental properties.
Definition object.h:32
void clear_handlers()
Clear all registered event handlers.
virtual ~Object() noexcept=default
std::function< void(Event &event)> EventCallback
Event handler callback function.
Definition object.h:55
std::vector< CallbackMeta > CallbackArray
Helper type for an array of callbacks.
Definition object.h:142
detail::CopyOnWriteAllocate< CallbackArray > m_callbacks
Array of callbacks.
Definition object.h:145
uint64_t RegisterHandle
Handle type.
Definition object.h:61
void invoke_handlers(Event &event)
Invoke all handlers with the specified event.
void invoke_handlers(EventId event)
Invoke all handlers with the specified EventId.
Object() noexcept=default
RegisterHandle on_event(const EventCallback &handler, const FilterFlags &mask={})
Add an event handler to be called when the widget generates an event.
void name(const std::string &name)
Set the name of the Object.
Definition object.h:52
void remove_handler(RegisterHandle handle)
Remove an event handler.
std::string m_name
A user defined name for the Object.
Definition object.h:148
Copy-On-Write wrapper for an object or container.
Definition cow.h:33
EventId
Event identifiers.
Definition event.h:36
EGT framework namespace.
Definition animation.h:24
A single event that has information about the event and state for the event.
Definition event.h:255