Lagrange
Loading...
Searching...
No Matches
AttributeBase Class Referenceabstract

Base handle for attributes. More...

#include <lagrange/Attribute.h>

Inheritance diagram for AttributeBase:
Attribute< ValueType > Attribute< Index > Attribute< ValueType_ > IndexedAttribute< ValueType_, Index_ >

Public Member Functions

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

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
nodiscardpure virtual

Gets the attribute value type.

Returns
An enum describing the value type.

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

◆ get_element_type()

AttributeElement get_element_type ( ) const
inlinenodiscard

Gets the attribute element type.

Returns
The element type.

◆ get_usage()

AttributeUsage get_usage ( ) const
inlinenodiscard

Gets the attribute usage tag.

Returns
The usage tag.

◆ get_num_channels()

size_t get_num_channels ( ) const
inlinenodiscard

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: