errno_scope Class Reference
[Error Library]

#include <stlsoft/error/errno_scope.hpp>

List of all members.


Detailed Description

A scoping class that scopes the thread's last error.

  DWORD   err = errno;
  { stlsoft::errno_scope  scope; // Scope the error while we change it

    // Some code that changes (or may change) the last error
    . . .

    errno = ENOMEM; // ... we just do this for pedagogical purposes

  } // End of scope - error value replaced to former value

  assert(errno == err);

Public Types

typedef errno_scope class_type

Public Member Functions

Operations
 errno_scope () throw ()
 Remembers the current value of errno.
 errno_scope (int errno_) throw ()
 Remembers the given value as the value of errno.
 ~errno_scope () throw ()
 Replaces the remembered value of errno.
Operations
 operator int () const
 The remembered value of errno.

Constructor & Destructor Documentation

errno_scope (  )  throw () [inline]

Remembers the current value of errno.

errno_scope ( int  errno_  )  throw () [inline, explicit]

Remembers the given value as the value of errno.

~errno_scope (  )  throw () [inline]

Replaces the remembered value of errno.


Member Function Documentation

operator int (  )  const [inline]

The remembered value of errno.


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

Generated on Thu Jun 10 08:58:45 2010 for STLSoft by  doxygen 1.5.6