MGIS 3.1.0
Loading...
Searching...
No Matches
mgis::behaviour::MaterialStateManager::FieldHolder Struct Reference
Inheritance diagram for mgis::behaviour::MaterialStateManager::FieldHolder:

Public Member Functions

template<typename ValueType>
requires ((!std::same_as<std::remove_cvref_t<ValueType>, FieldHolder>) && (std::is_assignable_v<std::variant<std::monostate, std::span<const mgis::real>, MutableFieldHolder>&, ValueType>))
FieldHolder & operator= (ValueType &&v)
 assign new values and release the clean-up hook
FieldHolder & operator= (const mgis::real) MGIS_NOEXCEPT

Public Attributes

std::shared_ptr< void > external_storage_hook = {}
 object calling the clean-up hook of the immutable externally allocated memory referenced by the std::span<const mgis::real> alternative, if any (see the set functions taking a hook).

Member Function Documentation

◆ operator=()

template<typename ValueType>
requires ((!std::same_as<std::remove_cvref_t<ValueType>, FieldHolder>) && (std::is_assignable_v<std::variant<std::monostate, std::span<const mgis::real>, MutableFieldHolder>&, ValueType>))
FieldHolder & mgis::behaviour::MaterialStateManager::FieldHolder::operator= ( ValueType && v)
inline

assign new values and release the clean-up hook

Parameters
[in]vvalues

Member Data Documentation

◆ external_storage_hook

std::shared_ptr<void> mgis::behaviour::MaterialStateManager::FieldHolder::external_storage_hook = {}

object calling the clean-up hook of the immutable externally allocated memory referenced by the std::span<const mgis::real> alternative, if any (see the set functions taking a hook).

This object is shared by the copies of the field holder: the hook is called once, when the last copy is destroyed or no longer refers to this memory. Code replacing the values without using the assignment operators of this class (emplace for instance) shall reset it.


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