ad_rss
ObjectIdVectorValidInputRange.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: LGPL-2.1-only
7  *
8  * ----------------- END LICENSE BLOCK -----------------------------------
9  */
10 
18 #pragma once
19 
20 #include <cmath>
21 #include <limits>
23 #include "spdlog/fmt/ostr.h"
24 #include "spdlog/spdlog.h"
25 
38 inline bool withinValidInputRange(::ad::rss::world::ObjectIdVector const &input, bool const logErrors = true)
39 {
40  bool inValidInputRange = (input.size() <= std::size_t(1000));
41  if (!inValidInputRange && logErrors)
42  {
43  spdlog::error("withinValidInputRange(::ad::rss::world::ObjectIdVector)>> {}, invalid input range",
44  input); // LCOV_EXCL_BR_LINE
45  }
46 
47  return inValidInputRange;
48 }
ad::rss::world::ObjectIdVector
std::vector<::ad::rss::world::ObjectId > ObjectIdVector
DataType ObjectIdVector.
Definition: ObjectIdVector.hpp:42
ObjectIdVector.hpp
withinValidInputRange
bool withinValidInputRange(::ad::rss::world::ObjectIdVector const &input, bool const logErrors=true)
check if the given ObjectIdVector is within valid input range
Definition: ObjectIdVectorValidInputRange.hpp:38