7 Var & var = this->vars[ id ];
9 if( var.locked && var.locked != setter )
11 this->
warning(
SRC_INFO,
"DVar ",
id,
" is locked to an instance. Can not change it using different setter instance." );
19 var.type =
typeid( Type );
20 var.deleter = [ val ]()
26 if( var.type !=
typeid( Type ) )
28 this->
warning(
SRC_INFO,
"DVar ",
id,
" was already set with different type. Skipping this set." );
32 ( *
reinterpret_cast< Type *
>( var.val ) ) = value;
34 var.listeners.foreach(
42 template<
class Type >
45 Var & var = this->vars[ id ];
51 std::type_index type =
typeid( Type );
52 if( type != var.type )
54 this->
warning(
SRC_INFO,
"Trying to get DVar value using id of different type than with which it was set. There are probably two ids with the same persistent id '",
id,
"'." );
58 return *
reinterpret_cast< Type *
>( var.val );