| 1412 | } |
| 1413 | |
| 1414 | FieldVector StructType::GetAllFieldsByName(const std::string& name) const { |
| 1415 | FieldVector result; |
| 1416 | auto p = impl_->name_to_index_.equal_range(name); |
| 1417 | for (auto it = p.first; it != p.second; ++it) { |
| 1418 | result.push_back(children_[it->second]); |
| 1419 | } |
| 1420 | return result; |
| 1421 | } |
| 1422 | |
| 1423 | Result<std::shared_ptr<StructType>> StructType::AddField( |
| 1424 | int i, const std::shared_ptr<Field>& field) const { |