44 std::map<std::string, const wmtk::utils::Hashable*>
child_hashables()
const override;
45 std::map<std::string, std::size_t>
child_hashes()
const override;
66 const std::string& name,
76 std::vector<MeshAttributes<T>>&
get();
93 const std::vector<MeshAttributes<T>>&
get()
const;
102 void pop_scope(
bool apply_updates =
true);
108 template <
typename Functor,
typename... Args>
111 template <typename T>
114 template <typename T>
129 template <typename T>
132 if constexpr (std::is_same_v<T, char>) {
135 if constexpr (std::is_same_v<T, int64_t>) {
138 if constexpr (std::is_same_v<T, double>) {
141 if constexpr (std::is_same_v<T, Rational>) {
145 template <
typename T>
148 if constexpr (std::is_same_v<T, char>) {
151 if constexpr (std::is_same_v<T, int64_t>) {
154 if constexpr (std::is_same_v<T, double>) {
157 if constexpr (std::is_same_v<T, Rational>) {
162 template <
typename T>
166 return get<T>()[index];
169 template <
typename T>
173 return get<T>().at(index);
176 template <
typename T>
181 template <
typename T>
186 template <
typename T>
188 const std::string& name,
195 r.
m_base_handle = get<T>(ptype).register_attribute(name,
size, replace, default_value),
201 template <
typename Functor,
typename... Args>
208 return std::invoke(std::forward<Functor>(f), std::forward<Args>(args)...);
210 template <
typename T>
218 template <
typename T>
226 template <
typename T>
232 template <
typename T>
235 const std::string& name)
std::vector< MeshAttributes< double > > m_double_attributes
decltype(auto) parent_scope(Functor &&f, Args &&... args) const
AttributeScopeHandle create_scope(Mesh &m)
std::vector< MeshAttributes< char > > m_char_attributes
void set_capacities(std::vector< int64_t > capacities)
void serialize(MeshWriter &writer) const
void pop_scope(bool apply_updates=true)
void guarantee_at_least_attributes(int64_t dimension, int64_t size)
AttributeManager(int64_t size)
AttributeManager(AttributeManager &&o)=default
int64_t get_attribute_dimension(const TypedAttributeHandle< T > &handle) const
void reserve_attributes_to_fit()
std::map< std::string, const wmtk::utils::Hashable * > child_hashables() const override
bool operator==(const AttributeManager &other) const
AttributeManager & operator=(AttributeManager &&o)=default
void change_to_child_scope() const
void change_to_parent_scope() const
const T & get_attribute_default_value(const TypedAttributeHandle< T > &handle) const
std::vector< int64_t > m_capacities
std::map< std::string, std::size_t > child_hashes() const override
std::vector< MeshAttributes< Rational > > m_rational_attributes
void clear_attributes(const std::vector< attribute::MeshAttributeHandle::HandleVariant > &custom_attributes)
Remove all custom attributes besides the one passed in.
void assert_capacity_valid() const
std::vector< MeshAttributes< T > > & get()
AttributeManager & operator=(const AttributeManager &o)=delete
void rollback_current_scope()
void guarantee_more_attributes(int64_t dimension, int64_t size)
std::vector< MeshAttributeHandle::HandleVariant > get_all_attributes() const
void reserve_more_attributes(int64_t dimension, int64_t size)
std::string get_name(const TypedAttributeHandle< T > &attr) const
AttributeManager(const AttributeManager &o)=delete
TypedAttributeHandle< T > register_attribute(const std::string &name, PrimitiveType type, int64_t size, bool replace, T default_value)
void delete_attribute(const attribute::MeshAttributeHandle::HandleVariant &to_delete)
void set_name(const TypedAttributeHandle< T > &attr, const std::string &name)
void reserve_attributes(int64_t dimension, int64_t size)
std::vector< MeshAttributes< int64_t > > m_long_attributes
This handle is a wrapper for the MeshManager scope funtions.
std::variant< TypedAttributeHandle< char >, TypedAttributeHandle< int64_t >, TypedAttributeHandle< double >, TypedAttributeHandle< wmtk::Rational > > HandleVariant
Contains all attributes of type T for a single mesh.
Handle that represents attributes for some mesh.
wmtk::attribute::AttributeHandle m_base_handle
wmtk::PrimitiveType m_primitive_type
constexpr int8_t get_primitive_type_id(PrimitiveType t)
Get a unique integer id corresponding to each primitive type.