cparsimsynchr.h Source File

Parallel Simulation API: cparsimsynchr.h Source File
Parallel Simulation API
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
23namespace omnetpp {
24
25class cSimulation;
26class cMessage;
28class cParsimCommunications;
29
50class 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
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
Represents one partition in a parallel simulation. Knows about partitions and the links between this ...
Definition cparsimpartition.h:59
cParsimSynchronizer()
Definition cparsimsynchr.h:60
virtual cEvent * takeNextEvent() override=0
virtual void endRun() override=0
virtual cEvent * guessNextEvent() override
virtual void setContext(cSimulation *sim, cParsimPartition *seg, cParsimCommunications *co)
Definition cparsimsynchr.h:75
virtual std::string str() const override
virtual void processOutgoingMessage(cMessage *msg, const SendOptions &options, int procId, int moduleId, int gateId, void *data)=0
virtual void startRun() override=0
virtual ~cParsimSynchronizer()
Definition cparsimsynchr.h:65