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

Method ModelObject

src/model/ModelObject.cpp:877–890  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

875 }
876
877 ModelObject::ModelObject(IddObjectType type, const Model& model, bool fastName)
878 : WorkspaceObject(model.getImpl<detail::Model_Impl>()->createObject(IdfObject(type, fastName), false)) {
879 // create object of correct type
880 OS_ASSERT(getImpl<detail::ModelObject_Impl>());
881 OS_ASSERT(!getImpl<detail::ModelObject_Impl>()->initialized());
882 // add to Workspace
883 openstudio::detail::WorkspaceObject_ImplPtrVector impls;
884 impls.push_back(getImpl<openstudio::detail::WorkspaceObject_Impl>());
885 model.getImpl<detail::Model_Impl>()->addObjects(impls, false);
886 // object should be initialized and ready to go
887 if (!getImpl<detail::ModelObject_Impl>()->initialized()) {
888 LOG_AND_THROW("ModelObject not initialized: " << '\n' << getImpl<openstudio::detail::WorkspaceObject_Impl>()->idfObject());
889 }
890 }
891
892 ModelObject::ModelObject(std::shared_ptr<detail::ModelObject_Impl> p) : WorkspaceObject(std::move(p)) {}
893

Callers

nothing calls this directly

Calls 6

initializedMethod · 0.80
idfObjectMethod · 0.80
IdfObjectClass · 0.50
createObjectMethod · 0.45
push_backMethod · 0.45
addObjectsMethod · 0.45

Tested by

no test coverage detected