Source-highlight Library
srchilite::EventGenerator< EventListener, EventType > Class Template Reference

A generic event generator, for listeners of type EventListener and events of type EventType. More...

#include <eventgenerator.h>

Collaboration diagram for srchilite::EventGenerator< EventListener, EventType >:

Public Member Functions

void addListener (EventListener *listener)
void removeListener (EventListener *listener)
bool hasListeners () const
void notify (const EventType &event)
 Notifies all listeners of a specific event.

Private Attributes

std::list< EventListener * > listeners
 the list of listeners

Detailed Description

template<class EventListener, class EventType>
class srchilite::EventGenerator< EventListener, EventType >

A generic event generator, for listeners of type EventListener and events of type EventType.

EventListener must implement the method notify(const EventType &)

Member Function Documentation

◆ notify()

template<class EventListener, class EventType>
void srchilite::EventGenerator< EventListener, EventType >::notify ( const EventType & event)
inline

Notifies all listeners of a specific event.

Parameters
eventthe event

The documentation for this class was generated from the following file:
  • /cygdrive/d/a/scallywag/source-highlight/source-highlight-3.1.9-1.x86_64/src/source-highlight-3.1.9/lib/srchilite/eventgenerator.h