Public Member Functions | Private Attributes | List of all members
cSetValueTemporarily< T > Class Template Reference

helper class to set value on construction and reset to previous value on destruction. (RAII-idiom) More...

#include <util.h>

Public Member Functions

 cSetValueTemporarily (T *_value_ptr, T new_value)
 CTOR: remember current value of _value_ptr and set it to new_value. More...
 
 ~cSetValueTemporarily ()
 DTOR: restore the remembered value. More...
 

Private Attributes

old_value
 
T * value_ptr
 

Detailed Description

template<typename T>
class cSetValueTemporarily< T >

helper class to set value on construction and reset to previous value on destruction. (RAII-idiom)

Definition at line 334 of file util.h.

Constructor & Destructor Documentation

template<typename T>
cSetValueTemporarily< T >::cSetValueTemporarily ( T *  _value_ptr,
new_value 
)
inline

CTOR: remember current value of _value_ptr and set it to new_value.

Definition at line 340 of file util.h.

template<typename T>
cSetValueTemporarily< T >::~cSetValueTemporarily ( )
inline

DTOR: restore the remembered value.

Definition at line 348 of file util.h.

Member Data Documentation

template<typename T>
T cSetValueTemporarily< T >::old_value
private

Definition at line 337 of file util.h.

template<typename T>
T* cSetValueTemporarily< T >::value_ptr
private

Definition at line 336 of file util.h.


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


sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Sun Aug 18 2019 03:42:21