cproxygate.h Source File

Parallel Simulation API: cproxygate.h Source File
Parallel Simulation API
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
22namespace omnetpp {
23
25
47class 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:
65
68 virtual std::string str() const override;
70
73
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
109
112 void setPartition(cParsimPartition *seg) {partition=seg;}
116 cParsimPartition *getPartition() {return partition;}
118
121
126 void setSynchData(void *data) {this->data = data;}
130 void *getSynchData() {return data;}
132};
133
134} // namespace omnetpp
135
136
137#endif
138
Represents one partition in a parallel simulation. Knows about partitions and the links between this ...
Definition cparsimpartition.h:59
void setPartition(cParsimPartition *seg)
Definition cproxygate.h:112
void setSynchData(void *data)
Definition cproxygate.h:126
cParsimPartition * getPartition()
Definition cproxygate.h:116
int getRemoteModuleId()
Definition cproxygate.h:99
short getRemoteProcId()
Definition cproxygate.h:94
void setRemoteGate(short procId, int moduleId, int gateId)
void * getSynchData()
Definition cproxygate.h:130
virtual std::string str() const override
int getRemoteGateId()
Definition cproxygate.h:104
virtual bool deliver(cMessage *msg, const SendOptions &options, simtime_t at) override