Object <- Flattener |
|
Class Flattener defines no new attributes.
Fields
| Field | Type | |
|---|---|---|
| Flattener: | isPackage: | Boolean |
| hasPristine: | Boolean | |
| includeChanges: | Boolean | |
| cluster: | Object | |
| volumeRoster: | VolumeRosterPointer | |
| commitCount: | Unsigned | |
| crc: | Unsigned | |
| heapTable: | ObjectRangeList | |
| processedCount: | Unsigned | |
| heapTableMasksList: | IntegerList | |
| definedComponentsTable: | ComponentRangeSetPointer | |
| classesTable: | RangeSetPointer | |
| sharedTable: | RangeSetPointer | |
| codeAttributeBuffer: | Buffer | |
| globalDataInitAttributeBuffer: | Buffer | |
| methodInformationBuffer: | Buffer | |
| outReferencesList: | ObjectList | |
| firstUnresolvedOutReference: | Unsigned | |
| translatedComponentsTable: | ComponentRangeSetPointer | |
| objectsList: | ObjectList | |
| unresolvedComponentsTable: | ComponentRangeSetPointer | |
| componentsTranslationTable: | ComponentRangeMapPointer | |
| noSendReferencesTable: | RangeSetPointer | |
| scriptClassesList: | ObjectList | |
| scriptClassNumbersList: | ClassNumberList | |
| codeType: | UnsignedShort | |
| codeIsForDebugSystem: | Boolean |
instance Flattener tag; isPackage: false; hasPristine: false; includeChanges: false; cluster: nilObject; volumeRoster: 0; commitCount: 0; crc: 0; heapTable: nilObject; processedCount: 0; heapTableMasksList: nilObject; definedComponentsTable: 0; classesTable: 0; sharedTable: 0; codeAttributeBuffer: nilObject; globalDataInitAttributeBuffer: nilObject; methodInformationBuffer: nilObject; outReferencesList: nilObject; firstUnresolvedOutReference: 0; translatedComponentsTable: 0; objectsList: nilObject; unresolvedComponentsTable: 0; componentsTranslationTable: 0; noSendReferencesTable: 0; scriptClassesList: nilObject; scriptClassNumbersList: nilObject; codeType: 0; codeIsForDebugSystem: false; end instance;
Define Class Flattener; inherits from Object; // ----------------------- // Fields // ----------------------- // --- Flags ---- field isPackage : Boolean; // Used for both encoding and decoding. // Encoding - set to true if we are encoding a package. // Decoding - set to true if the frozen format is // a package frozen format. The cluster field will then // contain the decoded package. field hasPristine : Boolean; // Used for package encoding only. // Set to true if the package we are encoding // has a pristine version. field includeChanges : Boolean; // Used for package encoding only. // Set to true, if a caller wants to send // the package with its changes. // If false, in case that the package has a pristine // version, only the pristine version of a package is // encoded. field cluster : Object, weak; // Used for both encoding and decoding. // When encoding a cluster the package cluster // which we are encoding is stored in the field. // When encoding an object list the field remains empty. // When decoding an object list the cluster object // will be the cluster to where these objects are // added. When decoding a package the cluster filed // will hold the new cluster that was just created. field volumeRoster : VolumeRosterPointer; field commitCount : Unsigned; // Used for package encoding only. This field is used for // to check if a cluster was modified while encoding. // In case of a package cluster encoding // it is sufficient check to check the commitCount because we encode // all objects in the cluster. // This check won't work in case of object list decoding. First, // because objects may be from different clusters (including the transient). // and second because we are encoding the current version of the objects. field crc : Unsigned; // Used for encoding of object list only. // the CRC data is calculated in the beginning and // the end of of the encoding. If different it means // that the some objects were modified, so we fail. // --- Tables ---- field heapTable : ObjectRangeList; // decoding encoding field processedCount : Unsigned; // encoding/decoding // Decoding - the number of objects that were decoded (=read) so far. // Encoding - the number of objects that were encoded (=written) so far. field heapTableMasksList : IntegerList; field definedComponentsTable : ComponentRangeSetPointer; // encoding field classesTable : RangeSetPointer; // encoding // the table is used for holding the classNumbers for every // object in the heap. Each class appears only once. field sharedTable : RangeSetPointer; // decoding field codeAttributeBuffer : Buffer, weak; // decoding field globalDataInitAttributeBuffer : Buffer, weak; // decoding field methodInformationBuffer : Buffer, weak; // decoding // these buffers are allocated in the temporary block cluster during decoding // the cluster is the one in the cluster field field outReferencesList : ObjectList, weak; //decoder field firstUnresolvedOutReference : Unsigned; // decoding ? // ??? use something else instead of the index, maybe ComponentRangesTable field translatedComponentsTable : ComponentRangeSetPointer; // encoder // holds every component range for which we have a translation rule. field objectsList : ObjectList, weak; // list of objects to encode; weak because the caller still owns it field unresolvedComponentsTable : ComponentRangeSetPointer; // Mapping information - for Decoding field componentsTranslationTable : ComponentRangeMapPointer; // Map between every external component and intercomponents. field noSendReferencesTable : RangeSetPointer; // encoding // These references will be nilled out field scriptClassesList : ObjectList; field scriptClassNumbersList : ClassNumberList; // used when for objects (not packages) to encode/decode script classes field codeType : UnsignedShort; // decoding field codeIsForDebugSystem : Boolean; // decoding // used to hold the code type between the time the code attribute buffer // is created and the package is fully created // ----------------------- // operations // ----------------------- class operation WriteFrozenPackage(stream: Stream; package: PackageCluster; includeChanges: Boolean); class operation WriteFrozenPackageWithFailAnnouncements(stream: Stream; package: PackageCluster; includeChanges: Boolean; modifiedAnnouncement: Announcement; romPackageAnnouncement: Announcement; failAgain: Boolean); // To be use when sending a package // if includeChanges is true and a package has a pristine version // the routine will include changes to the pristine version // WriteFrozenPackage may raise the following exceptions: // iModifiedWhileEncodingError // iSendingROMPackageError // WriteFrozenPackageWithFailAnnouncements catches the exceptions and // puts up an announcement. If <failAgain> is true it refails after // putting up the announcement. class operation ReadFrozenPackage(stream: Stream; volume: MemoryDevice): PackageCluster; class operation ReadFrozenPackageWithoutHeader(stream: Stream; volume: MemoryDevice): PackageCluster; class operation ReadFrozenPackageWithFailAnnouncements(stream: Stream; volume: MemoryDevice; decodingAnnouncement: Announcement; noMemoryAnnouncement: Announcement; failAgain: Boolean): PackageCluster; class operation ReadFrozenPackageWithoutHeaderWithFailAnnouncements(stream: Stream; volume: MemoryDevice; decodingAnnouncement: Announcement; noMemoryAnnouncement: Announcement; failAgain: Boolean): PackageCluster; // Read frozen package. // May raise the following exceptions: // iFlattenerDecodingError // ReadFrozenPackageWithFailAnnouncements catches the exception // and puts up an announcement. If <failAgain> is true it refails // after putting up the announcement. class operation WriteFrozenObjectList(stream: Stream; objectsList: ObjectList; outList: ObjectList); class operation WriteFrozenObjectListWithFailAnnouncements(stream: Stream; objectsList: ObjectList; outList: ObjectList; modifiedAnnouncement: Announcement; failAgain: Boolean); // To be used as the mail un-flattener // WriteFrozenObjectList raise the following exceptions: // iModifiedWhileEncodingError // WriteFrozenObjectListWithFailAnnouncements catches the exception and // puts up an announcement. If <failAgain> is true it refails after // putting up the announcement. class operation ReadFrozenObjectList(stream: Stream; nearThis: Object; outList: ObjectList; var allResolved: Boolean): ObjectList; class operation ReadFrozenObjectListWithoutHeader(stream: Stream; nearThis: Object; outList: ObjectList; var allResolved: Boolean): ObjectList; class operation ReadFrozenObjectListWithFailAnnouncements(stream: Stream; nearThis: Object; outList: ObjectList; var allResolved: Boolean; decodingAnnouncement: Announcement; noMemoryAnnouncement: Announcement; failAgain: Boolean): ObjectList; class operation ReadFrozenObjectListWithoutHeaderWithFailAnnouncements(stream: Stream; nearThis: Object; outList: ObjectList; var allResolved: Boolean; decodingAnnouncement: Announcement; noMemoryAnnouncement: Announcement; failAgain: Boolean): ObjectList; // To be use as the mail un-flattener // May raise the following exceptions: // iFlattenerDecodingError // ReadFrozenObjectListWithFailAnnouncements catches the exception and // puts up an announcement. If <failAgain> is true it refails after // putting up the announcement. class operation WriteFrozenObjectOwnedList(stream: Stream; object: Object); // Write an object and all the objects it owned onto the stream as an // object list. The object passed in will be the first item in the list. // May raise the following exceptions: // iModifiedWhileEncodingError class operation WriteFrozenObject(stream: Stream; object: Object; parameters: Pointer); class operation ReadFrozenObject(stream: Stream; nearThis: Object; parameters: Pointer): Object; // Write or read an individual object to or from the stream. // Parameters are of type WriteFrozenObjectParams. // These low-level calls are rarely useful. Use the object list or // package calls defined above instead. // Private - Decoding methods operation ReadStreamableMulticodeAttributes(stream: Stream); operation ReadImportTableAttribute(stream: Stream; header: Unsigned); operation ReadAbbreviatedClassesAttribute(stream: Stream; header: Unsigned); operation ReadDefinedComponentTableAttribute(stream: Stream; header: Unsigned); operation ReadObjectAddressingTableAttribute(stream: Stream; header: Unsigned); operation ReadOutAddressingTableAttribute(stream: Stream; header: Unsigned); operation ReadHeapAttribute(stream: Stream; header: Unsigned); operation RevertDecoding(stream: Stream); // operation ReadExternalFunctionNamesAttribute // operation ReadCodeAttribute // operation ReadFunctionOffsetsAttribute // ReadAttributeToNewBuffer, SkipAttribute // Private - Encoding methods operation WriteImportTableAttribute(stream: Stream); operation WriteAbbreviatedClassesAttribute(stream: Stream); operation WriteDefinedComponentsTableAttribute(stream: Stream); operation WriteHeapAttribute(stream: Stream; mask: Unsigned); operation WriteObjectAddressingTableAttribute(stream: Stream; mask: Unsigned; isList: Boolean); operation WriteOutAddressingTableAttribute(stream: Stream); overrides Init; overrides Finalize; end class;