Public Member Functions | Private Attributes
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>

List of all members.

Public Member Functions

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

Private Attributes

T old_value
Tvalue_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 351 of file util.h.


Constructor & Destructor Documentation

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

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

Definition at line 357 of file util.h.

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

DTOR: restore the remembered value.

Definition at line 365 of file util.h.


Member Data Documentation

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

Definition at line 354 of file util.h.

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

Definition at line 353 of file util.h.


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


schunk_sdh
Author(s): Mathias Luedtke , Florian Weisshardt
autogenerated on Sat Jun 8 2019 20:25:21