Lagrange
AttributeBase Class Referenceabstract

Base handle for attributes. More...

#include <lagrange/Attribute.h>

Inherited by Attribute< ValueType >, Attribute< Index >, Attribute< ValueType_ >, and IndexedAttribute< ValueType_, Index_ >.

Public Member Functions

 AttributeBase (AttributeElement element, AttributeUsage usage, size_t num_channels)
 Constructs a new instance. More...
 
virtual ~AttributeBase ()
 Destroys the object.
 
 AttributeBase (AttributeBase &&other)=default
 Move constructor. More...
 
AttributeBaseoperator= (AttributeBase &&other)=default
 Assignment move operator. More...
 
 AttributeBase (const AttributeBase &other)=default
 Copy constructor. More...
 
AttributeBaseoperator= (const AttributeBase &other)=default
 Assignment copy operator. More...
 
virtual AttributeValueType get_value_type () const =0
 Gets the attribute value type. More...
 
AttributeElement get_element_type () const
 Gets the attribute element type. More...
 
AttributeUsage get_usage () const
 Gets the attribute usage tag. More...
 
size_t get_num_channels () const
 Gets the number of channels for the attribute. More...
 
void unsafe_set_usage (AttributeUsage usage)
 Sets the attribute usage tag. More...
 
void unsafe_set_element_type (AttributeElement element)
 Sets the attribute element type. More...
 

Protected Attributes

AttributeElement m_element
 Element type (vertex, facet, indexed, etc.).
 
AttributeUsage m_usage
 Attribute usage tag.
 
size_t m_num_channels = 0
 Number of channel for each value.
 

Detailed Description

Base handle for attributes.

This is a common base class to allow for type erasure.

Constructor & Destructor Documentation

◆ AttributeBase() [1/3]

AttributeBase ( AttributeElement  element,
AttributeUsage  usage,
size_t  num_channels 
)

Constructs a new instance.

Parameters
[in]elementElement type (vertex, facet, etc.).
[in]usageUsage tag.
[in]num_channelsNumber of channels.

◆ AttributeBase() [2/3]

AttributeBase ( AttributeBase &&  other)
default

Move constructor.

Parameters
otherInstance to move from.

◆ AttributeBase() [3/3]

AttributeBase ( const AttributeBase other)
default

Copy constructor.

Parameters
[in]otherInstance to copy from.

Member Function Documentation

◆ operator=() [1/2]

AttributeBase & operator= ( AttributeBase &&  other)
default

Assignment move operator.

Parameters
otherInstance to move from.
Returns
The result of the assignment.

◆ operator=() [2/2]

AttributeBase & operator= ( const AttributeBase other)
default

Assignment copy operator.

Parameters
[in]otherInstance to copy from.
Returns
The result of the assignment.

◆ get_value_type()

virtual AttributeValueType get_value_type ( ) const
pure virtual

Gets the attribute value type.

Returns
An enum describing the value type.

Implemented in Attribute< ValueType_ >, Attribute< ValueType >, Attribute< Index >, and IndexedAttribute< ValueType_, Index_ >.

◆ get_element_type()

AttributeElement get_element_type ( ) const
inline

Gets the attribute element type.

Returns
The element type.

◆ get_usage()

AttributeUsage get_usage ( ) const
inline

Gets the attribute usage tag.

Returns
The usage tag.

◆ get_num_channels()

size_t get_num_channels ( ) const
inline

Gets the number of channels for the attribute.

Returns
The number of channels.

◆ unsafe_set_usage()

void unsafe_set_usage ( AttributeUsage  usage)
inline

Sets the attribute usage tag.

Note
No check is performed, use with caution!
Parameters
[in]usageNew usage tag.

◆ unsafe_set_element_type()

void unsafe_set_element_type ( AttributeElement  element)
inline

Sets the attribute element type.

Note
No check is performed, use with caution!
Parameters
[in]elementNew element type.

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