ad_map_access
Classes | Typedefs | Enumerations | Functions
ad::map::restriction Namespace Reference

namespace restriction More...

Classes

struct  Restriction
 DataType Restriction. More...
 
struct  Restrictions
 DataType Restrictions. More...
 
struct  SpeedLimit
 DataType SpeedLimit. More...
 
struct  VehicleDescriptor
 DataType VehicleDescriptor. More...
 

Typedefs

typedef uint16_t PassengerCount
 DataType PassengerCount.
 
typedef std::vector<::ad::map::restriction::RestrictionRestrictionList
 DataType RestrictionList.
 
typedef std::vector<::ad::map::restriction::RoadUserTypeRoadUserTypeList
 DataType RoadUserTypeList.
 
typedef std::vector<::ad::map::restriction::SpeedLimitSpeedLimitList
 DataType SpeedLimitList.
 

Enumerations

enum  RoadUserType : int32_t {
  RoadUserType::INVALID = 0, RoadUserType::UNKNOWN = 1, RoadUserType::CAR = 2, RoadUserType::BUS = 3,
  RoadUserType::TRUCK = 4, RoadUserType::PEDESTRIAN = 5, RoadUserType::MOTORBIKE = 6, RoadUserType::BICYCLE = 7,
  RoadUserType::CAR_ELECTRIC = 8, RoadUserType::CAR_HYBRID = 9, RoadUserType::CAR_PETROL = 10, RoadUserType::CAR_DIESEL = 11
}
 DataType RoadUserType. More...
 

Functions

std::ostream & operator<< (std::ostream &os, Restriction const &_value)
 standard ostream operator More...
 
std::ostream & operator<< (std::ostream &os, Restrictions const &_value)
 standard ostream operator More...
 
std::ostream & operator<< (std::ostream &os, RoadUserType const &value)
 standard ostream operator More...
 
std::ostream & operator<< (std::ostream &os, SpeedLimit const &_value)
 standard ostream operator More...
 
std::ostream & operator<< (std::ostream &os, VehicleDescriptor const &_value)
 standard ostream operator More...
 
bool areAttributesEqual (SpeedLimit const &left, SpeedLimit const &right)
 Compare two speed limit attributes for equality. More...
 
template<typename RangeAttribute >
bool combineRangeAttributes (RangeAttribute &left, RangeAttribute const &right)
 Tries to combine two RangeAttributes into one. More...
 
template<typename RangeAttribute >
bool doesRangeAttributeOverlap (std::vector< RangeAttribute > const &attributeList, RangeAttribute const &attribute)
 Checks if another attribute overlaps any existing element. More...
 
template<typename RangeAttribute >
void insertRangeAttribute (std::vector< RangeAttribute > &attributeList, RangeAttribute const &attribute)
 Insert attribute and preserve order. More...
 
template<typename RangeAttribute >
void optimizeRangeAttributeList (std::vector< RangeAttribute > &attributeList)
 Combines multiple elements into one - if possible.
 
bool isValid (VehicleDescriptor const &descriptor, bool const logErrors=true)
 checks if the given VehicleDescriptor is valid More...
 
bool isValid (Restriction const &restriction, bool const logErrors=true)
 checks if the given Restriction is valid More...
 
bool isValid (Restrictions const &restrictions, bool const logErrors=true)
 checks if the given Restrictions is valid More...
 
bool isAccessOk (Restriction const &restriction, VehicleDescriptor const &vehicle)
 Checks if restriction allows vehicle at this object. More...
 
bool isAccessOk (Restrictions const &restrictions, VehicleDescriptor const &vehicle)
 Checks if vehicle fits the restriction criteria. More...
 
PassengerCount getHOV (Restrictions const &restrictions)
 

Detailed Description

namespace restriction

Handling of traffic restrictions

Enumeration Type Documentation

◆ RoadUserType

enum ad::map::restriction::RoadUserType : int32_t
strong

DataType RoadUserType.

Enumerator
INVALID 

INVALID

UNKNOWN 

UNKNOWN

CAR 

CAR

BUS 

BUS

TRUCK 

TRUCK

PEDESTRIAN 

PEDESTRIAN

MOTORBIKE 

MOTORBIKE

BICYCLE 

BICYCLE

CAR_ELECTRIC 

CAR_ELECTRIC

CAR_HYBRID 

CAR_HYBRID

CAR_PETROL 

CAR_PETROL

CAR_DIESEL 

CAR_DIESEL

Function Documentation

◆ areAttributesEqual()

bool ad::map::restriction::areAttributesEqual ( SpeedLimit const &  left,
SpeedLimit const &  right 
)
inline

Compare two speed limit attributes for equality.

Parameters
[in]leftSpeedLimit object.
[in]rightSpeedLimit object.
Returns
true if the attributes of the left SpeedLimit and right SpeedLimit can be considered to be equal.

◆ combineRangeAttributes()

template<typename RangeAttribute >
bool ad::map::restriction::combineRangeAttributes ( RangeAttribute &  left,
RangeAttribute const &  right 
)

Tries to combine two RangeAttributes into one.

Parameters
[in]leftRangeAttributes object.
[in]rightRangeAttributes object.
Returns
true if left RangeAttributes is extended with right one.

◆ doesRangeAttributeOverlap()

template<typename RangeAttribute >
bool ad::map::restriction::doesRangeAttributeOverlap ( std::vector< RangeAttribute > const &  attributeList,
RangeAttribute const &  attribute 
)

Checks if another attribute overlaps any existing element.

Parameters
[in]attributeListattribute list to check for overlap
[in]attributeanother attribute.
Returns
true if another element overlaps any existing element in the attributeList

◆ getHOV()

PassengerCount ad::map::restriction::getHOV ( Restrictions const &  restrictions)
Returns
Maximum of HOV restriction found.

◆ insertRangeAttribute()

template<typename RangeAttribute >
void ad::map::restriction::insertRangeAttribute ( std::vector< RangeAttribute > &  attributeList,
RangeAttribute const &  attribute 
)

Insert attribute and preserve order.

Parameters
[in]attributeListattribute list
[in]attributeattribute to insert

◆ isAccessOk() [1/2]

bool ad::map::restriction::isAccessOk ( Restriction const &  restriction,
VehicleDescriptor const &  vehicle 
)

Checks if restriction allows vehicle at this object.

Parameters
[in]restrictiondata.
[in]vehicleVehicle data.

◆ isAccessOk() [2/2]

bool ad::map::restriction::isAccessOk ( Restrictions const &  restrictions,
VehicleDescriptor const &  vehicle 
)

Checks if vehicle fits the restriction criteria.

Parameters
vehicleDescription of the vehicle.
Returns
true of vehicle fits the restrictions criteria.

◆ isValid() [1/3]

bool ad::map::restriction::isValid ( Restriction const &  restriction,
bool const  logErrors = true 
)
inline

checks if the given Restriction is valid

The restriction is valid if it's within valid input range.

◆ isValid() [2/3]

bool ad::map::restriction::isValid ( Restrictions const &  restrictions,
bool const  logErrors = true 
)
inline

checks if the given Restrictions is valid

The restrictions is valid if it's within valid input range.

◆ isValid() [3/3]

bool ad::map::restriction::isValid ( VehicleDescriptor const &  descriptor,
bool const  logErrors = true 
)
inline

checks if the given VehicleDescriptor is valid

The descriptor is valid if it's within valid input range.

◆ operator<<() [1/5]

std::ostream& ad::map::restriction::operator<< ( std::ostream &  os,
Restriction const &  _value 
)
inline

standard ostream operator

Parameters
[in]osThe output stream to write to
[in]_valueRestriction value
Returns
The stream object.

◆ operator<<() [2/5]

std::ostream& ad::map::restriction::operator<< ( std::ostream &  os,
Restrictions const &  _value 
)
inline

standard ostream operator

Parameters
[in]osThe output stream to write to
[in]_valueRestrictions value
Returns
The stream object.

◆ operator<<() [3/5]

std::ostream& ad::map::restriction::operator<< ( std::ostream &  os,
RoadUserType const &  value 
)
inline

standard ostream operator

Parameters
[in]osThe output stream to write to
[in]valueRoadUserType value
Returns
The stream object.

◆ operator<<() [4/5]

std::ostream& ad::map::restriction::operator<< ( std::ostream &  os,
SpeedLimit const &  _value 
)
inline

standard ostream operator

Parameters
[in]osThe output stream to write to
[in]_valueSpeedLimit value
Returns
The stream object.

◆ operator<<() [5/5]

std::ostream& ad::map::restriction::operator<< ( std::ostream &  os,
VehicleDescriptor const &  _value 
)
inline

standard ostream operator

Parameters
[in]osThe output stream to write to
[in]_valueVehicleDescriptor value
Returns
The stream object.