Memory Block Class
Topics
:The MemoryBlock class is a general-purpose data structure is use by the Device Cache classes to store data in small fixed length blocks of memory.
const unsigned MEMORY_BLOCK_SIZE = 1024; // Fixed Block size
MemoryBlock::MemoryBlock()
MemoryBlock::GetDimLen()
MemoryBlock::Load()
MemoryBlock::length()
MemoryBlock::m_buf()
MemoryBlock::resize()
unsigned MemoryBlock::GetDimLen()
- Public member function that returns the maximum number of bytes a block can contain.void MemoryBlock::Load(const void *buf, unsigned bytes)
- Public member function used to load data into a buffer. NOTE: The byte size will automatically be truncated if the size of the fixed length block is exceeded.unsigned MemoryBlock::length()
- Public member function that returns the logical length (number of byte actually used) of a memory block. - Public member function that returns a pointer to the memory block.const char *MemoryBlock::m_buf()
- Public member function that returns a pointer to the memory buffer.int MemoryBlock::resize(unsigned bytes)
- Public member function used to resize the logical length of this block. Returns false if the fixed length is exceeded.
End Of Document |