ad_map_access
generated
include
ad
map
access
PartitionIdValidInputRange.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>
22
#include "
ad/map/access/PartitionId.hpp
"
23
#include "spdlog/fmt/ostr.h"
24
#include "spdlog/spdlog.h"
25
38
inline
bool
withinValidInputRange
(::
ad::map::access::PartitionId
const
&input,
bool
const
logErrors =
true
)
39
{
40
// check for generic numeric limits of the type
41
bool
inValidInputRange = input.
isValid
() && (
std::numeric_limits<::ad::map::access::PartitionId>::lowest
() <= input)
42
&& (input <=
std::numeric_limits<::ad::map::access::PartitionId>::max
());
43
if
(!inValidInputRange && logErrors)
44
{
45
spdlog::error(
"withinValidInputRange(::ad::map::access::PartitionId)>> {} out of numerical limits [{}, {}]"
,
46
input,
47
std::numeric_limits<::ad::map::access::PartitionId>::lowest
(),
48
std::numeric_limits<::ad::map::access::PartitionId>::max
());
// LCOV_EXCL_BR_LINE
49
}
50
return
inValidInputRange;
51
}
std::numeric_limits<::ad::map::access::PartitionId >::lowest
static inline ::ad::map::access::PartitionId lowest()
Definition:
PartitionId.hpp:399
ad::map::access::PartitionId
DataType PartitionId.
Definition:
PartitionId.hpp:66
ad::map::access::PartitionId::isValid
bool isValid() const
Definition:
PartitionId.hpp:312
std::numeric_limits<::ad::map::access::PartitionId >::max
static inline ::ad::map::access::PartitionId max()
Definition:
PartitionId.hpp:406
PartitionId.hpp
withinValidInputRange
bool withinValidInputRange(::ad::map::access::PartitionId const &input, bool const logErrors=true)
check if the given PartitionId is within valid input range
Definition:
PartitionIdValidInputRange.hpp:38
Generated by
1.8.17