Inheritance diagram for CP_MacOSPtr:
Public Member Functions | |
Constructor / Destructor | |
CP_MacOSPtr () | |
Constructor. | |
CP_MacOSPtr (UInt32 inSize) | |
CP_MacOSPtr (CP_MacOSPtr &inPtrBlock) | |
CP_MacOSPtr (Ptr inMacPtr, bool inOwnsPtr=true) | |
~CP_MacOSPtr () | |
Destructor. | |
Copying | |
void | CopyTo (void *inBuffer, UInt32 inNumBytes) const |
void | CopyFrom (void *ioBuffer, UInt32 inNumBytes) |
Getters | |
Ptr | GetOSPtr () |
char * | GetPtr () |
Length | |
UInt32 | Length () const |
void | SetLength (UInt32 inLength) |
Locking | |
void | Lock () |
void | Unlock () |
bool | IsLocked () |
Operators | |
CP_MacOSPtr & | operator= (CP_MacOSPtr &inPtrBlock) |
operator Ptr () | |
Testers | |
bool | IsValid () |
bool | OwnsPtr () |
Wrapping | |
void | Wrap (Ptr inExistingPtr, bool inOwnsPtr=true) |
void | Detach () |
Protected Attributes | |
Ptr | fBlock |
bool | fOwnsPtr |
bool | fLocked |
UInt32 | fActualBlockLength |
Private Member Functions | |
Allocation | |
void | Allocate (UInt32 inSize) |
void | Deallocate () |
|
Constructor.
|
|
Constructor.
|
|
Copy constructor.
|
|
Constructor.
|
|
Destructor.
|
|
Returns a char * to the actual bytes of this memory.
|
|
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 OS memory block.
|
|
Returns the OSPtr for the memory block of this object. If this object still owns this memory, be careful not to delete the OSPtr, otherwise there will be a problem when this object tries to release the already released 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 OSPtr if necessary.
|
|
Unlocks the platforms OSPtr.
|
|
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.
|
|
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 Ptr. If inOwnsHandle is true, then this object takes over ownership of the Ptr 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.
|
|
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. |