cresultlistener.h

00001 //==========================================================================
00002 //  CRESULTLISTENER.H - part of
00003 //                     OMNeT++/OMNEST
00004 //            Discrete System Simulation in C++
00005 //
00006 //  Author: Andras Varga
00007 //
00008 //==========================================================================
00009 
00010 /*--------------------------------------------------------------*
00011   Copyright (C) 1992-2008 Andras Varga
00012   Copyright (C) 2006-2008 OpenSim Ltd.
00013 
00014   This file is distributed WITHOUT ANY WARRANTY. See the file
00015   `license' for details on this and other legal matters.
00016 *--------------------------------------------------------------*/
00017 
00018 #ifndef __CRESULTLISTENER_H
00019 #define __CRESULTLISTENER_H
00020 
00021 #include "simkerneldefs.h"
00022 #include "clistener.h"
00023 
00024 NAMESPACE_BEGIN
00025 
00026 class cResultFilter;
00027 class cComponent;
00028 
00029 
00035 class SIM_API cResultListener : public cIListener
00036 {
00037     public:
00038         virtual const char *getClassName() const {return opp_typename(typeid(*this));}
00039         virtual std::string str() const {return opp_typename(typeid(*this));}
00040         static const char *getPooled(const char *s);
00041 
00042         // simplified API that better supports chaining:
00043         virtual void receiveSignal(cResultFilter *prev, simtime_t_cref t, bool b) = 0;
00044         virtual void receiveSignal(cResultFilter *prev, simtime_t_cref t, long l) = 0;
00045         virtual void receiveSignal(cResultFilter *prev, simtime_t_cref t, unsigned long l) = 0;
00046         virtual void receiveSignal(cResultFilter *prev, simtime_t_cref t, double d) = 0;
00047         virtual void receiveSignal(cResultFilter *prev, simtime_t_cref t, const SimTime& v) = 0;
00048         virtual void receiveSignal(cResultFilter *prev, simtime_t_cref t, const char *s) = 0;
00049         virtual void receiveSignal(cResultFilter *prev, simtime_t_cref t, cObject *obj) = 0;
00050         virtual void subscribedTo(cResultFilter *prev);
00051         virtual void unsubscribedFrom(cResultFilter *prev);
00052         virtual void finish(cResultFilter *prev) {}
00053 
00054         // original listener API delegates to simplified API:
00055         virtual void receiveSignal(cComponent *source, simsignal_t signalID, bool b);
00056         virtual void receiveSignal(cComponent *source, simsignal_t signalID, long l);
00057         virtual void receiveSignal(cComponent *source, simsignal_t signalID, unsigned long l);
00058         virtual void receiveSignal(cComponent *source, simsignal_t signalID, double d);
00059         virtual void receiveSignal(cComponent *source, simsignal_t signalID, const SimTime& v);
00060         virtual void receiveSignal(cComponent *source, simsignal_t signalID, const char *s);
00061         virtual void receiveSignal(cComponent *source, simsignal_t signalID, cObject *obj);
00062         virtual void subscribedTo(cComponent *component, simsignal_t signalID);
00063         virtual void unsubscribedFrom(cComponent *component, simsignal_t signalID);
00064         virtual void finish(cComponent *component, simsignal_t signalID);
00065 };
00066 
00067 NAMESPACE_END
00068 
00069 #endif
00070 
00071 
Generated on Tue Dec 2 11:16:27 2014 for OMNeT++ Simulation Library by  doxygen 1.6.3