home *** CD-ROM | disk | FTP | other *** search
- /*
- File: SortedDynamicArray.h
-
- Contains: An abstract base class for sorted dynamic arrays
-
- Written by: Dave Falkenburg
-
- Copyright: © 1994-95 by Dave Falkenburg, all rights reserved.
-
- Change History (most recent first):
-
- <1> 1/3/95 DRF First checked in.
- */
-
- #ifndef _SORTEDDYNAMICARRAY_
- #define _SORTEDDYNAMICARRAY_
- #pragma once
-
- #include "DynamicArray.h"
-
- //--------------------------------------------------------------------------------
- class TSortedDynamicArray : public TDynamicArray
- {
- protected:
- // Protect the constructor because it isn’t legal
- // to create a TSortedDynamicArray directly.
-
- TSortedDynamicArray();
-
- // methods which must be overridden:
-
- typedef SInt32 CompareResult;
- virtual CompareResult Compare(ArrayElementPtr element1,
- ArrayElementPtr element2) = 0;
-
- public:
- OSErr Add(ArrayElementPtr newElement);
- ArrayElementPtr Find(ArrayElementPtr prototypeElement);
- };
-
- #endif
-