PGROUTING  2.6-dev
trsp_types.h
Go to the documentation of this file.
1 /*
2  * Shortest path with turn restrictions algorithm for PostgreSQL
3  *
4  * Copyright (c) 2017 pgRouting developers
5  * Mail: project@pgrouting.org
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  */
22 
23 #ifndef INCLUDE_C_TYPES_TRSP_TYPES_H_
24 #define INCLUDE_C_TYPES_TRSP_TYPES_H_
25 
26 
27 #ifdef __cplusplus
28 
29 #include <cstddef>
30 
31 #else // __cplusplus
32 
33 // for bool
34 #ifdef __GNUC__
35 #pragma GCC diagnostic ignored "-pedantic"
36 #endif
37 
38 #include <postgres.h>
39 
40 #ifdef __GNUC__
41 #pragma GCC diagnostic pop
42 #endif
43 
44 // For NULL & size_t
45 #include <stdlib.h>
46 
47 
48 #endif // __cplusplus
49 
50 // For int64_t etc
51 #include <stdint.h>
52 
53 
54 
55 typedef struct {
56  int64_t id;
57  int64_t source;
58  int64_t target;
59  double cost;
60  double reverse_cost;
61 } edge_t;
62 
63 typedef struct restrict_struct {
64  int target_id;
65  double to_cost;
66  int via[5];
67 }
69 
70 typedef struct path_element {
71  int64_t vertex_id;
72  int64_t edge_id;
73  double cost;
75 
76 
77 
78 #endif // INCLUDE_C_TYPES_TRSP_TYPES_H_
int64_t vertex_id
Definition: trsp_types.h:71
int64_t source
Definition: trsp_types.h:57
int via[5]
Definition: trsp.h:42
double cost
Definition: trsp_types.h:59
struct restrict_struct restrict_t
int target_id
Definition: trsp.h:40
int64_t target
Definition: trsp_types.h:58
double cost
Definition: trsp_types.h:73
int64_t edge_id
Definition: trsp_types.h:72
struct path_element path_element_tt
struct edge edge_t
double reverse_cost
Definition: trsp_types.h:60
double to_cost
Definition: trsp_types.h:65
int64_t id
Definition: trsp_types.h:56