@bldrs-ai/conway 1.445.1339 → 1.448.1345
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/examples/browser-bundled.cjs +94 -10
- package/compiled/examples/cli-bundled.cjs +248 -95
- package/compiled/examples/cli-step-bundled.cjs +94 -10
- package/compiled/examples/validator-bundled.cjs +94 -10
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts +34 -1
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_geometry_extraction.js +139 -58
- package/compiled/src/step/parsing/uint32_sink.d.ts +15 -0
- package/compiled/src/step/parsing/uint32_sink.d.ts.map +1 -1
- package/compiled/src/step/parsing/uint32_sink.js +35 -0
- package/compiled/src/step/parsing/uint32_sink.test.js +83 -1
- package/compiled/src/step/step_entity_base.d.ts +20 -0
- package/compiled/src/step/step_entity_base.d.ts.map +1 -1
- package/compiled/src/step/step_entity_base.js +30 -9
- package/compiled/src/step/step_model_base.d.ts +25 -0
- package/compiled/src/step/step_model_base.d.ts.map +1 -1
- package/compiled/src/step/step_model_base.js +48 -0
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { skipValue, stepExtractArrayBegin, stepExtractArrayToken, stepExtractNumber, stepExtractOptional, } from "./step_deserialization_functions.js";
|
|
1
2
|
/**
|
|
2
3
|
* Growable Uint32Array append sink.
|
|
3
4
|
*
|
|
@@ -48,3 +49,37 @@ export class Uint32Sink {
|
|
|
48
49
|
this.data_[this.length_++] = value;
|
|
49
50
|
}
|
|
50
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Parse a STEP integer list at `cursor` into `sink`, appending in order.
|
|
54
|
+
*
|
|
55
|
+
* The single implementation shared by the entity-level and
|
|
56
|
+
* reference-level fast paths, so they cannot drift from each other or
|
|
57
|
+
* from the generated array getters they stand in for (same optional
|
|
58
|
+
* handling, same element extraction, same "incorrectly typed" error).
|
|
59
|
+
*
|
|
60
|
+
* @param buffer The record's buffer window.
|
|
61
|
+
* @param cursor Start of the field.
|
|
62
|
+
* @param endCursor End bound for extraction.
|
|
63
|
+
* @param sink Receives the appended values.
|
|
64
|
+
* @return {number} How many values were appended (0 when unset/optional-null).
|
|
65
|
+
*/
|
|
66
|
+
export function extractIntegerArrayAt(buffer, cursor, endCursor, sink) {
|
|
67
|
+
if (stepExtractOptional(buffer, cursor, endCursor) === null) {
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
let count = 0;
|
|
71
|
+
let signedCursor0 = stepExtractArrayBegin(buffer, cursor, endCursor);
|
|
72
|
+
let readCursor = Math.abs(signedCursor0);
|
|
73
|
+
while (signedCursor0 >= 0) {
|
|
74
|
+
const value = stepExtractNumber(buffer, readCursor, endCursor);
|
|
75
|
+
if (value === void 0) {
|
|
76
|
+
throw new Error("Value in STEP was incorrectly typed");
|
|
77
|
+
}
|
|
78
|
+
readCursor = skipValue(buffer, readCursor, endCursor);
|
|
79
|
+
sink.push(value);
|
|
80
|
+
++count;
|
|
81
|
+
signedCursor0 = stepExtractArrayToken(buffer, readCursor, endCursor);
|
|
82
|
+
readCursor = Math.abs(signedCursor0);
|
|
83
|
+
}
|
|
84
|
+
return count;
|
|
85
|
+
}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import * as fs from "fs";
|
|
6
6
|
import { beforeAll, describe, expect, test } from "@jest/globals";
|
|
7
7
|
import { IfcAPI } from "../../compat/web-ifc/ifc_api.js";
|
|
8
|
-
import
|
|
8
|
+
import EntityTypesIfc from "../../ifc/ifc4_gen/entity_types_ifc.gen.js";
|
|
9
|
+
import { IfcIndexedPolygonalFace, IfcIndexedPolygonalFaceWithVoids, IfcPolygonalFaceSet, } from "../../ifc/ifc4_gen/index.js";
|
|
9
10
|
import { Uint32Sink } from "./uint32_sink.js";
|
|
10
11
|
describe("Uint32Sink", () => {
|
|
11
12
|
test("appends, grows past its initial capacity, and views exactly its length", () => {
|
|
@@ -75,3 +76,84 @@ describe("extractIntegerArrayInto", () => {
|
|
|
75
76
|
expect(Array.from(sink.view)).toEqual(expected);
|
|
76
77
|
}, 120000);
|
|
77
78
|
});
|
|
79
|
+
// The reference-level path the faceset extraction uses to avoid
|
|
80
|
+
// constructing an entity per face. It must agree with the generated
|
|
81
|
+
// getters exactly, and must report failure (rather than guess) whenever
|
|
82
|
+
// its preconditions don't hold, because the caller's fallback depends on
|
|
83
|
+
// that signal.
|
|
84
|
+
describe("reference-level faceset fast path", () => {
|
|
85
|
+
const FACES_OFFSET = 2;
|
|
86
|
+
const FACES_BASE_OFFSET = 1;
|
|
87
|
+
const FACES_DEPTH = 4;
|
|
88
|
+
const COORD_INDEX_OFFSET = 0;
|
|
89
|
+
let api;
|
|
90
|
+
let modelID;
|
|
91
|
+
/**
|
|
92
|
+
* @return {object} The StepModel behind the passthrough tuple.
|
|
93
|
+
*/
|
|
94
|
+
function stepModel() {
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
|
+
return api.models.get(modelID).model[0];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @return {IfcPolygonalFaceSet[]} The fixture's facesets.
|
|
100
|
+
*/
|
|
101
|
+
function faceSets() {
|
|
102
|
+
return Array.from(stepModel().types(IfcPolygonalFaceSet));
|
|
103
|
+
}
|
|
104
|
+
beforeAll(async () => {
|
|
105
|
+
api = new IfcAPI();
|
|
106
|
+
await api.Init();
|
|
107
|
+
modelID = api.OpenModel(new Uint8Array(fs.readFileSync("data/index.ifc")), { COORDINATE_TO_ORIGIN: true, USE_FAST_BOOLS: true });
|
|
108
|
+
}, 120000);
|
|
109
|
+
test("forEachReferenceInField yields exactly the express IDs the Faces getter resolves", () => {
|
|
110
|
+
const sets = faceSets();
|
|
111
|
+
expect(sets.length).toBeGreaterThan(0);
|
|
112
|
+
for (const faceSet of sets) {
|
|
113
|
+
const walked = [];
|
|
114
|
+
const completed = faceSet.forEachReferenceInField(FACES_OFFSET, FACES_BASE_OFFSET, FACES_DEPTH, (expressID) => {
|
|
115
|
+
walked.push(expressID);
|
|
116
|
+
return true;
|
|
117
|
+
});
|
|
118
|
+
expect(completed).toBe(true);
|
|
119
|
+
expect(walked).toEqual(faceSet.Faces.map((face) => face.expressID));
|
|
120
|
+
}
|
|
121
|
+
}, 120000);
|
|
122
|
+
test("forEachReferenceInField stops when the callback returns false", () => {
|
|
123
|
+
const faceSet = faceSets()[0];
|
|
124
|
+
const walked = [];
|
|
125
|
+
const completed = faceSet.forEachReferenceInField(FACES_OFFSET, FACES_BASE_OFFSET, FACES_DEPTH, (expressID) => {
|
|
126
|
+
walked.push(expressID);
|
|
127
|
+
return false;
|
|
128
|
+
});
|
|
129
|
+
expect(completed).toBe(false);
|
|
130
|
+
expect(walked.length).toBe(1);
|
|
131
|
+
}, 120000);
|
|
132
|
+
test("extractIntegerArrayByExpressIDInto matches the generated CoordIndex getter", () => {
|
|
133
|
+
const model = stepModel();
|
|
134
|
+
const sink = new Uint32Sink(4);
|
|
135
|
+
for (const faceSet of faceSets()) {
|
|
136
|
+
for (const face of faceSet.Faces) {
|
|
137
|
+
if (face instanceof IfcIndexedPolygonalFaceWithVoids) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
sink.reset();
|
|
141
|
+
const count = model.extractIntegerArrayByExpressIDInto(face.expressID, COORD_INDEX_OFFSET, EntityTypesIfc.IFCINDEXEDPOLYGONALFACE, sink);
|
|
142
|
+
expect(count).toBe(face.CoordIndex.length);
|
|
143
|
+
expect(Array.from(sink.view)).toEqual(face.CoordIndex);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}, 120000);
|
|
147
|
+
test("reports failure for an unknown express ID and for a type mismatch", () => {
|
|
148
|
+
const model = stepModel();
|
|
149
|
+
const sink = new Uint32Sink(4);
|
|
150
|
+
const face = faceSets()[0].Faces[0];
|
|
151
|
+
// Unknown record: the caller must fall back, not read something else.
|
|
152
|
+
expect(model.extractIntegerArrayByExpressIDInto(268435455, COORD_INDEX_OFFSET, EntityTypesIfc.IFCINDEXEDPOLYGONALFACE, sink))
|
|
153
|
+
.toBeUndefined();
|
|
154
|
+
// Right record, wrong expected type: field offsets would not be
|
|
155
|
+
// comparable, so this must refuse rather than misread the record.
|
|
156
|
+
expect(model.extractIntegerArrayByExpressIDInto(face.expressID, COORD_INDEX_OFFSET, EntityTypesIfc.IFCPOLYGONALFACESET, sink))
|
|
157
|
+
.toBeUndefined();
|
|
158
|
+
}, 120000);
|
|
159
|
+
});
|
|
@@ -326,6 +326,26 @@ export default abstract class StepEntityBase<EntityTypeIDs extends number> imple
|
|
|
326
326
|
* @return {number} How many values were appended (0 when the field is
|
|
327
327
|
* unset/optional-null).
|
|
328
328
|
*/
|
|
329
|
+
/**
|
|
330
|
+
* Walk a reference-list field, handing each element's express ID to
|
|
331
|
+
* `onReference` without resolving it to an entity.
|
|
332
|
+
*
|
|
333
|
+
* Lets hot loops decide per element how to read the referenced record
|
|
334
|
+
* (see StepModelBase.extractIntegerArrayByExpressIDInto) instead of
|
|
335
|
+
* paying for an entity per element the way the generated list getters
|
|
336
|
+
* do. Inline (non-reference) elements yield `undefined`, and
|
|
337
|
+
* `onReference` returning false aborts the walk — together those let
|
|
338
|
+
* a caller bail out to the generated getter for anything it is not
|
|
339
|
+
* prepared to handle.
|
|
340
|
+
*
|
|
341
|
+
* @param offset The offset in the vtable to extract from.
|
|
342
|
+
* @param baseOffset The base offset of the class in the vtable.
|
|
343
|
+
* @param depth The depth in the inheritance hierarchy.
|
|
344
|
+
* @param onReference Receives each element's express ID, or undefined
|
|
345
|
+
* for an inline element; return false to abort.
|
|
346
|
+
* @return {boolean} False if the walk was aborted, true otherwise.
|
|
347
|
+
*/
|
|
348
|
+
forEachReferenceInField(offset: number, baseOffset: number, depth: number, onReference: (expressID: number | undefined) => boolean): boolean;
|
|
329
349
|
extractIntegerArrayInto(offset: number, baseOffset: number, depth: number, sink: Uint32Sink): number;
|
|
330
350
|
/**
|
|
331
351
|
* Extract a number at the particular vtable offset (i.e. the position
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step_entity_base.d.ts","sourceRoot":"","sources":["../../../src/step/step_entity_base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uDAAuD,CAAA;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAejD,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"step_entity_base.d.ts","sourceRoot":"","sources":["../../../src/step/step_entity_base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uDAAuD,CAAA;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAejD,OAAO,EAAE,UAAU,EAAyB,MAAM,uBAAuB,CAAA;AAEzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,2BAC+B,MAAM,kCAAkC,CAAA;AAC9E,OAAO,aAAa,MAAM,mBAAmB,CAAA;AAG7C,aAAK,YAAY;IACf,OAAO,IAAI;IACX,MAAM,IAAA;IACN,KAAK,IAAA;IACL,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,GAAG,IAAA;IACH,KAAK,IAAA;IACL,SAAS,IAAA;IACT,OAAO,IAAA;IACP,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IAwCxD;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,IAAI;CAKlC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { skipValue, stepExtractArray, stepExtractArrayBegin, stepExtractArrayToken, stepExtractBinary, stepExtractBoolean, stepExtractInlineElemement, stepExtractLogical, stepExtractNumber, stepExtractOptional, stepExtractReference, stepExtractString, } from "./parsing/step_deserialization_functions.js";
|
|
2
|
+
import { extractIntegerArrayAt } from "./parsing/uint32_sink.js";
|
|
2
3
|
import { stepBufferBase } from "./step_buffer_provider.js";
|
|
3
4
|
var IfcTokenType;
|
|
4
5
|
(function (IfcTokenType) {
|
|
@@ -467,28 +468,48 @@ export default class StepEntityBase {
|
|
|
467
468
|
* @return {number} How many values were appended (0 when the field is
|
|
468
469
|
* unset/optional-null).
|
|
469
470
|
*/
|
|
470
|
-
|
|
471
|
+
/**
|
|
472
|
+
* Walk a reference-list field, handing each element's express ID to
|
|
473
|
+
* `onReference` without resolving it to an entity.
|
|
474
|
+
*
|
|
475
|
+
* Lets hot loops decide per element how to read the referenced record
|
|
476
|
+
* (see StepModelBase.extractIntegerArrayByExpressIDInto) instead of
|
|
477
|
+
* paying for an entity per element the way the generated list getters
|
|
478
|
+
* do. Inline (non-reference) elements yield `undefined`, and
|
|
479
|
+
* `onReference` returning false aborts the walk — together those let
|
|
480
|
+
* a caller bail out to the generated getter for anything it is not
|
|
481
|
+
* prepared to handle.
|
|
482
|
+
*
|
|
483
|
+
* @param offset The offset in the vtable to extract from.
|
|
484
|
+
* @param baseOffset The base offset of the class in the vtable.
|
|
485
|
+
* @param depth The depth in the inheritance hierarchy.
|
|
486
|
+
* @param onReference Receives each element's express ID, or undefined
|
|
487
|
+
* for an inline element; return false to abort.
|
|
488
|
+
* @return {boolean} False if the walk was aborted, true otherwise.
|
|
489
|
+
*/
|
|
490
|
+
forEachReferenceInField(offset, baseOffset, depth, onReference) {
|
|
471
491
|
let cursor = this.getOffsetCursor(offset, baseOffset, depth);
|
|
472
492
|
const buffer = this.buffer;
|
|
473
493
|
const endCursor = buffer.length;
|
|
474
494
|
if (stepExtractOptional(buffer, cursor, endCursor) === null) {
|
|
475
|
-
return
|
|
495
|
+
return true;
|
|
476
496
|
}
|
|
477
|
-
let count = 0;
|
|
478
497
|
let signedCursor0 = stepExtractArrayBegin(buffer, cursor, endCursor);
|
|
479
498
|
cursor = Math.abs(signedCursor0);
|
|
480
499
|
while (signedCursor0 >= 0) {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
throw new Error("Value in STEP was incorrectly typed");
|
|
500
|
+
if (!onReference(stepExtractReference(buffer, cursor, endCursor))) {
|
|
501
|
+
return false;
|
|
484
502
|
}
|
|
485
503
|
cursor = skipValue(buffer, cursor, endCursor);
|
|
486
|
-
sink.push(value);
|
|
487
|
-
++count;
|
|
488
504
|
signedCursor0 = stepExtractArrayToken(buffer, cursor, endCursor);
|
|
489
505
|
cursor = Math.abs(signedCursor0);
|
|
490
506
|
}
|
|
491
|
-
return
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
extractIntegerArrayInto(offset, baseOffset, depth, sink) {
|
|
510
|
+
const cursor = this.getOffsetCursor(offset, baseOffset, depth);
|
|
511
|
+
const buffer = this.buffer;
|
|
512
|
+
return extractIntegerArrayAt(buffer, cursor, buffer.length, sink);
|
|
492
513
|
}
|
|
493
514
|
/**
|
|
494
515
|
* Extract a number at the particular vtable offset (i.e. the position
|
|
@@ -3,6 +3,7 @@ import { StepIndexColumns } from "./parsing/columnar_index.js";
|
|
|
3
3
|
import { StepBufferProvider, StepExternalByteStore } from "./step_buffer_provider.js";
|
|
4
4
|
import StepEntityBase from "./step_entity_base.js";
|
|
5
5
|
import StepEntitySchema from "./step_entity_schema.js";
|
|
6
|
+
import { Uint32Sink } from "./parsing/uint32_sink.js";
|
|
6
7
|
import StepEntityInternalReference from "./step_entity_internal_reference.js";
|
|
7
8
|
import { IIndexSetCursor } from "../core/i_index_set_cursor.js";
|
|
8
9
|
import { MultiIndexSet } from "../indexing/multi_index_set.js";
|
|
@@ -95,6 +96,30 @@ export default abstract class StepModelBase<EntityTypeIDs extends number, BaseEn
|
|
|
95
96
|
* @param element The raw elment to populate the vtable entry for.
|
|
96
97
|
* @return {boolean} Did the vtable entry populate correctly?
|
|
97
98
|
*/
|
|
99
|
+
/**
|
|
100
|
+
* Append a referenced record's unsigned-integer list field into `sink`
|
|
101
|
+
* without materialising the referenced entity.
|
|
102
|
+
*
|
|
103
|
+
* This is the reference-level twin of
|
|
104
|
+
* `StepEntityBase.extractIntegerArrayInto`, for hot loops that walk
|
|
105
|
+
* millions of small records (tessellated facesets) where constructing
|
|
106
|
+
* an entity per record dominates. It deliberately handles only the
|
|
107
|
+
* simple case and reports failure otherwise, so callers keep a
|
|
108
|
+
* correct fallback rather than this growing subtle special cases:
|
|
109
|
+
* the reference must resolve, be single-class (no multi-mapping),
|
|
110
|
+
* and be exactly `expectedTypeID` — which is what makes reading
|
|
111
|
+
* `offset` as a plain vtable slot equivalent to the generated
|
|
112
|
+
* getter's `getOffsetCursor( offset, _, _ )` (that only subtracts a
|
|
113
|
+
* base offset for multi-mapped records).
|
|
114
|
+
*
|
|
115
|
+
* @param expressID The referenced record's express ID.
|
|
116
|
+
* @param offset The field's vtable offset within the record.
|
|
117
|
+
* @param expectedTypeID The type the record must be.
|
|
118
|
+
* @param sink Receives the appended values.
|
|
119
|
+
* @return {number | undefined} Count appended, or undefined when the
|
|
120
|
+
* fast path does not apply and the caller must fall back.
|
|
121
|
+
*/
|
|
122
|
+
extractIntegerArrayByExpressIDInto(expressID: number, offset: number, expectedTypeID: EntityTypeIDs, sink: Uint32Sink): number | undefined;
|
|
98
123
|
populateVtableEntryRaw(element: StepEntityInternalReference<EntityTypeIDs>): boolean;
|
|
99
124
|
/**
|
|
100
125
|
* Force the population of the the vtable entry for a particular ID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step_model_base.d.ts","sourceRoot":"","sources":["../../../src/step/step_model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CAAE,IAAI,EAAE,iBAAiB,GAAI,aAAa,GAAG,SAAS;CAIrF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { releaseScratchParsingBuffer } from "./parsing/step_deserialization_functions.js";
|
|
2
2
|
import { ResidentStepBufferProvider, WindowedStepBufferProvider, } from "./step_buffer_provider.js";
|
|
3
3
|
import StepVtableBuilder from "./parsing/step_vtable_builder.js";
|
|
4
|
+
import { extractIntegerArrayAt } from "./parsing/uint32_sink.js";
|
|
4
5
|
import { extractOneHotLow } from "../indexing/bit_operations.js";
|
|
5
6
|
import { TriangleElementMap } from "../core/triangle_element_map.js";
|
|
6
7
|
import InterpolationSearchTable32 from "../indexing/interpolation_search_table_32.js";
|
|
@@ -246,6 +247,53 @@ export default class StepModelBase {
|
|
|
246
247
|
* @param element The raw elment to populate the vtable entry for.
|
|
247
248
|
* @return {boolean} Did the vtable entry populate correctly?
|
|
248
249
|
*/
|
|
250
|
+
/**
|
|
251
|
+
* Append a referenced record's unsigned-integer list field into `sink`
|
|
252
|
+
* without materialising the referenced entity.
|
|
253
|
+
*
|
|
254
|
+
* This is the reference-level twin of
|
|
255
|
+
* `StepEntityBase.extractIntegerArrayInto`, for hot loops that walk
|
|
256
|
+
* millions of small records (tessellated facesets) where constructing
|
|
257
|
+
* an entity per record dominates. It deliberately handles only the
|
|
258
|
+
* simple case and reports failure otherwise, so callers keep a
|
|
259
|
+
* correct fallback rather than this growing subtle special cases:
|
|
260
|
+
* the reference must resolve, be single-class (no multi-mapping),
|
|
261
|
+
* and be exactly `expectedTypeID` — which is what makes reading
|
|
262
|
+
* `offset` as a plain vtable slot equivalent to the generated
|
|
263
|
+
* getter's `getOffsetCursor( offset, _, _ )` (that only subtracts a
|
|
264
|
+
* base offset for multi-mapped records).
|
|
265
|
+
*
|
|
266
|
+
* @param expressID The referenced record's express ID.
|
|
267
|
+
* @param offset The field's vtable offset within the record.
|
|
268
|
+
* @param expectedTypeID The type the record must be.
|
|
269
|
+
* @param sink Receives the appended values.
|
|
270
|
+
* @return {number | undefined} Count appended, or undefined when the
|
|
271
|
+
* fast path does not apply and the caller must fall back.
|
|
272
|
+
*/
|
|
273
|
+
extractIntegerArrayByExpressIDInto(expressID, offset, expectedTypeID, sink) {
|
|
274
|
+
const localID = this.expressIDMap_.get(expressID);
|
|
275
|
+
if (localID === void 0 || localID >= this.count_) {
|
|
276
|
+
return void 0;
|
|
277
|
+
}
|
|
278
|
+
const element = this.entry(localID);
|
|
279
|
+
// Multi-mapped records need per-depth base offsets; leave them to
|
|
280
|
+
// the generated getters.
|
|
281
|
+
if (element.multiMapping !== void 0 || element.typeID !== expectedTypeID) {
|
|
282
|
+
return void 0;
|
|
283
|
+
}
|
|
284
|
+
if (element.vtableIndex === void 0 && !this.populateVtableEntryRaw(element)) {
|
|
285
|
+
return void 0;
|
|
286
|
+
}
|
|
287
|
+
const vtable = element.vtable;
|
|
288
|
+
const buffer = element.buffer;
|
|
289
|
+
if (vtable === void 0 || buffer === void 0 ||
|
|
290
|
+
offset >= (element.vtableCount ?? 0)) {
|
|
291
|
+
return void 0;
|
|
292
|
+
}
|
|
293
|
+
// Same window the vtable cursors were recorded against, and the
|
|
294
|
+
// same end bound the generated array getters use.
|
|
295
|
+
return extractIntegerArrayAt(buffer, vtable[element.vtableIndex + offset], buffer.length, sink);
|
|
296
|
+
}
|
|
249
297
|
populateVtableEntryRaw(element) {
|
|
250
298
|
if (element.vtableIndex !== void 0 || element.typeID === 0) {
|
|
251
299
|
return true;
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
// only the first segment (major) is meaningful and is the one CI carries forward.
|
|
6
6
|
// Must stay in `vN.N.N` shape: the CI stamp regex, scripts/updateVersion.mjs, and
|
|
7
7
|
// statistics.ts all match `v\d+\.\d+\.\d+`.
|
|
8
|
-
const versionString = 'Conway v1.
|
|
8
|
+
const versionString = 'Conway v1.448.1345';
|
|
9
9
|
export { versionString };
|