-- File: DBModel.mesa -- Contents: Internal versions of DBModel procs, imported by DBImpl -- and exported to DBModel. -- Last edited by: -- Cattell on: July 21, 1983 2:05 pm -- Willie-sue, February 3, 1983 10:51 am DIRECTORY Rope, DB; DBModel: DEFINITIONS IMPORTS DB = BEGIN OPEN DB; QInitialize: PROC[ nCachePages: NAT, nFreeTuples: NAT, cacheFileName: ROPE, augments: BOOL]; QOpenTransaction: PROC[ segment: Segment, useTrans: Transaction_ NIL, noLog: BOOL]; QMarkTransaction: PROC[trans: Transaction]; QAbortTransaction: PROC[trans: Transaction]; QCloseTransaction: PROC[trans: Transaction]; QDeclareSegment: PROC[ filePath: ROPE, segment: Segment_ NIL, number: NAT_ 0, readonly: BOOL_ FALSE, createIfNotFound: BOOL_ TRUE, nBytesInitial, nBytesPerExtent: INT_ 32768 ]; QEraseSegment: PROC[segment: Segment]; QGetSegmentInfo: PROC[segment: Segment] RETURNS [ filePath: ROPE, number: NAT, trans: Transaction, readOnly: BOOL, nBytesInitial, nBytesPerExtent: INT]; QGetSegments: PUBLIC PROC RETURNS [LIST OF Segment]; -- *** Part 2: Schema-definition operations [DBModelGlobalImpl] QDeclareDomain: PROC [ name: ROPE, segment: Segment, version: Version_ NewOrOld, estRelships: INT_ 5] RETURNS [d: Domain]; QDeclareRelation: PROC [ name: ROPE, segment: Segment, version: Version_ NewOrOld] RETURNS [r: Relation]; QDeclareAttribute: PROC [ r: Relation, name: ROPE, type: DataType_ AnyDomainType, uniqueness: Uniqueness _ None, length: INT_ 0, link: LinkType_ Linked, version: Version_ NewOrOld] RETURNS[a: Attribute]; QDeclareSubType: PROC [of, is: Domain]; QDeclareIndex: PROC [r: Relation, order: AttributeList, version: Version] RETURNS[Index]; QDestroyDomain: PROC [d: Domain]; QDestroyRelation: PROC [r: Relation]; QDestroySubType: PROC [of, is: Domain]; -- *** Part 3: Primitive operations [DBModelBasicImpl] QDeclareEntity: PROC[d: Domain, name: ROPE_ NIL, version: Version_ NewOrOld] RETURNS [e: Entity]; QFetchEntity: PROC[d: Domain, name: ROPE_ NIL, segment: Segment_ NIL] RETURNS [e: Entity]; QDeclareRelship: PROC[r: Relation, init: AttributeValueList_ NIL, version: Version_ NewOrOld] RETURNS[t: Relship]; QDestroyEntity: PROC[e: Entity]; QDestroyRelship: PROC[t: Relship]; QSetF: PROC[t: Relship, a: Attribute, v: Value, updateIndices: BOOL_ TRUE]; -- Special updateIndices argument => update associated indices QSetFS: PROC [t: Relship, a: Attribute, v: ROPE]; QGetF: PROC[t: Relship, a: Attribute, string: BOOL_ FALSE] RETURNS [Value]; -- Special string argument => fetch attribute as string regardless of actual type. QGetFS: PROC[t: Relship, a: Attribute] RETURNS [ROPE]; QNameOf: PROC [e: Entity] RETURNS [s: ROPE]; QChangeName: PROC [e: Entity, s: ROPE]; QDomainOf: PROC[e: Entity] RETURNS [Domain]; QRelationOf: PROC[t: Relship] RETURNS [Relation]; QSegmentOf: PROC[x: EntityOrRelship] RETURNS [Segment]; -- *** Part 4: Aggregate operations [DBModelSetImpl] QRelationSubset: PROC[ r: Relation, constraint: AttributeValueList_ NIL, start: FirstLast_ First, searchSegment: Segment_ NIL] RETURNS [RelshipSet]; QNextRelship: PROC[t: RelshipSet] RETURNS [Relship]; QPrevRelship: PROC[t: RelshipSet] RETURNS [Relship]; QReleaseRelshipSet: PROC [rs: RelshipSet]; QDomainSubset: PROC[ d: Domain, lowName, highName: ROPE_ NIL, start: FirstLast_ First, searchSubDomains: BOOL_ TRUE, segment: Segment_ NIL] RETURNS [EntitySet]; QNextEntity: PROC[es: EntitySet] RETURNS [Entity]; QPrevEntity: PROC[es: EntitySet] RETURNS [Entity]; QReleaseEntitySet: PROC[es: EntitySet]; QGetAllRefAttributes: PROC [e: Entity] RETURNS [AttributeList]; QGetDomainRefAttributes: PROC[d: Domain] RETURNS[al: AttributeList]; -- *** Part 5: Miscellaneous operations [DBModelBasicImpl] -- Properties QDeclareProperty: PROC [ relationName: ROPE, of: Domain, is: DataType, segment: Segment, uniqueness: Uniqueness_ None, version: Version_ NewOrOld] RETURNS [aIs: Attribute]; QGetP: PROC [e: Entity, aIs: Attribute, aOf: Attribute_ NIL] RETURNS [v: Value]; QSetP: PROC [e: Entity, aIs: Attribute, v: Value, aOf: Attribute_ NIL] RETURNS [Relship]; QGetPList: PROC [e: Entity, aIs: Attribute, aOf: Attribute_ NIL] RETURNS [vl: LIST OF Value]; QSetPList: PROC [e: Entity, aIs: Attribute, vl: LIST OF Value, aOf: Attribute_ NIL]; QEntitySetToList: PROC[es: EntitySet] RETURNS [el: LIST OF Entity]; QRelshipSetToList: PROC[rs: RelshipSet] RETURNS [rl: LIST OF Relship]; END. Change log: By Cattell October 22, 1982 12:43 pm: use "Q" instead of "Internal" to save characters. Modified for new view level, properties. By Willie-Sue on February 3, 1983 -- added noLog arg to QOpenTransaction