Remove usage of StringView typedef

This commit is contained in:
Dennis Luxen
2022-10-30 19:52:57 +01:00
parent 274dcc58a5
commit 5c9d0d152c
14 changed files with 56 additions and 60 deletions
+6 -6
View File
@@ -203,7 +203,7 @@ class ContiguousInternalMemoryDataFacade<routing_algorithms::offline::Algorithm>
return DatasourceReverseRange(DatasourceForwardRange());
}
StringView GetDatasourceName(const DatasourceID /*id*/) const override { return StringView{}; }
std::string_view GetDatasourceName(const DatasourceID /*id*/) const override { return std::string_view{}; }
guidance::TurnInstruction GetTurnInstructionForEdgeID(const EdgeID /*id*/) const override
{
@@ -270,11 +270,11 @@ class ContiguousInternalMemoryDataFacade<routing_algorithms::offline::Algorithm>
bool HasLaneData(const EdgeID /*id*/) const override { return false; }
NameID GetNameIndex(const NodeID /*nodeID*/) const override { return EMPTY_NAMEID; }
StringView GetNameForID(const NameID /*id*/) const override { return StringView{}; }
StringView GetRefForID(const NameID /*id*/) const override { return StringView{}; }
StringView GetPronunciationForID(const NameID /*id*/) const override { return StringView{}; }
StringView GetDestinationsForID(const NameID /*id*/) const override { return StringView{}; }
StringView GetExitsForID(const NameID /*id*/) const override { return StringView{}; }
std::string_view GetNameForID(const NameID /*id*/) const override { return std::string_view{}; }
std::string_view GetRefForID(const NameID /*id*/) const override { return std::string_view{}; }
std::string_view GetPronunciationForID(const NameID /*id*/) const override { return std::string_view{}; }
std::string_view GetDestinationsForID(const NameID /*id*/) const override { return std::string_view{}; }
std::string_view GetExitsForID(const NameID /*id*/) const override { return std::string_view{}; }
bool GetContinueStraightDefault() const override { return false; }
std::string GetTimestamp() const override { return ""; }
double GetMapMatchingMaxSpeed() const override { return 0; }
+6 -8
View File
@@ -26,8 +26,6 @@ namespace test
class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
{
using StringView = util::StringView;
public:
bool ExcludeNode(const NodeID) const override { return false; };
@@ -95,7 +93,7 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
return DatasourceReverseRange(DatasourceForwardRange());
}
StringView GetDatasourceName(const DatasourceID) const override final { return {}; }
std::string_view GetDatasourceName(const DatasourceID) const override final { return {}; }
osrm::guidance::TurnInstruction
GetTurnInstructionForEdgeID(const EdgeID /* id */) const override
@@ -154,11 +152,11 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
NameID GetNameIndex(const NodeID /* id */) const override { return 0; }
StringView GetNameForID(const NameID) const override final { return {}; }
StringView GetRefForID(const NameID) const override final { return {}; }
StringView GetPronunciationForID(const NameID) const override final { return {}; }
StringView GetDestinationsForID(const NameID) const override final { return {}; }
StringView GetExitsForID(const NameID) const override final { return {}; }
std::string_view GetNameForID(const NameID) const override final { return {}; }
std::string_view GetRefForID(const NameID) const override final { return {}; }
std::string_view GetPronunciationForID(const NameID) const override final { return {}; }
std::string_view GetDestinationsForID(const NameID) const override final { return {}; }
std::string_view GetExitsForID(const NameID) const override final { return {}; }
bool GetContinueStraightDefault() const override { return true; }
double GetMapMatchingMaxSpeed() const override { return 180 / 3.6; }
+1 -1
View File
@@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(check_string_view)
std::string name_data = "hellostringview";
std::vector<std::uint32_t> name_offsets = {0, 5, 11, 15};
IndexedData<VariableGroupBlock<16, StringView>> indexed_data(
IndexedData<VariableGroupBlock<16, std::string_view>> indexed_data(
name_offsets.begin(), name_offsets.end(), name_data.begin());
BOOST_CHECK_EQUAL(indexed_data.at(0), "hello");