Declared in <XHandle.h>
This is the wrapper to a block of movable memory.
Construction/Destruction
Memory size
Memory extraction
XGHandle::GetChar
XGHandle::GetLong
XGHandle::GetMemory
XGHandle::GetShort
XGHandle::SetChar
XGHandle::SetLong
XGHandle::SetMemory
XGHandle::SetShort
Memory Access
Memory manipulation
Construction/Destruction
Usage: void XGGroupBox::DoDrawView(Rect)
Create me. The 'pagesize' value is the number of bytes which I try to allocate at a time to satisfy handle resize requests.
Usage: XGHandle::~XGHandle()
Delete me
Memory size
Usage: unsigned long GetSize()const
Returns the size of this handle.
Usage: void XGHandle::SetSize(unsigned long size)
Set the new size of this handle. This will work unless it's time to reallocate the data--in that case, this may fail
Memory extraction
Usage: char GetChar(unsigned long off)const
Gets the character at the specified byte offset.
Usage: long XGHandle::GetLong(unsigned long off)const
Get the long integer in a portable way. This converts the word object from network byte order to the native order of this platform.
Usage: void XGHandle::GetMemory(unsigned long off,unsigned long len,void*data)const
Copy memory from handle into array
Usage: short XGHandle::GetShort(unsigned long off)const
Get the short integer in a portable way. This converts the word object from network byte order to the native order of this platform.
Usage: void SetChar(unsigned long off,char c)
Sets the character at the specified byte offset to the byte provided
Usage: void XGHandle::SetLong(unsigned long off,long value)
Set the long integer in a portable way This stores the word object from native order of this platform to network order.
Usage: void XGHandle::SetMemory(unsigned long off,unsigned long len,const void*data)
Copy memory from array into handle
Usage: void XGHandle::SetShort(unsigned long off,short value)
Set the short integer in a portable way. This stores the word object from native order of this platform to network order.
Memory Access
Usage: void XGHandle::Lock()
This locks the handle. You should use the XGHandleLock object to lock this handle in an exception-safe manner.
Usage: void XGHandle::Unlock()
Unlock memory. You should use the XGHandleLock object to unlock this handle in an exception/safe manner.
Usage: void*XGHandle::operator*()const
This is the quick and dirty way to access memory without locking the handle. Best to lock the handle instead
Memory manipulation
Usage: void XGHandle::Append(unsigned long len,void*ptr)
Append a block of memory to the end of this thing
Usage: void XGHandle::Delete(unsigned long off,unsigned long len)
Delete a chunk of memory from the spot specified
Usage: void XGHandle::Insert(unsigned long off,unsigned long len,void*ptr)
Insert memory into the spot specified