EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
EBGeometry::LabelId< Tag > Struct Template Reference

The number of a label, typed by what it labels, so that a number of one kind cannot index a table of another: a surface label's number does not compile where a material's is expected. More...

#include <EBGeometry_LabelId.hpp>

Inheritance diagram for EBGeometry::LabelId< Tag >:
Inheritance graph
[legend]

Public Member Functions

constexpr LabelId () noexcept=default
 No label.
 
constexpr LabelId (const uint32_t a_value) noexcept
 A label's number.
 
constexpr uint32_t value () const noexcept
 The number, for indexing an array of your own.
 
constexpr bool isNone () const noexcept
 Whether this is no label.
 
constexpr bool operator== (const LabelId &a_other) const noexcept
 Equality.
 
constexpr bool operator!= (const LabelId &a_other) const noexcept
 Inequality.
 

Static Public Member Functions

static constexpr LabelId none () noexcept
 No label.
 

Public Attributes

uint32_t m_value = NoneValue
 The number.
 

Static Public Attributes

static constexpr uint32_t NoneValue = 0xFFFFFFFFU
 The number of no label.
 

Detailed Description

template<class Tag>
struct EBGeometry::LabelId< Tag >

The number of a label, typed by what it labels, so that a number of one kind cannot index a table of another: a surface label's number does not compile where a material's is expected.

A trivially copyable wrapper of a 32-bit number, usable on the host and the device. The labels of each kind are numbered from 0 in the order their names first appear in the expression (see ExprIndex); value() is the number, for indexing an array of your own. None is no label.

Template Parameters
TagWhat the label labels (SurfaceLabelTag, MaterialLabelTag).

Constructor & Destructor Documentation

◆ LabelId()

template<class Tag >
constexpr EBGeometry::LabelId< Tag >::LabelId ( const uint32_t  a_value)
inlineexplicitconstexprnoexcept

A label's number.

Parameters
[in]a_valueThe number (NoneValue for none).

Member Function Documentation

◆ isNone()

template<class Tag >
constexpr bool EBGeometry::LabelId< Tag >::isNone ( ) const
inlineconstexprnoexcept

Whether this is no label.

Returns
True for none.

◆ none()

template<class Tag >
static constexpr LabelId EBGeometry::LabelId< Tag >::none ( )
inlinestaticconstexprnoexcept

No label.

Returns
The id of no label.

◆ operator!=()

template<class Tag >
constexpr bool EBGeometry::LabelId< Tag >::operator!= ( const LabelId< Tag > &  a_other) const
inlineconstexprnoexcept

Inequality.

Parameters
[in]a_otherAnother id of the same kind.
Returns
True if the numbers differ.

◆ operator==()

template<class Tag >
constexpr bool EBGeometry::LabelId< Tag >::operator== ( const LabelId< Tag > &  a_other) const
inlineconstexprnoexcept

Equality.

Parameters
[in]a_otherAnother id of the same kind.
Returns
True if the numbers are equal.

◆ value()

template<class Tag >
constexpr uint32_t EBGeometry::LabelId< Tag >::value ( ) const
inlineconstexprnoexcept

The number, for indexing an array of your own.

Returns
The number; NoneValue for no label, which no table of labels reaches.

The documentation for this struct was generated from the following file: