FunctorField.inl
Go to the documentation of this file.
1 namespace iv
2 {
3 
4 template< class T >
5 FunctorField< T >::FunctorField( Instance * inst, std::function< void( bool ) > const & OnChanged ) :
6  Field< T >( inst ),
7  change_reporter( OnChanged )
8 {
9 }
10 
11 template< class T >
12 void FunctorField< T >::OnChange( std::function< void( bool real ) > const & f )
13 {
14  this->change_reporter = f;
15  if( this->change_reporter )
16  this->change_reporter( false );
17 }
18 
19 template< class T >
21 {
22  return this->Field< T >::Get();
23 }
24 
25 template< class T >
27 {
28  if( this->change_reporter )
29  this->change_reporter( real );
30 }
31 
32 template< class T >
33 void FunctorField< T >::Modify( T const & val )
34 {
35  IV_MEMCHECK( val );
36  this->Field< T >::Modify( val );
37 }
38 
39 }