| 149 | } |
| 150 | |
| 151 | std::string DataModelBase::FindDataSource(const rapidjson::Value& dataModel, |
| 152 | DataSourcesType& sources) const |
| 153 | { |
| 154 | if (!dataModel.HasMember("data_source")) |
| 155 | { |
| 156 | throw std::runtime_error(this->ObjectName + " must provide a data_source."); |
| 157 | } |
| 158 | std::string dsname = dataModel["data_source"].GetString(); |
| 159 | auto iter = sources.find(dsname); |
| 160 | if (iter == sources.end()) |
| 161 | { |
| 162 | throw std::runtime_error("data_source." + dsname + " was not found."); |
| 163 | } |
| 164 | return dsname; |
| 165 | } |
| 166 | |
| 167 | void DataModelBase::ProcessJSON(const rapidjson::Value& json, DataSourcesType& sources) |
| 168 | { |
no test coverage detected