Wildmeshing Toolkit
TypedAttributeHandle.cpp
Go to the documentation of this file.
1 #include <fmt/format.h>
2 #include <cassert>
3 #include <tuple>
6 
7 namespace wmtk::attribute {
8 
9 template <typename T>
11 {
12  return fmt::format(
13  "{}:{}",
14  m_base_handle.index,
15  wmtk::primitive_type_name(m_primitive_type)
16 
17  );
18 }
19 
20 template <typename T>
22 {
23  return std::tie(m_base_handle, m_primitive_type) <
24  std::tie(o.m_base_handle, o.m_primitive_type);
25 }
26 template <typename T>
28  : TypedAttributeHandle(h.as<T>())
29 {
30  assert(h.holds<T>());
31 }
32 
33 template class TypedAttributeHandle<double>;
34 template class TypedAttributeHandle<int64_t>;
35 template class TypedAttributeHandle<Rational>;
36 template class TypedAttributeHandle<char>;
37 } // namespace wmtk::attribute
Handle that represents attributes for some mesh.
bool operator<(const TypedAttributeHandle< T > &o) const
wmtk::attribute::AttributeHandle m_base_handle
std::string_view primitive_type_name(PrimitiveType t)