Wildmeshing Toolkit
attribute_ambiguous_error.cpp
Go to the documentation of this file.
1
2
#include "
attribute_ambiguous_error.hpp
"
3
#include <fmt/format.h>
4
#include <fmt/ranges.h>
5
#include <algorithm>
6
#include <iterator>
7
#include "
named_error_text.hpp
"
8
namespace
wmtk::components::multimesh::utils::detail
{
9
10
std::string
attribute_ambiguous_error::make_message
(
11
const
AttributeDescription
& ad,
12
const
std::vector<AttributeDescription>& possibilities)
13
{
14
std::vector<std::string> names;
15
16
std::string (*maker)(
const
AttributeDescription
&) =
make_named_error_string
;
17
std::transform(possibilities.begin(), possibilities.end(), std::back_inserter(names), maker);
18
return
fmt::format(
19
"Multiple options for an attribute {} found: [{}]"
,
20
make_named_error_string
(ad),
21
fmt::join(names,
","
));
22
}
23
}
// namespace wmtk::components::multimesh::utils::detail
attribute_ambiguous_error.hpp
wmtk::components::multimesh::utils::detail::attribute_ambiguous_error::make_message
static std::string make_message(const AttributeDescription &description, const std::vector< AttributeDescription > &possibilities)
Definition:
attribute_ambiguous_error.cpp:10
named_error_text.hpp
wmtk::components::multimesh::utils::detail
Definition:
attribute_ambiguous_error.cpp:8
wmtk::components::multimesh::utils::detail::make_named_error_string
std::string make_named_error_string(const std::string_view &path, const std::optional< uint8_t > &dimension, const std::optional< attribute::AttributeType > &type)
Definition:
named_error_text.cpp:10
wmtk::components::multimesh::utils::AttributeDescription
Definition:
AttributeDescription.hpp:17
components
multimesh
src
wmtk
components
multimesh
utils
detail
attribute_ambiguous_error.cpp
Generated by
1.9.1