Humble Framework for SkyOS


Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

HMem< BUFFER_SIZE > Class Template Reference
[Base]

#include <HMemory.h>

Inheritance diagram for HMem< BUFFER_SIZE >:

HObj

Detailed Description

template<uint32 BUFFER_SIZE>
class HMem< BUFFER_SIZE >

The HMem class is a "buffer" class that allocates a fixed block of memory.

Definition at line 395 of file HMemory.h.

Public Member Functions

 HMem (PtrConst pData, uint32 uSize) throw ()
ErrCode Zero (void)
 Zeroes the buffer, i.e. sets all content bytes to zero (0x00).
uint8 GetAt (uint32 udx) const
 Returns the byte at a given offset, or zero if offset is out of bounds.
ErrCode SetAt (uint32 udx, uint8 xVal)
 Sets the byte at a given offset.
ErrCode SetAt (uint32 udx, PtrConst pData, uint32 uBytes)
 Sets a series of bytes at a given offset.
 operator PtrDataConst () const
uint8 & operator[] (uint32 udx) throw (HError)
uint8 operator[] (uint32 udx) const throw (HError)
HMemoperator= (HMem const &rhs) throw ()

Static Public Member Functions

static uint32 GetSize (void)
 Returns the size of the buffer, or zero if non-existent.

Protected Member Functions

ErrCode assign (PtrData pData, uint32 uBytes)
 Copies data into the buffer.
bool validIndex (const uint32 udx) const
 Tests an index (offset) value for validity.
bool validPtr (PtrConst pData) const
 Tests a data pointer value for validity.

Protected Attributes

uint8 m_buffer [BUFFER_SIZE]
 data buffer


Member Function Documentation

template<uint32 BUFFER_SIZE>
ErrCode HMem< BUFFER_SIZE >::Zero void   ) 
 

Returns:
Always NO_ERROR

Definition at line 429 of file HMemory.h.

template<uint32 BUFFER_SIZE>
ErrCode HMem< BUFFER_SIZE >::assign PtrData  pData,
uint32  uBytes
[protected]
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
pData Ptr to data to copy
uBytes Count of bytes to copy

Definition at line 445 of file HMemory.h.

template<uint32 BUFFER_SIZE>
uint8 HMem< BUFFER_SIZE >::GetAt uint32  udx  )  const
 

Returns:
Byte at offset
Parameters:
udx Index of character

Definition at line 473 of file HMemory.h.

template<uint32 BUFFER_SIZE>
static uint32 HMem< BUFFER_SIZE >::GetSize void   )  [static]
 

Returns:
Size of buffer in bytes

Definition at line 479 of file HMemory.h.

template<uint32 BUFFER_SIZE>
ErrCode HMem< BUFFER_SIZE >::SetAt uint32  udx,
uint8  xVal
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
udx Index
xVal Byte to set

Definition at line 488 of file HMemory.h.

template<uint32 BUFFER_SIZE>
ErrCode HMem< BUFFER_SIZE >::SetAt uint32  udx,
PtrConst  pData,
uint32  uBytes
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
udx Index
pData Data to copy
uBytes Length of data

Definition at line 507 of file HMemory.h.

template<uint32 BUFFER_SIZE>
bool HMem< BUFFER_SIZE >::validIndex const uint32  udx  )  const [protected]
 

Returns:
True if the index falls within the buffer
Parameters:
udx Index value to test

Definition at line 543 of file HMemory.h.

template<uint32 BUFFER_SIZE>
bool HMem< BUFFER_SIZE >::validPtr PtrConst  pData  )  const [protected]
 

A valid pointer is an pointer that is non-null, and is NOT the same as the buffer pointer (to avoid self-replication). Note that this method does not do any type of length checking.

Returns:
True if the pointer is valid
Parameters:
pData Pointer to test

Definition at line 555 of file HMemory.h.


The documentation for this class was generated from the following file:
 

2006.01.09-16:37