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

Method emitChangeSignals

src/utilities/idf/WorkspaceObject.cpp:925–979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

923 }
924
925 void WorkspaceObject_Impl::emitChangeSignals() {
926 if (m_diffs.empty()) {
927 return;
928 }
929
930 bool nameChange = false;
931 bool dataChange = false;
932
933 for (const IdfObjectDiff& diff : m_diffs) {
934
935 if (diff.isNull()) {
936 continue;
937 }
938
939 boost::optional<unsigned> index = diff.index();
940 if (index) {
941
942 OptionalIddField oIddField = iddObject().getField(*index);
943
944 if (oIddField && oIddField->isObjectListField() && diff.optionalCast<WorkspaceObjectDiff>()) {
945
946 auto workspaceObjectDiff = diff.cast<WorkspaceObjectDiff>();
947
948 Handle newHandle;
949 if (workspaceObjectDiff.newHandle()) {
950 newHandle = workspaceObjectDiff.newHandle().get();
951 }
952
953 Handle oldHandle;
954 if (workspaceObjectDiff.oldHandle()) {
955 oldHandle = workspaceObjectDiff.oldHandle().get();
956 }
957
958 this->onRelationshipChange.nano_emit(*index, newHandle, oldHandle);
959
960 } else if (oIddField && oIddField->isNameField()) {
961 nameChange = true;
962 } else {
963 dataChange = true;
964 }
965 }
966 }
967
968 if (nameChange) {
969 this->onNameChange.nano_emit();
970 }
971
972 if (dataChange) {
973 this->onDataChange.nano_emit();
974 }
975
976 this->onChange.nano_emit();
977
978 m_diffs.clear();
979 }
980
981 // PROTECTED
982

Callers 6

setNameMethod · 0.95
setStringMethod · 0.95
setPointerMethod · 0.95
pushStringMethod · 0.95
pushPointerMethod · 0.95
popExtensibleGroupMethod · 0.95

Calls 11

isNullMethod · 0.80
newHandleMethod · 0.80
oldHandleMethod · 0.80
nano_emitMethod · 0.80
isNameFieldMethod · 0.80
emptyMethod · 0.45
indexMethod · 0.45
getFieldMethod · 0.45
isObjectListFieldMethod · 0.45
getMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected