Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_AutoOSHandle Class Reference

A smart pointer like class for dealing with handles. More...

List of all members.

Public Member Functions

Constructor / Destructor
 CP_AutoOSHandle ()
 Constructor.
 CP_AutoOSHandle (CP_AutoOSHandle &inAutoHandle)
 CP_AutoOSHandle (OSHandle inHandle)
 CP_AutoOSHandle (size_t inSize)
 ~CP_AutoOSHandle () throw ()
 Destructor.
operators
CP_AutoOSHandleoperator= (CP_AutoOSHandle &ioHandle) throw ()
 operator OSHandle () const throw ()
Getters
OSHandle Get () const throw ()
Management
OSHandle Release () throw ()
void Reset (OSHandle inHandle=NULL) throw ()

Protected Attributes

OSHandle fHandle
OSPtr fHandlePtr


Detailed Description

This class wraps an OSs handle object into a smart pointer that manages the allocation and deallocation automatically.


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_AutoOSHandle::CP_AutoOSHandle  ) 
 

Constructor. Allocates a default 1 byte handle.

Exceptions:
NULL exceptions

CP_AutoOSHandle::CP_AutoOSHandle CP_AutoOSHandle inAutoHandle  ) 
 

Copy onstructor.

Parameters:
inAutoHandle AutoHandle object to copy the contents from.
Exceptions:
none 

CP_AutoOSHandle::CP_AutoOSHandle OSHandle  inHandle  )  [explicit]
 

Constructor.

Parameters:
inHandle OSHandle to acquire ownership of.
Exceptions:
none 

CP_AutoOSHandle::CP_AutoOSHandle size_t  inSize  )  [explicit]
 

Constructor.

Parameters:
inSize Size to allocate for new handle.
Exceptions:
NULL NULL exception if the memory could not be allocated.

CP_AutoOSHandle::~CP_AutoOSHandle  )  throw ()
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_AutoOSHandle & CP_AutoOSHandle::operator= CP_AutoOSHandle inAutoHandle  )  throw ()
 

Assignment operator. Copies the fields from the passed in AutoHandle to this object.

Parameters:
inAutoHandle AutoHandle object to copy fields from.
Exceptions:
none 
Returns:
CP_AutoOSHandle& Returns a reference to ourselves.

CP_AutoOSHandle::operator OSHandle  )  const throw ()
 

Returns the handle as an OSHandle.

Exceptions:
none 
Returns:
OSHandle The platforms OS handle.

OSHandle CP_AutoOSHandle::Get  )  const throw ()
 

Returns the handle as an OSHandle.

Exceptions:
none 
Returns:
OSHandle The platforms OS handle.

OSHandle CP_AutoOSHandle::Release  )  throw ()
 

Sets the OSHandle of this object to NULL, and returns the previous OS handle.

Exceptions:
none 
Returns:
OSHandle Returns the previous handle.

void CP_AutoOSHandle::Reset OSHandle  inHandle = NULL  )  throw ()
 

Disposes of the OSHandle previously held in this objects, and then sets the handle to the passed in OSHandle.

Parameters:
inHandle The OSHandle to acquire ownership of.
Exceptions:
none 
Returns:
OSHandle Returns the previous handle.


Member Data Documentation

OSHandle CP_AutoOSHandle::fHandle [protected]
 

OSPtr CP_AutoOSHandle::fHandlePtr [protected]
 

Platforms handle object.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:22 2005 for CPLAT by  doxygen 1.4.0