NetAnimTrace.h

Go to the documentation of this file.
00001 //
00002 // Copyright (C) 2010 Andras Varga
00003 //
00004 // This program is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public License
00006 // as published by the Free Software Foundation; either version 2
00007 // of the License, or (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public License
00015 // along with this program; if not, see <http://www.gnu.org/licenses/>.
00016 //
00017 
00018 #ifndef __INET_NETANIMTRACEWRITER_H
00019 #define __INET_NETANIMTRACEWRITER_H
00020 
00021 #include <fstream>
00022 #include <INETDefs.h>
00023 
00024 #if OMNETPP_VERSION < 0x0401
00025 
00026 class INET_API NetAnimTrace : public cSimpleModule
00027 {
00028   protected:
00029     virtual void initialize() {error("This module requires at least OMNeT++ 4.1");}
00030 };
00031 
00032 #else
00033 
00039 class INET_API NetAnimTrace : public cSimpleModule, protected cListener
00040 {
00041   protected:
00042     static simsignal_t messageSentSignal;
00043     std::ofstream f;
00044   protected:
00045     virtual void initialize();
00046     virtual void handleMessage(cMessage *msg);
00047     virtual void finish();
00048     virtual void dump();
00049     virtual void receiveSignal(cComponent *source, simsignal_t signalID, cObject *obj);
00050     virtual bool isRelevantModule(cModule *mod);
00051     virtual void resolveNodeCoordinates(cModule *mod, double& x, double& y);
00052     virtual void addNode(cModule *mod);
00053     virtual void addLink(cGate *gate);
00054 };
00055 
00056 #endif // OMNETPP_VERSION
00057 
00058 #endif  // header guard
00059 
00060