#include <Dinfo.h>
Public Member Functions | |
Dinfo () | |
Dinfo (bool isOneZombie) | |
char * | allocData (unsigned int numData) const |
char * | copyData (const char *orig, unsigned int origEntries, unsigned int copyEntries, unsigned int startEntry) const |
void | assignData (char *data, unsigned int copyEntries, const char *orig, unsigned int origEntries) const |
void | destroyData (char *d) const |
unsigned int | size () const |
unsigned int | sizeIncrement () const |
bool | isA (const DinfoBase *other) const |
char* Dinfo< D >::allocData | ( | unsigned int | numData | ) | const [inline, virtual] |
Implements DinfoBase.
void Dinfo< D >::assignData | ( | char * | copy, | |
unsigned int | copyEntries, | |||
const char * | orig, | |||
unsigned int | origEntries | |||
) | const [inline, virtual] |
Assigns data contents from 'orig' over to 'copy'. Tiles the origEntries onto the copyEntries. So if there are fewer origEntries, the orig data contents are repeated till the copy is full.
Implements DinfoBase.
References DinfoBase::isOneZombie().
char* Dinfo< D >::copyData | ( | const char * | orig, | |
unsigned int | origEntries, | |||
unsigned int | copyEntries, | |||
unsigned int | startEntry | |||
) | const [inline, virtual] |
Return a newly allocated copy of the original data, repeated copyEntries times. Orig data untouched. Analogous to copying a vector into a bigger one. Repeat the original data as many times as possible.
Implements DinfoBase.
References DinfoBase::isOneZombie().
void Dinfo< D >::destroyData | ( | char * | d | ) | const [inline, virtual] |
Implements DinfoBase.
unsigned int Dinfo< D >::size | ( | ) | const [inline, virtual] |
Implements DinfoBase.
Reimplemented in ZeroSizeDinfo< D >.
unsigned int Dinfo< D >::sizeIncrement | ( | ) | const [inline, virtual] |
This little hack is used for lookups of a data entry in an array. Normally sizeIncrement is identical to size. However, if it is a OneZombie then we always need to return the original pointer, so here sizeIncrement becomes zero.
Implements DinfoBase.
Reimplemented in ZeroSizeDinfo< D >.