From 19285d61ab8bf26a97310b59d48722055105b830 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Sun, 8 Dec 2013 19:38:13 +0100 Subject: [PATCH] reorder includes to cut compile time --- Library/OSRM.cpp | 23 +++++++++++++++++++++++ Library/OSRM.h | 26 +++++--------------------- Server/ServerFactory.h | 7 ++++++- Tools/simpleclient.cpp | 2 ++ Util/ProgramOptions.h | 5 +---- Util/ServerPaths.h | 41 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 78 insertions(+), 26 deletions(-) create mode 100644 Util/ServerPaths.h diff --git a/Library/OSRM.cpp b/Library/OSRM.cpp index 2ffcee1a6..41b3e67b3 100644 --- a/Library/OSRM.cpp +++ b/Library/OSRM.cpp @@ -27,6 +27,29 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "OSRM.h" +#include "../Plugins/HelloWorldPlugin.h" +#include "../Plugins/LocatePlugin.h" +#include "../Plugins/NearestPlugin.h" +#include "../Plugins/TimestampPlugin.h" +#include "../Plugins/ViaRoutePlugin.h" + + +#include "../Server/DataStructures/InternalDataFacade.h" +#include "../Server/DataStructures/SharedDataFacade.h" +// #include "../Util/InputFileUtil.h" +// #include "../Util/OSRMException.h" +// #include "../Util/SimpleLogger.h" + +#include +// #include +// #include +// #include +// #include +// #include +// #include +// #include + +// #include OSRM::OSRM( const ServerPaths & server_paths, const bool use_shared_memory ) : use_shared_memory(use_shared_memory) diff --git a/Library/OSRM.h b/Library/OSRM.h index 0666a06fa..dfbab87bc 100644 --- a/Library/OSRM.h +++ b/Library/OSRM.h @@ -28,32 +28,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef OSRM_H #define OSRM_H +#include "../DataStructures/QueryEdge.h" #include "../Plugins/BasePlugin.h" -#include "../Plugins/HelloWorldPlugin.h" -#include "../Plugins/LocatePlugin.h" -#include "../Plugins/NearestPlugin.h" -#include "../Plugins/TimestampPlugin.h" -#include "../Plugins/ViaRoutePlugin.h" -#include "../Server/DataStructures/BaseDataFacade.h" -#include "../Server/DataStructures/InternalDataFacade.h" -#include "../Server/DataStructures/SharedBarriers.h" -#include "../Server/DataStructures/SharedDataFacade.h" +#include "../Server/Http/Reply.h" #include "../Server/DataStructures/RouteParameters.h" -#include "../Util/InputFileUtil.h" -#include "../Util/OSRMException.h" -#include "../Util/SimpleLogger.h" +#include "../Server/DataStructures/SharedBarriers.h" +#include "../Server/DataStructures/BaseDataFacade.h" +#include "../Util/ServerPaths.h" -#include -#include -#include -#include -#include -#include #include -#include -#include -#include class OSRM : boost::noncopyable { private: diff --git a/Server/ServerFactory.h b/Server/ServerFactory.h index b463e5f37..64bb29c0c 100644 --- a/Server/ServerFactory.h +++ b/Server/ServerFactory.h @@ -29,6 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define SERVERFACTORY_H_ #include "Server.h" +#include "../Util/OpenMPWrapper.h" #include "../Util/SimpleLogger.h" #include "../Util/StringUtil.h" @@ -45,7 +46,11 @@ struct ServerFactory : boost::noncopyable { std::stringstream port_stream; port_stream << ip_port; - return new Server( ip_address, port_stream.str(), std::min( omp_get_num_procs(), threads) ); + return new Server( + ip_address, + port_stream.str(), + std::min( omp_get_num_procs(), threads) + ); } }; diff --git a/Tools/simpleclient.cpp b/Tools/simpleclient.cpp index f617b462a..702aabf0a 100644 --- a/Tools/simpleclient.cpp +++ b/Tools/simpleclient.cpp @@ -26,6 +26,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "../Library/OSRM.h" +#include "../Util/GitDescription.h" +#include "../Util/ProgramOptions.h" #include "../Util/SimpleLogger.h" #include diff --git a/Util/ProgramOptions.h b/Util/ProgramOptions.h index 4d0c64c57..160c47938 100644 --- a/Util/ProgramOptions.h +++ b/Util/ProgramOptions.h @@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "GitDescription.h" #include "OSRMException.h" +#include "ServerPaths.h" #include "SimpleLogger.h" #include @@ -42,10 +43,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -typedef boost::unordered_map< - const std::string, - boost::filesystem::path - > ServerPaths; namespace boost { namespace filesystem { diff --git a/Util/ServerPaths.h b/Util/ServerPaths.h new file mode 100644 index 000000000..23c2bb9af --- /dev/null +++ b/Util/ServerPaths.h @@ -0,0 +1,41 @@ +/* + +Copyright (c) 2013, Project OSRM, Dennis Luxen, others +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef SERVER_PATH_H +#define SERVER_PATH_H + +#include +#include + +#include + +typedef boost::unordered_map< + const std::string, + boost::filesystem::path + > ServerPaths; + +#endif //SERVER_PATH_H