OMNeT++ Parallel Simulation Support  5.4.1
cparsimsynchr.h
1 //=========================================================================
2 // CPARSIMSYNCHR.H - part of
3 //
4 // OMNeT++/OMNEST
5 // Discrete System Simulation in C++
6 //
7 // Author: Andras Varga, 2003
8 // Dept. of Electrical and Computer Systems Engineering,
9 // Monash University, Melbourne, Australia
10 //
11 //=========================================================================
12 
13 /*--------------------------------------------------------------*
14  Copyright (C) 2003-2017 Andras Varga
15  Copyright (C) 2006-2017 OpenSim Ltd.
16 
17  This file is distributed WITHOUT ANY WARRANTY. See the file
18  `license' for details on this and other legal matters.
19 *--------------------------------------------------------------*/
20 
21 #ifndef __OMNETPP_CPARSIMSYNCHR_H
22 #define __OMNETPP_CPARSIMSYNCHR_H
23 
24 #include "omnetpp/cscheduler.h"
25 #include "omnetpp/simtime_t.h"
26 
27 namespace omnetpp {
28 
29 class cSimulation;
30 class cMessage;
31 class cParsimPartition;
32 class cParsimCommunications;
33 
54 class SIM_API cParsimSynchronizer : public cScheduler
55 {
56  protected:
57  cParsimPartition *partition;
59 
60  public:
64  cParsimSynchronizer() : cScheduler() {partition = nullptr; comm = nullptr;}
65 
69  virtual ~cParsimSynchronizer() {}
70 
74  virtual std::string str() const override;
75 
80  {setSimulation(sim); partition = seg; comm = co;}
81 
85  virtual void startRun() override = 0;
86 
90  virtual void endRun() override = 0;
91 
95  virtual cEvent *guessNextEvent() override;
96 
100  virtual cEvent *takeNextEvent() override = 0;
101 
108  virtual void processOutgoingMessage(cMessage *msg, int procId, int moduleId, int gateId, void *data) = 0;
109 };
110 
111 } // namespace omnetpp
112 
113 
114 #endif
115 
virtual void setContext(cSimulation *sim, cParsimPartition *seg, cParsimCommunications *co)
Definition: cparsimsynchr.h:79
Definition: cadvlinkdelaylookahead.h:26
Abstract base class for parallel simulation algorithms. Subclasses implement the "null message algori...
Definition: cparsimsynchr.h:54
cParsimSynchronizer()
Definition: cparsimsynchr.h:64
virtual ~cParsimSynchronizer()
Definition: cparsimsynchr.h:69
Represents one partition in a parallel simulation. Knows about partitions and the links between this ...
Definition: cparsimpartition.h:62