#include <auto_flag.hh>
Classes | |
| struct | safe_bool_struct |
Public Member Functions | |
| auto_flag (bool &flag, bool init=true, bool restore_old=true) | |
| bool | get () const |
| operator safe_bool () const | |
| ~auto_flag () | |
Private Types | |
| typedef void(safe_bool_struct::* | safe_bool )() |
Private Attributes | |
| bool & | m_flag |
| bool | m_restore |
Definition at line 36 of file auto_flag.hh.
typedef void(safe_bool_struct::* utilmm::auto_flag< bool >::safe_bool)() [private] |
Definition at line 45 of file auto_flag.hh.
| utilmm::auto_flag< bool >::auto_flag | ( | bool & | flag, |
| bool | init = true, |
||
| bool | restore_old = true |
||
| ) | [inline] |
Sets flag to init. On destruction, the flag will be set to either ! init if restore_old is false, or to the initial flag value if restore_old is true
Definition at line 52 of file auto_flag.hh.
| utilmm::auto_flag< bool >::~auto_flag | ( | ) | [inline] |
Sets the value of the flag according to the restore_old argument of the constructor
Definition at line 59 of file auto_flag.hh.
| bool utilmm::auto_flag< bool >::get | ( | ) | const [inline] |
Get the current value of the flag
Definition at line 63 of file auto_flag.hh.
| utilmm::auto_flag< bool >::operator safe_bool | ( | ) | const [inline] |
Definition at line 65 of file auto_flag.hh.
bool& utilmm::auto_flag< bool >::m_flag [private] |
Definition at line 39 of file auto_flag.hh.
bool utilmm::auto_flag< bool >::m_restore [private] |
Definition at line 40 of file auto_flag.hh.