Go to the previous, next section.

CNEventExploder -- Send Events to multiple EventHandlers

SYNOPSIS

#include <CNCL/EventExploder.h>

TYPE

CN_EVENTEXPLODER

BASE CLASSES

CNEventHandler

DERIVED CLASSES

None

RELATED CLASSES

CNEvent, CNEventHandler, CNEventScheduler, CNSimTime

DESCRIPTION

CNEventExploder is a subclass derived from CNEventHandler.
It maintains a list of other arbitrary CNEventHandlers and forwards all received events to all the CNEventHandlers in its list. This can be used to implement "broadcast"-events.

Constructors:

CNEventExploder();
CNEventExploder(CNParam *param);
Initializes the event exploder.

In addition to the member functions required by CNCL, CNEventExploder provides the following member functions:

virtual void event_handler(const CNEvent *ev);
This function receives an event and re-sends it to other CNEventHandlers.

virtual void add_handler(CNEventHandler *eh);
This function adds a new CNEventHandler to the list. It will then receive all events that are send to the CNEventExploder.

If a CNEventHandler is added more than once, it will also receive all events as many times.

virtual void rem_handler(CNEventHandler *eh);
This function removes a previously added CNEventHandler from the list. It will no longer receive events managed by the CNEventExploder.

If a CNEventHandler has been added more than once, it also has to be removed as many times to be completely removed from the CNEventExploder.

Go to the previous, next section.