Workspace 6.21.5
Public Types | Public Member Functions | Protected Member Functions | List of all members
StateHandle Class Reference

Base class for state handles. More...

#include <Mesh/DataStructures/MeshModelInterface/meshitemhandle.h>

Inheritance diagram for StateHandle:
[legend]

Public Types

using size_type = ItemHandle::size_type
 

Public Member Functions

const DataExecution::DataFactorygetDataFactory () const
 
const DataExecution::DataObjectgetDefaultValue () const
 
size_type getIndex () const
 
const QString & getName () const
 
template<typename T >
bool isDataType () const
 
virtual bool isValid () const
 
bool operator!= (const StateHandle &other) const
 
bool operator< (const StateHandle &other) const
 
bool operator== (const StateHandle &other) const
 

Protected Member Functions

 StateHandle ()
 
 StateHandle (const StateHandle &other)
 
 StateHandle (size_type index, const QString &name, const DataExecution::DataObject &defaultValue)
 
virtual ~StateHandle ()
 
StateHandleoperator= (const StateHandle &other)
 

Detailed Description

StateHandles have to clone their default value when copied, therefore it is recommended to pass this object by reference whenever possible.

Member Typedef Documentation

◆ size_type

Constructor & Destructor Documentation

◆ StateHandle() [1/3]

StateHandle ( )
inlineprotected

Construct a default (invalid) handle

◆ StateHandle() [2/3]

StateHandle ( size_type  index,
const QString &  name,
const DataExecution::DataObject defaultValue 
)
inlineprotected

StateHandles store a cloned copy of the state's default value. Since this requires a memory allocation (the size of the state's data type) this may have some cost involved. It is recommended/expected that StateHandles are created infrequently and passed by reference.

◆ StateHandle() [3/3]

StateHandle ( const StateHandle other)
inlineprotected

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ ~StateHandle()

~StateHandle ( )
inlineprotectedvirtual

Member Function Documentation

◆ getDataFactory()

const DataExecution::DataFactory & getDataFactory ( ) const
inline

◆ getDefaultValue()

const DataExecution::DataObject & getDefaultValue ( ) const
inline

◆ getIndex()

StateHandle::size_type getIndex ( ) const
inline
Returns
The index associated with this handle. Using the method when !isValid() is undefined.
See also
isValid()

◆ getName()

const QString & getName ( ) const
inline

◆ isDataType()

bool isDataType

◆ isValid()

bool isValid ( ) const
inlinevirtual

Reimplemented in ElementStateHandle.

◆ operator!=()

bool operator!= ( const StateHandle other) const
inline

◆ operator<()

bool operator< ( const StateHandle other) const
inline

◆ operator=()

StateHandle & operator= ( const StateHandle other)
inlineprotected

◆ operator==()

bool operator== ( const StateHandle other) const
inline