00001 //========================================================================= 00002 // CISPEVENTLOGGER.H - part of 00003 // 00004 // OMNeT++/OMNEST 00005 // Discrete System Simulation in C++ 00006 // 00007 // Written by: Andras Varga, 2003 00008 // 00009 //========================================================================= 00010 00011 /*--------------------------------------------------------------* 00012 Copyright (C) 2003-2005 Andras Varga 00013 Monash University, Dept. of Electrical and Computer Systems Eng. 00014 Melbourne, Australia 00015 00016 This file is distributed WITHOUT ANY WARRANTY. See the file 00017 `license' for details on this and other legal matters. 00018 *--------------------------------------------------------------*/ 00019 00020 #ifndef __CISPEVENTLOGGER_H__ 00021 #define __CISPEVENTLOGGER_H__ 00022 00023 #include "cnullmessageprot.h" 00024 00025 00036 class cISPEventLogger : public cNullMessageProtocol 00037 { 00038 protected: 00039 // stores one external event, as needed for the ISP algorithm 00040 struct ExternalEvent { 00041 simtime_t t; // time of event 00042 int srcProcId; // origin of event 00043 }; 00044 FILE *fout; // the event log file 00045 00046 protected: 00047 // helper 00048 bool isExternalMessage(cMessage *msg); 00049 00050 public: 00054 cISPEventLogger(); 00055 00059 virtual ~cISPEventLogger(); 00060 00065 virtual void startRun(); 00066 00071 virtual void endRun(); 00072 00077 virtual cMessage *getNextEvent(); 00078 }; 00079 00080 #endif 00081