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

Function mergeOutputTableSummaryReports

src/workflow/Util.cpp:146–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144*****************************************************************************************************************************************************/
145
146bool mergeOutputTableSummaryReports(IdfObject& existingObject, const IdfObject& newObject) {
147
148 bool added = false;
149
150 // Merge
151 std::vector<std::string> reports;
152 {
153 auto existinEgs = existingObject.extensibleGroups();
154 reports.reserve(existinEgs.size());
155 std::transform(existinEgs.cbegin(), existinEgs.cend(), std::back_inserter(reports), [](const auto& eg) { return eg.getString(0).get(); });
156 }
157
158 std::vector<std::string> reportsToAdd;
159 {
160 auto newEgs = newObject.extensibleGroups();
161 std::transform(newEgs.cbegin(), newEgs.cend(), std::back_inserter(reportsToAdd), [](const auto& eg) { return eg.getString(0).get(); });
162 }
163
164 for (const auto& newReport : reportsToAdd) {
165 if (std::find(reports.cbegin(), reports.cend(), newReport) == reports.cend()) {
166 existingObject.pushExtensibleGroup({newReport});
167 added = true;
168 }
169 }
170
171 return added;
172}
173
174bool isEnergyPlusOutputRequestPotentiallyUnsafe(const IddObjectType& iddObjectType) {
175 std::string const valueName = iddObjectType.valueName();

Callers 2

TEST_FFunction · 0.85

Calls 7

extensibleGroupsMethod · 0.80
cbeginMethod · 0.80
cendMethod · 0.80
pushExtensibleGroupMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45
getStringMethod · 0.45

Tested by 1

TEST_FFunction · 0.68