home *** CD-ROM | disk | FTP | other *** search
- /************************************************************
- *
- * Created: Sunday, January 20, 1991 4:11:08 PM
- * CNameIndex.h
- * C++ class definition for file index objects
- *
- * Copyright Neologic Systems 1992
- * All rights reserved
- *
- * Within a class, references to permanent objects are kept in a sorted list called a
- * file index. The default sorting order in an index is ascending by ID value, however
- * other sorting orders are possible. The class CNameIndex implements a sample
- * secondary index.
- *
- ***********************************************************/
- #pragma once /* Include this file only once */
- #ifndef __CNameIndex__
- #define __CNameIndex__ 1
-
- #include "NeoTypes.h"
- #include CNeoNodeH
-
- typedef struct {
- NeoID fID; // identity of the offspring this entry refers to
- CNeoString fName; // name of the offspring this entry refers to
- } NameIndexEntry;
-
- const NeoID kNameIndexID = 20;
-
- class CNameIndex : public CNeoNode {
- public:
- /** Instance Methods **/
- CNameIndex(const short aCount, CNeoNode *aParent, const NeoID aID);
- static CNeoPersist *New(void);
- virtual NeoID getClassID(void) const;
- virtual OSErr getEntryValue(const short aIndex, const NeoTag aName, const NeoTag aType, void *aValue);
- virtual long getFileLength(void) const;
- virtual long getLength(void) const;
-
- /** I/O Methods **/
- virtual void readObject(CNeoStream *aStream, const NeoTag aTag);
- virtual void writeObject(CNeoStream *aStream, const NeoTag aTag);
-
- /** Object List Management Methods **/
- virtual CNeoPersist *
- getObject(const short aIndex);
- virtual CNeoNode * insertObject(const short aIndex, CNeoPersist *aObject);
- static void * KeyManager(const NeoKeyOp aOp, ...);
-
- /** Entry Methods **/
- virtual short getEntrySize(void) const;
-
- protected:
- #ifdef qNeoDebug
- /** Debugging Methods **/
- virtual const void *verify(const void *aValue) const;
- #endif
-
- /** Instance Variables **/
- public:
- NameIndexEntry fEntry[kNeoDefaultNodeEntryCount]; // references to objects in the list
- };
- #endif
-