/* ------------------------------------------------------------------------*/ /* */ /* TVOBJS.H */ /* */ /* Copyright (c) Borland International 1991 */ /* All Rights Reserved. */ /* */ /* defines the classes TObject, TNSCollection, and TNSSortedCollection. */ /* */ /* The NS variants of collections are Not Streamable. These are */ /* needed for internal use in the stream manager. There are */ /* streamable variants of each of these classes for use by the */ /* rest of the library. */ /* */ /* ------------------------------------------------------------------------*/ #include #if defined( Uses_TObject ) && !defined( __TObject ) #define __TObject #if !defined( __STDDEF_H ) #include #endif // __STDDEF_H struct StrIt { char opt; void *item; }; class TObject { public: virtual ~TObject(); static void destroy( TObject * ); virtual void shutDown(); private: }; inline void TObject::destroy( TObject *o ) { if( o != 0 ) o->shutDown(); delete o; } #endif // Uses_TObject #if defined( Uses_TNSCollection ) && !defined( __TNSCollection ) #define __TNSCollection class TNSCollection : public TObject { public: TNSCollection( ccIndex aLimit, ccIndex aDelta ); ~TNSCollection(); virtual void shutDown(); void *at( ccIndex index ); virtual ccIndex indexOf( void *item ); void atFree( ccIndex index ); void atRemove( ccIndex index ); void remove( void *item ); void removeAll(); void free( void *item ); void freeAll(); void atInsert( ccIndex index, void *item ); void atPut( ccIndex index, void *item ); virtual ccIndex insert( void *item ); static void error( ccIndex code, ccIndex info ); void *firstThat( ccTestFunc Test, void *arg ); void *lastThat( ccTestFunc Test, void *arg ); void forEach( ccAppFunc action, void *arg ); void pack(); virtual void setLimit( ccIndex aLimit ); void SetOptItem(int item,char opt){if(item