OMNeT++ Parallel Simulation Support  6.0.3
cproxygate.h
1 //=========================================================================
2 // CPROXYGATE.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_CPROXYGATE_H
18 #define __OMNETPP_CPROXYGATE_H
19 
20 #include "omnetpp/cgate.h"
21 
22 namespace omnetpp {
23 
24 class cParsimPartition;
25 
47 class SIM_API cProxyGate : public cGate // noncopyable
48 {
49  friend class cPlaceholderModule;
50  private:
51  cParsimPartition *partition = nullptr;
52  short remoteProcId = -1;
53  int remoteModuleId = -1;
54  int remoteGateId = -1;
55  void *data = nullptr;
56 
57  protected:
58  // internal: constructor is protected because only cPlaceholderModule
59  // is allowed to create instances
60  explicit cProxyGate();
61 
62  public:
68  virtual std::string str() const override;
70 
80  virtual bool deliver(cMessage *msg, const SendOptions& options, simtime_t at) override;
82 
85 
89  void setRemoteGate(short procId, int moduleId, int gateId);
90 
94  short getRemoteProcId() {return remoteProcId;}
95 
99  int getRemoteModuleId() {return remoteModuleId;}
100 
104  int getRemoteGateId() {return remoteGateId;}
106 
112  void setPartition(cParsimPartition *seg) {partition=seg;}
116  cParsimPartition *getPartition() {return partition;}
118 
126  void setSynchData(void *data) {this->data = data;}
130  void *getSynchData() {return data;}
132 };
133 
134 } // namespace omnetpp
135 
136 
137 #endif
138 
omnetpp::cPlaceholderModule
In distributed parallel simulation, modules of the network are distributed across partitions.
Definition: cplaceholdermod.h:33
omnetpp::cProxyGate::setPartition
void setPartition(cParsimPartition *seg)
Definition: cproxygate.h:112
omnetpp::SendOptions
omnetpp::cGate
omnetpp::cParsimPartition
Represents one partition in a parallel simulation. Knows about partitions and the links between this ...
Definition: cparsimpartition.h:58
omnetpp::cProxyGate::getRemoteProcId
short getRemoteProcId()
Definition: cproxygate.h:94
simtime_t
SimTime simtime_t
omnetpp::cProxyGate::getRemoteGateId
int getRemoteGateId()
Definition: cproxygate.h:104
omnetpp::cProxyGate::getRemoteModuleId
int getRemoteModuleId()
Definition: cproxygate.h:99
omnetpp::cProxyGate::setSynchData
void setSynchData(void *data)
Definition: cproxygate.h:126
omnetpp::cMessage
omnetpp::cProxyGate
A gate that belongs to a cross-partition link and represents the remote gate on the local partition....
Definition: cproxygate.h:47
omnetpp::cProxyGate::getSynchData
void * getSynchData()
Definition: cproxygate.h:130
omnetpp::cProxyGate::getPartition
cParsimPartition * getPartition()
Definition: cproxygate.h:116