lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Public Types | Public Member Functions
lean::smart::auto_restore< Value > Class Template Reference

Auto restore class that automatically restores the initial value of the stored object on destruction. More...

#include <auto_restore.h>

Inherits noncopyable.

List of all members.

Public Types

typedef Value value_type
 Type of the value managed by this class.

Public Member Functions

 auto_restore (value_type &value)
 Constructs an auto-restore object that will restore the given object's current value on destruction.
 auto_restore (value_type &value, const value_type &newValue)
 Constructs an auto-restore object that will assign the given value to the given object and restore the given object's current value on destruction.
 ~auto_restore ()
 Resets the stored object to its initial value.
LEAN_INLINE value_typeget (void)
 Gets the object managed by this class.
LEAN_INLINE const value_typeget (void) const
 Gets the object managed by this class.
LEAN_INLINE value_typeoperator* ()
 Gets the object managed by this class.
LEAN_INLINE const value_typeoperator* () const
 Gets the object managed by this class.
LEAN_INLINE value_typeoperator-> ()
 Gets the object managed by this class.
LEAN_INLINE const value_typeoperator-> () const
 Gets the object managed by this class.
LEAN_INLINE operator value_type & ()
 Gets the object managed by this class.
LEAN_INLINE operator const value_type & () const
 Gets the object managed by this class.

Detailed Description

template<class Value>
class lean::smart::auto_restore< Value >

Auto restore class that automatically restores the initial value of the stored object on destruction.


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