OMNeT++ Parallel Simulation Support 6.1
Discrete Event Simulation Library
cispeventlogger.h
1 //=========================================================================
2 // CISPEVENTLOGGER.H - part of
3 //
4 // OMNeT++/OMNEST
5 // Discrete System Simulation in C++
6 //
7 //=========================================================================
8 
9 /*--------------------------------------------------------------*
10  Copyright (C) 1992-2017 Andras Varga
11  Copyright (C) 2006-2017 OpenSim Ltd.
12 
13  This file is distributed WITHOUT ANY WARRANTY. See the file
14  `license' for details on this and other legal matters.
15 *--------------------------------------------------------------*/
16 
17 #ifndef __OMNETPP_CISPEVENTLOGGER_H
18 #define __OMNETPP_CISPEVENTLOGGER_H
19 
20 #include "cnullmessageprot.h"
21 
22 namespace omnetpp {
23 
24 
35 class SIM_API cISPEventLogger : public cNullMessageProtocol
36 {
37  protected:
38  FILE *fout = nullptr; // the event log file (stores ExternalEvent's)
39 
40  protected:
41  // Overridden to set message priority to sourceProcId. We do the same in
42  // cIdealSimulationProtocol. This ensures that messages with equal
43  // timestamps will get processed in the same order in both protocols,
44  // whatever the concrete timing conditions.
45  void processReceivedMessage(cMessage *msg, const SendOptions& options, int destModuleId, int destGateId, int sourceProcId) override;
46 
47  public:
52 
56  virtual ~cISPEventLogger() {}
57 
62  virtual void startRun() override;
63 
68  virtual void endRun() override;
69 
74  void processOutgoingMessage(cMessage *msg, const SendOptions& options, int procId, int moduleId, int gateId, void *data) override;
75 
80  virtual cEvent *takeNextEvent() override;
81 
85  virtual void putBackEvent(cEvent *event) override;
86 };
87 
88 } // namespace omnetpp
89 
90 
91 #endif
92 
omnetpp::cISPEventLogger
Implements phase one for the Ideal Simulation Protocol (ISP), namely, creating the log of "external" ...
Definition: cispeventlogger.h:35
omnetpp::cISPEventLogger::~cISPEventLogger
virtual ~cISPEventLogger()
Definition: cispeventlogger.h:56
omnetpp::cNullMessageProtocol
Implements the "null message algorithm". Lookahead calculation is encapsulated into a separate object...
Definition: cnullmessageprot.h:36
omnetpp::cISPEventLogger::cISPEventLogger
cISPEventLogger()
Definition: cispeventlogger.h:51