From beafa1870889464feb26211a89ca7854fd83380f Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Thu, 18 Feb 2016 13:26:54 -0800 Subject: [PATCH] Fix forward declarations in publicly facing osrm header --- include/osrm/osrm.hpp | 33 ++------------------------------- include/osrm/osrm_fwd.hpp | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 31 deletions(-) create mode 100644 include/osrm/osrm_fwd.hpp diff --git a/include/osrm/osrm.hpp b/include/osrm/osrm.hpp index b8fbe0362..292c90c65 100644 --- a/include/osrm/osrm.hpp +++ b/include/osrm/osrm.hpp @@ -28,39 +28,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef OSRM_HPP #define OSRM_HPP +#include "osrm/osrm_fwd.hpp" #include "osrm/status.hpp" #include namespace osrm { - -// Fwd decls -namespace util -{ -namespace json -{ -struct Object; -} -} - -namespace engine -{ -class Engine; - -struct EngineConfig; -namespace api -{ -struct RouteParameters; -struct TableParameters; -struct NearestParameters; -struct TripParameters; -struct MatchParameters; -} -} - -// End fwd decls - +namespace json = util::json; using engine::EngineConfig; using engine::api::RouteParameters; using engine::api::TableParameters; @@ -68,10 +43,6 @@ using engine::api::NearestParameters; using engine::api::TripParameters; using engine::api::MatchParameters; -namespace json = util::json; - -// OSRM API - class OSRM final { public: diff --git a/include/osrm/osrm_fwd.hpp b/include/osrm/osrm_fwd.hpp new file mode 100644 index 000000000..fc21fbb4a --- /dev/null +++ b/include/osrm/osrm_fwd.hpp @@ -0,0 +1,34 @@ +#ifndef OSRM_FWD_HPP +#define OSRM_FWD_HPP + +// OSRM API forward declarations for usage in interfaces. Exposes forward declarations for: +// osrm::util::json::Object, osrm::engine::api::XParameters + +namespace osrm +{ + +namespace util +{ +namespace json +{ +struct Object; +} // ns json +} // ns util + +namespace engine +{ +namespace api +{ +struct RouteParameters; +struct TableParameters; +struct NearestParameters; +struct TripParameters; +struct MatchParameters; +} // ns api + +class Engine; +struct EngineConfig; +} // ns engine +} // ns osrm + +#endif