ad_map_access
LanePointValidInputRange.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>
24 #include "ad/physics/DistanceValidInputRange.hpp"
25 #include "ad/physics/RatioValueValidInputRange.hpp"
26 #include "spdlog/fmt/ostr.h"
27 #include "spdlog/spdlog.h"
28 
39 inline bool withinValidInputRange(::ad::map::match::LanePoint const &input, bool const logErrors = true)
40 {
41  // check for generic member input ranges
42  bool inValidInputRange = true;
43  inValidInputRange = withinValidInputRange(input.paraPoint, logErrors)
44  && withinValidInputRange(input.lateralT, logErrors) && withinValidInputRange(input.laneLength, logErrors)
45  && withinValidInputRange(input.laneWidth, logErrors);
46  if (!inValidInputRange && logErrors)
47  {
48  spdlog::error("withinValidInputRange(::ad::map::match::LanePoint)>> {} has invalid member",
49  input); // LCOV_EXCL_BR_LINE
50  }
51 
52  return inValidInputRange;
53 }
LanePoint.hpp
ParaPointValidInputRange.hpp
withinValidInputRange
bool withinValidInputRange(::ad::map::match::LanePoint const &input, bool const logErrors=true)
check if the given LanePoint is within valid input range
Definition: LanePointValidInputRange.hpp:39
ad::map::match::LanePoint
DataType LanePoint.
Definition: LanePoint.hpp:49
ad::map::match::LanePoint::laneWidth
::ad::physics::Distance laneWidth
Definition: LanePoint.hpp:135
ad::map::match::LanePoint::laneLength
::ad::physics::Distance laneLength
Definition: LanePoint.hpp:130