13#ifndef ML_EVENT_SOURCE_H
14#define ML_EVENT_SOURCE_H
74 void sendEvent(BaseEvent*
event)
const
76 (*cb)(userData,
event);
80 return (cb !=
nullptr);
84 return cb == b.cb && userData == b.userData;
92 std::vector<ListenerEntry> _eventListeners;
93 bool _inEventListenerIteration;
94 bool _eventListenersRemovedInIteration;
148 if (
from->getTypeId()->isDerivedFrom((
static_cast<ToTypePtr>(0))->getClassTypeId())) {
164 if (
from->getTypeId()->isDerivedFrom((
static_cast<ToTypePtr>(0))->getClassTypeId())) {
BaseEvent is the base class for all events emitted from EventSourceBase.
EventSource * source() const
Returns the Base object emitting this event.
Class representing general ML objects that support import/export via strings (setPersistentState() an...
EventSourceRemovedEvent is used to indicate when the EventSourceBase object is removed.
EventSourceDeletedEvent()
EventSourceBase class adds event listener handling to Base.
EventSource(const EventSource &evSource)
void addEventListener(BaseEventCallback *cb, void *userData)
Adds event listener callback to this Base object.
void sendEvent(BaseEvent *event, void *skipListener=nullptr)
Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass....
bool hasEventListeners() const
Checks whether any event listeners have been added to this Base object; this can be used to skip the ...
void removeEventListener(BaseEventCallback *cb, void *userData)
Removes event listener callback from this Base object.
#define ML_ABSTRACT_CLASS_HEADER(className)
Similar to ML_ABSTRACT_CLASS_HEADER_EXPORTED with a non-existing export symbol.
ToTypePtr mlbaseevent_cast(ml::BaseEvent *from)
Cast operation for safely casting BaseEvents to derived types.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non-existing export symbol.
#define ML_ABSTRACT_ROOT_CLASS_HEADER(className)
bool operator==(const Tmat2< DT > &a, const Tmat2< DT > &b)
a == b ? Returns true if yes.
void BaseEventCallback(void *, BaseEvent *)