Lagrange
IndexedAttribute< ValueType_, Index_ > Class Template Reference

Derived attribute class that stores the actual information. More...

#include <lagrange/IndexedAttribute.h>

Inherits AttributeBase.

Public Types

using ValueType = ValueType_
 Attribute value type.
 
using Index = Index_
 Attribute index type.
 

Public Member Functions

Attribute construction
 IndexedAttribute (AttributeUsage usage, size_t num_channels)
 Constructs a new instance. More...
 
 ~IndexedAttribute () override
 Destroys the object.
 
 IndexedAttribute (IndexedAttribute &&other) noexcept
 Move constructor. More...
 
IndexedAttributeoperator= (IndexedAttribute &&other) noexcept
 Assignment move operator. More...
 
 IndexedAttribute (const IndexedAttribute &other)
 Copy constructor. More...
 
IndexedAttributeoperator= (const IndexedAttribute &other)
 Assignment copy operator. More...
 
AttributeValueType get_value_type () const override
 Gets the attribute value type. More...
 
Attribute access
Attribute< ValueType > & values ()
 Access attribute values. More...
 
const Attribute< ValueType > & values () const
 Access attribute values. More...
 
Attribute< Index > & indices ()
 Access attribute indices. More...
 
const Attribute< Index > & indices () const
 Access attribute indices. More...
 
- Public Member Functions inherited from AttributeBase
 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...
 

Static Public Attributes

static constexpr bool IsIndexed = true
 Whether this attribute type is indexed.
 

Protected Attributes

Attribute< ValueTypem_values
 
Attribute< Indexm_indices
 
- Protected Attributes inherited from AttributeBase
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

template<typename ValueType_, typename Index_>
class lagrange::IndexedAttribute< ValueType_, Index_ >

Derived attribute class that stores the actual information.

Template Parameters
ValueType_Attribute value type.
Index_Attribute index type.

Constructor & Destructor Documentation

◆ IndexedAttribute() [1/3]

IndexedAttribute ( AttributeUsage  usage,
size_t  num_channels 
)

Constructs a new instance.

Parameters
[in]usageUsage tag.
[in]num_channelsNumber of channels.

◆ IndexedAttribute() [2/3]

IndexedAttribute ( IndexedAttribute< ValueType_, Index_ > &&  other)
noexcept

Move constructor.

Parameters
otherInstance to move from.

◆ IndexedAttribute() [3/3]

IndexedAttribute ( const IndexedAttribute< ValueType_, Index_ > &  other)
explicit

Copy constructor.

Parameters
[in]otherInstance to copy from.

Member Function Documentation

◆ operator=() [1/2]

IndexedAttribute & operator= ( IndexedAttribute< ValueType_, Index_ > &&  other)
noexcept

Assignment move operator.

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

◆ operator=() [2/2]

IndexedAttribute & operator= ( const IndexedAttribute< ValueType_, Index_ > &  other)

Assignment copy operator.

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

◆ get_value_type()

AttributeValueType get_value_type ( ) const
inlineoverridevirtual

Gets the attribute value type.

Returns
An enum describing the value type.

Implements AttributeBase.

◆ values() [1/2]

Attribute< ValueType > & values ( )
inline

Access attribute values.

Returns
A reference to the attribute values.

◆ values() [2/2]

const Attribute< ValueType > & values ( ) const
inline

Access attribute values.

Returns
A reference to the attribute values.

◆ indices() [1/2]

Attribute< Index > & indices ( )
inline

Access attribute indices.

Returns
A reference to the attribute indices.

◆ indices() [2/2]

const Attribute< Index > & indices ( ) const
inline

Access attribute indices.

Returns
A reference to the attribute indices.

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