Classes | Public Member Functions | Private Types | Private Attributes
utilmm::auto_flag< bool > Class Template Reference

#include <auto_flag.hh>

List of all members.

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

Detailed Description

template<>
class utilmm::auto_flag< bool >

Definition at line 36 of file auto_flag.hh.


Member Typedef Documentation

typedef void(safe_bool_struct::* utilmm::auto_flag< bool >::safe_bool)() [private]

Definition at line 45 of file auto_flag.hh.


Constructor & Destructor Documentation

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.


Member Function Documentation

bool utilmm::auto_flag< bool >::get ( ) const [inline]

Get the current value of the flag

Returns:
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.


Member Data Documentation

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.


The documentation for this class was generated from the following file:


utilmm
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Mon Oct 6 2014 03:17:01