ad_map_access
MapEntryValidInputRange.hpp
Go to the documentation of this file.
1 /*
2  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3  *
4  * Copyright (C) 2018-2020 Intel Corporation
5  *
6  * SPDX-License-Identifier: MIT
7  *
8  * ----------------- END LICENSE BLOCK -----------------------------------
9  */
10 
18 #pragma once
19 
20 #include <cmath>
21 #include <limits>
25 #include "ad/physics/DistanceValidInputRange.hpp"
26 #include "spdlog/fmt/ostr.h"
27 #include "spdlog/spdlog.h"
28 
39 inline bool withinValidInputRange(::ad::map::config::MapEntry const &input, bool const logErrors = true)
40 {
41  // check for generic member input ranges
42  bool inValidInputRange = true;
43  inValidInputRange = withinValidInputRange(input.openDriveOverlapMargin, logErrors)
45  && withinValidInputRange(input.openDriveDefaultTrafficLightType, logErrors);
46  if (!inValidInputRange && logErrors)
47  {
48  spdlog::error("withinValidInputRange(::ad::map::config::MapEntry)>> {} has invalid member",
49  input); // LCOV_EXCL_BR_LINE
50  }
51 
52  return inValidInputRange;
53 }
withinValidInputRange
bool withinValidInputRange(::ad::map::config::MapEntry const &input, bool const logErrors=true)
check if the given MapEntry is within valid input range
Definition: MapEntryValidInputRange.hpp:39
IntersectionTypeValidInputRange.hpp
MapEntry.hpp
ad::map::config::MapEntry::openDriveDefaultIntersectionType
::ad::map::intersection::IntersectionType openDriveDefaultIntersectionType
Definition: MapEntry.hpp:137
ad::map::config::MapEntry::openDriveOverlapMargin
::ad::physics::Distance openDriveOverlapMargin
Definition: MapEntry.hpp:132
ad::map::config::MapEntry
DataType MapEntry.
Definition: MapEntry.hpp:48
TrafficLightTypeValidInputRange.hpp