From acef7346431b5aa5868203fce29d50a00f06567f Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Wed, 7 May 2014 15:33:24 +0200 Subject: [PATCH] break out RouteParameters into compile unit --- CMakeLists.txt | 2 +- Include/osrm/RouteParameters.h | 104 ++++++++++----------------------- 2 files changed, 32 insertions(+), 74 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4dc5f69b0..55eb5ea89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ add_executable(osrm-prepare ${PrepareSources}) file(GLOB ServerGlob Server/*.cpp) file(GLOB DescriptorGlob Descriptors/*.cpp) -file(GLOB DatastructureGlob DataStructures/SearchEngineData.cpp) +file(GLOB DatastructureGlob DataStructures/SearchEngineData.cpp DataStructures/RouteParameters.cpp) file(GLOB CoordinateGlob DataStructures/Coordinate.cpp) file(GLOB AlgorithmGlob Algorithms/*.cpp) file(GLOB HttpGlob Server/Http/*.cpp) diff --git a/Include/osrm/RouteParameters.h b/Include/osrm/RouteParameters.h index b35a0cf60..8cc053456 100644 --- a/Include/osrm/RouteParameters.h +++ b/Include/osrm/RouteParameters.h @@ -30,23 +30,40 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -#include -#include -#include +#include #include #include -struct RouteParameters { - RouteParameters() : - zoomLevel(18), - printInstructions(false), - alternateRoute(true), - geometry(true), - compression(true), - deprecatedAPI(false), - checkSum(-1) - { } +struct RouteParameters +{ + RouteParameters(); + + void setZoomLevel(const short i); + + void setAlternateRouteFlag(const bool b); + + void setDeprecatedAPIFlag(const std::string &); + + void setChecksum(const unsigned c); + + void setInstructionFlag(const bool b); + + void setService(const std::string &s); + + void setOutputFormat(const std::string &s); + + void setJSONpParameter(const std::string &s); + + void addHint(const std::string &s); + + void setLanguage(const std::string &s); + + void setGeometryFlag(const bool b); + + void setCompressionFlag(const bool b); + + void addCoordinate(const boost::fusion::vector &arg_); short zoomLevel; bool printInstructions; @@ -61,65 +78,6 @@ struct RouteParameters { std::string language; std::vector hints; std::vector coordinates; - - void setZoomLevel(const short i) { - if (18 >= i && 0 <= i) { - zoomLevel = i; - } - } - - void setAlternateRouteFlag(const bool b) { - alternateRoute = b; - } - - void setDeprecatedAPIFlag(const std::string &) { - deprecatedAPI = true; - } - - void setChecksum(const unsigned c) { - checkSum = c; - } - - void setInstructionFlag(const bool b) { - printInstructions = b; - } - - void setService( const std::string & s) { - service = s; - } - - void setOutputFormat(const std::string & s) { - outputFormat = s; - } - - void setJSONpParameter(const std::string & s) { - jsonpParameter = s; - } - - void addHint(const std::string & s) { - hints.resize( coordinates.size() ); - if( !hints.empty() ) { - hints.back() = s; - } - } - - void setLanguage(const std::string & s) { - language = s; - } - - void setGeometryFlag(const bool b) { - geometry = b; - } - - void setCompressionFlag(const bool b) { - compression = b; - } - - void addCoordinate(const boost::fusion::vector < double, double > & arg_) { - int lat = COORDINATE_PRECISION*boost::fusion::at_c < 0 > (arg_); - int lon = COORDINATE_PRECISION*boost::fusion::at_c < 1 > (arg_); - coordinates.push_back(FixedPointCoordinate(lat, lon)); - } }; -#endif /*ROUTE_PARAMETERS_H*/ +#endif // ROUTE_PARAMETERS_H