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

Method uniquelyIdentifiableByName

src/utilities/idf/WorkspaceObject.cpp:1228–1246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1226 }
1227
1228 bool WorkspaceObject_Impl::uniquelyIdentifiableByName() const {
1229 OptionalString oName = name();
1230 if (!oName) {
1231 return true;
1232 }
1233 WorkspaceObjectVector candidates = m_workspace->getObjectsByReference(iddObject().references());
1234 for (const WorkspaceObject& candidate : candidates) {
1235 if ((candidate.iddObject().type() == openstudio::IddObjectType::OS_Connection)
1236 || (candidate.iddObject().type() == openstudio::IddObjectType::OS_PortList)) {
1237 continue;
1238 }
1239 OptionalString candidateName = candidate.name();
1240 OS_ASSERT(candidateName);
1241 if ((istringEqual(*oName, *candidateName) && (!initialized() || (getObject<WorkspaceObject>() != candidate)))) {
1242 return false;
1243 }
1244 }
1245 return true;
1246 }
1247
1248 bool WorkspaceObject_Impl::fieldDataIsCorrectType(unsigned index) const {
1249 OptionalIddField oIddField = iddObject().getField(index);

Callers

nothing calls this directly

Calls 7

nameClass · 0.85
istringEqualFunction · 0.85
getObjectsByReferenceMethod · 0.80
referencesMethod · 0.80
iddObjectMethod · 0.80
typeMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected