OMNeT++ Parallel Simulation Support 6.1
Discrete Event Simulation Library
cparsimsynchr.h
1 //=========================================================================
2 // CPARSIMSYNCHR.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_CPARSIMSYNCHR_H
18 #define __OMNETPP_CPARSIMSYNCHR_H
19 
20 #include "omnetpp/cscheduler.h"
21 #include "omnetpp/simtime_t.h"
22 
23 namespace omnetpp {
24 
25 class cSimulation;
26 class cMessage;
27 class cParsimPartition;
28 class cParsimCommunications;
29 
50 class SIM_API cParsimSynchronizer : public cScheduler
51 {
52  protected:
53  cParsimPartition *partition;
54  cParsimCommunications *comm;
55 
56  public:
60  cParsimSynchronizer() : cScheduler() {partition = nullptr; comm = nullptr;}
61 
65  virtual ~cParsimSynchronizer() {}
66 
70  virtual std::string str() const override;
71 
75  virtual void setContext(cSimulation *sim, cParsimPartition *seg, cParsimCommunications *co)
76  {setSimulation(sim); partition = seg; comm = co;}
77 
81  virtual void startRun() override = 0;
82 
86  virtual void endRun() override = 0;
87 
91  virtual cEvent *guessNextEvent() override;
92 
96  virtual cEvent *takeNextEvent() override = 0;
97 
104  virtual void processOutgoingMessage(cMessage *msg, const SendOptions& options, int procId, int moduleId, int gateId, void *data) = 0;
105 };
106 
107 } // namespace omnetpp
108 
109 
110 #endif
111 
omnetpp::cParsimSynchronizer::cParsimSynchronizer
cParsimSynchronizer()
Definition: cparsimsynchr.h:60
omnetpp::cParsimSynchronizer::~cParsimSynchronizer
virtual ~cParsimSynchronizer()
Definition: cparsimsynchr.h:65
omnetpp::cParsimPartition
Represents one partition in a parallel simulation. Knows about partitions and the links between this ...
Definition: cparsimpartition.h:58
omnetpp::cParsimSynchronizer
Abstract base class for parallel simulation algorithms. Subclasses implement the "null message algori...
Definition: cparsimsynchr.h:50
omnetpp::cParsimSynchronizer::setContext
virtual void setContext(cSimulation *sim, cParsimPartition *seg, cParsimCommunications *co)
Definition: cparsimsynchr.h:75