Wildmeshing Toolkit
Loading...
Searching...
No Matches
TypedAttributeHandle.hpp
Go to the documentation of this file.
1
2#pragma once
4#include "AttributeHandle.hpp"
5namespace wmtk {
6class Mesh;
7class Rational;
8namespace attribute {
9template <typename T>
10class MeshAttributes;
11template <typename T, int Dim>
12class AccessorBase;
13template <typename T, typename MeshType, int Dim>
14class Accessor;
15
16class AttributeManager;
17
18class MeshAttributeHandle;
19
26template <typename T>
28{
29public:
30 using Type = T;
31
32private:
33 friend class wmtk::Mesh;
34 friend class MeshAttributes<T>;
35 template <typename U, int Dim>
36 friend class AccessorBase;
37 template <typename U, typename MeshType, int Dim>
38 friend class Accessor;
39 friend class AttributeManager;
40 friend class wmtk::hash<TypedAttributeHandle<T>>;
43
51
53
54public:
55 using value_type = T;
61
62 template <typename U>
64 {
65 return std::is_same_v<T, U> && m_base_handle == o.m_base_handle &&
67 }
68 bool operator<(const TypedAttributeHandle<T>& o) const;
69 bool is_valid() const { return m_base_handle.is_valid(); }
71 const AttributeHandle& base_handle() const { return m_base_handle; }
72 operator std::string() const;
73};
74} // namespace attribute
75template <typename T>
77} // namespace wmtk
A CachingAccessor that uses tuples for accessing attributes instead of indices.
Definition Accessor.hpp:28
Internal handle representation used by MeshAttributes.
Contains all attributes of type T for a single mesh.
Handle that represents attributes for some mesh.
bool operator==(const TypedAttributeHandle< U > &o) const
TypedAttributeHandle & operator=(const TypedAttributeHandle &)=default
bool operator<(const TypedAttributeHandle< T > &o) const
TypedAttributeHandle(AttributeHandle ah, PrimitiveType pt)
TypedAttributeHandle(TypedAttributeHandle &&)=default
TypedAttributeHandle(int64_t index, PrimitiveType pt)
TypedAttributeHandle(const TypedAttributeHandle &)=default
TypedAttributeHandle & operator=(TypedAttributeHandle &&)=default
wmtk::attribute::AttributeHandle m_base_handle
const AttributeHandle & base_handle() const