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

Method keyVarGroups

src/model/MeterCustom.cpp:106–122  ·  view source on GitHub ↗

Return a vector of (Key, Var) pairs

Source from the content-addressed store, hash-verified

104
105 // Return a vector of (Key, Var) pairs
106 std::vector<std::pair<std::string, std::string>> MeterCustom_Impl::keyVarGroups() {
107 std::vector<std::pair<std::string, std::string>> result;
108
109 std::vector<IdfExtensibleGroup> groups = extensibleGroups();
110
111 for (const auto& group : groups) {
112 boost::optional<std::string> keyName = group.cast<WorkspaceExtensibleGroup>().getString(OS_Meter_CustomExtensibleFields::KeyName);
113 boost::optional<std::string> outputVariableorMeterName =
114 group.cast<WorkspaceExtensibleGroup>().getString(OS_Meter_CustomExtensibleFields::OutputVariableorMeterName);
115
116 if (keyName && outputVariableorMeterName) {
117 result.push_back(std::make_pair(keyName.get(), outputVariableorMeterName.get()));
118 }
119 }
120
121 return result;
122 }
123
124 // Return the number of (KeyName, OutputVariableorMeterName) groups
125 unsigned MeterCustom_Impl::numKeyVarGroups() const {

Callers 4

TEST_FFunction · 0.45
TEST_FFunction · 0.45
translateMeterCustomMethod · 0.45

Calls 3

getStringMethod · 0.45
push_backMethod · 0.45
getMethod · 0.45

Tested by 2

TEST_FFunction · 0.36
TEST_FFunction · 0.36