Wildmeshing Toolkit
Loading...
Searching...
No Matches
AttributeType.hpp
Go to the documentation of this file.
1#pragma once
3
4namespace wmtk::attribute {
5enum class AttributeType { Char = 0, Int64 = 1, Double = 2, Rational = 3 };
6
7template <AttributeType AT>
11template <>
16template <>
21template <>
23{
24 using type = int64_t;
25};
26template <>
31
32template <AttributeType AT>
34
35template <typename T>
37{
38 if constexpr (std::is_same_v<T, char>) {
40 } else if constexpr (std::is_same_v<T, double>) {
42 } else if constexpr (std::is_same_v<T, int64_t>) {
44 } else if constexpr (std::is_same_v<T, wmtk::Rational>) {
46 }
47 // If a compiler complains about the potentiality of no return value then a type accepted by the
48 // HAndleVariant is not being represented properly. If the comppiler is simply unhappy to not
49 // see a return then we should hack a default return value in an else statement with an asswert
50 // :(.
51 else {
52 static_assert(std::is_same_v<T, char>);
54 }
55}
56} // namespace wmtk::attribute
typename type_from_attribute_type_enum< AT >::type type_from_attribute_type_enum_t
constexpr auto attribute_type_enum_from_type() -> AttributeType