LoganBerryClass.mesa
Copyright Ó 1989, 1992 by Xerox Corporation. All rights reserved.
Doug Terry, October 24, 1990 12:29 pm PDT
Willie-s, April 23, 1992 3:06 pm PDT
Mechanisms for registering new LoganBerry classes. A LoganBerry class is a collection of routines that implement the LoganBerry interface. In addition to the standard LoganBerry implementation, examples of LoganBerry classes include stubs for performing RPC calls to remote LoganBerry servers and "veneers" that enable other databases, such as Cypress, to be accessed as LoganBerry databases.
A specific class is bound to a database handle during the Open call. On Open, each registered LoganBerry class is given the opportunity to Open the named database. The first class that returns a non-null open database handle is used for subsequent calls on that handle. Thus, the Open routine for each class should first check that the named database is one that is managed by the particular class.
Methods
See LoganBerry.mesa for a description of the various LoganBerry operations.
OpenProc: TYPE ~ PROC [conv: Conv, dbName: ROPE] RETURNS [db: OpenDB];
DescribeProc: TYPE ~ PROC [conv: Conv, db: OpenDB] RETURNS [info: SchemaInfo];
ReadEntryProc: TYPE ~ PROC [conv: Conv, db: OpenDB, key: AttributeType, value: AttributeValue] RETURNS [entry: Entry, others: BOOLEAN];
EnumerateEntriesProc: TYPE ~ PROC [db: OpenDB, key: AttributeType, start: AttributeValue, end: AttributeValue, proc: EntryProc] RETURNS [];
GenerateEntriesProc: TYPE ~ PROC [conv: Conv, db: OpenDB, key: AttributeType, start: AttributeValue, end: AttributeValue] RETURNS [cursor: Cursor];
NextEntryProc: TYPE ~ PROC [conv: Conv, cursor: Cursor, dir: CursorDirection] RETURNS [entry: Entry];
EndGenerateProc: TYPE ~ PROC [conv: Conv, cursor: Cursor] RETURNS [];
WriteEntryProc: TYPE ~ PROC [conv: Conv, db: OpenDB, entry: Entry, log: LogID, replace: BOOLEAN] RETURNS [];
DeleteEntryProc: TYPE ~ PROC [conv: Conv, db: OpenDB, key: AttributeType, value: AttributeValue] RETURNS [deleted: Entry];
CloseProc: TYPE ~ PROC [conv: Conv, db: OpenDB] RETURNS [];
BuildIndicesProc: TYPE ~ PROC [conv: Conv, db: OpenDB] RETURNS [];
CompactLogsProc: TYPE ~ PROC [conv: Conv, db: OpenDB] RETURNS [];
RegisterWriteProcProc: TYPE ~ PROC [proc: WriteProc, db: OpenDB, ident: ATOM, clientData: REF] RETURNS [];
UnregisterWriteProcProc: TYPE ~ PROC [db: OpenDB, ident: ATOM] RETURNS [];
IsLocalProc: TYPE ~ PROC [db: OpenDB] RETURNS [local: BOOL];
StartTransactionProc: TYPE ~ PROC [db: OpenDB, wantAtomic: BOOLEAN ¬ FALSE];
EndTransactionProc: TYPE ~ PROC [db: OpenDB, commit: BOOLEAN ¬ TRUE] RETURNS [committed: BOOLEAN];
FlushDBCacheProc: TYPE ~ PROC [db: OpenDB ¬ nullDB];
Class: TYPE ~ REF ClassObject;
ClassObject:
TYPE ~
RECORD [
name: ATOM ¬ NIL,
open: OpenProc ¬ NIL,
describe: DescribeProc ¬ NIL,
readEntry: ReadEntryProc ¬ NIL,
enumerateEntries: EnumerateEntriesProc ¬ NIL,
generateEntries: GenerateEntriesProc ¬ NIL,
nextEntry: NextEntryProc ¬ NIL,
endGenerate: EndGenerateProc ¬ NIL,
writeEntry: WriteEntryProc ¬ NIL,
deleteEntry: DeleteEntryProc ¬ NIL,
close: CloseProc ¬ NIL,
buildIndices: BuildIndicesProc ¬ NIL,
compactLogs: CompactLogsProc ¬ NIL,
isLocal: IsLocalProc ¬ NIL,
startTransaction: StartTransactionProc ¬ NIL,
endTransaction: EndTransactionProc ¬ NIL,
flushDBCache: FlushDBCacheProc ¬ NIL,
classData: REF ¬ NIL
];
Record for class-specific methods and state.