CMS 3D CMS Logo

lat::SaveErrno Class Reference

A class to save and restore errno over while the object exists. More...

#include <Iguana/Utilities/classlib/utils/SaveErrno.h>

List of all members.

Public Member Functions

 SaveErrno (void)
 Save the current value of errno.
 ~SaveErrno (void)
 Restore the saved value of errno.

Private Attributes

int m_errno
int m_winerr


Detailed Description

A class to save and restore errno over while the object exists.

On Windows saves both errno and GetLastError() value.

Definition at line 22 of file SaveErrno.h.


Constructor & Destructor Documentation

lat::SaveErrno::SaveErrno ( void   )  [inline]

Save the current value of errno.

Definition at line 40 of file SaveErrno.h.

References m_errno, and m_winerr.

00041 {
00042     m_errno = errno;
00043 # ifdef _WIN32
00044     m_winerr = GetLastError ();
00045 # endif
00046 }

lat::SaveErrno::~SaveErrno ( void   )  [inline]

Restore the saved value of errno.

Definition at line 50 of file SaveErrno.h.

References m_errno, and m_winerr.

00051 {
00052     errno = m_errno;
00053 # ifdef _WIN32
00054     SetLastError (m_winerr);
00055 # endif
00056 }


Member Data Documentation

int lat::SaveErrno::m_errno [private]

Definition at line 31 of file SaveErrno.h.

Referenced by SaveErrno(), and ~SaveErrno().

int lat::SaveErrno::m_winerr [private]

Definition at line 32 of file SaveErrno.h.

Referenced by SaveErrno(), and ~SaveErrno().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:48:34 2009 for CMSSW by  doxygen 1.5.4