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. More...
 

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

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: