libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout
include
osmscout
routing
TurnRestriction.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_TURNRESTRICTION_H
2
#define OSMSCOUT_TURNRESTRICTION_H
3
4
/*
5
This source is part of the libosmscout library
6
Copyright (C) 2009 Tim Teulings
7
8
This library is free software; you can redistribute it and/or
9
modify it under the terms of the GNU Lesser General Public
10
License as published by the Free Software Foundation; either
11
version 2.1 of the License, or (at your option) any later version.
12
13
This library 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 GNU
16
Lesser General Public License for more details.
17
18
You should have received a copy of the GNU Lesser General Public
19
License along with this library; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
*/
22
23
#include <memory>
24
25
#include <
osmscout/OSMScoutTypes.h
>
26
27
#include <
osmscout/io/FileScanner.h
>
28
#include <
osmscout/io/FileWriter.h
>
29
30
#include <
osmscout/system/Compiler.h
>
31
32
namespace
osmscout
{
33
34
class
OSMSCOUT_API
TurnRestriction
CLASS_FINAL
35
{
36
public
:
37
enum
Type
38
{
39
Allow
= 0,
40
Forbit
= 1
41
};
42
43
private
:
44
Type type;
45
OSMId
from;
// Way id
46
OSMId
via;
// Node id
47
OSMId
to;
// Way id
48
49
public
:
50
TurnRestriction
() =
default
;
51
52
inline
TurnRestriction
(
Type
type
,
53
OSMId
from
,
54
OSMId
via,
55
OSMId
to
)
56
:
type
(
type
),
57
from
(
from
),
58
via(via),
59
to
(
to
)
60
{
61
// no code
62
}
63
64
inline
Type
GetType
()
const
65
{
66
return
type
;
67
}
68
69
void
inline
SetFrom
(
Id
from
)
70
{
71
this->from=
from
;
72
}
73
74
inline
OSMId
GetFrom
()
const
75
{
76
return
from
;
77
}
78
79
inline
OSMId
GetVia
()
const
80
{
81
return
via;
82
}
83
84
inline
OSMId
GetTo
()
const
85
{
86
return
to
;
87
}
88
89
void
inline
SetTo
(
OSMId
to
)
90
{
91
this->to=
to
;
92
}
93
94
void
Read
(
FileScanner
& scanner);
95
void
Write
(
FileWriter
& writer)
const
;
96
};
97
98
using
TurnRestrictionRef
= std::shared_ptr<TurnRestriction>;
99
}
100
101
#endif
Compiler.h
OSMSCOUT_API
#define OSMSCOUT_API
Definition
CoreImportExport.h:45
FileScanner.h
FileWriter.h
OSMScoutTypes.h
osmscout::CLASS_FINAL
Definition
Area.h:88
osmscout::CLASS_FINAL::TurnRestriction
TurnRestriction()=default
osmscout::CLASS_FINAL::Read
void Read(FileScanner &scanner)
osmscout::CLASS_FINAL::GetVia
OSMId GetVia() const
Definition
TurnRestriction.h:79
osmscout::CLASS_FINAL::GetFrom
OSMId GetFrom() const
Definition
TurnRestriction.h:74
osmscout::CLASS_FINAL::GetTo
OSMId GetTo() const
Definition
TurnRestriction.h:84
osmscout::CLASS_FINAL::Type
Type
Definition
GroundTile.h:48
osmscout::CLASS_FINAL::Allow
@ Allow
Definition
TurnRestriction.h:39
osmscout::CLASS_FINAL::Forbit
@ Forbit
Definition
TurnRestriction.h:40
osmscout::CLASS_FINAL::from
const GeoCoord from
Definition
RouteStateAgent.h:37
osmscout::CLASS_FINAL::to
const GeoCoord to
Definition
RouteStateAgent.h:39
osmscout::CLASS_FINAL::TurnRestriction
TurnRestriction(Type type, OSMId from, OSMId via, OSMId to)
Definition
TurnRestriction.h:52
osmscout::CLASS_FINAL::FileScanner
FileScanner()=default
osmscout::CLASS_FINAL::FileWriter
FileWriter()=default
osmscout::CLASS_FINAL::GetType
Type GetType() const
Definition
TurnRestriction.h:64
osmscout::CLASS_FINAL::type
Type type
The type of the cell.
Definition
GroundTile.h:92
osmscout::CLASS_FINAL::SetFrom
void SetFrom(Id from)
Definition
TurnRestriction.h:69
osmscout::CLASS_FINAL::SetTo
void SetTo(OSMId to)
Definition
TurnRestriction.h:89
osmscout::CLASS_FINAL::Write
void Write(FileWriter &writer) const
osmscout::Id
uint64_t Id
Definition
OSMScoutTypes.h:40
osmscout::OSMId
int64_t OSMId
Definition
OSMScoutTypes.h:33
osmscout
Definition
Area.h:39
osmscout::TurnRestrictionRef
std::shared_ptr< TurnRestriction > TurnRestrictionRef
Definition
TurnRestriction.h:98
Generated by
1.17.0