Wildmeshing Toolkit
|
#include <AttributeManager.hpp>
Public Member Functions | |
AttributeManager (int64_t size) | |
~AttributeManager () | |
AttributeManager (const AttributeManager &o)=delete | |
AttributeManager (AttributeManager &&o)=default | |
AttributeManager & | operator= (const AttributeManager &o)=delete |
AttributeManager & | operator= (AttributeManager &&o)=default |
int64_t | size () const |
std::map< std::string, const wmtk::utils::Hashable * > | child_hashables () const override |
std::map< std::string, std::size_t > | child_hashes () const override |
AttributeScopeHandle | create_scope (Mesh &m) |
void | serialize (MeshWriter &writer) const |
void | reserve_to_fit () |
void | reserve_attributes_to_fit () |
void | reserve_attributes (int64_t dimension, int64_t size) |
void | set_capacities (std::vector< int64_t > capacities) |
void | reserve_more_attributes (int64_t dimension, int64_t size) |
void | reserve_more_attributes (const std::vector< int64_t > &more_capacities) |
void | guarantee_more_attributes (int64_t dimension, int64_t size) |
void | guarantee_more_attributes (const std::vector< int64_t > &more_capacities) |
void | guarantee_at_least_attributes (int64_t dimension, int64_t size) |
void | guarantee_at_least_attributes (const std::vector< int64_t > &at_least_capacities) |
bool | operator== (const AttributeManager &other) const |
void | assert_capacity_valid () const |
template<typename T > | |
TypedAttributeHandle< T > | register_attribute (const std::string &name, PrimitiveType type, int64_t size, bool replace, T default_value) |
std::vector< MeshAttributeHandle::HandleVariant > | get_all_attributes () const |
template<typename T > | |
std::vector< MeshAttributes< T > > & | get () |
template<typename T > | |
MeshAttributes< T > & | get (PrimitiveType ptype) |
template<typename T > | |
MeshAttributes< T > & | get (const TypedAttributeHandle< T > &handle) |
template<typename T > | |
std::string | get_name (const TypedAttributeHandle< T > &attr) const |
std::string | get_name (const attribute::MeshAttributeHandle::HandleVariant &attr) const |
template<typename T > | |
void | set_name (const TypedAttributeHandle< T > &attr, const std::string &name) |
template<typename T > | |
const std::vector< MeshAttributes< T > > & | get () const |
template<typename T > | |
const MeshAttributes< T > & | get (PrimitiveType ptype) const |
template<typename T > | |
const MeshAttributes< T > & | get (const TypedAttributeHandle< T > &handle) const |
void | push_scope () |
void | pop_scope (bool apply_updates=true) |
void | rollback_current_scope () |
void | flush_all_scopes () |
void | change_to_parent_scope () const |
void | change_to_child_scope () const |
template<typename Functor , typename... Args> | |
decltype(auto) | parent_scope (Functor &&f, Args &&... args) const |
template<typename T > | |
int64_t | get_attribute_dimension (const TypedAttributeHandle< T > &handle) const |
template<typename T > | |
const T & | get_attribute_default_value (const TypedAttributeHandle< T > &handle) const |
void | clear_attributes (const std::vector< attribute::MeshAttributeHandle::HandleVariant > &custom_attributes) |
Remove all custom attributes besides the one passed in. More... | |
void | delete_attribute (const attribute::MeshAttributeHandle::HandleVariant &to_delete) |
Public Member Functions inherited from wmtk::utils::MerkleTreeInteriorNode | |
std::map< std::string, std::size_t > | child_hashes () const override |
Public Member Functions inherited from wmtk::utils::Hashable | |
Hashable () | |
Hashable (const Hashable &) | |
Hashable (Hashable &&) | |
Hashable & | operator= (const Hashable &) |
Hashable & | operator= (Hashable &&) |
virtual | ~Hashable () |
virtual std::size_t | hash () const |
Public Attributes | |
std::vector< MeshAttributes< char > > | m_char_attributes |
std::vector< MeshAttributes< int64_t > > | m_long_attributes |
std::vector< MeshAttributes< double > > | m_double_attributes |
std::vector< MeshAttributes< Rational > > | m_rational_attributes |
std::vector< int64_t > | m_capacities |
Friends | |
class | internal::CheckpointScope |
Definition at line 16 of file AttributeManager.hpp.
wmtk::attribute::AttributeManager::AttributeManager | ( | int64_t | size | ) |
Definition at line 7 of file AttributeManager.cpp.
|
default |
|
delete |
|
default |
void wmtk::attribute::AttributeManager::assert_capacity_valid | ( | ) | const |
Definition at line 133 of file AttributeManager.cpp.
References m_capacities, m_char_attributes, m_double_attributes, m_long_attributes, and m_rational_attributes.
Referenced by wmtk::Mesh::assert_capacity_valid().
void wmtk::attribute::AttributeManager::change_to_child_scope | ( | ) | const |
Definition at line 255 of file AttributeManager.cpp.
References m_char_attributes, m_double_attributes, m_long_attributes, and m_rational_attributes.
Referenced by wmtk::attribute::internal::CheckpointScope::~CheckpointScope().
void wmtk::attribute::AttributeManager::change_to_parent_scope | ( | ) | const |
Definition at line 239 of file AttributeManager.cpp.
References m_char_attributes, m_double_attributes, m_long_attributes, and m_rational_attributes.
Referenced by wmtk::attribute::internal::CheckpointScope::CheckpointScope().
|
overridevirtual |
Implements wmtk::utils::MerkleTreeInteriorNode.
Definition at line 17 of file AttributeManager.cpp.
References m_char_attributes, m_double_attributes, m_long_attributes, and m_rational_attributes.
|
overridevirtual |
Reimplemented from wmtk::utils::Hashable.
Definition at line 37 of file AttributeManager.cpp.
References wmtk::utils::MerkleTreeInteriorNode::child_hashes(), and m_capacities.
void wmtk::attribute::AttributeManager::clear_attributes | ( | const std::vector< attribute::MeshAttributeHandle::HandleVariant > & | custom_attributes | ) |
Remove all custom attributes besides the one passed in.
keep_attributes | Vector of attributes that should not be removed. |
Definition at line 323 of file AttributeManager.cpp.
References wmtk::get_primitive_type_from_id(), and wmtk::get_primitive_type_id().
Referenced by wmtk::Mesh::clear_attributes().
AttributeScopeHandle wmtk::attribute::AttributeManager::create_scope | ( | Mesh & | m | ) |
Definition at line 174 of file AttributeManager.cpp.
Referenced by wmtk::Mesh::create_single_mesh_scope().
void wmtk::attribute::AttributeManager::delete_attribute | ( | const attribute::MeshAttributeHandle::HandleVariant & | to_delete | ) |
Definition at line 366 of file AttributeManager.cpp.
Referenced by wmtk::Mesh::delete_attribute().
void wmtk::attribute::AttributeManager::flush_all_scopes | ( | ) |
|
inline |
Definition at line 146 of file AttributeManager.hpp.
References m_char_attributes, m_double_attributes, m_long_attributes, and m_rational_attributes.
Referenced by wmtk::multimesh::MultiMeshManager::deregister_child_mesh(), get_attribute_default_value(), get_attribute_dimension(), wmtk::Mesh::get_attribute_handle_typed(), get_name(), wmtk::Mesh::has_attribute(), and set_name().
|
inline |
Definition at line 130 of file AttributeManager.hpp.
References m_char_attributes, m_double_attributes, m_long_attributes, and m_rational_attributes.
|
inline |
Definition at line 177 of file AttributeManager.hpp.
References wmtk::attribute::TypedAttributeHandle< T >::m_primitive_type.
|
inline |
Definition at line 182 of file AttributeManager.hpp.
References wmtk::attribute::TypedAttributeHandle< T >::m_primitive_type.
|
inline |
Definition at line 170 of file AttributeManager.hpp.
References wmtk::get_primitive_type_id().
|
inline |
Definition at line 163 of file AttributeManager.hpp.
References wmtk::get_primitive_type_id().
std::vector< MeshAttributeHandle::HandleVariant > wmtk::attribute::AttributeManager::get_all_attributes | ( | ) | const |
Definition at line 271 of file AttributeManager.cpp.
References wmtk::get_primitive_type_from_id().
Referenced by wmtk::Mesh::custom_attributes().
|
inline |
Definition at line 219 of file AttributeManager.hpp.
References get(), wmtk::attribute::TypedAttributeHandle< T >::is_valid(), and wmtk::attribute::TypedAttributeHandle< T >::m_base_handle.
Referenced by wmtk::Mesh::get_attribute_default_value().
|
inline |
Definition at line 211 of file AttributeManager.hpp.
References get(), wmtk::attribute::TypedAttributeHandle< T >::is_valid(), and wmtk::attribute::TypedAttributeHandle< T >::m_base_handle.
Referenced by wmtk::Mesh::get_attribute_dimension().
std::string wmtk::attribute::AttributeManager::get_name | ( | const attribute::MeshAttributeHandle::HandleVariant & | attr | ) | const |
Definition at line 179 of file AttributeManager.cpp.
References get_name().
|
inline |
Definition at line 227 of file AttributeManager.hpp.
References get(), and wmtk::attribute::TypedAttributeHandle< T >::m_base_handle.
Referenced by wmtk::Mesh::get_attribute_name(), and get_name().
void wmtk::attribute::AttributeManager::guarantee_at_least_attributes | ( | const std::vector< int64_t > & | at_least_capacities | ) |
Definition at line 106 of file AttributeManager.cpp.
References guarantee_at_least_attributes(), and size().
void wmtk::attribute::AttributeManager::guarantee_at_least_attributes | ( | int64_t | dimension, |
int64_t | size | ||
) |
Definition at line 95 of file AttributeManager.cpp.
References m_char_attributes, m_double_attributes, m_long_attributes, m_rational_attributes, and size().
Referenced by guarantee_at_least_attributes(), wmtk::Mesh::guarantee_at_least_attributes(), and guarantee_more_attributes().
void wmtk::attribute::AttributeManager::guarantee_more_attributes | ( | const std::vector< int64_t > & | more_capacities | ) |
Definition at line 120 of file AttributeManager.cpp.
References guarantee_more_attributes(), and size().
void wmtk::attribute::AttributeManager::guarantee_more_attributes | ( | int64_t | dimension, |
int64_t | size | ||
) |
Definition at line 114 of file AttributeManager.cpp.
References guarantee_at_least_attributes(), m_capacities, and size().
Referenced by guarantee_more_attributes(), and wmtk::Mesh::guarantee_more_attributes().
|
default |
|
delete |
bool wmtk::attribute::AttributeManager::operator== | ( | const AttributeManager & | other | ) | const |
Definition at line 166 of file AttributeManager.cpp.
References m_capacities, m_char_attributes, m_double_attributes, m_long_attributes, and m_rational_attributes.
decltype(auto) wmtk::attribute::AttributeManager::parent_scope | ( | Functor && | f, |
Args &&... | args | ||
) | const |
void wmtk::attribute::AttributeManager::pop_scope | ( | bool | apply_updates = true | ) |
Definition at line 207 of file AttributeManager.cpp.
References m_char_attributes, m_double_attributes, m_long_attributes, and m_rational_attributes.
Referenced by wmtk::attribute::AttributeScopeHandle::~AttributeScopeHandle().
void wmtk::attribute::AttributeManager::push_scope | ( | ) |
Definition at line 192 of file AttributeManager.cpp.
References m_char_attributes, m_double_attributes, m_long_attributes, and m_rational_attributes.
Referenced by wmtk::attribute::AttributeScopeHandle::AttributeScopeHandle().
|
inline |
Definition at line 187 of file AttributeManager.hpp.
References wmtk::attribute::TypedAttributeHandle< T >::m_base_handle, wmtk::attribute::TypedAttributeHandle< T >::m_primitive_type, and size().
Referenced by wmtk::Mesh::register_attribute_typed().
void wmtk::attribute::AttributeManager::reserve_attributes | ( | int64_t | dimension, |
int64_t | size | ||
) |
Definition at line 72 of file AttributeManager.cpp.
References m_char_attributes, m_double_attributes, m_long_attributes, and m_rational_attributes.
Referenced by wmtk::Mesh::reserve_attributes(), reserve_attributes_to_fit(), and reserve_to_fit().
void wmtk::attribute::AttributeManager::reserve_attributes_to_fit | ( | ) |
Definition at line 154 of file AttributeManager.cpp.
References m_capacities, reserve_attributes(), and size().
Referenced by set_capacities().
void wmtk::attribute::AttributeManager::reserve_more_attributes | ( | const std::vector< int64_t > & | more_capacities | ) |
Definition at line 88 of file AttributeManager.cpp.
References reserve_more_attributes(), and size().
void wmtk::attribute::AttributeManager::reserve_more_attributes | ( | int64_t | dimension, |
int64_t | size | ||
) |
Definition at line 80 of file AttributeManager.cpp.
References m_char_attributes, m_double_attributes, m_long_attributes, m_rational_attributes, and size().
Referenced by reserve_more_attributes(), and wmtk::Mesh::reserve_more_attributes().
void wmtk::attribute::AttributeManager::reserve_to_fit | ( | ) |
Definition at line 65 of file AttributeManager.cpp.
References m_capacities, and reserve_attributes().
Referenced by wmtk::Mesh::reserve_attributes_to_fit().
void wmtk::attribute::AttributeManager::rollback_current_scope | ( | ) |
Definition at line 223 of file AttributeManager.cpp.
References m_char_attributes, m_double_attributes, m_long_attributes, and m_rational_attributes.
Referenced by wmtk::attribute::AttributeScopeHandle::mark_failed().
void wmtk::attribute::AttributeManager::serialize | ( | MeshWriter & | writer | ) | const |
Definition at line 52 of file AttributeManager.cpp.
References m_capacities, m_char_attributes, m_double_attributes, m_long_attributes, m_rational_attributes, wmtk::MeshWriter::write(), and wmtk::MeshWriter::write_capacities().
Referenced by wmtk::Mesh::serialize().
void wmtk::attribute::AttributeManager::set_capacities | ( | std::vector< int64_t > | capacities | ) |
Definition at line 127 of file AttributeManager.cpp.
References m_capacities, and reserve_attributes_to_fit().
Referenced by wmtk::Mesh::set_capacities().
|
inline |
Definition at line 233 of file AttributeManager.hpp.
References get(), and wmtk::attribute::TypedAttributeHandle< T >::m_base_handle.
Referenced by wmtk::multimesh::MultiMeshManager::update_child_handles().
int64_t wmtk::attribute::AttributeManager::size | ( | ) | const |
Definition at line 162 of file AttributeManager.cpp.
References m_capacities.
Referenced by guarantee_at_least_attributes(), guarantee_more_attributes(), register_attribute(), reserve_attributes_to_fit(), and reserve_more_attributes().
|
friend |
Definition at line 18 of file AttributeManager.hpp.
std::vector<int64_t> wmtk::attribute::AttributeManager::m_capacities |
Definition at line 38 of file AttributeManager.hpp.
Referenced by assert_capacity_valid(), wmtk::Mesh::capacity(), child_hashes(), wmtk::Mesh::consolidate(), guarantee_more_attributes(), operator==(), wmtk::Mesh::request_simplex_indices(), reserve_attributes_to_fit(), reserve_to_fit(), serialize(), set_capacities(), wmtk::Mesh::set_capacities_from_flags(), and size().
std::vector<MeshAttributes<char> > wmtk::attribute::AttributeManager::m_char_attributes |
Definition at line 31 of file AttributeManager.hpp.
Referenced by assert_capacity_valid(), change_to_child_scope(), change_to_parent_scope(), child_hashables(), wmtk::Mesh::consolidate(), get(), guarantee_at_least_attributes(), operator==(), pop_scope(), push_scope(), reserve_attributes(), reserve_more_attributes(), rollback_current_scope(), and serialize().
std::vector<MeshAttributes<double> > wmtk::attribute::AttributeManager::m_double_attributes |
Definition at line 33 of file AttributeManager.hpp.
Referenced by assert_capacity_valid(), change_to_child_scope(), change_to_parent_scope(), child_hashables(), wmtk::Mesh::consolidate(), get(), guarantee_at_least_attributes(), operator==(), pop_scope(), push_scope(), reserve_attributes(), reserve_more_attributes(), rollback_current_scope(), and serialize().
std::vector<MeshAttributes<int64_t> > wmtk::attribute::AttributeManager::m_long_attributes |
Definition at line 32 of file AttributeManager.hpp.
Referenced by assert_capacity_valid(), change_to_child_scope(), change_to_parent_scope(), child_hashables(), wmtk::Mesh::consolidate(), get(), guarantee_at_least_attributes(), operator==(), pop_scope(), push_scope(), reserve_attributes(), reserve_more_attributes(), rollback_current_scope(), and serialize().
std::vector<MeshAttributes<Rational> > wmtk::attribute::AttributeManager::m_rational_attributes |
Definition at line 34 of file AttributeManager.hpp.
Referenced by assert_capacity_valid(), change_to_child_scope(), change_to_parent_scope(), child_hashables(), wmtk::Mesh::consolidate(), get(), guarantee_at_least_attributes(), operator==(), pop_scope(), push_scope(), reserve_attributes(), reserve_more_attributes(), rollback_current_scope(), and serialize().