Inheritance diagram for CP_MacOSHandle:
Public Member Functions | |
Constructor / Destructor | |
CP_MacOSHandle () | |
Constructor. | |
CP_MacOSHandle (UInt32 inSize) | |
CP_MacOSHandle (CP_MacOSHandle &inHandleBlock) | |
CP_MacOSHandle (Handle inMacHandle, bool inOwnsHandle=true) | |
~CP_MacOSHandle () throw () | |
Destructor. | |
Copying | |
void | CopyTo (void *inBuffer, UInt32 inNumBytes) |
void | CopyFrom (void *ioBuffer, UInt32 inNumBytes) |
Getters | |
Handle | GetHandle () |
char * | GetPtr () |
Length | |
UInt32 | Length () const |
void | SetLength (UInt32 inLength) |
Locking | |
void | Lock () |
void | Unlock () |
bool | IsLocked () |
Operators | |
CP_MacOSHandle & | operator= (CP_MacOSHandle &inHandleBlock) |
operator Handle () | |
Ownership | |
void | Adopt (Handle inHandle) |
Handle | Release () const |
Testers | |
bool | IsValid () |
bool | OwnsHandle () |
Utility | |
void | Wrap (Handle inExistingHandle, bool inOwnsHandle=true) |
void | Detach () |
CP_MacOSHandle * | Clone () |
Protected Attributes | |
Handle | fBlock |
bool | fOwnsHandle |
bool | fLocked |
UInt32 | fActualBlockLength |
Private Member Functions | |
Allocation | |
void | Allocate (UInt32 inSize) |
void | Deallocate () |
|
Constructor.
|
|
Constructor.
|
|
Copy constructor.
|
|
Constructor.
|
|
Destructor.
|
|
Copies the passed in number of bytes of this memory block to the passed in destination buffer. The copy will start at the beginning of the memory block.
|
|
Copies the passed in number of bytes from the passed in buffer to this block of memory, starting at the first byte of this memory block.
|
|
Returns the Handle for the memory block of this object. If this object still owns this memory, be careful not to delete the OSHandle, otherwise there will be a problem when this object tries to release the already released memory.
|
|
Returns a char * to the actual bytes of this memory. This will lock the handle for accessing, in case the underlying OS can move a handle. You are responsible for calling the Unlock() memory when done to unlock the memory.
|
|
Returns the length of this memory block.
|
|
Set the length of the memory block. This will cause the platforms memory block to be resized to accommodate these changes.
|
|
Locks the platforms OSHandle.
|
|
Unlocks the platforms OSHandle.
|
|
Returns true if the memory block is locked.
|
|
Assignment operator. This will cause any memory in this object to be deallocated first, if we own the handle. Then the OS memory block will point to that of the passed in handle block object. The passed in handle block objects reference count will also be increased, since the underlying OSHandle is now shareed by this class.
|
|
Returns the MacOS Handle.
|
|
Adopts the passed in handle for this object.
|
|
Releases the handle owned by this object, and returns the handle.
|
|
Returns true if the memory block is not NULL.
|
|
Returns true if this object owns the block of memory, and is therefore responsible for its deletion. Otherwise the memory block held by this object will not be deleted by this class.
|
|
Wrap ourselves around an existing platforms Handle. If inOwnsHandle is true, then this object takes over ownership of the Handle and will be responsible for deleting the memory.
|
|
Notifies this class that it no longer owns the memory, and will not delete it. You are now responsible for deleting the memory to avoid a memory leak.
|
|
Return a new CP_MacOSHandle object that is a duplicate of this one. Use this method if you want to duplicate the data inside another CP_MacOSHandle object without retaining a reference to it.
|
|
Private routine to handle the allocation of the platforms memory block.
|
|
Private routine to handle the deallocation of the platforms memory block. This will only happen if this object owns the allocated memory, otherwise you are responsible for the deallocation of the memory.
|
|
Add a reference to our object, returning the new reference count.
|
|
Remove a reference to our object, returning the new reference count. If the count is 0, then this object is also deleted, and 0 is returned.
|
|
Add the object to the topmost auto-release pool. This will ensure that the object is eventually released.
|
|
Returns the current ref count.
|
|
|
|
Platforms memory object. |
|
Flag to indicate who is responsible for deleting the platforms memory. |
|
Flag to indicate if the block is locked. |