Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/src/cache.h
Parent Directory
|
Revision Log
Revision 1292 -
(show annotations)
(download)
(as text)
Fri May 3 15:25:56 2013 UTC (11 years, 10 months ago) by amb
File MIME type: text/x-chdr
File size: 1984 byte(s)
Fri May 3 15:25:56 2013 UTC (11 years, 10 months ago) by amb
File MIME type: text/x-chdr
File size: 1984 byte(s)
Add node, segment, way and turn relation cache for slim mode. Approx 40% speed-up for router.
1 | /*************************************** |
2 | Functions to maintain an in-RAM cache of on-disk data for slim mode. |
3 | |
4 | Part of the Routino routing software. |
5 | ******************/ /****************** |
6 | This file Copyright 2013 Andrew M. Bishop |
7 | |
8 | This program is free software: you can redistribute it and/or modify |
9 | it under the terms of the GNU Affero General Public License as published by |
10 | the Free Software Foundation, either version 3 of the License, or |
11 | (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public License |
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | ***************************************/ |
21 | |
22 | |
23 | #ifndef CACHE_H |
24 | #define CACHE_H /*+ To stop multiple inclusions. +*/ |
25 | |
26 | #include "types.h" |
27 | |
28 | |
29 | /* Node cache */ |
30 | |
31 | typedef struct _NodeCache NodeCache; |
32 | typedef struct _SegmentCache SegmentCache; |
33 | typedef struct _WayCache WayCache; |
34 | typedef struct _TurnRelationCache TurnRelationCache; |
35 | |
36 | |
37 | NodeCache *NewNodeCache(void); |
38 | |
39 | void DeleteNodeCache(NodeCache *cache); |
40 | |
41 | Node *FetchCachedNode(Nodes *nodes,index_t id); |
42 | |
43 | void InvalidateNodeCache(NodeCache *cache); |
44 | |
45 | |
46 | SegmentCache *NewSegmentCache(void); |
47 | |
48 | void DeleteSegmentCache(SegmentCache *cache); |
49 | |
50 | Segment *FetchCachedSegment(Segments *nodes,index_t id); |
51 | |
52 | void InvalidateSegmentCache(SegmentCache *cache); |
53 | |
54 | |
55 | WayCache *NewWayCache(void); |
56 | |
57 | void DeleteWayCache(WayCache *cache); |
58 | |
59 | Way *FetchCachedWay(Ways *nodes,index_t id); |
60 | |
61 | void InvalidateWayCache(WayCache *cache); |
62 | |
63 | |
64 | TurnRelationCache *NewTurnRelationCache(void); |
65 | |
66 | void DeleteTurnRelationCache(TurnRelationCache *cache); |
67 | |
68 | TurnRelation *FetchCachedTurnRelation(Relations *nodes,index_t id); |
69 | |
70 | void InvalidateTurnRelationCache(TurnRelationCache *cache); |
71 | |
72 | |
73 | #endif /* CACHE_H */ |