13#ifndef ML_EVENT_SOURCE_H 
   14#define ML_EVENT_SOURCE_H 
   64  struct ListenerEntry {
 
   67    void sendEvent(BaseEvent* 
event)
 const { (*cb)(userData, 
event); }
 
   68    bool isValid()
 const { 
return (cb != 
nullptr); }
 
   69    bool operator==(
const ListenerEntry& b)
 const { 
return cb == b.cb && userData == b.userData; }
 
   76  std::vector<ListenerEntry> _eventListeners;
 
   77  bool _inEventListenerIteration;
 
   78  bool _eventListenersRemovedInIteration;
 
 
  122template<
typename ToTypePtr>
 
  125    if (
from->getTypeId()->isDerivedFrom((
static_cast<ToTypePtr>(0))->getClassTypeId())) {
 
 
  136template<
typename ToTypePtr>
 
  139    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 *)