23 virtual char*
allocData(
unsigned int numData )
const = 0;
25 virtual unsigned int size()
const = 0;
34 virtual char*
copyData(
const char* orig,
unsigned int origEntries,
35 unsigned int copyEntries,
unsigned int startEntry )
const = 0;
43 virtual void assignData(
char* copy,
unsigned int copyEntries,
44 const char* orig,
unsigned int origEntries )
const = 0;
75 return reinterpret_cast< char*
>(
new( nothrow) D[ numData ] );
78 char*
copyData(
const char* orig,
unsigned int origEntries,
79 unsigned int copyEntries,
unsigned int startEntry )
const
81 if ( origEntries == 0 )
86 D* ret =
new( nothrow ) D[copyEntries];
89 const D* origData =
reinterpret_cast< const D*
>( orig );
90 for (
unsigned int i = 0; i < copyEntries; ++i ) {
91 ret[ i ] = origData[ ( i + startEntry ) % origEntries ];
103 return reinterpret_cast< char*
>( ret );
107 const char* orig,
unsigned int origEntries )
const
109 if ( origEntries == 0 || copyEntries == 0 ||
110 orig == 0 || data == 0 ) {
115 const D* origData =
reinterpret_cast< const D*
>( orig );
116 D* tgt =
reinterpret_cast< D*
>( data );
117 for (
unsigned int i = 0; i < copyEntries; ++i ) {
118 tgt[ i ] = origData[ i % origEntries ];
138 delete[]
reinterpret_cast< D*
>( d );
171 return dynamic_cast< const Dinfo< D >*
>( other );
virtual bool isA(const DinfoBase *other) const =0
virtual unsigned int size() const =0
virtual void destroyData(char *d) const =0
unsigned int size() const
DinfoBase(bool isOneZombie)
unsigned int sizeIncrement_
virtual char * copyData(const char *orig, unsigned int origEntries, unsigned int copyEntries, unsigned int startEntry) const =0
char * allocData(unsigned int numData) const
unsigned int size() const
virtual unsigned int sizeIncrement() const =0
unsigned int sizeIncrement() const
void assignData(char *data, unsigned int copyEntries, const char *orig, unsigned int origEntries) const
unsigned int sizeIncrement() const
char * copyData(const char *orig, unsigned int origEntries, unsigned int copyEntries, unsigned int startEntry) const
virtual void assignData(char *copy, unsigned int copyEntries, const char *orig, unsigned int origEntries) const =0
virtual char * allocData(unsigned int numData) const =0
void destroyData(char *d) const
bool isA(const DinfoBase *other) const