Routino SVN Repository Browser

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

ViewVC logotype

Annotation of /trunk/src/nodes.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 98 - (hide annotations) (download) (as text)
Mon Feb 2 18:53:13 2009 UTC (16 years, 2 months ago) by amb
File MIME type: text/x-chdr
File size: 2277 byte(s)
More variable and function name changes.

1 amb 18 /***************************************
2 amb 98 $Header: /home/amb/CVS/routino/src/nodes.h,v 1.16 2009-02-02 18:53:12 amb Exp $
3 amb 18
4     A header file for the nodes.
5     ******************/ /******************
6     Written by Andrew M. Bishop
7    
8     This file Copyright 2009 Andrew M. Bishop
9     It may be distributed under the GNU Public License, version 2, or
10     any higher version. See section COPYING of the GNU Public license
11     for conditions under which this file may be redistributed.
12     ***************************************/
13    
14    
15     #ifndef NODES_H
16     #define NODES_H /*+ To stop multiple inclusions. +*/
17    
18     #include <stdint.h>
19    
20 amb 96 #include "types.h"
21 amb 18
22    
23     /* Simple Types */
24    
25    
26     /*+ A node identifier. +*/
27     typedef uint32_t node_t;
28    
29    
30     /* Data structures */
31    
32    
33 amb 88 /*+ An extended structure used for processing. +*/
34 amb 97 typedef struct _NodeX
35 amb 88 {
36     node_t id; /*+ The node identifier. +*/
37 amb 89 int super; /*+ A marker for super nodes. +*/
38 amb 88
39     Node node; /*+ The real node data. +*/
40     }
41 amb 97 NodeX;
42 amb 88
43 amb 19 /*+ A structure containing a set of nodes (mmap format). +*/
44     typedef struct _Nodes
45     {
46 amb 65 uint32_t number; /*+ How many entries are used in total? +*/
47 amb 88
48     Node *nodes; /*+ An array of nodes. +*/
49    
50     void *data; /*+ The memory mapped data. +*/
51 amb 19 }
52     Nodes;
53    
54 amb 18 /*+ A structure containing a set of nodes (memory format). +*/
55 amb 97 typedef struct _NodesX
56 amb 18 {
57 amb 88 uint32_t sorted; /*+ Is the data sorted and therefore searchable? +*/
58 amb 18 uint32_t alloced; /*+ How many entries are allocated? +*/
59 amb 19 uint32_t number; /*+ How many entries are used? +*/
60    
61 amb 98 NodeX *xdata; /*+ The extended node data. +*/
62 amb 18 }
63 amb 97 NodesX;
64 amb 18
65    
66     /* Functions */
67    
68 amb 40 #include "segments.h"
69 amb 18
70 amb 40
71 amb 19 Nodes *LoadNodeList(const char *filename);
72 amb 18
73 amb 97 NodesX *NewNodeList(void);
74 amb 18
75 amb 97 void SaveNodeList(NodesX *nodesx,const char *filename);
76 amb 18
77 amb 98 NodeX *FindNodeX(NodesX* nodesx,node_t id);
78 amb 40
79 amb 98 Node *AppendNode(NodesX* nodesx,node_t id,float latitude,float longitude);
80 amb 18
81 amb 97 void SortNodeList(NodesX *nodesx);
82 amb 32
83 amb 97 void RemoveNonHighwayNodes(NodesX *nodesx,SegmentsX *segmentsx);
84 amb 88
85 amb 97 void FixupNodes(NodesX *nodesx,SegmentsX* segmentsx,int iteration);
86 amb 89
87 amb 97 #define LookupNodeX(xxx,yyy) (&(xxx)->xdata[NODE(yyy)])
88 amb 88
89 amb 97 #define IndexNodeX(xxx,yyy) ((yyy)-&(xxx)->xdata[0])
90    
91    
92 amb 18 #endif /* NODES_H */

Properties

Name Value
cvs:description Header file for nodes.