6 cm( inst, this,
"DVarCloner" ),
8 dvs( inst->getSystem< DVarSystem >() ),
14 this->dvs->
lock( this->instance(), this->target );
17 this->dvs->template set< T >( this->instance(), this->target, this->dvs->template get< T >( source ) );
22 DVarCloner< T >::~DVarCloner()
26 this->dvs->unlock( this->instance(), this->target );
27 this->dvs->remove_listener(
this, this->source );
32 Instance * DVarCloner< T >::instance()
38 void DVarCloner< T >::on_dvar_changed( DVarId
id, std::type_index type,
void * value )
40 if( type !=
typeid( T ) )
42 this->cm.warning(
SRC_INFO,
"DVar ",
id,
" has unexpected type." );
46 this->dvs->template set< T >( this->instance(), this->target, *
reinterpret_cast< T *
>( value ) );