245 std::string srcGateName;
247 parseIndexedName(srcGateStr, srcGateName, srcGateIndex);
248 bool isSrcGateInOut = (srcMod->gateType(srcGateName.c_str()) == cGate::INOUT);
253 std::string destGateName;
255 parseIndexedName(destGateStr, destGateName, destGateIndex);
256 bool isDestGateInOut = (destMod->gateType(destGateName.c_str()) == cGate::INOUT);
258 if (srcMod->getParentModule() != destMod->getParentModule())
259 throw cRuntimeError(
"The parent modules of src-module and dest-module are differ at %s",
260 node->getSourceLocation());
263 const char *channelTypeName = node->getAttribute(
"channel-type");
264 cChannelType *channelType = channelTypeName ? cChannelType::get(channelTypeName) : nullptr;
265 cXMLElementList paramList;
268 paramList = node->getChildrenByTagName(
"param");
270 srcGate = isSrcGateInOut ?
271 srcMod->gateHalf(srcGateName.c_str(), cGate::OUTPUT, srcGateIndex) :
272 srcMod->gate(srcGateName.c_str(), srcGateIndex);
273 destGate = isDestGateInOut ?
274 destMod->gateHalf(destGateName.c_str(), cGate::INPUT, destGateIndex) :
275 destMod->gate(destGateName.c_str(), destGateIndex);
279 if (isSrcGateInOut && isDestGateInOut) {
280 destGate = srcMod->gateHalf(srcGateName.c_str(), cGate::INPUT, srcGateIndex);
281 srcGate = destMod->gateHalf(destGateName.c_str(), cGate::OUTPUT, destGateIndex);
const char * getRequiredAttribute(cXMLElement *node, const char *attr)
Definition: ScenarioManager.cc:98
virtual cModule * getRequiredModule(cXMLElement *node, const char *attr)
Definition: ScenarioManager.cc:107
void createConnection(cXMLElementList ¶mList, cChannelType *channelType, cGate *srcGate, cGate *destGate)
Definition: ScenarioManager.cc:220