FunctorActivatorField.cpp
Go to the documentation of this file.
2 
3 namespace iv
4 {
5 
6 FunctorActivatorField::FunctorActivatorField( Instance * inst, std::function< void() > const & on_activated ) :
7  Field< Activator >( inst ),
8  cm( inst, this, "FunctorActivatorField" ),
9  _on_activated( on_activated )
10 {
11  this->cm.inherits( this->Field< Activator >::cm );
12 }
13 
14 void FunctorActivatorField::on_activated( std::function< void() > const & f )
15 {
16  this->_on_activated = f;
17 }
18 
20 {
21  if( this->Get().CopyActivations( this->_reference ) && real && this->_on_activated )
22  this->_on_activated();
23 }
24 
25 }