Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Protected Attributes
StHandleHolder Class Reference

#include <nsAEUtils.h>

List of all members.

Classes

class  getter

Public Member Functions

 StHandleHolder (Handle inHandle=nil)
 ~StHandleHolder ()
StHandleHolderoperator= (Handle rhs)
void Lock ()
void Unlock ()
Handle GetHandle ()
Size GetHandleSize ()
Ptr GetPtr ()
getter operator& ()
getter AssignHandle ()

Protected Attributes

Handle mHandle
SInt32 mLockCount
UInt8 mOldHandleState

Detailed Description

Definition at line 200 of file nsAEUtils.h.


Constructor & Destructor Documentation

StHandleHolder::StHandleHolder ( Handle  inHandle = nil)

Definition at line 590 of file nsAEUtils.cpp.

:      mHandle(inHandle)
,      mLockCount(0)
{
}

Definition at line 601 of file nsAEUtils.cpp.

{
       if (mHandle)
              DisposeHandle(mHandle);
}

Member Function Documentation

Definition at line 244 of file nsAEUtils.h.

                                   {
                                          return getter(*this);
                                   }
Handle StHandleHolder::GetHandle ( ) [inline]

Definition at line 211 of file nsAEUtils.h.

{ return mHandle; }
Size StHandleHolder::GetHandleSize ( ) [inline]

Definition at line 212 of file nsAEUtils.h.

{ return (mHandle) ? ::GetHandleSize(mHandle) : 0; } 
Ptr StHandleHolder::GetPtr ( ) [inline]

Definition at line 213 of file nsAEUtils.h.

{ return (mHandle) ? *mHandle : nil; }

Definition at line 628 of file nsAEUtils.cpp.

{
       ThrowIfNil(mHandle);
       if (++mLockCount > 1) return;
       mOldHandleState = HGetState(mHandle);
       HLock(mHandle);
}
getter StHandleHolder::operator& ( ) [inline]

Definition at line 239 of file nsAEUtils.h.

                                   {
                                          return getter(*this);
                                   }
StHandleHolder & StHandleHolder::operator= ( Handle  rhs)

Definition at line 612 of file nsAEUtils.cpp.

{
       AE_ASSERT(mLockCount == 0, "Bad lock count");
       mLockCount = 0;
       
       if (mHandle)
              DisposeHandle(mHandle);
              
       mHandle = rhs;
       return *this;
}

Definition at line 640 of file nsAEUtils.cpp.

{
       ThrowIfNil(mHandle);
       AE_ASSERT(mLockCount > 0, "Bad lock count");
       if (--mLockCount == 0)
              HSetState(mHandle, mOldHandleState);
}

Member Data Documentation

Handle StHandleHolder::mHandle [protected]

Definition at line 251 of file nsAEUtils.h.

SInt32 StHandleHolder::mLockCount [protected]

Definition at line 252 of file nsAEUtils.h.

Definition at line 253 of file nsAEUtils.h.


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