MCPcopy Create free account
hub / github.com/comaps/comaps / GetMainType

Function GetMainType

generator/hierarchy_entry.cpp:49–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47namespace hierarchy
48{
49uint32_t GetMainType(FeatureParams::Types const & types)
50{
51 auto const & airportChecker = ftypes::IsAirportChecker::Instance();
52 auto it = base::FindIf(types, airportChecker);
53 if (it != std::cend(types))
54 return *it;
55
56 auto const & attractChecker = ftypes::AttractionsChecker::Instance();
57 auto const type = attractChecker.GetBestType(types);
58 if (type != ftype::GetEmptyValue())
59 return type;
60
61 auto const & eatChecker = ftypes::IsEatChecker::Instance();
62 it = base::FindIf(types, eatChecker);
63 if (it != std::cend(types))
64 return *it;
65
66 auto const & buildingPartChecker = ftypes::IsBuildingPartChecker::Instance();
67 it = base::FindIf(types, buildingPartChecker);
68 return it != std::cend(types) ? *it : ftype::GetEmptyValue();
69}
70
71std::string HierarchyEntryToCsvString(HierarchyEntry const & entry, char delim)
72{

Callers 1

IsAcceptedMethod · 0.85

Calls 4

cendFunction · 0.85
GetEmptyValueFunction · 0.85
FindIfFunction · 0.50
GetBestTypeMethod · 0.45

Tested by

no test coverage detected