9 cm( inst, this,
"Field_R" ),
20 this->source_r->Remove_Listener(
this );
33 this->source_r->Remove_Listener(
this );
37 this->source_rw =
nullptr;
42 this->OnChanged(
false );
49 this->source_r->Remove_Listener(
this );
51 this->source_r =
nullptr;
52 this->source_rw =
nullptr;
55 this->OnChanged(
false );
61 if( this->constant == value )
65 this->source_r->Remove_Listener(
this );
67 this->source_r =
nullptr;
68 this->source_rw =
nullptr;
69 this->constant = value;
71 this->OnChanged(
false );
77 if( this->constant.has_value() )
78 return this->constant.value();
83 auto result = this->source_r->Get();
90 this->OnChanged(
true );
94 void Field< T >::Attribute_Deactivated( Attribute * src )
96 this->source_r =
nullptr;
97 this->source_rw =
nullptr;
98 this->OnChanged(
false );
102 void Field< T >::AnySource_R_Impl( Attribute * src )
104 Attr< T > * casted =
dynamic_cast< Attr< T > *
>( src );
106 this->Assign_Attribute_R( casted );
110 std::type_index Field< T >::Type_Impl()
116 Attribute::ValueMode Field< T >::mode_Impl()
const
118 if( this->source_rw )
120 return this->source_rw->Mode();
122 else if( this->source_r )
124 auto src_mode = this->source_r->Mode();
125 if( src_mode == Attribute::ValueMode::Disabled )
126 return Attribute::ValueMode::Disabled;
128 return Attribute::ValueMode::Value;
130 else if( this->constant.has_value() )
132 return Attribute::ValueMode::Value;
136 return Attribute::ValueMode::Disabled;
141 FieldI::Assignment Field< T >::AssignmentState_impl()
const
143 if( this->source_rw )
144 return Assignment::Attribute_RW;
145 else if( this->source_r )
146 return Assignment::Attribute_R;
147 else if( this->constant.has_value() )
148 return Assignment::Constant;
150 return Assignment::Unassigned;
157 this->source_r->Remove_Listener(
this );
160 this->source_r = attr;
161 this->source_rw = attr;
166 this->OnChanged(
false );
172 if( this->source_rw )
173 this->source_rw->
Modify( &this->cm, val );
181 this->Assign_Attribute_RW( casted );