00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CIDEALSIMULATIONPROT_H__
00021 #define __CIDEALSIMULATIONPROT_H__
00022
00023 #include "cparsimprotocolbase.h"
00024
00025
00026 class cCommBuffer;
00027
00039 class cIdealSimulationProtocol : public cParsimProtocolBase
00040 {
00041 protected:
00042
00043 struct ExternalEvent {
00044 simtime_t t;
00045 int srcProcId;
00046 };
00047
00048 bool debug;
00049 FILE *fin;
00050 ExternalEvent nextExternalEvent;
00051
00052
00053 ExternalEvent *table;
00054 int tableSize;
00055 int numItems;
00056 int nextPos;
00057
00058 protected:
00059
00060 virtual void processReceivedMessage(cMessage *msg, int destModuleId, int destGateId, int sourceProcId);
00061
00062
00063 virtual void readNextRecordedEvent();
00064
00065
00066 bool isExternalMessage(cMessage *msg);
00067
00068 public:
00072 cIdealSimulationProtocol();
00073
00077 virtual ~cIdealSimulationProtocol();
00078
00082 virtual void startRun();
00083
00087 virtual void endRun();
00088
00092 virtual cMessage *getNextEvent();
00093 };
00094
00095 #endif
00096