Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Annotation of /trunk/src/ways.h
Parent Directory
|
Revision Log
Revision 365 -
(hide annotations)
(download)
(as text)
Mon Apr 12 16:42:23 2010 UTC (15 years ago) by amb
File MIME type: text/x-chdr
File size: 2960 byte(s)
Mon Apr 12 16:42:23 2010 UTC (15 years ago) by amb
File MIME type: text/x-chdr
File size: 2960 byte(s)
Move the type checking/printing functions from way.c to type.c.
1 | amb | 21 | /*************************************** |
2 | amb | 365 | $Header: /home/amb/CVS/routino/src/ways.h,v 1.35 2010-04-12 16:42:11 amb Exp $ |
3 | amb | 21 | |
4 | A header file for the ways. | ||
5 | amb | 151 | |
6 | Part of the Routino routing software. | ||
7 | amb | 21 | ******************/ /****************** |
8 | amb | 365 | This file Copyright 2008-2010 Andrew M. Bishop |
9 | amb | 21 | |
10 | amb | 151 | This program is free software: you can redistribute it and/or modify |
11 | it under the terms of the GNU Affero General Public License as published by | ||
12 | the Free Software Foundation, either version 3 of the License, or | ||
13 | (at your option) any later version. | ||
14 | |||
15 | This program is distributed in the hope that it will be useful, | ||
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | GNU Affero General Public License for more details. | ||
19 | |||
20 | You should have received a copy of the GNU Affero General Public License | ||
21 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
22 | amb | 21 | ***************************************/ |
23 | |||
24 | |||
25 | #ifndef WAYS_H | ||
26 | #define WAYS_H /*+ To stop multiple inclusions. +*/ | ||
27 | |||
28 | #include <stdint.h> | ||
29 | |||
30 | amb | 109 | #include "types.h" |
31 | amb | 21 | |
32 | |||
33 | /* Data structures */ | ||
34 | |||
35 | |||
36 | amb | 298 | /*+ A structure containing a single way (members ordered to minimise overall size). +*/ |
37 | amb | 109 | struct _Way |
38 | amb | 87 | { |
39 | amb | 109 | index_t name; /*+ The offset of the name of the way in the names array. +*/ |
40 | amb | 87 | |
41 | amb | 296 | wayallow_t allow; /*+ The type of traffic allowed on the way. +*/ |
42 | |||
43 | amb | 298 | waytype_t type; /*+ The highway type of the way. +*/ |
44 | amb | 109 | |
45 | amb | 298 | wayprop_t props; /*+ The properties of the way. +*/ |
46 | |||
47 | amb | 135 | speed_t speed; /*+ The defined maximum speed limit of the way. +*/ |
48 | |||
49 | weight_t weight; /*+ The defined maximum weight of traffic on the way. +*/ | ||
50 | height_t height; /*+ The defined maximum height of traffic on the way. +*/ | ||
51 | width_t width; /*+ The defined maximum width of traffic on the way. +*/ | ||
52 | length_t length; /*+ The defined maximum length of traffic on the way. +*/ | ||
53 | amb | 109 | }; |
54 | |||
55 | |||
56 | amb | 21 | /*+ A structure containing a set of ways (mmap format). +*/ |
57 | amb | 109 | struct _Ways |
58 | amb | 21 | { |
59 | amb | 307 | uint32_t number; /*+ How many ways are stored? +*/ |
60 | uint32_t onumber; /*+ How many ways were there originally? +*/ | ||
61 | amb | 87 | |
62 | amb | 307 | wayallow_t allow; /*+ The type of traffic allowed when parsing. +*/ |
63 | wayprop_t props; /*+ The properties that were included when parsing. +*/ | ||
64 | amb | 87 | |
65 | amb | 307 | Way *ways; /*+ An array of ways. +*/ |
66 | char *names; /*+ An array of characters containing the names. +*/ | ||
67 | |||
68 | void *data; /*+ The memory mapped data. +*/ | ||
69 | amb | 109 | }; |
70 | amb | 21 | |
71 | |||
72 | amb | 109 | /* Macros */ |
73 | amb | 21 | |
74 | |||
75 | amb | 109 | /*+ Return a Way* pointer given a set of ways and an index. +*/ |
76 | #define LookupWay(xxx,yyy) (&(xxx)->ways[yyy]) | ||
77 | amb | 21 | |
78 | amb | 109 | /*+ Return the name of a way given the Way pointer and a set of ways. +*/ |
79 | #define WayName(xxx,yyy) (&(xxx)->names[(yyy)->name]) | ||
80 | amb | 21 | |
81 | |||
82 | amb | 109 | /* Functions */ |
83 | amb | 21 | |
84 | |||
85 | amb | 109 | Ways *LoadWayList(const char *filename); |
86 | amb | 21 | |
87 | amb | 201 | int WaysCompare(Way *way1,Way *way2); |
88 | amb | 32 | |
89 | amb | 181 | |
90 | amb | 21 | #endif /* WAYS_H */ |
Properties
Name | Value |
---|---|
cvs:description | Header file for ways. |