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

Method addModelObject

src/model/ModelObjectList.cpp:98–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 }
97
98 bool ModelObjectList_Impl::addModelObject(const ModelObject& modelObject) {
99
100 // DLM: should this class prevent duplicates in the list?
101
102 auto eg = getObject<ModelObject>().pushExtensibleGroup().cast<WorkspaceExtensibleGroup>();
103
104 bool ok = eg.setPointer(OS_ModelObjectListExtensibleFields::ModelObject, modelObject.handle());
105
106 if (!ok) {
107 getObject<ModelObject>().eraseExtensibleGroup(eg.groupIndex());
108 }
109 return ok;
110 }
111
112 bool ModelObjectList_Impl::hasModelObject(const ModelObject& modelObject) const {
113 std::vector<IdfExtensibleGroup> groups = extensibleGroups();

Callers 15

addSpeedMethod · 0.80
addGeneratorMethod · 0.80
addSpeedMethod · 0.80
addTemplateMethod · 0.80
addModuleMethod · 0.80
addTemplateMethod · 0.80
addSpeedMethod · 0.80

Calls 5

pushExtensibleGroupMethod · 0.80
eraseExtensibleGroupMethod · 0.80
groupIndexMethod · 0.80
setPointerMethod · 0.45
handleMethod · 0.45

Tested by 1

TEST_FFunction · 0.64