| 48 | } |
| 49 | |
| 50 | void HoUnitSpecification::AddUnitGroup(HoUnitGroup group) { |
| 51 | const std::string& key = group.ShortName(); |
| 52 | if (key.empty()) { |
| 53 | MDF_ERROR() << "A unit group must have a short name."; |
| 54 | return; |
| 55 | } |
| 56 | |
| 57 | if (const auto itr = unit_group_list_.find(key); |
| 58 | itr != unit_group_list_.cend() ) { |
| 59 | MDF_ERROR() << "The unit group is already defined. Short Name: " << key; |
| 60 | return; |
| 61 | } |
| 62 | unit_group_list_.emplace(key,std::move(group)); |
| 63 | } |
| 64 | |
| 65 | const HoUnitGroupList& HoUnitSpecification::UnitGroups() const { |
| 66 | return unit_group_list_; |