Loading [MathJax]/extensions/tex2jax.js
Wildmeshing Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AttributeDescription.hpp
Go to the documentation of this file.
1#pragma once
2#include <compare>
3#include <optional>
7
8namespace wmtk::attribute {
10}
11
13
14
15// the minimal information to uniquely extract an attribute handle
17{
18 std::string path;
19 std::optional<uint8_t> dimension;
20 std::optional<attribute::AttributeType> type;
21
22
29
31 const std::string_view& p,
32 const std::optional<uint8_t>& dim,
33 const std::optional<attribute::AttributeType>& t)
34 : path(p)
35 , dimension(dim)
36 , type(t)
37 {}
38
40 const std::string_view& p,
41 const std::optional<PrimitiveType>& pt,
42 const std::optional<attribute::AttributeType>& t)
44 p,
45 pt.has_value() ? std::optional<uint8_t>{wmtk::get_primitive_type_id(pt.value())}
46 : std::optional<uint8_t>{},
47 t)
48 {}
49
50
51 std::optional<PrimitiveType> primitive_type() const;
52
53 auto operator<=>(const AttributeDescription&) const -> std::strong_ordering;
54 auto operator==(const AttributeDescription&) const -> bool;
55
56
58};
59} // namespace wmtk::components::multimesh::utils
#define WMTK_NLOHMANN_JSON_FRIEND_DECLARATION(Type)
#define WMTK_NLOHMANN_JSON_DECLARATION(Type)
constexpr int8_t get_primitive_type_id(PrimitiveType t)
Get a unique integer id corresponding to each primitive type.
AttributeDescription & operator=(AttributeDescription &&)=default
AttributeDescription(const std::string_view &p, const std::optional< PrimitiveType > &pt, const std::optional< attribute::AttributeType > &t)
AttributeDescription(AttributeDescription &&)=default
auto operator==(const AttributeDescription &) const -> bool
AttributeDescription(const AttributeDescription &)=default
auto operator<=>(const AttributeDescription &) const -> std::strong_ordering
AttributeDescription & operator=(const AttributeDescription &)=default
AttributeDescription(const std::string_view &p, const std::optional< uint8_t > &dim, const std::optional< attribute::AttributeType > &t)