Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /trunk/src/relationsx.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 496 - (show annotations) (download) (as text)
Fri Sep 17 17:42:45 2010 UTC (14 years, 6 months ago) by amb
File MIME type: text/x-chdr
File size: 2663 byte(s)
Initial revision

1 /***************************************
2 $Header: /home/amb/CVS/routino/src/relationsx.h,v 1.1 2010-09-17 17:42:26 amb Exp $
3
4 A header file for the extended Relations structure.
5
6 Part of the Routino routing software.
7 ******************/ /******************
8 This file Copyright 2010 Andrew M. Bishop
9
10 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 ***************************************/
23
24
25 #ifndef RELATIONSX_H
26 #define RELATIONSX_H /*+ To stop multiple inclusions. +*/
27
28 #include <stdint.h>
29
30 #include "types.h"
31
32 #include "typesx.h"
33
34
35 /* Data structures */
36
37
38 /*+ An extended structure containing a single route relation. +*/
39 struct _RouteRelX
40 {
41 relation_t id; /*+ The relation identifier. +*/
42
43 allow_t routes; /*+ The types of route that this relation belongs to. +*/
44 };
45
46
47 /*+ A structure containing a set of relations. +*/
48 struct _RelationsX
49 {
50 /* Route relations */
51
52 char *rfilename; /*+ The name of the temporary file (for the RouteRelX). +*/
53 int rfd; /*+ The file descriptor of the temporary file (for the RouteRelX). +*/
54
55 index_t rxnumber; /*+ The number of unsorted extended route relations. +*/
56
57 #if !SLIM
58
59 RouteRelX *rxdata; /*+ The extended data for the route relations (sorted). +*/
60
61 #else
62
63 RouteRelX rxcached[2]; /*+ Two cached route relations read from the file in slim mode. +*/
64
65 #endif
66
67 index_t rnumber; /*+ How many route relation entries are still useful? +*/
68
69 size_t *ridata; /*+ The index of the extended data for the route relations (sorted by ID). +*/
70 };
71
72
73 /* Functions */
74
75
76 RelationsX *NewRelationList(int append);
77 void FreeRelationList(RelationsX *relationsx,int keep);
78
79 void AppendRouteRelation(RelationsX* relationsx,relation_t id,allow_t routes,
80 way_t *ways,int nways,
81 relation_t *relations,int nrelations);
82
83 void SortRelationList(RelationsX *relationsx);
84
85 void ProcessRouteRelations(RelationsX *relationsx,WaysX *waysx);
86
87
88 #endif /* RELATIONSX_H */