diff --git a/include/c_types/line_graph_rt.h b/include/c_types/line_graph_rt.h deleted file mode 100644 index 8f38241e84..0000000000 --- a/include/c_types/line_graph_rt.h +++ /dev/null @@ -1,50 +0,0 @@ -/*PGR-GNU***************************************************************** -File: line_graph_rt.h - -Generated with Template by: -Copyright (c) 2015 pgRouting developers -Mail: project@pgrouting.org - -Function's developer: -Copyright (c) 2017 Vidhan Jain -Mail: vidhanj1307@gmail.com - ------- - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - ********************************************************************PGR-GNU*/ -/*! @file */ - -#ifndef INCLUDE_C_TYPES_LINE_GRAPH_RT_H_ -#define INCLUDE_C_TYPES_LINE_GRAPH_RT_H_ -#pragma once - -/* for int64_t */ -#ifdef __cplusplus -# include -#else -# include -#endif - -struct Line_graph_rt { - int64_t id; - int64_t source; - int64_t target; - double cost; - double reverse_cost; -}; - -#endif // INCLUDE_C_TYPES_LINE_GRAPH_RT_H_ diff --git a/include/drivers/lineGraph/lineGraph_driver.h b/include/drivers/lineGraph/lineGraph_driver.h index 67c5e29395..d5b20f69d5 100644 --- a/include/drivers/lineGraph/lineGraph_driver.h +++ b/include/drivers/lineGraph/lineGraph_driver.h @@ -39,7 +39,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #endif typedef struct Edge_t Edge_t; -typedef struct Line_graph_rt Line_graph_rt; #ifdef __cplusplus extern "C" { @@ -56,7 +55,7 @@ extern "C" { Edge_t *data_edges, size_t total_edges, bool directed, - Line_graph_rt **return_tuples, + Edge_t **return_tuples, size_t *return_count, char ** log_msg, char ** notice_msg, diff --git a/include/lineGraph/pgr_lineGraph.hpp b/include/lineGraph/pgr_lineGraph.hpp index ec43303491..f7f6b6b0ec 100644 --- a/include/lineGraph/pgr_lineGraph.hpp +++ b/include/lineGraph/pgr_lineGraph.hpp @@ -87,12 +87,12 @@ class Pgr_lineGraph : public Pgr_base_graph { } - std::vector< Line_graph_rt > + std::vector< Edge_t > get_postgres_results_directed() { - std::vector< Line_graph_rt > results; + std::vector< Edge_t > results; typename boost::graph_traits < G >::edge_iterator edgeIt, edgeEnd; - std::map < std::pair, Line_graph_rt > unique; + std::map < std::pair, Edge_t > unique; int64_t count = 0; for (boost::tie(edgeIt, edgeEnd) = boost::edges(this->graph); @@ -116,7 +116,7 @@ class Pgr_lineGraph : public Pgr_base_graph { e_source *= -1; e_target *= -1; - Line_graph_rt edge = { + Edge_t edge = { ++count, e_source, e_target, diff --git a/include/yen/pgr_turnRestrictedPath.hpp b/include/yen/pgr_turnRestrictedPath.hpp index d468f4a84e..c657c13e8b 100644 --- a/include/yen/pgr_turnRestrictedPath.hpp +++ b/include/yen/pgr_turnRestrictedPath.hpp @@ -43,7 +43,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "cpp_common/compPaths.h" #include "cpp_common/pgr_messages.h" #include "cpp_common/rule.h" -#include "c_types/line_graph_rt.h" namespace pgrouting { namespace yen { diff --git a/src/lineGraph/lineGraph.c b/src/lineGraph/lineGraph.c index 865169a060..1d7eaa5065 100644 --- a/src/lineGraph/lineGraph.c +++ b/src/lineGraph/lineGraph.c @@ -46,14 +46,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "c_common/postgres_connection.h" -#include "c_types/line_graph_rt.h" -/* for macro PGR_DBG */ +#include "c_types/edge_t.h" #include "c_common/debug_macro.h" -/* for pgr_global_report */ #include "c_common/e_report.h" -/* for time_msg & clock */ #include "c_common/time_msg.h" -/* for functions to get edges information */ #include "c_common/edges_input.h" #include "drivers/lineGraph/lineGraph_driver.h" // the link to the C++ code of the function @@ -69,7 +65,7 @@ void process( char* edges_sql, bool directed, - Line_graph_rt **result_tuples, + Edge_t **result_tuples, size_t *result_count) { /* * https://www.postgresql.org/docs/current/static/spi-spi-connect.html @@ -138,7 +134,7 @@ PGDLLEXPORT Datum _pgr_linegraph(PG_FUNCTION_ARGS) { /**************************************************************************/ /* MODIFY AS NEEDED */ /* */ - Line_graph_rt *result_tuples = NULL; + Edge_t *result_tuples = NULL; size_t result_count = 0; /* */ /**************************************************************************/ @@ -184,7 +180,7 @@ PGDLLEXPORT Datum _pgr_linegraph(PG_FUNCTION_ARGS) { funcctx = SRF_PERCALL_SETUP(); tuple_desc = funcctx->tuple_desc; - result_tuples = (Line_graph_rt*) funcctx->user_fctx; + result_tuples = (Edge_t*) funcctx->user_fctx; if (funcctx->call_cntr < funcctx->max_calls) { HeapTuple tuple; diff --git a/src/lineGraph/lineGraph_driver.cpp b/src/lineGraph/lineGraph_driver.cpp index 56cbb11d21..9f9e067a14 100644 --- a/src/lineGraph/lineGraph_driver.cpp +++ b/src/lineGraph/lineGraph_driver.cpp @@ -36,7 +36,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "dijkstra/pgr_dijkstra.hpp" -#include "c_types/line_graph_rt.h" #include "cpp_common/pgr_alloc.hpp" #include "cpp_common/pgr_assert.h" @@ -45,8 +44,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. void get_postgres_result( - std::vector< Line_graph_rt > edge_result, - Line_graph_rt **return_tuples, + std::vector< Edge_t > edge_result, + Edge_t **return_tuples, size_t &sequence) { (*return_tuples) = pgr_alloc(edge_result.size(), (*return_tuples)); @@ -62,7 +61,7 @@ do_pgr_lineGraph( Edge_t *data_edges, size_t total_edges, bool directed, - Line_graph_rt **return_tuples, + Edge_t **return_tuples, size_t *return_count, char ** log_msg, char ** notice_msg, @@ -88,7 +87,7 @@ do_pgr_lineGraph( pgrouting::LinearDirectedGraph, pgrouting::Line_vertex, pgrouting::Basic_edge> line(digraph); - std::vector< Line_graph_rt > line_graph_edges; + std::vector< Edge_t > line_graph_edges; line_graph_edges = line.get_postgres_results_directed(); auto count = line_graph_edges.size();