Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

OS_Errno.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // $Id: OS_Errno.inl,v 1.1.1.1 2001/12/04 14:33:06 chad Exp $
00003 
00004 #if defined (ACE_HAS_WINCE_BROKEN_ERRNO)
00005 
00006 ACE_INLINE ACE_CE_Errno *
00007 ACE_CE_Errno::instance ()
00008 {
00009   // This should be inlined.
00010   return ACE_CE_Errno::instance_;
00011 }
00012 
00013 ACE_INLINE
00014 ACE_CE_Errno::operator int (void) const
00015 {
00016   return (int) TlsGetValue (ACE_CE_Errno::errno_key_);
00017 }
00018 
00019 ACE_INLINE int
00020 ACE_CE_Errno::operator= (int x)
00021 {
00022   // error checking?
00023   TlsSetValue (ACE_CE_Errno::errno_key_, (void *) x);
00024   return x;
00025 }
00026 
00027 #endif /* ACE_HAS_WINCE_BROKEN_ERRNO */
00028 
00029 ACE_INLINE
00030 ACE_Errno_Guard::ACE_Errno_Guard (ACE_ERRNO_TYPE &errno_ref,
00031                                   int error)
00032   :
00033 #if defined (ACE_MT_SAFE)
00034     errno_ptr_ (&errno_ref),
00035 #endif /* ACE_MT_SAFE */
00036     error_ (error)
00037 {
00038 #if !defined(ACE_MT_SAFE)
00039   ACE_UNUSED_ARG (errno_ref);
00040 #endif /* ACE_MT_SAFE */
00041 }
00042 
00043 ACE_INLINE
00044 ACE_Errno_Guard::ACE_Errno_Guard (ACE_ERRNO_TYPE &errno_ref)
00045   :
00046 #if defined (ACE_MT_SAFE)
00047     errno_ptr_ (&errno_ref),
00048 #endif /* ACE_MT_SAFE */
00049     error_ (errno_ref)
00050 {
00051 }
00052 
00053 ACE_INLINE
00054 ACE_Errno_Guard::~ACE_Errno_Guard (void)
00055 {
00056 #if defined (ACE_MT_SAFE)
00057   *errno_ptr_ = this->error_;
00058 #else
00059   errno = this->error_;
00060 #endif /* ACE_MT_SAFE */
00061 }
00062 
00063 #if defined (ACE_HAS_WINCE_BROKEN_ERRNO)
00064 ACE_INLINE int
00065 ACE_Errno_Guard::operator= (const ACE_ERRNO_TYPE &error)
00066 {
00067   return this->error_ = error;
00068 }
00069 #endif /* ACE_HAS_WINCE_BROKEN_ERRNO */
00070 
00071 ACE_INLINE int
00072 ACE_Errno_Guard::operator= (int error)
00073 {
00074   return this->error_ = error;
00075 }
00076 
00077 ACE_INLINE int
00078 ACE_Errno_Guard::operator== (int error)
00079 {
00080   return this->error_ == error;
00081 }
00082 
00083 ACE_INLINE int
00084 ACE_Errno_Guard::operator!= (int error)
00085 {
00086   return this->error_ != error;
00087 }

Generated on Mon Jun 16 11:20:44 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002