KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVMemoryChunk Class Reference

Detailed Description

Memory handled by KVMemoryPool.

Created by KVClassFactory on Fri Oct 1 16:50:15 2010 Author: John Frankland,,,,

Definition at line 15 of file KVMemoryChunk.h.

#include <KVMemoryChunk.h>

Public Member Functions

 KVMemoryChunk ()
 Default constructor.
 
 KVMemoryChunk (size_t)
 Allocate new chunk of size 'bytes'.
 
virtual ~KVMemoryChunk ()
 Destructor.
 
voidGetMemory (size_t)
 
KVMemoryChunkNext () const
 
void Print ()
 
void SetNext (KVMemoryChunk *n)
 

Private Attributes

char * fMemory
 pointer to start of chunk
 
KVMemoryChunkfNext
 next chunk of memory
 
size_t fSize
 size of chunk in bytes
 
size_t fUsed
 memory used in bytes
 

Constructor & Destructor Documentation

◆ KVMemoryChunk() [1/2]

KVMemoryChunk::KVMemoryChunk ( )

Default constructor.

Definition at line 13 of file KVMemoryChunk.cpp.

◆ KVMemoryChunk() [2/2]

KVMemoryChunk::KVMemoryChunk ( size_t  bytes)

Allocate new chunk of size 'bytes'.

Definition at line 24 of file KVMemoryChunk.cpp.

◆ ~KVMemoryChunk()

KVMemoryChunk::~KVMemoryChunk ( )
virtual

Destructor.

Definition at line 37 of file KVMemoryChunk.cpp.

Member Function Documentation

◆ GetMemory()

void * KVMemoryChunk::GetMemory ( size_t  bytes)

Return pointer to block of memory of size 'bytes' If no block of this size is available, returns 0 (test it!!)

Definition at line 50 of file KVMemoryChunk.cpp.

◆ Next()

KVMemoryChunk * KVMemoryChunk::Next ( ) const
inline

Definition at line 32 of file KVMemoryChunk.h.

◆ Print()

void KVMemoryChunk::Print ( )

Definition at line 66 of file KVMemoryChunk.cpp.

◆ SetNext()

void KVMemoryChunk::SetNext ( KVMemoryChunk n)
inline

Definition at line 28 of file KVMemoryChunk.h.

Member Data Documentation

◆ fMemory

char* KVMemoryChunk::fMemory
private

pointer to start of chunk

Definition at line 16 of file KVMemoryChunk.h.

◆ fNext

KVMemoryChunk* KVMemoryChunk::fNext
private

next chunk of memory

Definition at line 19 of file KVMemoryChunk.h.

◆ fSize

size_t KVMemoryChunk::fSize
private

size of chunk in bytes

Definition at line 17 of file KVMemoryChunk.h.

◆ fUsed

size_t KVMemoryChunk::fUsed
private

memory used in bytes

Definition at line 18 of file KVMemoryChunk.h.