Add destinations API feature

This commit is contained in:
Daniel J. Hofmann
2016-05-26 18:47:46 -04:00
parent bb0c2754d3
commit 6edc565c01
17 changed files with 92 additions and 25 deletions
@@ -147,6 +147,8 @@ class BaseDataFacade
virtual std::string GetPronunciationForID(const unsigned name_id) const = 0;
virtual std::string GetDestinationsForID(const unsigned name_id) const = 0;
virtual std::size_t GetCoreSize() const = 0;
virtual std::string GetTimestamp() const = 0;
@@ -593,9 +593,19 @@ class InternalDataFacade final : public BaseDataFacade
std::string GetPronunciationForID(const unsigned name_id) const override final
{
// We store the pronounciation directly after the name of a street.
// We store the pronounciation after the name and destination of a street.
// We do this to get around the street length limit of 255 which would hit
// if we concatenate these.
// if we concatenate these. Order (see extractor_callbacks):
// name (0), destination (1), pronunciation (2)
return GetNameForID(name_id + 2);
}
std::string GetDestinationsForID(const unsigned name_id) const override final
{
// We store the destination after the name of a street.
// We do this to get around the street length limit of 255 which would hit
// if we concatenate these. Order (see extractor_callbacks):
// name (0), destination (1), pronunciation (2)
return GetNameForID(name_id + 1);
}
@@ -662,6 +662,19 @@ class SharedDataFacade final : public BaseDataFacade
std::string GetPronunciationForID(const unsigned name_id) const override final
{
// We store the pronounciation after the name and destination of a street.
// We do this to get around the street length limit of 255 which would hit
// if we concatenate these. Order (see extractor_callbacks):
// name (0), destination (1), pronunciation (2)
return GetNameForID(name_id + 2);
}
std::string GetDestinationsForID(const unsigned name_id) const override final
{
// We store the destination after the name of a street.
// We do this to get around the street length limit of 255 which would hit
// if we concatenate these. Order (see extractor_callbacks):
// name (0), destination (1), pronunciation (2)
return GetNameForID(name_id + 1);
}