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

Method createObject

src/model/Model.cpp:155–166  ·  view source on GitHub ↗

Overriding this from WorkspaceObject_Impl is how all objects in the model end up as model objects

Source from the content-addressed store, hash-verified

153 // Overriding this from WorkspaceObject_Impl is how all objects in the model end up
154 // as model objects
155 std::shared_ptr<openstudio::detail::WorkspaceObject_Impl> Model_Impl::createObject(const IdfObject& object, bool keepHandle) {
156 auto result = modelObjectCreator.getNew(this, object, keepHandle);
157
158 if (!result) {
159 if (object.iddObject().type().value() != IddObjectType::CommentOnly) {
160 LOG(Warn, "Creating GenericModelObject for IddObjectType '" << object.iddObject().type().valueName() << "'.");
161 }
162 result = std::shared_ptr<GenericModelObject_Impl>(new GenericModelObject_Impl(object, this, keepHandle));
163 }
164
165 return result;
166 }
167
168 std::shared_ptr<openstudio::detail::WorkspaceObject_Impl>
169 Model_Impl::createObject(const std::shared_ptr<openstudio::detail::WorkspaceObject_Impl>& originalObjectImplPtr, bool keepHandle) {

Callers 3

ModelObjectMethod · 0.45
ComponentMethod · 0.45
ModelMethod · 0.45

Calls 6

getNewMethod · 0.80
iddObjectMethod · 0.80
valueNameMethod · 0.80
getCopyMethod · 0.80
valueMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected