ad_map_access
ContactLaneValidInputRange.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>
28 #include "spdlog/fmt/ostr.h"
29 #include "spdlog/spdlog.h"
30 
41 inline bool withinValidInputRange(::ad::map::lane::ContactLane const &input, bool const logErrors = true)
42 {
43  // check for generic member input ranges
44  bool inValidInputRange = true;
45  inValidInputRange = withinValidInputRange(input.toLane, logErrors) && withinValidInputRange(input.location, logErrors)
46  && withinValidInputRange(input.types, logErrors) && withinValidInputRange(input.restrictions, logErrors)
47  && withinValidInputRange(input.trafficLightId, logErrors);
48  if (!inValidInputRange && logErrors)
49  {
50  spdlog::error("withinValidInputRange(::ad::map::lane::ContactLane)>> {} has invalid member",
51  input); // LCOV_EXCL_BR_LINE
52  }
53 
54  return inValidInputRange;
55 }
ad::map::lane::ContactLane::toLane
::ad::map::lane::LaneId toLane
Definition: ContactLane.hpp:125
ContactTypeListValidInputRange.hpp
ad::map::lane::ContactLane::trafficLightId
::ad::map::landmark::LandmarkId trafficLightId
Definition: ContactLane.hpp:146
ContactLocationValidInputRange.hpp
ad::map::lane::ContactLane::restrictions
::ad::map::restriction::Restrictions restrictions
Definition: ContactLane.hpp:140
withinValidInputRange
bool withinValidInputRange(::ad::map::lane::ContactLane const &input, bool const logErrors=true)
check if the given ContactLane is within valid input range
Definition: ContactLaneValidInputRange.hpp:41
ContactLane.hpp
ad::map::lane::ContactLane
DataType ContactLane.
Definition: ContactLane.hpp:47
RestrictionsValidInputRange.hpp
ad::map::lane::ContactLane::types
::ad::map::lane::ContactTypeList types
Definition: ContactLane.hpp:135
LandmarkIdValidInputRange.hpp
ad::map::lane::ContactLane::location
::ad::map::lane::ContactLocation location
Definition: ContactLane.hpp:130
LaneIdValidInputRange.hpp