diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f2c2788c..e7971b8e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -382,7 +382,7 @@ set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) file(GLOB VariantGlob third_party/variant/*.hpp) file(GLOB LibraryGlob include/osrm/*.hpp) file(GLOB ParametersGlob include/engine/api/*.hpp) -set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/object_encoder.hpp include/engine/phantom_node.hpp) +set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp) set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp) set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp) set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp) diff --git a/include/engine/hint.hpp b/include/engine/hint.hpp index 4ebb320e7..57942f7b0 100644 --- a/include/engine/hint.hpp +++ b/include/engine/hint.hpp @@ -1,18 +1,12 @@ #ifndef ENGINE_HINT_HPP #define ENGINE_HINT_HPP -#include "engine/object_encoder.hpp" #include "engine/phantom_node.hpp" #include "util/coordinate.hpp" -#include "phantom_node.hpp" - -#include - -#include -#include #include +#include namespace osrm { @@ -35,17 +29,8 @@ struct Hint facade.GetCheckSum() == data_checksum; } - std::string ToBase64() const { return encodeBase64(*this); } - - static Hint FromBase64(const std::string &base64Hint) - { - BOOST_ASSERT_MSG(base64Hint.size() == - static_cast(std::ceil(sizeof(Hint) / 3.) * 4), - "Hint has invalid size"); - - auto decoded = decodeBase64(base64Hint); - return decoded; - } + std::string ToBase64() const; + static Hint FromBase64(const std::string &base64Hint); }; #ifndef _MSC_VER diff --git a/src/engine/hint.cpp b/src/engine/hint.cpp new file mode 100644 index 000000000..e47943c89 --- /dev/null +++ b/src/engine/hint.cpp @@ -0,0 +1,20 @@ +#include "engine/hint.hpp" +#include "engine/object_encoder.hpp" + +#include + +namespace osrm +{ +namespace engine +{ +std::string Hint::ToBase64() const { return encodeBase64(*this); } + +Hint Hint::FromBase64(const std::string &base64Hint) +{ + BOOST_ASSERT_MSG(base64Hint.size() == ENCODED_HINT_SIZE, "Hint has invalid size"); + + auto decoded = decodeBase64(base64Hint); + return decoded; +} +} +}