cListener Class Reference

A do-nothing implementation of cIListener, suitable as a base class for other listeners. More...

#include <clistener.h>

Inheritance diagram for cListener:
cIListener

List of all members.

Public Member Functions

virtual void receiveSignal (cComponent *source, simsignal_t signalID, bool b)
virtual void receiveSignal (cComponent *source, simsignal_t signalID, long l)
virtual void receiveSignal (cComponent *source, simsignal_t signalID, unsigned long l)
virtual void receiveSignal (cComponent *source, simsignal_t signalID, double d)
virtual void receiveSignal (cComponent *source, simsignal_t signalID, const SimTime &t)
virtual void receiveSignal (cComponent *source, simsignal_t signalID, const char *s)
virtual void receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj)

Protected Member Functions

virtual void unsupportedType (simsignal_t signalID, const char *dataType)

Detailed Description

A do-nothing implementation of cIListener, suitable as a base class for other listeners.

The user needs to redefine one or more of the overloaded receiveSignal() methods; the rest will throw a "Data type not supported" error.


Member Function Documentation

virtual void cListener::receiveSignal ( cComponent source,
simsignal_t  signalID,
cObject obj 
) [virtual]

Receive an emitted cObject value.

See receiveSignal(cComponent*,simsignal_t,bool) for more info.

Implements cIListener.

virtual void cListener::receiveSignal ( cComponent source,
simsignal_t  signalID,
const char *  s 
) [virtual]

Receive an emitted string value.

See receiveSignal(cComponent*,simsignal_t,bool) for more info.

Implements cIListener.

virtual void cListener::receiveSignal ( cComponent source,
simsignal_t  signalID,
const SimTime t 
) [virtual]

Receive an emitted simtime_t value.

See receiveSignal(cComponent*,simsignal_t,bool) for more info.

Implements cIListener.

virtual void cListener::receiveSignal ( cComponent source,
simsignal_t  signalID,
double  d 
) [virtual]

Receive an emitted double value.

See receiveSignal(cComponent*,simsignal_t,bool) for more info.

Implements cIListener.

virtual void cListener::receiveSignal ( cComponent source,
simsignal_t  signalID,
unsigned long  l 
) [virtual]

Receive an emitted unsigned long value.

See receiveSignal(cComponent*,simsignal_t,bool) for more info.

Implements cIListener.

virtual void cListener::receiveSignal ( cComponent source,
simsignal_t  signalID,
long  l 
) [virtual]

Receive an emitted long value.

See receiveSignal(cComponent*,simsignal_t,bool) for more info.

Implements cIListener.

virtual void cListener::receiveSignal ( cComponent source,
simsignal_t  signalID,
bool  b 
) [virtual]

Receive an emitted signal.

Note that cIListener declares several overloaded receiveSignal() methods, one for each data type (except that all integer types are merged to the long and unsigned long types). The "source" argument is the channel or module on which the emit() method was invoked, and NOT the one at which this listener is subscribed.

It is not allowed inside a receiveSignal() call to unsubscribe from the signal being received -- it will cause an error to be thrown. (This is to prevent interesting cases when the listener list is being modified while the component iterates on it. The alternative would be to make a temporary copy of the listener list each time, but this is not desirable for performance reasons.)

Implements cIListener.

virtual void cListener::unsupportedType ( simsignal_t  signalID,
const char *  dataType 
) [protected, virtual]

Utility function, throws a "data type not supported" error.


The documentation for this class was generated from the following file:
Generated on Tue Dec 2 11:16:28 2014 for OMNeT++ Simulation Library by  doxygen 1.6.3