Workspace 6.21.5
|
A base class for handles to some item in a MeshModelInterface such as a node, element or state. More...
#include <Mesh/DataStructures/MeshModelInterface/meshitemhandle.h>
Public Types | |
typedef quint32 | size_type |
Public Member Functions | |
size_type | getIndex () const |
size_type & | indexData () |
bool | isValid () const |
bool | operator!= (const ItemHandle &other) const |
bool | operator< (const ItemHandle &other) const |
bool | operator== (const ItemHandle &other) const |
Static Public Member Functions | |
static constexpr bool | isValidIndex (size_t index) |
Protected Member Functions | |
ItemHandle () | |
ItemHandle (size_type index) | |
These handles are returned when adding nodes or element and can be use to later refer to or access that element. For example the NodeHandles returned by addNode() are used to refer to those nodes when calling addElement().
Note that ItemHandles are left in an undefined state after any call to a method on the MeshModelInterface that results in indicies changing such as MeshNodesInterface::remove().
A default constructed ItemHandle is considered (and used to indicate) invalid (it's index will be size_type's max value)
NOTE: We don't want to make this class larger than it's data (quint32) so it should contain no virtual methods. This is why StateHandle does not derive from it.
typedef quint32 size_type |
The ItemHandle class uses a size_type variable to refer to any given node or element behind a MeshModelInterfaceso. It therefore defines the max range for any node or element index used by the interface. It has to be consistent between the 3 classes (ItemHandle, MeshNodeInterface and MeshElementsInterface) which is why it is defined once here.
|
inlineprotected |
Constructs an invalid handle
|
inlineprotected |
index | An index for this ItemHandle between 0 -> getLargestValidIndex() |
Calling code should use default constructor to indication deliberate construction of an invalid node rather than calling this constructor with an invalid index param. This allows us to detect unintended invalid ItemHandle creation in debug builds.
|
inline |
|
inline |
Should only be used by low level algorithms that need to modify the index directly.
|
inline |
|
staticconstexpr |
|
inline |
|
inline |
|
inline |