$search

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

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


schunk_sdh
Author(s): Florian Weisshardt
autogenerated on Sat Mar 2 13:36:44 2013