Wildmeshing Toolkit
wmtk::attribute::AttributeManager Class Reference

#include <AttributeManager.hpp>

Inheritance diagram for wmtk::attribute::AttributeManager:
[legend]
Collaboration diagram for wmtk::attribute::AttributeManager:
[legend]

Public Member Functions

 AttributeManager (int64_t size)
 
 ~AttributeManager ()
 
 AttributeManager (const AttributeManager &o)=delete
 
 AttributeManager (AttributeManager &&o)=default
 
AttributeManageroperator= (const AttributeManager &o)=delete
 
AttributeManageroperator= (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::HandleVariantget_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 &&)
 
Hashableoperator= (const Hashable &)
 
Hashableoperator= (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
 

Detailed Description

Definition at line 16 of file AttributeManager.hpp.

Constructor & Destructor Documentation

◆ AttributeManager() [1/3]

wmtk::attribute::AttributeManager::AttributeManager ( int64_t  size)

Definition at line 7 of file AttributeManager.cpp.

◆ ~AttributeManager()

wmtk::attribute::AttributeManager::~AttributeManager ( )
default

◆ AttributeManager() [2/3]

wmtk::attribute::AttributeManager::AttributeManager ( const AttributeManager o)
delete

◆ AttributeManager() [3/3]

wmtk::attribute::AttributeManager::AttributeManager ( AttributeManager &&  o)
default

Member Function Documentation

◆ assert_capacity_valid()

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().

Here is the caller graph for this function:

◆ change_to_child_scope()

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().

Here is the caller graph for this function:

◆ change_to_parent_scope()

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().

Here is the caller graph for this function:

◆ child_hashables()

std::map< std::string, const wmtk::utils::Hashable * > wmtk::attribute::AttributeManager::child_hashables ( ) const
overridevirtual

◆ child_hashes()

std::map< std::string, std::size_t > wmtk::attribute::AttributeManager::child_hashes ( ) const
overridevirtual

Reimplemented from wmtk::utils::Hashable.

Definition at line 37 of file AttributeManager.cpp.

References wmtk::utils::MerkleTreeInteriorNode::child_hashes(), and m_capacities.

Here is the call graph for this function:

◆ clear_attributes()

void wmtk::attribute::AttributeManager::clear_attributes ( const std::vector< attribute::MeshAttributeHandle::HandleVariant > &  custom_attributes)

Remove all custom attributes besides the one passed in.

Parameters
keep_attributesVector 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_scope()

AttributeScopeHandle wmtk::attribute::AttributeManager::create_scope ( Mesh m)

Definition at line 174 of file AttributeManager.cpp.

Referenced by wmtk::Mesh::create_single_mesh_scope().

Here is the caller graph for this function:

◆ delete_attribute()

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().

Here is the caller graph for this function:

◆ flush_all_scopes()

void wmtk::attribute::AttributeManager::flush_all_scopes ( )

◆ get() [1/6]

template<typename T >
std::vector< MeshAttributes< T > > & wmtk::attribute::AttributeManager::get
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().

Here is the caller graph for this function:

◆ get() [2/6]

template<typename T >
const std::vector< MeshAttributes< T > > & wmtk::attribute::AttributeManager::get
inline

◆ get() [3/6]

template<typename T >
MeshAttributes< T > & wmtk::attribute::AttributeManager::get ( const TypedAttributeHandle< T > &  handle)
inline

◆ get() [4/6]

template<typename T >
const MeshAttributes< T > & wmtk::attribute::AttributeManager::get ( const TypedAttributeHandle< T > &  handle) const
inline

◆ get() [5/6]

template<typename T >
MeshAttributes< T > & wmtk::attribute::AttributeManager::get ( PrimitiveType  ptype)
inline

Definition at line 170 of file AttributeManager.hpp.

References wmtk::get_primitive_type_id().

Here is the call graph for this function:

◆ get() [6/6]

template<typename T >
const MeshAttributes< T > & wmtk::attribute::AttributeManager::get ( PrimitiveType  ptype) const
inline

Definition at line 163 of file AttributeManager.hpp.

References wmtk::get_primitive_type_id().

Here is the call graph for this function:

◆ get_all_attributes()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_attribute_default_value()

template<typename T >
const T & wmtk::attribute::AttributeManager::get_attribute_default_value ( const TypedAttributeHandle< T > &  handle) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_attribute_dimension()

template<typename T >
int64_t wmtk::attribute::AttributeManager::get_attribute_dimension ( const TypedAttributeHandle< T > &  handle) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_name() [1/2]

std::string wmtk::attribute::AttributeManager::get_name ( const attribute::MeshAttributeHandle::HandleVariant attr) const

Definition at line 179 of file AttributeManager.cpp.

References get_name().

Here is the call graph for this function:

◆ get_name() [2/2]

template<typename T >
std::string wmtk::attribute::AttributeManager::get_name ( const TypedAttributeHandle< T > &  attr) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ guarantee_at_least_attributes() [1/2]

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().

Here is the call graph for this function:

◆ guarantee_at_least_attributes() [2/2]

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ guarantee_more_attributes() [1/2]

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().

Here is the call graph for this function:

◆ guarantee_more_attributes() [2/2]

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

AttributeManager& wmtk::attribute::AttributeManager::operator= ( AttributeManager &&  o)
default

◆ operator=() [2/2]

AttributeManager& wmtk::attribute::AttributeManager::operator= ( const AttributeManager o)
delete

◆ operator==()

bool wmtk::attribute::AttributeManager::operator== ( const AttributeManager other) const

◆ parent_scope()

template<typename Functor , typename... Args>
decltype(auto) wmtk::attribute::AttributeManager::parent_scope ( Functor &&  f,
Args &&...  args 
) const

◆ pop_scope()

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().

Here is the caller graph for this function:

◆ push_scope()

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().

Here is the caller graph for this function:

◆ register_attribute()

template<typename T >
TypedAttributeHandle< T > wmtk::attribute::AttributeManager::register_attribute ( const std::string &  name,
PrimitiveType  type,
int64_t  size,
bool  replace,
default_value 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reserve_attributes()

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().

Here is the caller graph for this function:

◆ reserve_attributes_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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reserve_more_attributes() [1/2]

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().

Here is the call graph for this function:

◆ reserve_more_attributes() [2/2]

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reserve_to_fit()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rollback_current_scope()

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().

Here is the caller graph for this function:

◆ serialize()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_capacities()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_name()

template<typename T >
void wmtk::attribute::AttributeManager::set_name ( const TypedAttributeHandle< T > &  attr,
const std::string &  name 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

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().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ internal::CheckpointScope

friend class internal::CheckpointScope
friend

Definition at line 18 of file AttributeManager.hpp.

Member Data Documentation

◆ m_capacities

◆ m_char_attributes

◆ m_double_attributes

◆ m_long_attributes

◆ m_rational_attributes


The documentation for this class was generated from the following files: