Geogram
Version 1.9.1-rc
A programming library of geometric algorithms
|
Observes Environment variables. More...
#include <geogram/basic/environment.h>
Public Member Functions | |
VariableObserver (const std::string &var_name) | |
Creates a new variable observer. More... | |
virtual void | value_changed (const std::string &new_value)=0 |
Receives a change notification. More... | |
virtual | ~VariableObserver () |
Deletes the observer. More... | |
const std::string & | observed_variable () const |
Gets the observed variable. More... | |
Observes Environment variables.
VariableObserver offers the possibility to receive notifications when a variable is changed in an Environment.
To listen to a variable:
Definition at line 83 of file environment.h.
GEO::VariableObserver::VariableObserver | ( | const std::string & | var_name | ) |
Creates a new variable observer.
This creates a new observer for variable var_name
and automatically adds itself to the variable's observers in the root environment.
[in] | var_name | name of the variable observed. |
|
virtual |
Deletes the observer.
This automatically removes this observer from the root environment.
|
inline |
Gets the observed variable.
Definition at line 113 of file environment.h.
|
pure virtual |
Receives a change notification.
This function is called by the Environment when the variable observed by this observer is modified.
[in] | new_value | the new value of the observed variable. |