MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / newPortAfterIndex

Method newPortAfterIndex

src/model/PortList.cpp:139–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137 }
138
139 unsigned PortList_Impl::newPortAfterIndex(unsigned portIndex) {
140 //std::vector<ModelObject> modelObjects = this->modelObjects();
141 for (int i = portIndex; i < int(nextPortIndex()) - 1; i++) {
142 ModelObject mo = modelObject(i).get();
143 unsigned port = connectedObjectPort(this->port(i)).get();
144 model().connect(getObject<ModelObject>(), this->port(i + 2), mo, port);
145 }
146
147 Model _model = model();
148 Node node(_model);
149
150 _model.connect(getObject<ModelObject>(), this->port(portIndex + 1), node, node.inletPort());
151
152 return this->port(portIndex++);
153 }
154
155 unsigned PortList_Impl::portIndexForModelObject(ModelObject& modelObject, bool* ok) const {
156 for (unsigned i = 0; i < nextPortIndex(); i++) {

Callers

nothing calls this directly

Calls 4

portMethod · 0.95
getMethod · 0.45
connectMethod · 0.45
inletPortMethod · 0.45

Tested by

no test coverage detected