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;
8template <typename T>
9class hash;
10namespace attribute {
11template <typename T>
12class TypedAttributeManager;
13template <typename T, typename MeshType, typename AttributeType, 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 TypedAttributeManager<T>;
35 template <typename U, typename MeshType, typename AttributeType, int Dim>
36 friend class Accessor;
37 friend class AttributeManager;
38 friend class wmtk::hash<TypedAttributeHandle<T>>;
41
49
51
52public:
53 using value_type = T;
59
60 template <typename U>
62 {
63 return std::is_same_v<T, U> && m_base_handle == o.m_base_handle &&
65 }
66 bool operator<(const TypedAttributeHandle<T>& o) const;
67 bool is_valid() const { return m_base_handle.is_valid(); }
69 const AttributeHandle& base_handle() const { return m_base_handle; }
70 operator std::string() const;
71};
72} // namespace attribute
73template <typename T>
75} // namespace wmtk
An Accessor that uses tuples for accessing attributes instead of indices.
Definition Accessor.hpp:28
Internal handle representation used by TypedAttributeManager.
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
Contains all attributes of type T for a single mesh.