2 #if defined(MTAO_DEBUG_MESH_COMP)
3 #include <spdlog/spdlog.h>
40 variant<char, int64_t, double, wmtk::Rational, std::tuple<char, wmtk::Rational, double>>;
44 template <HeldType Type>
47 template <HeldType Type>
77 #if defined(MTAO_DEBUG_MESH_COMP)
79 [&](
const auto& h,
const auto& oh) {
102 template <
typename T>
107 template <
typename T>
116 template <typename T>
151 std::string
name()
const;
159 template <
typename T>
163 return as_from_held_type<held_type_from_primitive<T>()>();
167 template <
typename T>
170 return holds_from_held_type<held_type_from_primitive<T>()>();
174 template <
typename T>
177 constexpr
static bool value =
false;
179 template <
typename T>
186 template <
typename T>
195 [](
const auto& h) noexcept ->
bool {
200 template <MeshAttributeHandle::HeldType Type>
203 return std::get<held_handle_type<Type>>(
m_handle);
206 template <MeshAttributeHandle::HeldType Type>
209 return std::holds_alternative<held_handle_type<Type>>(
m_handle);
212 template <
typename T>
215 return held_type_from_handle<TypedAttributeHandle<T>>();
217 template <
typename T>
221 return HeldType::Char;
223 return HeldType::Double;
225 return HeldType::Int64;
227 return HeldType::Rational;
234 return HeldType::Char;
240 return std::visit([](
const auto& h) {
return h.primitive_type(); },
m_handle);
242 template <
typename T>
245 return std::get<T>(
m_handle).primitive_type();
typename held_handle_type< Type >::Type held_primitive_type
const HandleVariant & handle() const
HeldType held_type() const
bool holds_basic_type() const
int64_t dimension() const
std::variant< TypedAttributeHandle< char >, TypedAttributeHandle< int64_t >, TypedAttributeHandle< double >, TypedAttributeHandle< wmtk::Rational > > HandleVariant
constexpr static HeldType held_type_from_handle()
PrimitiveType primitive_typeT() const
MeshAttributeHandle(MeshAttributeHandle &&o)=default
std::variant_alternative_t< size_t(Type), HandleVariant > held_handle_type
bool is_same_mesh(const Mesh &) const
constexpr static bool handle_type_is_basic()
auto as() const -> const held_handle_type< held_type_from_primitive< T >()> &
constexpr static HeldType held_type_from_primitive()
MeshAttributeHandle()=default
std::variant< char, int64_t, double, wmtk::Rational, std::tuple< char, wmtk::Rational, double > > ValueVariant
auto as_from_held_type() const -> const held_handle_type< Type > &
PrimitiveType primitive_type() const
MeshAttributeHandle(const MeshAttributeHandle &o)=default
MeshAttributeHandle & operator=(const MeshAttributeHandle &o)=default
bool operator==(const MeshAttributeHandle &o) const
bool holds_from_held_type() const
MeshAttributeHandle & operator=(MeshAttributeHandle &&o)=default
constexpr static bool value