| 1410 | // Convert WeightInfos protobuf to weights hashmap. |
| 1411 | template <typename TWeightInfo> |
| 1412 | inline hashmap<std::string, double> convertToHashmap( |
| 1413 | const google::protobuf::RepeatedPtrField<TWeightInfo> weightInfos) |
| 1414 | { |
| 1415 | hashmap<std::string, double> weights; |
| 1416 | |
| 1417 | foreach (const TWeightInfo& weightInfo, weightInfos) { |
| 1418 | weights[weightInfo.role()] = weightInfo.weight(); |
| 1419 | } |
| 1420 | |
| 1421 | return weights; |
| 1422 | } |
| 1423 | |
| 1424 | |
| 1425 | // Helper to create DomainInfo. |