home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Pier Shareware 6
/
The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso
/
038
/
dho_9a.zip
/
LIST.H
< prev
next >
Wrap
C/C++ Source or Header
|
1994-10-12
|
2KB
|
79 lines
// Developer Helper Object Set, (C) 1994 Thomas E. Bednarz, Jr.
// All rights reserved
#ifndef __LIST_H__
#define __LIST_H__
#include "object.h"
typedef unsigned short ushort;
typedef unsigned char uchar;
typedef Boolean (TestFunc)( TObject*, void * );
typedef void (*AppFunc)( TObject*, void* );
const char EOS = '\0';
typedef short ListIndex;
const ccNotFound = -1;
const maxCollectionSize = (int)((65536uL - 16)/sizeof( TObject* ));
class TList: public TObject
{
virtual void freeItem( TObject *item );
protected:
TList();
TObject **fItems;
ListIndex fCount;
ListIndex fLimit;
ListIndex fDelta;
Boolean fShouldDelete;
public:
TList( ListIndex aLimit, ListIndex aDelta );
virtual ~TList();
TObject *at( ListIndex index );
virtual ListIndex indexOf( TObject *item );
void atFree( ListIndex index );
void atRemove( ListIndex index );
void remove( TObject *item );
void removeAll();
void free( TObject *item );
void freeAll();
void atInsert( ListIndex index, TObject *item );
void atPut( ListIndex index, TObject *item );
virtual ListIndex insert( TObject *item );
static void error( ListIndex code, ListIndex info );
TObject *firstThat( TestFunc Test, void *arg );
TObject *lastThat( TestFunc Test, void *arg );
void forEach( AppFunc action, void *arg );
void pack();
virtual void setLimit( ListIndex aLimit );
ListIndex getCount();
virtual const char *getClassName(void);
};
#endif //list.h