Wildmeshing Toolkit
wmtk::attribute::MeshAttributeHandle Class Reference

#include <MeshAttributeHandle.hpp>

Collaboration diagram for wmtk::attribute::MeshAttributeHandle:
[legend]

Public Types

enum class  HeldType { Char = 0 , Int64 = 1 , Double = 2 , Rational = 3 }
 
using HandleVariant = std::variant< TypedAttributeHandle< char >, TypedAttributeHandle< int64_t >, TypedAttributeHandle< double >, TypedAttributeHandle< wmtk::Rational > >
 
using ValueVariant = std::variant< char, int64_t, double, wmtk::Rational, std::tuple< char, wmtk::Rational, double > >
 
template<HeldType Type>
using held_handle_type = std::variant_alternative_t< size_t(Type), HandleVariant >
 
template<HeldType Type>
using held_primitive_type = typename held_handle_type< Type >::Type
 

Public Member Functions

 MeshAttributeHandle ()=default
 
 MeshAttributeHandle (Mesh &m, const HandleVariant &h)
 
 MeshAttributeHandle (const MeshAttributeHandle &o)=default
 
 MeshAttributeHandle (MeshAttributeHandle &&o)=default
 
MeshAttributeHandleoperator= (const MeshAttributeHandle &o)=default
 
MeshAttributeHandleoperator= (MeshAttributeHandle &&o)=default
 
bool operator== (const MeshAttributeHandle &o) const
 
bool is_same_mesh (const Mesh &) const
 
bool is_valid () const
 
PrimitiveType primitive_type () const
 
template<typename T >
PrimitiveType primitive_typeT () const
 
template<typename T >
auto as () const -> const held_handle_type< held_type_from_primitive< T >()> &
 
template<HeldType Type>
auto as_from_held_type () const -> const held_handle_type< Type > &
 
template<typename T >
bool holds () const
 
bool holds_basic_type () const
 
template<HeldType Type>
bool holds_from_held_type () const
 
HeldType held_type () const
 
Meshmesh ()
 
const Meshmesh () const
 
HandleVarianthandle ()
 
const HandleVarianthandle () const
 
int64_t dimension () const
 
std::string name () const
 
template<typename T >
constexpr bool handle_type_is_basic ()
 
template<typename T >
constexpr auto held_type_from_primitive () -> HeldType
 
template<typename T >
constexpr auto held_type_from_handle () -> HeldType
 

Static Public Member Functions

template<typename T >
constexpr static HeldType held_type_from_primitive ()
 
template<typename T >
constexpr static HeldType held_type_from_handle ()
 
template<typename T >
constexpr static bool handle_type_is_basic ()
 

Private Attributes

Meshm_mesh = nullptr
 
HandleVariant m_handle
 

Friends

class wmtk::Mesh
 
class wmtk::hash< MeshAttributeHandle >
 

Detailed Description

Definition at line 25 of file MeshAttributeHandle.hpp.

Member Typedef Documentation

◆ HandleVariant

◆ held_handle_type

template<HeldType Type>
using wmtk::attribute::MeshAttributeHandle::held_handle_type = std::variant_alternative_t<size_t(Type), HandleVariant>

Definition at line 45 of file MeshAttributeHandle.hpp.

◆ held_primitive_type

template<HeldType Type>
using wmtk::attribute::MeshAttributeHandle::held_primitive_type = typename held_handle_type<Type>::Type

Definition at line 48 of file MeshAttributeHandle.hpp.

◆ ValueVariant

using wmtk::attribute::MeshAttributeHandle::ValueVariant = std:: variant<char, int64_t, double, wmtk::Rational, std::tuple<char, wmtk::Rational, double> >

Definition at line 39 of file MeshAttributeHandle.hpp.

Member Enumeration Documentation

◆ HeldType

Enumerator
Char 
Int64 
Double 
Rational 

Definition at line 42 of file MeshAttributeHandle.hpp.

Constructor & Destructor Documentation

◆ MeshAttributeHandle() [1/4]

wmtk::attribute::MeshAttributeHandle::MeshAttributeHandle ( )
default

◆ MeshAttributeHandle() [2/4]

wmtk::attribute::MeshAttributeHandle::MeshAttributeHandle ( Mesh m,
const HandleVariant h 
)

Definition at line 7 of file MeshAttributeHandle.cpp.

◆ MeshAttributeHandle() [3/4]

wmtk::attribute::MeshAttributeHandle::MeshAttributeHandle ( const MeshAttributeHandle o)
default

◆ MeshAttributeHandle() [4/4]

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

Member Function Documentation

◆ as()

◆ as_from_held_type()

template<MeshAttributeHandle::HeldType Type>
auto wmtk::attribute::MeshAttributeHandle::as_from_held_type
inline

Definition at line 201 of file MeshAttributeHandle.hpp.

References m_handle.

◆ dimension()

int64_t wmtk::attribute::MeshAttributeHandle::dimension ( ) const

◆ handle() [1/2]

◆ handle() [2/2]

const HandleVariant& wmtk::attribute::MeshAttributeHandle::handle ( ) const
inline

Definition at line 132 of file MeshAttributeHandle.hpp.

References m_handle.

◆ handle_type_is_basic() [1/2]

template<typename T >
constexpr static bool wmtk::attribute::MeshAttributeHandle::handle_type_is_basic ( )
staticconstexpr

Referenced by holds_basic_type().

Here is the caller graph for this function:

◆ handle_type_is_basic() [2/2]

template<typename T >
constexpr bool wmtk::attribute::MeshAttributeHandle::handle_type_is_basic ( )
inlineconstexpr

Definition at line 187 of file MeshAttributeHandle.hpp.

◆ held_type()

auto wmtk::attribute::MeshAttributeHandle::held_type ( ) const

Definition at line 28 of file MeshAttributeHandle.cpp.

References m_handle.

Referenced by wmtk::components::multimesh::multimesh(), and wmtk::operations::VertexLaplacianSmooth::VertexLaplacianSmooth().

Here is the caller graph for this function:

◆ held_type_from_handle() [1/2]

template<typename T >
constexpr static HeldType wmtk::attribute::MeshAttributeHandle::held_type_from_handle ( )
staticconstexpr

◆ held_type_from_handle() [2/2]

template<typename T >
constexpr auto wmtk::attribute::MeshAttributeHandle::held_type_from_handle ( ) -> HeldType
inlineconstexpr

Definition at line 218 of file MeshAttributeHandle.hpp.

◆ held_type_from_primitive() [1/2]

template<typename T >
constexpr static HeldType wmtk::attribute::MeshAttributeHandle::held_type_from_primitive ( )
staticconstexpr

◆ held_type_from_primitive() [2/2]

template<typename T >
constexpr auto wmtk::attribute::MeshAttributeHandle::held_type_from_primitive ( ) -> HeldType
inlineconstexpr

Definition at line 213 of file MeshAttributeHandle.hpp.

◆ holds()

◆ holds_basic_type()

bool wmtk::attribute::MeshAttributeHandle::holds_basic_type ( ) const
inline

Definition at line 192 of file MeshAttributeHandle.hpp.

References handle_type_is_basic(), and m_handle.

Here is the call graph for this function:

◆ holds_from_held_type()

template<MeshAttributeHandle::HeldType Type>
bool wmtk::attribute::MeshAttributeHandle::holds_from_held_type
inline

Definition at line 207 of file MeshAttributeHandle.hpp.

References m_handle.

◆ is_same_mesh()

bool wmtk::attribute::MeshAttributeHandle::is_same_mesh ( const Mesh m) const

Definition at line 12 of file MeshAttributeHandle.cpp.

References m_mesh.

Referenced by wmtk::function::Function::Function(), wmtk::operations::Operation::get_transfer_strategy(), wmtk::function::PerSimplexFunction::PerSimplexFunction(), and wmtk::operations::Operation::set_transfer_strategy().

Here is the caller graph for this function:

◆ is_valid()

bool wmtk::attribute::MeshAttributeHandle::is_valid ( ) const

Definition at line 38 of file MeshAttributeHandle.cpp.

References m_handle, and m_mesh.

Referenced by wmtk::function::PerSimplexFunction::attribute_handle(), and wmtk::function::Function::embedded_dimension().

Here is the caller graph for this function:

◆ mesh() [1/2]

◆ mesh() [2/2]

const Mesh & wmtk::attribute::MeshAttributeHandle::mesh ( ) const

Definition at line 23 of file MeshAttributeHandle.cpp.

References m_mesh.

◆ name()

std::string wmtk::attribute::MeshAttributeHandle::name ( ) const

Definition at line 51 of file MeshAttributeHandle.cpp.

References wmtk::Mesh::get_attribute_name(), m_handle, and mesh().

Here is the call graph for this function:

◆ operator=() [1/2]

MeshAttributeHandle& wmtk::attribute::MeshAttributeHandle::operator= ( const MeshAttributeHandle o)
default

◆ operator=() [2/2]

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

◆ operator==()

bool wmtk::attribute::MeshAttributeHandle::operator== ( const MeshAttributeHandle o) const
inline

Definition at line 75 of file MeshAttributeHandle.hpp.

References m_handle, and m_mesh.

◆ primitive_type()

PrimitiveType wmtk::attribute::MeshAttributeHandle::primitive_type ( ) const
inline

◆ primitive_typeT()

template<typename T >
PrimitiveType wmtk::attribute::MeshAttributeHandle::primitive_typeT
inline

Definition at line 243 of file MeshAttributeHandle.hpp.

References m_handle.

Friends And Related Function Documentation

◆ wmtk::hash< MeshAttributeHandle >

friend class wmtk::hash< MeshAttributeHandle >
friend

Definition at line 66 of file MeshAttributeHandle.hpp.

◆ wmtk::Mesh

friend class wmtk::Mesh
friend

Definition at line 66 of file MeshAttributeHandle.hpp.

Member Data Documentation

◆ m_handle

HandleVariant wmtk::attribute::MeshAttributeHandle::m_handle
private

◆ m_mesh

Mesh* wmtk::attribute::MeshAttributeHandle::m_mesh = nullptr
private

Definition at line 155 of file MeshAttributeHandle.hpp.

Referenced by is_same_mesh(), is_valid(), mesh(), and operator==().


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