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

Method createAndAddClonedObjects

src/utilities/idf/Workspace.cpp:2326–2339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2324 }
2325
2326 void Workspace_Impl::createAndAddClonedObjects(const std::shared_ptr<detail::Workspace_Impl>& /*thisImpl*/,
2327 std::shared_ptr<detail::Workspace_Impl> cloneImpl, bool keepHandles) const {
2328 detail::WorkspaceObject_ImplPtrVector newObjectImplPtrs;
2329 HandleMap oldNewHandleMap;
2330 for (const WorkspaceObject& object : allObjects()) {
2331 newObjectImplPtrs.push_back(cloneImpl->createObject(object.getImpl<detail::WorkspaceObject_Impl>(), keepHandles));
2332 Handle h = newObjectImplPtrs.back()->handle();
2333 if (!keepHandles) {
2334 oldNewHandleMap.insert(HandleMap::value_type(object.handle(), h));
2335 }
2336 }
2337 // add Object_ImplPtrs to clone's Workspace_Impl
2338 cloneImpl->addClones(newObjectImplPtrs, oldNewHandleMap, true);
2339 }
2340
2341 void Workspace_Impl::createAndAddSubsetClonedObjects(const std::shared_ptr<detail::Workspace_Impl>& thisImpl,
2342 std::shared_ptr<detail::Workspace_Impl> cloneImpl, const std::vector<Handle>& handles,

Callers

nothing calls this directly

Calls 5

addClonesMethod · 0.80
push_backMethod · 0.45
createObjectMethod · 0.45
handleMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected