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

Method setReversePointer

src/utilities/idf/WorkspaceObject.cpp:1030–1039  ·  view source on GitHub ↗

Pre-condition: ReversePointer(sourceHandle,index) is not in m_targetData. Post-condition: m_targetData indicates that object sourceHandle points to this object from field index.

Source from the content-addressed store, hash-verified

1028 // Post-condition: m_targetData indicates that object sourceHandle points to this object from
1029 // field index.
1030 void WorkspaceObject_Impl::setReversePointer(const Handle& sourceHandle, unsigned index) {
1031 OS_ASSERT(!m_handle.isNull());
1032 if (!m_targetData) {
1033 m_targetData = TargetData();
1034 }
1035 // automatically maintains uniqueness
1036 std::pair<TargetData::pointer_set::iterator, bool> insertResult;
1037 insertResult = m_targetData->reversePointers.insert(ReversePointer(sourceHandle, index));
1038 OS_ASSERT(insertResult.second);
1039 }
1040
1041 void WorkspaceObject_Impl::restorePointers() {
1042 OS_ASSERT(!m_handle.isNull());

Callers 3

initializeOnCloneMethod · 0.80
restorePointersMethod · 0.80
setPointerImplMethod · 0.80

Calls 3

ReversePointerFunction · 0.85
isNullMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected