OMNeT++ Parallel Simulation Support  5.4.1
cparsimpartition.h
1 //=========================================================================
2 // CPARSIMPARTITION.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_CPARSIMPARTITION_H
22 #define __OMNETPP_CPARSIMPARTITION_H
23 
24 #include "omnetpp/simkerneldefs.h"
25 #include "omnetpp/cobject.h"
26 #include "omnetpp/simtime_t.h"
27 #include "omnetpp/clifecyclelistener.h"
28 
29 namespace omnetpp {
30 
31 class cSimulation;
32 class cParsimSynchronizer;
33 class cParsimCommunications;
34 class cCommBuffer;
35 class cException;
36 class cTerminationException;
37 
38 
63 {
64  protected:
65  cSimulation *sim;
67  cParsimSynchronizer *synch;
68  bool debug;
69 
70  protected:
71  // internal: fills in remote gate addresses of all cProxyGate's in the current partition
72  void connectRemoteGates();
73 
78  virtual void lifecycleEvent(SimulationLifecycleEventType eventType, cObject *details) override;
79 
80  public:
85 
89  virtual ~cParsimPartition();
90 
94  void setContext(cSimulation *sim, cParsimCommunications *comm, cParsimSynchronizer *synch);
95 
100  void startRun();
101 
105  void endRun();
106 
110  void shutdown();
111 
117  virtual void processOutgoingMessage(cMessage *msg, int procId, int moduleId, int gateId, void *data);
118 
125  virtual void processReceivedBuffer(cCommBuffer *buffer, int tag, int sourceProcId);
126 
134  virtual void processReceivedMessage(cMessage *msg, int destModuleId, int destGateId, int sourceProcId);
135 
144  virtual void broadcastTerminationException(cTerminationException& e);
145 
154  virtual void broadcastException(std::exception& e);
155 };
156 
157 } // namespace omnetpp
158 
159 
160 #endif
161 
Definition: cadvlinkdelaylookahead.h:26
Abstract base class for parallel simulation algorithms. Subclasses implement the "null message algori...
Definition: cparsimsynchr.h:54
SimulationLifecycleEventType
Represents one partition in a parallel simulation. Knows about partitions and the links between this ...
Definition: cparsimpartition.h:62