2012-08-27 11:40:59 -04:00
|
|
|
/*
|
|
|
|
|
2013-10-14 07:42:28 -04:00
|
|
|
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
|
|
|
|
All rights reserved.
|
2012-08-27 11:40:59 -04:00
|
|
|
|
2013-10-14 07:42:28 -04:00
|
|
|
Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
are permitted provided that the following conditions are met:
|
2012-08-27 11:40:59 -04:00
|
|
|
|
2013-10-14 07:42:28 -04:00
|
|
|
Redistributions of source code must retain the above copyright notice, this list
|
|
|
|
of conditions and the following disclaimer.
|
|
|
|
Redistributions in binary form must reproduce the above copyright notice, this
|
|
|
|
list of conditions and the following disclaimer in the documentation and/or
|
|
|
|
other materials provided with the distribution.
|
2012-08-27 11:40:59 -04:00
|
|
|
|
2013-10-14 07:42:28 -04:00
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
|
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
|
|
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2012-08-27 11:40:59 -04:00
|
|
|
|
2013-10-14 07:42:28 -04:00
|
|
|
*/
|
2012-08-27 11:40:59 -04:00
|
|
|
|
2014-05-07 11:25:35 -04:00
|
|
|
#ifndef RESTRICTION_H
|
|
|
|
#define RESTRICTION_H
|
2012-08-27 11:40:59 -04:00
|
|
|
|
2013-08-14 05:59:46 -04:00
|
|
|
#include "../typedefs.h"
|
2014-01-29 05:31:39 -05:00
|
|
|
|
|
|
|
#include <limits>
|
2012-08-27 11:40:59 -04:00
|
|
|
|
2014-05-07 11:25:35 -04:00
|
|
|
struct TurnRestriction
|
|
|
|
{
|
2014-08-26 11:20:40 -04:00
|
|
|
union WayOrNode
|
|
|
|
{
|
|
|
|
NodeID node;
|
|
|
|
EdgeID way;
|
|
|
|
};
|
|
|
|
WayOrNode via;
|
|
|
|
WayOrNode from;
|
|
|
|
WayOrNode to;
|
|
|
|
|
2014-05-07 11:25:35 -04:00
|
|
|
struct Bits
|
|
|
|
{ // mostly unused
|
2013-08-14 05:59:46 -04:00
|
|
|
Bits()
|
2014-08-26 11:20:40 -04:00
|
|
|
: is_only(false), uses_via_way(false), unused2(false), unused3(false), unused4(false),
|
2014-05-07 11:25:35 -04:00
|
|
|
unused5(false), unused6(false), unused7(false)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-08-26 11:20:40 -04:00
|
|
|
bool is_only : 1;
|
|
|
|
bool uses_via_way : 1;
|
2014-05-07 11:25:35 -04:00
|
|
|
bool unused2 : 1;
|
|
|
|
bool unused3 : 1;
|
|
|
|
bool unused4 : 1;
|
|
|
|
bool unused5 : 1;
|
|
|
|
bool unused6 : 1;
|
|
|
|
bool unused7 : 1;
|
2012-08-27 11:40:59 -04:00
|
|
|
} flags;
|
|
|
|
|
2014-08-26 11:20:40 -04:00
|
|
|
explicit TurnRestriction(NodeID node)
|
2013-08-14 05:59:46 -04:00
|
|
|
{
|
2014-08-26 11:20:40 -04:00
|
|
|
via.node = node;
|
|
|
|
from.node = SPECIAL_NODEID;
|
|
|
|
to.node = SPECIAL_NODEID;
|
2013-08-14 05:59:46 -04:00
|
|
|
}
|
2012-08-27 11:40:59 -04:00
|
|
|
|
2014-08-26 11:20:40 -04:00
|
|
|
explicit TurnRestriction(const bool is_only = false)
|
2014-05-07 11:25:35 -04:00
|
|
|
{
|
2014-08-26 11:20:40 -04:00
|
|
|
via.node = SPECIAL_NODEID;
|
|
|
|
from.node = SPECIAL_NODEID;
|
|
|
|
to.node = SPECIAL_NODEID;
|
|
|
|
flags.is_only = is_only;
|
2012-08-27 11:40:59 -04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-05-07 11:25:35 -04:00
|
|
|
#endif // RESTRICTION_H
|