Return a vector of (Key, Var) pairs
| 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 { |