| 153 | } // namespace |
| 154 | |
| 155 | uint8_t CalculateHeader(size_t const typesCount, HeaderGeomType const headerGeomType, FeatureParamsBase const & params) |
| 156 | { |
| 157 | ASSERT(typesCount != 0, ("Feature should have at least one type.")); |
| 158 | ASSERT_LESS_OR_EQUAL(typesCount, kMaxTypesCount, ()); |
| 159 | uint8_t header = static_cast<uint8_t>(typesCount - 1); |
| 160 | |
| 161 | if (!params.name.IsEmpty()) |
| 162 | header |= HEADER_MASK_HAS_NAME; |
| 163 | |
| 164 | if (params.layer != LAYER_EMPTY) |
| 165 | header |= HEADER_MASK_HAS_LAYER; |
| 166 | |
| 167 | header |= static_cast<uint8_t>(headerGeomType); |
| 168 | |
| 169 | // Geometry type for additional info is only one. |
| 170 | switch (headerGeomType) |
| 171 | { |
| 172 | case HeaderGeomType::Point: |
| 173 | if (params.rank != 0) |
| 174 | header |= HEADER_MASK_HAS_ADDINFO; |
| 175 | break; |
| 176 | case HeaderGeomType::Line: |
| 177 | if (!params.ref.empty()) |
| 178 | header |= HEADER_MASK_HAS_ADDINFO; |
| 179 | break; |
| 180 | case HeaderGeomType::Area: |
| 181 | case HeaderGeomType::PointEx: |
| 182 | if (!params.house.IsEmpty()) |
| 183 | header |= HEADER_MASK_HAS_ADDINFO; |
| 184 | break; |
| 185 | } |
| 186 | |
| 187 | return header; |
| 188 | } |
| 189 | |
| 190 | void TypesHolder::SortByUseless() |
| 191 | { |
no test coverage detected