<<>> <> <> <> <<>> <> <<>> <> <<>> <> <<>> DIRECTORY PatternMatch USING [MatchProc], Rope USING [ROPE], LoganBerry; LoganQueryClass: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; <> QueryClass: TYPE = REF QueryClassRec; QueryClassRec: TYPE = RECORD [ flavor: ATOM ¬ NIL, -- name of cursor's class retrieve: RetrieveProc ¬ NIL, -- get next database entry destroy: DestroyProc ¬ NIL -- end the query (and destroy the cursor) ]; RetrieveProc: TYPE = PROC [cursor: Cursor, dir: CursorDirection ¬ increasing] RETURNS [entry: LoganBerry.Entry]; <> DestroyProc: TYPE = PROC [cursor: Cursor] RETURNS []; <> <> Cursor: TYPE = RECORD [ class: QueryClass ¬ NIL, -- cursor's class data: REF -- data slot for cursor class implementor ]; CursorDirection: TYPE = LoganBerry.CursorDirection; <> <<$Simple>> GenerateEntries: PROC [db: LoganBerry.OpenDB, key: LoganBerry.AttributeType, start: LoganBerry.AttributeValue ¬ NIL, end: LoganBerry.AttributeValue ¬ NIL] RETURNS [cursor: Cursor]; <> <> <<>> <<$Filter>> MatchProc: TYPE = PatternMatch.MatchProc; FilterEntries: PROC [input: Cursor, pattern: ROPE, filter: MatchProc, atype: LoganBerry.AttributeType, stopIfNothingGreater: BOOLEAN ¬ FALSE] RETURNS [output: Cursor]; <> <<$Merger>> MergeEntries: PROC [input1, input2: Cursor, atype: LoganBerry.AttributeType] RETURNS [output: Cursor]; <> <> <<$AntiFilter>> AntiFilterEntries: PROC [input: Cursor, pattern: ROPE, filter: MatchProc, atype: LoganBerry.AttributeType] RETURNS [output: Cursor]; <> <<$Duplicator>> DuplicateEntries: PROC [input: Cursor] RETURNS [output1, output2: Cursor]; <> <<>> <<$UnDuplicator>> UnDuplicateEntries: PROC [input: Cursor, atype: LoganBerry.AttributeType] RETURNS [output: Cursor]; <> <<>> <<$Subtracter>> SubtractEntries: PROC [input, except: Cursor, ptype, atype: LoganBerry.AttributeType] RETURNS [output: Cursor]; <> <<>> <<$Feeder>> FeedEntries: PROC [] RETURNS [output: Cursor]; <> <<>> SetFeederInput: PROC [feeder, input: Cursor]; <> <> <<$Aborter>> <<>> EnableAborts: PROC [input: Cursor] RETURNS [output: Cursor]; <> AbortQuery: PROC [cursor: Cursor]; <> <<>> END. <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <<>>