luigi12345 commited on
Commit
3620341
1 Parent(s): d5c1a65

bb407c926ade92d71d63118491528f140f6e1db306106933efc1a5b13d350f96

Browse files
Files changed (50) hide show
  1. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/index.js +62 -0
  2. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/index.js.map +1 -0
  3. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/index.ts +31 -0
  4. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int16-list.d.ts +10 -0
  5. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int16-list.js +32 -0
  6. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int16-list.js.map +1 -0
  7. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int16-list.ts +35 -0
  8. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int32-list.d.ts +10 -0
  9. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int32-list.js +32 -0
  10. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int32-list.js.map +1 -0
  11. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int32-list.ts +33 -0
  12. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int64-list.d.ts +11 -0
  13. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int64-list.js +32 -0
  14. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int64-list.js.map +1 -0
  15. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int64-list.ts +34 -0
  16. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int8-list.d.ts +10 -0
  17. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int8-list.js +32 -0
  18. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int8-list.js.map +1 -0
  19. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int8-list.ts +33 -0
  20. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface-list.d.ts +6 -0
  21. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface-list.js +10 -0
  22. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface-list.js.map +1 -0
  23. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface-list.ts +9 -0
  24. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface.d.ts +8 -0
  25. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface.js +18 -0
  26. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface.js.map +1 -0
  27. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface.ts +17 -0
  28. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/list.d.ts +76 -0
  29. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/list.js +274 -0
  30. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/list.js.map +1 -0
  31. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/list.ts +381 -0
  32. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/orphan.d.ts +38 -0
  33. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/orphan.js +120 -0
  34. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/orphan.js.map +1 -0
  35. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/orphan.ts +188 -0
  36. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-allocation-result.d.ts +18 -0
  37. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-allocation-result.js +27 -0
  38. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-allocation-result.js.map +1 -0
  39. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-allocation-result.ts +31 -0
  40. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-list.d.ts +6 -0
  41. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-list.js +35 -0
  42. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-list.js.map +1 -0
  43. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-list.ts +34 -0
  44. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-type.d.ts +9 -0
  45. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-type.js +14 -0
  46. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-type.js.map +1 -0
  47. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-type.ts +10 -0
  48. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer.d.ts +362 -0
  49. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer.js +795 -0
  50. workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer.js.map +1 -0
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/index.js ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.VoidList = exports.VOID = exports.Void = exports.Uint64List = exports.Uint32List = exports.Uint16List = exports.Uint8List = exports.TextList = exports.Text = exports.Struct = exports.Pointer = exports.PointerType = exports.PointerList = exports.Orphan = exports.List = exports.InterfaceList = exports.Interface = exports.Int64List = exports.Int32List = exports.Int16List = exports.Int8List = exports.Float64List = exports.Float32List = exports.DataList = exports.Data = exports.CompositeList = exports.BoolList = exports.AnyPointerList = void 0;
7
+ var any_pointer_list_1 = require("./any-pointer-list");
8
+ Object.defineProperty(exports, "AnyPointerList", { enumerable: true, get: function () { return any_pointer_list_1.AnyPointerList; } });
9
+ var bool_list_1 = require("./bool-list");
10
+ Object.defineProperty(exports, "BoolList", { enumerable: true, get: function () { return bool_list_1.BoolList; } });
11
+ var composite_list_1 = require("./composite-list");
12
+ Object.defineProperty(exports, "CompositeList", { enumerable: true, get: function () { return composite_list_1.CompositeList; } });
13
+ var data_1 = require("./data");
14
+ Object.defineProperty(exports, "Data", { enumerable: true, get: function () { return data_1.Data; } });
15
+ var data_list_1 = require("./data-list");
16
+ Object.defineProperty(exports, "DataList", { enumerable: true, get: function () { return data_list_1.DataList; } });
17
+ var float32_list_1 = require("./float32-list");
18
+ Object.defineProperty(exports, "Float32List", { enumerable: true, get: function () { return float32_list_1.Float32List; } });
19
+ var float64_list_1 = require("./float64-list");
20
+ Object.defineProperty(exports, "Float64List", { enumerable: true, get: function () { return float64_list_1.Float64List; } });
21
+ var int8_list_1 = require("./int8-list");
22
+ Object.defineProperty(exports, "Int8List", { enumerable: true, get: function () { return int8_list_1.Int8List; } });
23
+ var int16_list_1 = require("./int16-list");
24
+ Object.defineProperty(exports, "Int16List", { enumerable: true, get: function () { return int16_list_1.Int16List; } });
25
+ var int32_list_1 = require("./int32-list");
26
+ Object.defineProperty(exports, "Int32List", { enumerable: true, get: function () { return int32_list_1.Int32List; } });
27
+ var int64_list_1 = require("./int64-list");
28
+ Object.defineProperty(exports, "Int64List", { enumerable: true, get: function () { return int64_list_1.Int64List; } });
29
+ var interface_1 = require("./interface");
30
+ Object.defineProperty(exports, "Interface", { enumerable: true, get: function () { return interface_1.Interface; } });
31
+ var interface_list_1 = require("./interface-list");
32
+ Object.defineProperty(exports, "InterfaceList", { enumerable: true, get: function () { return interface_list_1.InterfaceList; } });
33
+ var list_1 = require("./list");
34
+ Object.defineProperty(exports, "List", { enumerable: true, get: function () { return list_1.List; } });
35
+ var orphan_1 = require("./orphan");
36
+ Object.defineProperty(exports, "Orphan", { enumerable: true, get: function () { return orphan_1.Orphan; } });
37
+ var pointer_list_1 = require("./pointer-list");
38
+ Object.defineProperty(exports, "PointerList", { enumerable: true, get: function () { return pointer_list_1.PointerList; } });
39
+ var pointer_type_1 = require("./pointer-type");
40
+ Object.defineProperty(exports, "PointerType", { enumerable: true, get: function () { return pointer_type_1.PointerType; } });
41
+ var pointer_1 = require("./pointer");
42
+ Object.defineProperty(exports, "Pointer", { enumerable: true, get: function () { return pointer_1.Pointer; } });
43
+ var struct_1 = require("./struct");
44
+ Object.defineProperty(exports, "Struct", { enumerable: true, get: function () { return struct_1.Struct; } });
45
+ var text_1 = require("./text");
46
+ Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return text_1.Text; } });
47
+ var text_list_1 = require("./text-list");
48
+ Object.defineProperty(exports, "TextList", { enumerable: true, get: function () { return text_list_1.TextList; } });
49
+ var uint8_list_1 = require("./uint8-list");
50
+ Object.defineProperty(exports, "Uint8List", { enumerable: true, get: function () { return uint8_list_1.Uint8List; } });
51
+ var uint16_list_1 = require("./uint16-list");
52
+ Object.defineProperty(exports, "Uint16List", { enumerable: true, get: function () { return uint16_list_1.Uint16List; } });
53
+ var uint32_list_1 = require("./uint32-list");
54
+ Object.defineProperty(exports, "Uint32List", { enumerable: true, get: function () { return uint32_list_1.Uint32List; } });
55
+ var uint64_list_1 = require("./uint64-list");
56
+ Object.defineProperty(exports, "Uint64List", { enumerable: true, get: function () { return uint64_list_1.Uint64List; } });
57
+ var void_1 = require("./void");
58
+ Object.defineProperty(exports, "Void", { enumerable: true, get: function () { return void_1.Void; } });
59
+ Object.defineProperty(exports, "VOID", { enumerable: true, get: function () { return void_1.VOID; } });
60
+ var void_list_1 = require("./void-list");
61
+ Object.defineProperty(exports, "VoidList", { enumerable: true, get: function () { return void_list_1.VoidList; } });
62
+ //# sourceMappingURL=index.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/index.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,mD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List } from "./any-pointer-list";
6
+ export { BoolList } from "./bool-list";
7
+ export { CompositeList } from "./composite-list";
8
+ export { Data } from "./data";
9
+ export { DataList } from "./data-list";
10
+ export { Float32List } from "./float32-list";
11
+ export { Float64List } from "./float64-list";
12
+ export { Int8List } from "./int8-list";
13
+ export { Int16List } from "./int16-list";
14
+ export { Int32List } from "./int32-list";
15
+ export { Int64List } from "./int64-list";
16
+ export { Interface } from "./interface";
17
+ export { InterfaceList } from "./interface-list";
18
+ export { List, ListCtor } from "./list";
19
+ export { Orphan } from "./orphan";
20
+ export { PointerList } from "./pointer-list";
21
+ export { PointerType } from "./pointer-type";
22
+ export { Pointer } from "./pointer";
23
+ export { _StructCtor, Struct, StructCtor } from "./struct";
24
+ export { Text } from "./text";
25
+ export { TextList } from "./text-list";
26
+ export { Uint8List } from "./uint8-list";
27
+ export { Uint16List } from "./uint16-list";
28
+ export { Uint32List } from "./uint32-list";
29
+ export { Uint64List } from "./uint64-list";
30
+ export { Void, VOID } from "./void";
31
+ export { VoidList } from "./void-list";
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int16-list.d.ts ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+ import { _ListCtor, List } from "./list";
5
+ export declare class Int16List extends List<number> {
6
+ static readonly _capnp: _ListCtor;
7
+ get(index: number): number;
8
+ set(index: number, value: number): void;
9
+ toString(): string;
10
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int16-list.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Int16List = void 0;
7
+ const tslib_1 = require("tslib");
8
+ const debug_1 = tslib_1.__importDefault(require("debug"));
9
+ const list_element_size_1 = require("../list-element-size");
10
+ const list_1 = require("./list");
11
+ const pointer_1 = require("./pointer");
12
+ const trace = debug_1.default("capnp:list:composite");
13
+ trace("load");
14
+ class Int16List extends list_1.List {
15
+ get(index) {
16
+ const c = pointer_1.getContent(this);
17
+ return c.segment.getInt16(c.byteOffset + index * 2);
18
+ }
19
+ set(index, value) {
20
+ const c = pointer_1.getContent(this);
21
+ c.segment.setInt16(c.byteOffset + index * 2, value);
22
+ }
23
+ toString() {
24
+ return `Int16_${super.toString()}`;
25
+ }
26
+ }
27
+ exports.Int16List = Int16List;
28
+ Int16List._capnp = {
29
+ displayName: "List<Int16>",
30
+ size: list_element_size_1.ListElementSize.BYTE_2
31
+ };
32
+ //# sourceMappingURL=int16-list.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int16-list.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"int16-list.js","sourceRoot":"","sources":["int16-list.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,0DAA8B;AAE9B,4DAAuD;AACvD,iCAAyC;AACzC,uCAAuC;AAEvC,MAAM,KAAK,GAAG,eAAS,CAAC,sBAAsB,CAAC,CAAC;AAChD,KAAK,CAAC,MAAM,CAAC,CAAC;AAEd,MAAa,SAAU,SAAQ,WAAY;IAMzC,GAAG,CAAC,KAAa;QACf,MAAM,CAAC,GAAG,oBAAU,CAAC,IAAI,CAAC,CAAC;QAE3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,GAAG,CAAC,KAAa,EAAE,KAAa;QAC9B,MAAM,CAAC,GAAG,oBAAU,CAAC,IAAI,CAAC,CAAC;QAE3B,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,GAAG,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,QAAQ;QACN,OAAO,SAAS,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;IACrC,CAAC;;AApBH,8BAqBC;AApBiB,gBAAM,GAAc;IAClC,WAAW,EAAE,aAAuB;IACpC,IAAI,EAAE,mCAAe,CAAC,MAAM;CAC7B,CAAC"}
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int16-list.ts ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+
5
+ import initTrace from "debug";
6
+
7
+ import { ListElementSize } from "../list-element-size";
8
+ import { _ListCtor, List } from "./list";
9
+ import { getContent } from "./pointer";
10
+
11
+ const trace = initTrace("capnp:list:composite");
12
+ trace("load");
13
+
14
+ export class Int16List extends List<number> {
15
+ static readonly _capnp: _ListCtor = {
16
+ displayName: "List<Int16>" as string,
17
+ size: ListElementSize.BYTE_2
18
+ };
19
+
20
+ get(index: number): number {
21
+ const c = getContent(this);
22
+
23
+ return c.segment.getInt16(c.byteOffset + index * 2);
24
+ }
25
+
26
+ set(index: number, value: number): void {
27
+ const c = getContent(this);
28
+
29
+ c.segment.setInt16(c.byteOffset + index * 2, value);
30
+ }
31
+
32
+ toString(): string {
33
+ return `Int16_${super.toString()}`;
34
+ }
35
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int32-list.d.ts ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+ import { _ListCtor, List } from "./list";
5
+ export declare class Int32List extends List<number> {
6
+ static readonly _capnp: _ListCtor;
7
+ get(index: number): number;
8
+ set(index: number, value: number): void;
9
+ toString(): string;
10
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int32-list.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Int32List = void 0;
7
+ const tslib_1 = require("tslib");
8
+ const debug_1 = tslib_1.__importDefault(require("debug"));
9
+ const list_element_size_1 = require("../list-element-size");
10
+ const list_1 = require("./list");
11
+ const pointer_1 = require("./pointer");
12
+ const trace = debug_1.default("capnp:list:composite");
13
+ trace("load");
14
+ class Int32List extends list_1.List {
15
+ get(index) {
16
+ const c = pointer_1.getContent(this);
17
+ return c.segment.getInt32(c.byteOffset + index * 4);
18
+ }
19
+ set(index, value) {
20
+ const c = pointer_1.getContent(this);
21
+ c.segment.setInt32(c.byteOffset + index * 4, value);
22
+ }
23
+ toString() {
24
+ return `Int32_${super.toString()}`;
25
+ }
26
+ }
27
+ exports.Int32List = Int32List;
28
+ Int32List._capnp = {
29
+ displayName: "List<Int32>",
30
+ size: list_element_size_1.ListElementSize.BYTE_4
31
+ };
32
+ //# sourceMappingURL=int32-list.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int32-list.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"int32-list.js","sourceRoot":"","sources":["int32-list.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,0DAA8B;AAE9B,4DAAuD;AACvD,iCAAyC;AACzC,uCAAuC;AAEvC,MAAM,KAAK,GAAG,eAAS,CAAC,sBAAsB,CAAC,CAAC;AAChD,KAAK,CAAC,MAAM,CAAC,CAAC;AAEd,MAAa,SAAU,SAAQ,WAAY;IAMzC,GAAG,CAAC,KAAa;QACf,MAAM,CAAC,GAAG,oBAAU,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,GAAG,CAAC,KAAa,EAAE,KAAa;QAC9B,MAAM,CAAC,GAAG,oBAAU,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,GAAG,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,QAAQ;QACN,OAAO,SAAS,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;IACrC,CAAC;;AAlBH,8BAmBC;AAlBiB,gBAAM,GAAc;IAClC,WAAW,EAAE,aAAuB;IACpC,IAAI,EAAE,mCAAe,CAAC,MAAM;CAC7B,CAAC"}
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int32-list.ts ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+
5
+ import initTrace from "debug";
6
+
7
+ import { ListElementSize } from "../list-element-size";
8
+ import { _ListCtor, List } from "./list";
9
+ import { getContent } from "./pointer";
10
+
11
+ const trace = initTrace("capnp:list:composite");
12
+ trace("load");
13
+
14
+ export class Int32List extends List<number> {
15
+ static readonly _capnp: _ListCtor = {
16
+ displayName: "List<Int32>" as string,
17
+ size: ListElementSize.BYTE_4
18
+ };
19
+
20
+ get(index: number): number {
21
+ const c = getContent(this);
22
+ return c.segment.getInt32(c.byteOffset + index * 4);
23
+ }
24
+
25
+ set(index: number, value: number): void {
26
+ const c = getContent(this);
27
+ c.segment.setInt32(c.byteOffset + index * 4, value);
28
+ }
29
+
30
+ toString(): string {
31
+ return `Int32_${super.toString()}`;
32
+ }
33
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int64-list.d.ts ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+ import { Int64 } from "../../types";
5
+ import { _ListCtor, List } from "./list";
6
+ export declare class Int64List extends List<Int64> {
7
+ static readonly _capnp: _ListCtor;
8
+ get(index: number): Int64;
9
+ set(index: number, value: Int64): void;
10
+ toString(): string;
11
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int64-list.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Int64List = void 0;
7
+ const tslib_1 = require("tslib");
8
+ const debug_1 = tslib_1.__importDefault(require("debug"));
9
+ const list_element_size_1 = require("../list-element-size");
10
+ const list_1 = require("./list");
11
+ const pointer_1 = require("./pointer");
12
+ const trace = debug_1.default("capnp:list:composite");
13
+ trace("load");
14
+ class Int64List extends list_1.List {
15
+ get(index) {
16
+ const c = pointer_1.getContent(this);
17
+ return c.segment.getInt64(c.byteOffset + index * 8);
18
+ }
19
+ set(index, value) {
20
+ const c = pointer_1.getContent(this);
21
+ c.segment.setInt64(c.byteOffset + index * 8, value);
22
+ }
23
+ toString() {
24
+ return `Int64_${super.toString()}`;
25
+ }
26
+ }
27
+ exports.Int64List = Int64List;
28
+ Int64List._capnp = {
29
+ displayName: "List<Int64>",
30
+ size: list_element_size_1.ListElementSize.BYTE_8,
31
+ };
32
+ //# sourceMappingURL=int64-list.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int64-list.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"int64-list.js","sourceRoot":"","sources":["int64-list.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,0DAA8B;AAG9B,4DAAuD;AACvD,iCAAyC;AACzC,uCAAuC;AAEvC,MAAM,KAAK,GAAG,eAAS,CAAC,sBAAsB,CAAC,CAAC;AAChD,KAAK,CAAC,MAAM,CAAC,CAAC;AAEd,MAAa,SAAU,SAAQ,WAAW;IAMxC,GAAG,CAAC,KAAa;QACf,MAAM,CAAC,GAAG,oBAAU,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,GAAG,CAAC,KAAa,EAAE,KAAY;QAC7B,MAAM,CAAC,GAAG,oBAAU,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,GAAG,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,QAAQ;QACN,OAAO,SAAS,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;IACrC,CAAC;;AAlBH,8BAmBC;AAlBiB,gBAAM,GAAc;IAClC,WAAW,EAAE,aAAuB;IACpC,IAAI,EAAE,mCAAe,CAAC,MAAM;CAC7B,CAAC"}
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int64-list.ts ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+
5
+ import initTrace from "debug";
6
+
7
+ import { Int64 } from "../../types";
8
+ import { ListElementSize } from "../list-element-size";
9
+ import { _ListCtor, List } from "./list";
10
+ import { getContent } from "./pointer";
11
+
12
+ const trace = initTrace("capnp:list:composite");
13
+ trace("load");
14
+
15
+ export class Int64List extends List<Int64> {
16
+ static readonly _capnp: _ListCtor = {
17
+ displayName: "List<Int64>" as string,
18
+ size: ListElementSize.BYTE_8,
19
+ };
20
+
21
+ get(index: number): Int64 {
22
+ const c = getContent(this);
23
+ return c.segment.getInt64(c.byteOffset + index * 8);
24
+ }
25
+
26
+ set(index: number, value: Int64): void {
27
+ const c = getContent(this);
28
+ c.segment.setInt64(c.byteOffset + index * 8, value);
29
+ }
30
+
31
+ toString(): string {
32
+ return `Int64_${super.toString()}`;
33
+ }
34
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int8-list.d.ts ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+ import { _ListCtor, List } from "./list";
5
+ export declare class Int8List extends List<number> {
6
+ static readonly _capnp: _ListCtor;
7
+ get(index: number): number;
8
+ set(index: number, value: number): void;
9
+ toString(): string;
10
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int8-list.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Int8List = void 0;
7
+ const tslib_1 = require("tslib");
8
+ const debug_1 = tslib_1.__importDefault(require("debug"));
9
+ const list_element_size_1 = require("../list-element-size");
10
+ const list_1 = require("./list");
11
+ const pointer_1 = require("./pointer");
12
+ const trace = debug_1.default("capnp:list:composite");
13
+ trace("load");
14
+ class Int8List extends list_1.List {
15
+ get(index) {
16
+ const c = pointer_1.getContent(this);
17
+ return c.segment.getInt8(c.byteOffset + index);
18
+ }
19
+ set(index, value) {
20
+ const c = pointer_1.getContent(this);
21
+ c.segment.setInt8(c.byteOffset + index, value);
22
+ }
23
+ toString() {
24
+ return `Int8_${super.toString()}`;
25
+ }
26
+ }
27
+ exports.Int8List = Int8List;
28
+ Int8List._capnp = {
29
+ displayName: "List<Int8>",
30
+ size: list_element_size_1.ListElementSize.BYTE
31
+ };
32
+ //# sourceMappingURL=int8-list.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int8-list.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"int8-list.js","sourceRoot":"","sources":["int8-list.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,0DAA8B;AAE9B,4DAAuD;AACvD,iCAAyC;AACzC,uCAAuC;AAEvC,MAAM,KAAK,GAAG,eAAS,CAAC,sBAAsB,CAAC,CAAC;AAChD,KAAK,CAAC,MAAM,CAAC,CAAC;AAEd,MAAa,QAAS,SAAQ,WAAY;IAMxC,GAAG,CAAC,KAAa;QACf,MAAM,CAAC,GAAG,oBAAU,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,GAAG,KAAK,CAAC,CAAC;IACjD,CAAC;IAED,GAAG,CAAC,KAAa,EAAE,KAAa;QAC9B,MAAM,CAAC,GAAG,oBAAU,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IAED,QAAQ;QACN,OAAO,QAAQ,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;IACpC,CAAC;;AAlBH,4BAmBC;AAlBiB,eAAM,GAAc;IAClC,WAAW,EAAE,YAAsB;IACnC,IAAI,EAAE,mCAAe,CAAC,IAAI;CAC3B,CAAC"}
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/int8-list.ts ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+
5
+ import initTrace from "debug";
6
+
7
+ import { ListElementSize } from "../list-element-size";
8
+ import { _ListCtor, List } from "./list";
9
+ import { getContent } from "./pointer";
10
+
11
+ const trace = initTrace("capnp:list:composite");
12
+ trace("load");
13
+
14
+ export class Int8List extends List<number> {
15
+ static readonly _capnp: _ListCtor = {
16
+ displayName: "List<Int8>" as string,
17
+ size: ListElementSize.BYTE
18
+ };
19
+
20
+ get(index: number): number {
21
+ const c = getContent(this);
22
+ return c.segment.getInt8(c.byteOffset + index);
23
+ }
24
+
25
+ set(index: number, value: number): void {
26
+ const c = getContent(this);
27
+ c.segment.setInt8(c.byteOffset + index, value);
28
+ }
29
+
30
+ toString(): string {
31
+ return `Int8_${super.toString()}`;
32
+ }
33
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface-list.d.ts ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+ import { Interface } from "./interface";
5
+ import { ListCtor } from "./list";
6
+ export declare const InterfaceList: ListCtor<Interface>;
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface-list.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.InterfaceList = void 0;
7
+ const interface_1 = require("./interface");
8
+ const pointer_list_1 = require("./pointer-list");
9
+ exports.InterfaceList = pointer_list_1.PointerList(interface_1.Interface);
10
+ //# sourceMappingURL=interface-list.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface-list.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"interface-list.js","sourceRoot":"","sources":["interface-list.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,2CAAwC;AAExC,iDAA6C;AAEhC,QAAA,aAAa,GAAwB,0BAAW,CAAC,qBAAS,CAAC,CAAC"}
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface-list.ts ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+
5
+ import { Interface } from "./interface";
6
+ import { ListCtor } from "./list";
7
+ import { PointerList } from "./pointer-list";
8
+
9
+ export const InterfaceList: ListCtor<Interface> = PointerList(Interface);
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface.d.ts ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+ import { Segment } from "../segment";
5
+ import { Pointer } from "./pointer";
6
+ export declare class Interface extends Pointer {
7
+ constructor(segment: Segment, byteOffset: number, depthLimit?: number);
8
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Interface = void 0;
7
+ const constants_1 = require("../../constants");
8
+ const errors_1 = require("../../errors");
9
+ const util_1 = require("../../util");
10
+ const pointer_1 = require("./pointer");
11
+ class Interface extends pointer_1.Pointer {
12
+ constructor(segment, byteOffset, depthLimit = constants_1.MAX_DEPTH) {
13
+ super(segment, byteOffset, depthLimit);
14
+ throw new Error(util_1.format(errors_1.NOT_IMPLEMENTED, "new Interface"));
15
+ }
16
+ }
17
+ exports.Interface = Interface;
18
+ //# sourceMappingURL=interface.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["interface.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,+CAA4C;AAC5C,yCAA+C;AAC/C,qCAAoC;AAEpC,uCAAoC;AAEpC,MAAa,SAAU,SAAQ,iBAAO;IACpC,YAAY,OAAgB,EAAE,UAAkB,EAAE,UAAU,GAAG,qBAAS;QACtE,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;QAEvC,MAAM,IAAI,KAAK,CAAC,aAAM,CAAC,wBAAe,EAAE,eAAe,CAAC,CAAC,CAAC;IAC5D,CAAC;CACF;AAND,8BAMC"}
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/interface.ts ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+
5
+ import { MAX_DEPTH } from "../../constants";
6
+ import { NOT_IMPLEMENTED } from "../../errors";
7
+ import { format } from "../../util";
8
+ import { Segment } from "../segment";
9
+ import { Pointer } from "./pointer";
10
+
11
+ export class Interface extends Pointer {
12
+ constructor(segment: Segment, byteOffset: number, depthLimit = MAX_DEPTH) {
13
+ super(segment, byteOffset, depthLimit);
14
+
15
+ throw new Error(format(NOT_IMPLEMENTED, "new Interface"));
16
+ }
17
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/list.d.ts ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+ import { ListElementSize } from "../list-element-size";
5
+ import { ObjectSize } from "../object-size";
6
+ import { Segment } from "../segment";
7
+ import { Pointer } from "./pointer";
8
+ export interface _ListCtor {
9
+ readonly compositeSize?: ObjectSize;
10
+ readonly displayName: string;
11
+ readonly size: ListElementSize;
12
+ }
13
+ export interface ListCtor<T> {
14
+ readonly _capnp: _ListCtor;
15
+ new (segment: Segment, byteOffset: number, depthLimit?: number): List<T>;
16
+ }
17
+ export declare type FilterCallback<T> = (this: void, value: T, index: number) => boolean;
18
+ export declare type IndexedCallback<T, U> = (this: void, value: T, index: number) => U;
19
+ export interface Group<T> {
20
+ [k: string]: T;
21
+ }
22
+ /**
23
+ * A generic list class. Implements Filterable,
24
+ */
25
+ export declare class List<T> extends Pointer {
26
+ static readonly _capnp: _ListCtor;
27
+ static readonly get: typeof get;
28
+ static readonly initList: typeof initList;
29
+ static readonly set: typeof set;
30
+ static toString(): string;
31
+ all(callbackfn: FilterCallback<T>): boolean;
32
+ any(callbackfn: FilterCallback<T>): boolean;
33
+ ap<U>(callbackfns: Array<IndexedCallback<T, U>>): U[];
34
+ concat(other: List<T>): T[];
35
+ drop(n: number): T[];
36
+ dropWhile(callbackfn: FilterCallback<T>): T[];
37
+ empty(): T[];
38
+ every(callbackfn: FilterCallback<T>): boolean;
39
+ filter(callbackfn: FilterCallback<T>): T[];
40
+ find(callbackfn: FilterCallback<T>): T | undefined;
41
+ findIndex(callbackfn: FilterCallback<T>): number;
42
+ forEach(callbackfn: (this: void, value: T, index: number) => void): void;
43
+ get(_index: number): T;
44
+ /**
45
+ * Get the length of this list.
46
+ *
47
+ * @returns {number} The number of elements in this list.
48
+ */
49
+ getLength(): number;
50
+ groupBy(callbackfn: IndexedCallback<T, string>): Group<T>;
51
+ intersperse(sep: T): T[];
52
+ map<U>(callbackfn: IndexedCallback<T, U>): U[];
53
+ reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T): T;
54
+ reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;
55
+ set(_index: number, _value: T): void;
56
+ slice(start?: number, end?: number): T[];
57
+ some(callbackfn: FilterCallback<T>): boolean;
58
+ take(n: number): T[];
59
+ takeWhile(callbackfn: FilterCallback<T>): T[];
60
+ toArray(): T[];
61
+ toString(): string;
62
+ }
63
+ /**
64
+ * Initialize the list with the given element size and length. This will allocate new space for the list, ideally in
65
+ * the same segment as this pointer.
66
+ *
67
+ * @param {ListElementSize} elementSize The size of each element in the list.
68
+ * @param {number} length The number of elements in the list.
69
+ * @param {List<T>} l The list to initialize.
70
+ * @param {ObjectSize} [compositeSize] The size of each element in a composite list. This value is required for
71
+ * composite lists.
72
+ * @returns {void}
73
+ */
74
+ export declare function initList<T>(elementSize: ListElementSize, length: number, l: List<T>, compositeSize?: ObjectSize): void;
75
+ export declare function get<T>(_index: number, _l: List<T>): T;
76
+ export declare function set<T>(_index: number, _value: T, _l: List<T>): void;
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/list.js ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.set = exports.get = exports.initList = exports.List = void 0;
7
+ const tslib_1 = require("tslib");
8
+ const debug_1 = tslib_1.__importDefault(require("debug"));
9
+ const errors_1 = require("../../errors");
10
+ const util_1 = require("../../util");
11
+ const list_element_size_1 = require("../list-element-size");
12
+ const object_size_1 = require("../object-size");
13
+ const pointer_1 = require("./pointer");
14
+ const trace = debug_1.default("capnp:list");
15
+ trace("load");
16
+ /**
17
+ * A generic list class. Implements Filterable,
18
+ */
19
+ class List extends pointer_1.Pointer {
20
+ static toString() {
21
+ return this._capnp.displayName;
22
+ }
23
+ all(callbackfn) {
24
+ const length = this.getLength();
25
+ for (let i = 0; i < length; i++) {
26
+ if (!callbackfn(this.get(i), i))
27
+ return false;
28
+ }
29
+ return true;
30
+ }
31
+ any(callbackfn) {
32
+ const length = this.getLength();
33
+ for (let i = 0; i < length; i++) {
34
+ if (callbackfn(this.get(i), i))
35
+ return true;
36
+ }
37
+ return false;
38
+ }
39
+ ap(callbackfns) {
40
+ const length = this.getLength();
41
+ const res = [];
42
+ for (let i = 0; i < length; i++) {
43
+ res.push(...callbackfns.map((f) => f(this.get(i), i)));
44
+ }
45
+ return res;
46
+ }
47
+ concat(other) {
48
+ const length = this.getLength();
49
+ const otherLength = other.getLength();
50
+ const res = new Array(length + otherLength);
51
+ for (let i = 0; i < length; i++)
52
+ res[i] = this.get(i);
53
+ for (let i = 0; i < otherLength; i++)
54
+ res[i + length] = other.get(i);
55
+ return res;
56
+ }
57
+ drop(n) {
58
+ const length = this.getLength();
59
+ const res = new Array(length);
60
+ for (let i = n; i < length; i++)
61
+ res[i] = this.get(i);
62
+ return res;
63
+ }
64
+ dropWhile(callbackfn) {
65
+ const length = this.getLength();
66
+ const res = [];
67
+ let drop = true;
68
+ for (let i = 0; i < length; i++) {
69
+ const v = this.get(i);
70
+ if (drop)
71
+ drop = callbackfn(v, i);
72
+ if (!drop)
73
+ res.push(v);
74
+ }
75
+ return res;
76
+ }
77
+ empty() {
78
+ return [];
79
+ }
80
+ every(callbackfn) {
81
+ return this.all(callbackfn);
82
+ }
83
+ filter(callbackfn) {
84
+ const length = this.getLength();
85
+ const res = [];
86
+ for (let i = 0; i < length; i++) {
87
+ const value = this.get(i);
88
+ if (callbackfn(value, i))
89
+ res.push(value);
90
+ }
91
+ return res;
92
+ }
93
+ find(callbackfn) {
94
+ const length = this.getLength();
95
+ for (let i = 0; i < length; i++) {
96
+ const value = this.get(i);
97
+ if (callbackfn(value, i))
98
+ return value;
99
+ }
100
+ return undefined;
101
+ }
102
+ findIndex(callbackfn) {
103
+ const length = this.getLength();
104
+ for (let i = 0; i < length; i++) {
105
+ const value = this.get(i);
106
+ if (callbackfn(value, i))
107
+ return i;
108
+ }
109
+ return -1;
110
+ }
111
+ forEach(callbackfn) {
112
+ const length = this.getLength();
113
+ for (let i = 0; i < length; i++)
114
+ callbackfn(this.get(i), i);
115
+ }
116
+ get(_index) {
117
+ return get(_index, this);
118
+ }
119
+ /**
120
+ * Get the length of this list.
121
+ *
122
+ * @returns {number} The number of elements in this list.
123
+ */
124
+ getLength() {
125
+ return pointer_1.getTargetListLength(this);
126
+ }
127
+ groupBy(callbackfn) {
128
+ const length = this.getLength();
129
+ const res = {};
130
+ for (let i = 0; i < length; i++) {
131
+ const v = this.get(i);
132
+ res[callbackfn(v, i)] = v;
133
+ }
134
+ return res;
135
+ }
136
+ intersperse(sep) {
137
+ const length = this.getLength();
138
+ const res = new Array(length);
139
+ for (let i = 0; i < length; i++) {
140
+ if (i > 0)
141
+ res.push(sep);
142
+ res.push(this.get(i));
143
+ }
144
+ return res;
145
+ }
146
+ map(callbackfn) {
147
+ const length = this.getLength();
148
+ const res = new Array(length);
149
+ for (let i = 0; i < length; i++)
150
+ res[i] = callbackfn(this.get(i), i);
151
+ return res;
152
+ }
153
+ reduce(callbackfn, initialValue) {
154
+ let i = 0;
155
+ let res;
156
+ if (initialValue === undefined) {
157
+ res = this.get(0);
158
+ i++;
159
+ }
160
+ else {
161
+ res = initialValue;
162
+ }
163
+ for (; i < this.getLength(); i++)
164
+ res = callbackfn(res, this.get(i), i);
165
+ return res;
166
+ }
167
+ set(_index, _value) {
168
+ set(_index, _value, this);
169
+ }
170
+ slice(start = 0, end) {
171
+ const length = end ? Math.min(this.getLength(), end) : this.getLength();
172
+ const res = new Array(length - start);
173
+ for (let i = start; i < length; i++)
174
+ res[i] = this.get(i);
175
+ return res;
176
+ }
177
+ some(callbackfn) {
178
+ return this.any(callbackfn);
179
+ }
180
+ take(n) {
181
+ const length = Math.min(this.getLength(), n);
182
+ const res = new Array(length);
183
+ for (let i = 0; i < length; i++)
184
+ res[i] = this.get(i);
185
+ return res;
186
+ }
187
+ takeWhile(callbackfn) {
188
+ const length = this.getLength();
189
+ const res = [];
190
+ let take;
191
+ for (let i = 0; i < length; i++) {
192
+ const v = this.get(i);
193
+ take = callbackfn(v, i);
194
+ if (!take)
195
+ return res;
196
+ res.push(v);
197
+ }
198
+ return res;
199
+ }
200
+ toArray() {
201
+ return this.map(util_1.identity);
202
+ }
203
+ toString() {
204
+ return `List_${super.toString()}`;
205
+ }
206
+ }
207
+ exports.List = List;
208
+ List._capnp = {
209
+ displayName: "List<Generic>",
210
+ size: list_element_size_1.ListElementSize.VOID,
211
+ };
212
+ List.get = get;
213
+ List.initList = initList;
214
+ List.set = set;
215
+ /**
216
+ * Initialize the list with the given element size and length. This will allocate new space for the list, ideally in
217
+ * the same segment as this pointer.
218
+ *
219
+ * @param {ListElementSize} elementSize The size of each element in the list.
220
+ * @param {number} length The number of elements in the list.
221
+ * @param {List<T>} l The list to initialize.
222
+ * @param {ObjectSize} [compositeSize] The size of each element in a composite list. This value is required for
223
+ * composite lists.
224
+ * @returns {void}
225
+ */
226
+ function initList(elementSize, length, l, compositeSize) {
227
+ let c;
228
+ switch (elementSize) {
229
+ case list_element_size_1.ListElementSize.BIT:
230
+ c = l.segment.allocate(Math.ceil(length / 8));
231
+ break;
232
+ case list_element_size_1.ListElementSize.BYTE:
233
+ case list_element_size_1.ListElementSize.BYTE_2:
234
+ case list_element_size_1.ListElementSize.BYTE_4:
235
+ case list_element_size_1.ListElementSize.BYTE_8:
236
+ case list_element_size_1.ListElementSize.POINTER:
237
+ c = l.segment.allocate(length * pointer_1.getListElementByteLength(elementSize));
238
+ break;
239
+ case list_element_size_1.ListElementSize.COMPOSITE: {
240
+ if (compositeSize === undefined) {
241
+ throw new Error(util_1.format(errors_1.PTR_COMPOSITE_SIZE_UNDEFINED));
242
+ }
243
+ compositeSize = object_size_1.padToWord(compositeSize);
244
+ const byteLength = object_size_1.getByteLength(compositeSize) * length;
245
+ // We need to allocate an extra 8 bytes for the tag word, then make sure we write the length to it. We advance
246
+ // the content pointer by 8 bytes so that it then points to the first list element as intended. Everything
247
+ // starts off zeroed out so these nested structs don't need to be initialized in any way.
248
+ c = l.segment.allocate(byteLength + 8);
249
+ pointer_1.setStructPointer(length, compositeSize, c);
250
+ trace("Wrote composite tag word %s for %s.", c, l);
251
+ break;
252
+ }
253
+ case list_element_size_1.ListElementSize.VOID:
254
+ // No need to allocate anything, we can write the list pointer right here.
255
+ pointer_1.setListPointer(0, elementSize, length, l);
256
+ return;
257
+ default:
258
+ throw new Error(util_1.format(errors_1.PTR_INVALID_LIST_SIZE, elementSize));
259
+ }
260
+ const res = pointer_1.initPointer(c.segment, c.byteOffset, l);
261
+ pointer_1.setListPointer(res.offsetWords, elementSize, length, res.pointer, compositeSize);
262
+ }
263
+ exports.initList = initList;
264
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
265
+ function get(_index, _l) {
266
+ throw new TypeError();
267
+ }
268
+ exports.get = get;
269
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
270
+ function set(_index, _value, _l) {
271
+ throw new TypeError();
272
+ }
273
+ exports.set = set;
274
+ //# sourceMappingURL=list.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/list.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["list.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,0DAA8B;AAE9B,yCAAmF;AACnF,qCAA8C;AAC9C,4DAAuD;AACvD,gDAAsE;AAEtE,uCAOmB;AAEnB,MAAM,KAAK,GAAG,eAAS,CAAC,YAAY,CAAC,CAAC;AACtC,KAAK,CAAC,MAAM,CAAC,CAAC;AAqBd;;GAEG;AAEH,MAAa,IAAQ,SAAQ,iBAAO;IASlC,MAAM,CAAC,QAAQ;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACjC,CAAC;IAED,GAAG,CAAC,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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+
5
+ import initTrace from "debug";
6
+
7
+ import { PTR_COMPOSITE_SIZE_UNDEFINED, PTR_INVALID_LIST_SIZE } from "../../errors";
8
+ import { format, identity } from "../../util";
9
+ import { ListElementSize } from "../list-element-size";
10
+ import { ObjectSize, padToWord, getByteLength } from "../object-size";
11
+ import { Segment } from "../segment";
12
+ import {
13
+ Pointer,
14
+ getTargetListLength,
15
+ getListElementByteLength,
16
+ setStructPointer,
17
+ setListPointer,
18
+ initPointer,
19
+ } from "./pointer";
20
+
21
+ const trace = initTrace("capnp:list");
22
+ trace("load");
23
+
24
+ export interface _ListCtor {
25
+ readonly compositeSize?: ObjectSize;
26
+ readonly displayName: string;
27
+ readonly size: ListElementSize;
28
+ }
29
+
30
+ export interface ListCtor<T> {
31
+ readonly _capnp: _ListCtor;
32
+
33
+ new (segment: Segment, byteOffset: number, depthLimit?: number): List<T>;
34
+ }
35
+
36
+ export type FilterCallback<T> = (this: void, value: T, index: number) => boolean;
37
+ export type IndexedCallback<T, U> = (this: void, value: T, index: number) => U;
38
+
39
+ export interface Group<T> {
40
+ [k: string]: T;
41
+ }
42
+
43
+ /**
44
+ * A generic list class. Implements Filterable,
45
+ */
46
+
47
+ export class List<T> extends Pointer {
48
+ static readonly _capnp: _ListCtor = {
49
+ displayName: "List<Generic>" as string,
50
+ size: ListElementSize.VOID,
51
+ };
52
+ static readonly get = get;
53
+ static readonly initList = initList;
54
+ static readonly set = set;
55
+
56
+ static toString(): string {
57
+ return this._capnp.displayName;
58
+ }
59
+
60
+ all(callbackfn: FilterCallback<T>): boolean {
61
+ const length = this.getLength();
62
+
63
+ for (let i = 0; i < length; i++) {
64
+ if (!callbackfn(this.get(i), i)) return false;
65
+ }
66
+
67
+ return true;
68
+ }
69
+
70
+ any(callbackfn: FilterCallback<T>): boolean {
71
+ const length = this.getLength();
72
+
73
+ for (let i = 0; i < length; i++) {
74
+ if (callbackfn(this.get(i), i)) return true;
75
+ }
76
+
77
+ return false;
78
+ }
79
+
80
+ ap<U>(callbackfns: Array<IndexedCallback<T, U>>): U[] {
81
+ const length = this.getLength();
82
+ const res: U[] = [];
83
+
84
+ for (let i = 0; i < length; i++) {
85
+ res.push(...callbackfns.map((f) => f(this.get(i), i)));
86
+ }
87
+
88
+ return res;
89
+ }
90
+
91
+ concat(other: List<T>): T[] {
92
+ const length = this.getLength();
93
+ const otherLength = other.getLength();
94
+ const res = new Array<T>(length + otherLength);
95
+
96
+ for (let i = 0; i < length; i++) res[i] = this.get(i);
97
+
98
+ for (let i = 0; i < otherLength; i++) res[i + length] = other.get(i);
99
+
100
+ return res;
101
+ }
102
+
103
+ drop(n: number): T[] {
104
+ const length = this.getLength();
105
+ const res = new Array(length) as T[];
106
+
107
+ for (let i = n; i < length; i++) res[i] = this.get(i);
108
+
109
+ return res;
110
+ }
111
+
112
+ dropWhile(callbackfn: FilterCallback<T>): T[] {
113
+ const length = this.getLength();
114
+ const res: T[] = [];
115
+ let drop = true;
116
+
117
+ for (let i = 0; i < length; i++) {
118
+ const v = this.get(i);
119
+
120
+ if (drop) drop = callbackfn(v, i);
121
+
122
+ if (!drop) res.push(v);
123
+ }
124
+
125
+ return res;
126
+ }
127
+
128
+ empty(): T[] {
129
+ return [] as T[];
130
+ }
131
+
132
+ every(callbackfn: FilterCallback<T>): boolean {
133
+ return this.all(callbackfn);
134
+ }
135
+
136
+ filter(callbackfn: FilterCallback<T>): T[] {
137
+ const length = this.getLength();
138
+ const res: T[] = [];
139
+
140
+ for (let i = 0; i < length; i++) {
141
+ const value = this.get(i);
142
+
143
+ if (callbackfn(value, i)) res.push(value);
144
+ }
145
+
146
+ return res;
147
+ }
148
+
149
+ find(callbackfn: FilterCallback<T>): T | undefined {
150
+ const length = this.getLength();
151
+
152
+ for (let i = 0; i < length; i++) {
153
+ const value = this.get(i);
154
+
155
+ if (callbackfn(value, i)) return value;
156
+ }
157
+
158
+ return undefined;
159
+ }
160
+
161
+ findIndex(callbackfn: FilterCallback<T>): number {
162
+ const length = this.getLength();
163
+
164
+ for (let i = 0; i < length; i++) {
165
+ const value = this.get(i);
166
+
167
+ if (callbackfn(value, i)) return i;
168
+ }
169
+
170
+ return -1;
171
+ }
172
+
173
+ forEach(callbackfn: (this: void, value: T, index: number) => void): void {
174
+ const length = this.getLength();
175
+
176
+ for (let i = 0; i < length; i++) callbackfn(this.get(i), i);
177
+ }
178
+
179
+ get(_index: number): T {
180
+ return get(_index, this);
181
+ }
182
+
183
+ /**
184
+ * Get the length of this list.
185
+ *
186
+ * @returns {number} The number of elements in this list.
187
+ */
188
+
189
+ getLength(): number {
190
+ return getTargetListLength(this);
191
+ }
192
+
193
+ groupBy(callbackfn: IndexedCallback<T, string>): Group<T> {
194
+ const length = this.getLength();
195
+ const res: Group<T> = {};
196
+
197
+ for (let i = 0; i < length; i++) {
198
+ const v = this.get(i);
199
+ res[callbackfn(v, i)] = v;
200
+ }
201
+
202
+ return res;
203
+ }
204
+
205
+ intersperse(sep: T): T[] {
206
+ const length = this.getLength();
207
+ const res = new Array(length) as T[];
208
+
209
+ for (let i = 0; i < length; i++) {
210
+ if (i > 0) res.push(sep);
211
+
212
+ res.push(this.get(i));
213
+ }
214
+
215
+ return res;
216
+ }
217
+
218
+ map<U>(callbackfn: IndexedCallback<T, U>): U[] {
219
+ const length = this.getLength();
220
+ const res = new Array(length) as U[];
221
+
222
+ for (let i = 0; i < length; i++) res[i] = callbackfn(this.get(i), i);
223
+
224
+ return res;
225
+ }
226
+
227
+ reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T): T;
228
+ reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;
229
+ reduce<U>(
230
+ callbackfn: (previousValue: T | U, currentValue: T, currentIndex: number) => T | U,
231
+ initialValue?: U
232
+ ): T | U {
233
+ let i = 0;
234
+ let res: T | U;
235
+
236
+ if (initialValue === undefined) {
237
+ res = this.get(0);
238
+ i++;
239
+ } else {
240
+ res = initialValue;
241
+ }
242
+
243
+ for (; i < this.getLength(); i++) res = callbackfn(res, this.get(i), i);
244
+
245
+ return res;
246
+ }
247
+
248
+ set(_index: number, _value: T): void {
249
+ set(_index, _value, this);
250
+ }
251
+
252
+ slice(start = 0, end?: number): T[] {
253
+ const length = end ? Math.min(this.getLength(), end) : this.getLength();
254
+ const res = new Array(length - start) as T[];
255
+
256
+ for (let i = start; i < length; i++) res[i] = this.get(i);
257
+
258
+ return res;
259
+ }
260
+
261
+ some(callbackfn: FilterCallback<T>): boolean {
262
+ return this.any(callbackfn);
263
+ }
264
+
265
+ take(n: number): T[] {
266
+ const length = Math.min(this.getLength(), n);
267
+ const res = new Array(length) as T[];
268
+
269
+ for (let i = 0; i < length; i++) res[i] = this.get(i);
270
+
271
+ return res;
272
+ }
273
+
274
+ takeWhile(callbackfn: FilterCallback<T>): T[] {
275
+ const length = this.getLength();
276
+ const res: T[] = [];
277
+ let take;
278
+
279
+ for (let i = 0; i < length; i++) {
280
+ const v = this.get(i);
281
+
282
+ take = callbackfn(v, i);
283
+
284
+ if (!take) return res;
285
+
286
+ res.push(v);
287
+ }
288
+
289
+ return res;
290
+ }
291
+
292
+ toArray(): T[] {
293
+ return this.map(identity);
294
+ }
295
+
296
+ toString(): string {
297
+ return `List_${super.toString()}`;
298
+ }
299
+ }
300
+
301
+ /**
302
+ * Initialize the list with the given element size and length. This will allocate new space for the list, ideally in
303
+ * the same segment as this pointer.
304
+ *
305
+ * @param {ListElementSize} elementSize The size of each element in the list.
306
+ * @param {number} length The number of elements in the list.
307
+ * @param {List<T>} l The list to initialize.
308
+ * @param {ObjectSize} [compositeSize] The size of each element in a composite list. This value is required for
309
+ * composite lists.
310
+ * @returns {void}
311
+ */
312
+
313
+ export function initList<T>(
314
+ elementSize: ListElementSize,
315
+ length: number,
316
+ l: List<T>,
317
+ compositeSize?: ObjectSize
318
+ ): void {
319
+ let c: Pointer;
320
+
321
+ switch (elementSize) {
322
+ case ListElementSize.BIT:
323
+ c = l.segment.allocate(Math.ceil(length / 8));
324
+
325
+ break;
326
+
327
+ case ListElementSize.BYTE:
328
+ case ListElementSize.BYTE_2:
329
+ case ListElementSize.BYTE_4:
330
+ case ListElementSize.BYTE_8:
331
+ case ListElementSize.POINTER:
332
+ c = l.segment.allocate(length * getListElementByteLength(elementSize));
333
+
334
+ break;
335
+
336
+ case ListElementSize.COMPOSITE: {
337
+ if (compositeSize === undefined) {
338
+ throw new Error(format(PTR_COMPOSITE_SIZE_UNDEFINED));
339
+ }
340
+
341
+ compositeSize = padToWord(compositeSize);
342
+
343
+ const byteLength = getByteLength(compositeSize) * length;
344
+
345
+ // We need to allocate an extra 8 bytes for the tag word, then make sure we write the length to it. We advance
346
+ // the content pointer by 8 bytes so that it then points to the first list element as intended. Everything
347
+ // starts off zeroed out so these nested structs don't need to be initialized in any way.
348
+
349
+ c = l.segment.allocate(byteLength + 8);
350
+
351
+ setStructPointer(length, compositeSize, c);
352
+
353
+ trace("Wrote composite tag word %s for %s.", c, l);
354
+
355
+ break;
356
+ }
357
+ case ListElementSize.VOID:
358
+ // No need to allocate anything, we can write the list pointer right here.
359
+
360
+ setListPointer(0, elementSize, length, l);
361
+
362
+ return;
363
+
364
+ default:
365
+ throw new Error(format(PTR_INVALID_LIST_SIZE, elementSize));
366
+ }
367
+
368
+ const res = initPointer(c.segment, c.byteOffset, l);
369
+
370
+ setListPointer(res.offsetWords, elementSize, length, res.pointer, compositeSize);
371
+ }
372
+
373
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
374
+ export function get<T>(_index: number, _l: List<T>): T {
375
+ throw new TypeError();
376
+ }
377
+
378
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
379
+ export function set<T>(_index: number, _value: T, _l: List<T>): void {
380
+ throw new TypeError();
381
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/orphan.d.ts ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { ListElementSize } from "../list-element-size";
2
+ import { ObjectSize } from "../object-size";
3
+ import { Segment } from "../segment";
4
+ import { Pointer } from "./pointer";
5
+ import { PointerType } from "./pointer-type";
6
+ export interface _Orphan {
7
+ capId: number;
8
+ elementSize: ListElementSize;
9
+ length: number;
10
+ size: ObjectSize;
11
+ type: PointerType;
12
+ }
13
+ /**
14
+ * An orphaned pointer. This object itself is technically a pointer to the original pointer's content, which was left
15
+ * untouched in its original message. The original pointer data is encoded as attributes on the Orphan object, ready to
16
+ * be reconstructed once another pointer is ready to adopt it.
17
+ *
18
+ * @export
19
+ * @class Orphan
20
+ * @extends {Pointer}
21
+ * @template T
22
+ */
23
+ export declare class Orphan<T extends Pointer> {
24
+ /** If this member is not present then the orphan has already been adopted, or something went very wrong. */
25
+ _capnp?: _Orphan;
26
+ byteOffset: number;
27
+ segment: Segment;
28
+ constructor(src: T);
29
+ /**
30
+ * Adopt (move) this orphan into the target pointer location. This will allocate far pointers in `dst` as needed.
31
+ *
32
+ * @param {T} dst The destination pointer.
33
+ * @returns {void}
34
+ */
35
+ _moveTo(dst: T): void;
36
+ dispose(): void;
37
+ toString(): string;
38
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/orphan.js ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Orphan = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const debug_1 = tslib_1.__importDefault(require("debug"));
6
+ const errors_1 = require("../../errors");
7
+ const util_1 = require("../../util");
8
+ const list_element_size_1 = require("../list-element-size");
9
+ const object_size_1 = require("../object-size");
10
+ const pointer_1 = require("./pointer");
11
+ const pointer_type_1 = require("./pointer-type");
12
+ const trace = debug_1.default("capnp:orphan");
13
+ trace("load");
14
+ // Technically speaking this class doesn't need to be generic, but the extra type checking enforced by this helps to
15
+ // make sure you don't accidentally adopt a pointer of the wrong type.
16
+ /**
17
+ * An orphaned pointer. This object itself is technically a pointer to the original pointer's content, which was left
18
+ * untouched in its original message. The original pointer data is encoded as attributes on the Orphan object, ready to
19
+ * be reconstructed once another pointer is ready to adopt it.
20
+ *
21
+ * @export
22
+ * @class Orphan
23
+ * @extends {Pointer}
24
+ * @template T
25
+ */
26
+ class Orphan {
27
+ constructor(src) {
28
+ const c = pointer_1.getContent(src);
29
+ this.segment = c.segment;
30
+ this.byteOffset = c.byteOffset;
31
+ this._capnp = {};
32
+ // Read vital info from the src pointer so we can reconstruct it during adoption.
33
+ this._capnp.type = pointer_1.getTargetPointerType(src);
34
+ switch (this._capnp.type) {
35
+ case pointer_type_1.PointerType.STRUCT:
36
+ this._capnp.size = pointer_1.getTargetStructSize(src);
37
+ break;
38
+ case pointer_type_1.PointerType.LIST:
39
+ this._capnp.length = pointer_1.getTargetListLength(src);
40
+ this._capnp.elementSize = pointer_1.getTargetListElementSize(src);
41
+ if (this._capnp.elementSize === list_element_size_1.ListElementSize.COMPOSITE) {
42
+ this._capnp.size = pointer_1.getTargetCompositeListSize(src);
43
+ }
44
+ break;
45
+ case pointer_type_1.PointerType.OTHER:
46
+ this._capnp.capId = pointer_1.getCapabilityId(src);
47
+ break;
48
+ default:
49
+ // COVERAGE: Unreachable code.
50
+ /* istanbul ignore next */
51
+ throw new Error(errors_1.PTR_INVALID_POINTER_TYPE);
52
+ }
53
+ // Zero out the source pointer (but not the contents!).
54
+ pointer_1.erasePointer(src);
55
+ }
56
+ /**
57
+ * Adopt (move) this orphan into the target pointer location. This will allocate far pointers in `dst` as needed.
58
+ *
59
+ * @param {T} dst The destination pointer.
60
+ * @returns {void}
61
+ */
62
+ _moveTo(dst) {
63
+ if (this._capnp === undefined) {
64
+ throw new Error(util_1.format(errors_1.PTR_ALREADY_ADOPTED, this));
65
+ }
66
+ // TODO: Implement copy semantics when this happens.
67
+ if (this.segment.message !== dst.segment.message) {
68
+ throw new Error(util_1.format(errors_1.PTR_ADOPT_WRONG_MESSAGE, this, dst));
69
+ }
70
+ // Recursively wipe out the destination pointer first.
71
+ pointer_1.erase(dst);
72
+ const res = pointer_1.initPointer(this.segment, this.byteOffset, dst);
73
+ switch (this._capnp.type) {
74
+ case pointer_type_1.PointerType.STRUCT:
75
+ pointer_1.setStructPointer(res.offsetWords, this._capnp.size, res.pointer);
76
+ break;
77
+ case pointer_type_1.PointerType.LIST: {
78
+ let offsetWords = res.offsetWords;
79
+ if (this._capnp.elementSize === list_element_size_1.ListElementSize.COMPOSITE) {
80
+ offsetWords--; // The tag word gets skipped.
81
+ }
82
+ pointer_1.setListPointer(offsetWords, this._capnp.elementSize, this._capnp.length, res.pointer, this._capnp.size);
83
+ break;
84
+ }
85
+ case pointer_type_1.PointerType.OTHER:
86
+ pointer_1.setInterfacePointer(this._capnp.capId, res.pointer);
87
+ break;
88
+ /* istanbul ignore next */
89
+ default:
90
+ throw new Error(errors_1.PTR_INVALID_POINTER_TYPE);
91
+ }
92
+ this._capnp = undefined;
93
+ }
94
+ dispose() {
95
+ // FIXME: Should this throw?
96
+ if (this._capnp === undefined) {
97
+ trace("not disposing an already disposed orphan", this);
98
+ return;
99
+ }
100
+ switch (this._capnp.type) {
101
+ case pointer_type_1.PointerType.STRUCT:
102
+ this.segment.fillZeroWords(this.byteOffset, object_size_1.getWordLength(this._capnp.size));
103
+ break;
104
+ case pointer_type_1.PointerType.LIST: {
105
+ const byteLength = pointer_1.getListByteLength(this._capnp.elementSize, this._capnp.length, this._capnp.size);
106
+ this.segment.fillZeroWords(this.byteOffset, byteLength);
107
+ break;
108
+ }
109
+ default:
110
+ // Other pointer types don't actually have any content.
111
+ break;
112
+ }
113
+ this._capnp = undefined;
114
+ }
115
+ toString() {
116
+ return util_1.format("Orphan_%d@%a,type:%s", this.segment.id, this.byteOffset, this._capnp && this._capnp.type);
117
+ }
118
+ }
119
+ exports.Orphan = Orphan;
120
+ //# sourceMappingURL=orphan.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/orphan.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"orphan.js","sourceRoot":"","sources":["orphan.ts"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAE9B,yCAAsG;AACtG,qCAAoC;AACpC,4DAAuD;AACvD,gDAA2D;AAE3D,uCAgBmB;AACnB,iDAA6C;AAE7C,MAAM,KAAK,GAAG,eAAS,CAAC,cAAc,CAAC,CAAC;AACxC,KAAK,CAAC,MAAM,CAAC,CAAC;AAUd,oHAAoH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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import initTrace from "debug";
2
+
3
+ import { PTR_ADOPT_WRONG_MESSAGE, PTR_ALREADY_ADOPTED, PTR_INVALID_POINTER_TYPE } from "../../errors";
4
+ import { format } from "../../util";
5
+ import { ListElementSize } from "../list-element-size";
6
+ import { ObjectSize, getWordLength } from "../object-size";
7
+ import { Segment } from "../segment";
8
+ import {
9
+ Pointer,
10
+ getTargetListLength,
11
+ getTargetStructSize,
12
+ getTargetPointerType,
13
+ getTargetListElementSize,
14
+ getTargetCompositeListSize,
15
+ getCapabilityId,
16
+ getContent,
17
+ erasePointer,
18
+ initPointer,
19
+ erase,
20
+ setStructPointer,
21
+ setListPointer,
22
+ setInterfacePointer,
23
+ getListByteLength,
24
+ } from "./pointer";
25
+ import { PointerType } from "./pointer-type";
26
+
27
+ const trace = initTrace("capnp:orphan");
28
+ trace("load");
29
+
30
+ export interface _Orphan {
31
+ capId: number;
32
+ elementSize: ListElementSize;
33
+ length: number;
34
+ size: ObjectSize;
35
+ type: PointerType;
36
+ }
37
+
38
+ // Technically speaking this class doesn't need to be generic, but the extra type checking enforced by this helps to
39
+ // make sure you don't accidentally adopt a pointer of the wrong type.
40
+
41
+ /**
42
+ * An orphaned pointer. This object itself is technically a pointer to the original pointer's content, which was left
43
+ * untouched in its original message. The original pointer data is encoded as attributes on the Orphan object, ready to
44
+ * be reconstructed once another pointer is ready to adopt it.
45
+ *
46
+ * @export
47
+ * @class Orphan
48
+ * @extends {Pointer}
49
+ * @template T
50
+ */
51
+
52
+ export class Orphan<T extends Pointer> {
53
+ /** If this member is not present then the orphan has already been adopted, or something went very wrong. */
54
+ _capnp?: _Orphan;
55
+
56
+ byteOffset: number;
57
+ segment: Segment;
58
+
59
+ constructor(src: T) {
60
+ const c = getContent(src);
61
+
62
+ this.segment = c.segment;
63
+ this.byteOffset = c.byteOffset;
64
+
65
+ this._capnp = {} as _Orphan;
66
+
67
+ // Read vital info from the src pointer so we can reconstruct it during adoption.
68
+
69
+ this._capnp.type = getTargetPointerType(src);
70
+
71
+ switch (this._capnp.type) {
72
+ case PointerType.STRUCT:
73
+ this._capnp.size = getTargetStructSize(src);
74
+
75
+ break;
76
+
77
+ case PointerType.LIST:
78
+ this._capnp.length = getTargetListLength(src);
79
+ this._capnp.elementSize = getTargetListElementSize(src);
80
+
81
+ if (this._capnp.elementSize === ListElementSize.COMPOSITE) {
82
+ this._capnp.size = getTargetCompositeListSize(src);
83
+ }
84
+
85
+ break;
86
+
87
+ case PointerType.OTHER:
88
+ this._capnp.capId = getCapabilityId(src);
89
+
90
+ break;
91
+
92
+ default:
93
+ // COVERAGE: Unreachable code.
94
+ /* istanbul ignore next */
95
+ throw new Error(PTR_INVALID_POINTER_TYPE);
96
+ }
97
+
98
+ // Zero out the source pointer (but not the contents!).
99
+
100
+ erasePointer(src);
101
+ }
102
+
103
+ /**
104
+ * Adopt (move) this orphan into the target pointer location. This will allocate far pointers in `dst` as needed.
105
+ *
106
+ * @param {T} dst The destination pointer.
107
+ * @returns {void}
108
+ */
109
+
110
+ _moveTo(dst: T): void {
111
+ if (this._capnp === undefined) {
112
+ throw new Error(format(PTR_ALREADY_ADOPTED, this));
113
+ }
114
+
115
+ // TODO: Implement copy semantics when this happens.
116
+ if (this.segment.message !== dst.segment.message) {
117
+ throw new Error(format(PTR_ADOPT_WRONG_MESSAGE, this, dst));
118
+ }
119
+
120
+ // Recursively wipe out the destination pointer first.
121
+
122
+ erase(dst);
123
+
124
+ const res = initPointer(this.segment, this.byteOffset, dst);
125
+
126
+ switch (this._capnp.type) {
127
+ case PointerType.STRUCT:
128
+ setStructPointer(res.offsetWords, this._capnp.size, res.pointer);
129
+
130
+ break;
131
+
132
+ case PointerType.LIST: {
133
+ let offsetWords = res.offsetWords;
134
+
135
+ if (this._capnp.elementSize === ListElementSize.COMPOSITE) {
136
+ offsetWords--; // The tag word gets skipped.
137
+ }
138
+
139
+ setListPointer(offsetWords, this._capnp.elementSize, this._capnp.length, res.pointer, this._capnp.size);
140
+
141
+ break;
142
+ }
143
+ case PointerType.OTHER:
144
+ setInterfacePointer(this._capnp.capId, res.pointer);
145
+
146
+ break;
147
+
148
+ /* istanbul ignore next */
149
+ default:
150
+ throw new Error(PTR_INVALID_POINTER_TYPE);
151
+ }
152
+
153
+ this._capnp = undefined;
154
+ }
155
+
156
+ dispose(): void {
157
+ // FIXME: Should this throw?
158
+ if (this._capnp === undefined) {
159
+ trace("not disposing an already disposed orphan", this);
160
+
161
+ return;
162
+ }
163
+
164
+ switch (this._capnp.type) {
165
+ case PointerType.STRUCT:
166
+ this.segment.fillZeroWords(this.byteOffset, getWordLength(this._capnp.size));
167
+
168
+ break;
169
+
170
+ case PointerType.LIST: {
171
+ const byteLength = getListByteLength(this._capnp.elementSize, this._capnp.length, this._capnp.size);
172
+ this.segment.fillZeroWords(this.byteOffset, byteLength);
173
+
174
+ break;
175
+ }
176
+ default:
177
+ // Other pointer types don't actually have any content.
178
+
179
+ break;
180
+ }
181
+
182
+ this._capnp = undefined;
183
+ }
184
+
185
+ toString(): string {
186
+ return format("Orphan_%d@%a,type:%s", this.segment.id, this.byteOffset, this._capnp && this._capnp.type);
187
+ }
188
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-allocation-result.d.ts ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+ import { Pointer } from "./pointer";
5
+ /**
6
+ * This is used as the return value for `Pointer.prototype.initPointer`. Turns out using a class in V8 for multiple
7
+ * return values is faster than using an array or anonymous object.
8
+ *
9
+ * http://jsben.ch/#/zTdbD
10
+ *
11
+ * @export
12
+ * @class PointerAllocationResult
13
+ */
14
+ export declare class PointerAllocationResult {
15
+ readonly offsetWords: number;
16
+ readonly pointer: Pointer;
17
+ constructor(pointer: Pointer, offsetWords: number);
18
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-allocation-result.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PointerAllocationResult = void 0;
7
+ const tslib_1 = require("tslib");
8
+ const debug_1 = tslib_1.__importDefault(require("debug"));
9
+ const trace = debug_1.default("capnp:pointer-allocation-result");
10
+ trace("load");
11
+ /**
12
+ * This is used as the return value for `Pointer.prototype.initPointer`. Turns out using a class in V8 for multiple
13
+ * return values is faster than using an array or anonymous object.
14
+ *
15
+ * http://jsben.ch/#/zTdbD
16
+ *
17
+ * @export
18
+ * @class PointerAllocationResult
19
+ */
20
+ class PointerAllocationResult {
21
+ constructor(pointer, offsetWords) {
22
+ this.pointer = pointer;
23
+ this.offsetWords = offsetWords;
24
+ }
25
+ }
26
+ exports.PointerAllocationResult = PointerAllocationResult;
27
+ //# sourceMappingURL=pointer-allocation-result.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-allocation-result.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"pointer-allocation-result.js","sourceRoot":"","sources":["pointer-allocation-result.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,0DAA8B;AAI9B,MAAM,KAAK,GAAG,eAAS,CAAC,iCAAiC,CAAC,CAAC;AAC3D,KAAK,CAAC,MAAM,CAAC,CAAC;AAEd;;;;;;;;GAQG;AAEH,MAAa,uBAAuB;IAKlC,YAAY,OAAgB,EAAE,WAAmB;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;CACF;AATD,0DASC"}
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-allocation-result.ts ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+
5
+ import initTrace from "debug";
6
+
7
+ import { Pointer } from "./pointer";
8
+
9
+ const trace = initTrace("capnp:pointer-allocation-result");
10
+ trace("load");
11
+
12
+ /**
13
+ * This is used as the return value for `Pointer.prototype.initPointer`. Turns out using a class in V8 for multiple
14
+ * return values is faster than using an array or anonymous object.
15
+ *
16
+ * http://jsben.ch/#/zTdbD
17
+ *
18
+ * @export
19
+ * @class PointerAllocationResult
20
+ */
21
+
22
+ export class PointerAllocationResult {
23
+ readonly offsetWords: number;
24
+
25
+ readonly pointer: Pointer;
26
+
27
+ constructor(pointer: Pointer, offsetWords: number) {
28
+ this.pointer = pointer;
29
+ this.offsetWords = offsetWords;
30
+ }
31
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-list.d.ts ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+ import { ListCtor } from "./list";
5
+ import { Pointer, PointerCtor } from "./pointer";
6
+ export declare function PointerList<T extends Pointer>(PointerClass: PointerCtor<T>): ListCtor<T>;
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-list.js ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PointerList = void 0;
7
+ const tslib_1 = require("tslib");
8
+ const debug_1 = tslib_1.__importDefault(require("debug"));
9
+ const list_element_size_1 = require("../list-element-size");
10
+ const list_1 = require("./list");
11
+ const pointer_1 = require("./pointer");
12
+ const trace = debug_1.default("capnp:list:composite");
13
+ trace("load");
14
+ function PointerList(PointerClass) {
15
+ var _a;
16
+ return _a = class extends list_1.List {
17
+ get(index) {
18
+ const c = pointer_1.getContent(this);
19
+ return new PointerClass(c.segment, c.byteOffset + index * 8, this._capnp.depthLimit - 1);
20
+ }
21
+ set(index, value) {
22
+ pointer_1.copyFrom(value, this.get(index));
23
+ }
24
+ toString() {
25
+ return `Pointer_${super.toString()},cls:${PointerClass.toString()}`;
26
+ }
27
+ },
28
+ _a._capnp = {
29
+ displayName: `List<${PointerClass._capnp.displayName}>`,
30
+ size: list_element_size_1.ListElementSize.POINTER,
31
+ },
32
+ _a;
33
+ }
34
+ exports.PointerList = PointerList;
35
+ //# sourceMappingURL=pointer-list.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-list.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"pointer-list.js","sourceRoot":"","sources":["pointer-list.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,0DAA8B;AAE9B,4DAAuD;AACvD,iCAAmD;AACnD,uCAAuE;AAEvE,MAAM,KAAK,GAAG,eAAS,CAAC,sBAAsB,CAAC,CAAC;AAChD,KAAK,CAAC,MAAM,CAAC,CAAC;AAEd,SAAgB,WAAW,CAAoB,YAA4B;;IACzE,YAAO,KAAM,SAAQ,WAAO;YAM1B,GAAG,CAAC,KAAa;gBACf,MAAM,CAAC,GAAG,oBAAU,CAAC,IAAI,CAAC,CAAC;gBAC3B,OAAO,IAAI,YAAY,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,UAAU,GAAG,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;YAC3F,CAAC;YAED,GAAG,CAAC,KAAa,EAAE,KAAQ;gBACzB,kBAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;YACnC,CAAC;YAED,QAAQ;gBACN,OAAO,WAAW,KAAK,CAAC,QAAQ,EAAE,QAAQ,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC;YACtE,CAAC;SACF;QAjBiB,SAAM,GAAc;YAClC,WAAW,EAAE,QAAQ,YAAY,CAAC,MAAM,CAAC,WAAW,GAAG;YACvD,IAAI,EAAE,mCAAe,CAAC,OAAO;SAC7B;WAcF;AACJ,CAAC;AApBD,kCAoBC"}
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-list.ts ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+
5
+ import initTrace from "debug";
6
+
7
+ import { ListElementSize } from "../list-element-size";
8
+ import { _ListCtor, List, ListCtor } from "./list";
9
+ import { Pointer, PointerCtor, getContent, copyFrom } from "./pointer";
10
+
11
+ const trace = initTrace("capnp:list:composite");
12
+ trace("load");
13
+
14
+ export function PointerList<T extends Pointer>(PointerClass: PointerCtor<T>): ListCtor<T> {
15
+ return class extends List<T> {
16
+ static readonly _capnp: _ListCtor = {
17
+ displayName: `List<${PointerClass._capnp.displayName}>`,
18
+ size: ListElementSize.POINTER,
19
+ };
20
+
21
+ get(index: number): T {
22
+ const c = getContent(this);
23
+ return new PointerClass(c.segment, c.byteOffset + index * 8, this._capnp.depthLimit - 1);
24
+ }
25
+
26
+ set(index: number, value: T): void {
27
+ copyFrom(value, this.get(index));
28
+ }
29
+
30
+ toString(): string {
31
+ return `Pointer_${super.toString()},cls:${PointerClass.toString()}`;
32
+ }
33
+ };
34
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-type.d.ts ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+ export declare enum PointerType {
5
+ STRUCT = 0,
6
+ LIST = 1,
7
+ FAR = 2,
8
+ OTHER = 3
9
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-type.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PointerType = void 0;
7
+ var PointerType;
8
+ (function (PointerType) {
9
+ PointerType[PointerType["STRUCT"] = 0] = "STRUCT";
10
+ PointerType[PointerType["LIST"] = 1] = "LIST";
11
+ PointerType[PointerType["FAR"] = 2] = "FAR";
12
+ PointerType[PointerType["OTHER"] = 3] = "OTHER";
13
+ })(PointerType = exports.PointerType || (exports.PointerType = {}));
14
+ //# sourceMappingURL=pointer-type.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-type.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"pointer-type.js","sourceRoot":"","sources":["pointer-type.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,iDAAU,CAAA;IACV,6CAAQ,CAAA;IACR,2CAAO,CAAA;IACP,+CAAS,CAAA;AACX,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB"}
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer-type.ts ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+
5
+ export enum PointerType {
6
+ STRUCT = 0,
7
+ LIST = 1,
8
+ FAR = 2,
9
+ OTHER = 3
10
+ }
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer.d.ts ADDED
@@ -0,0 +1,362 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author jdiaz5513
3
+ */
4
+ import { ListElementSize } from "../list-element-size";
5
+ import { ObjectSize } from "../object-size";
6
+ import { Segment } from "../segment";
7
+ import { Orphan } from "./orphan";
8
+ import { PointerAllocationResult } from "./pointer-allocation-result";
9
+ import { PointerType } from "./pointer-type";
10
+ import { Message } from "../message";
11
+ export interface _PointerCtor {
12
+ readonly displayName: string;
13
+ }
14
+ export interface PointerCtor<T extends Pointer> {
15
+ readonly _capnp: _PointerCtor;
16
+ new (segment: Segment, byteOffset: number, depthLimit?: number): T;
17
+ }
18
+ export interface _Pointer {
19
+ compositeIndex?: number;
20
+ compositeList: boolean;
21
+ /**
22
+ * A number that is decremented as nested pointers are traversed. When this hits zero errors will be thrown.
23
+ */
24
+ depthLimit: number;
25
+ }
26
+ /**
27
+ * A pointer referencing a single byte location in a segment. This is typically used for Cap'n Proto pointers, but is
28
+ * also sometimes used to reference an offset to a pointer's content or tag words.
29
+ *
30
+ * @export
31
+ * @class Pointer
32
+ */
33
+ export declare class Pointer {
34
+ static readonly adopt: typeof adopt;
35
+ static readonly copyFrom: typeof copyFrom;
36
+ static readonly disown: typeof disown;
37
+ static readonly dump: typeof dump;
38
+ static readonly isNull: typeof isNull;
39
+ static readonly _capnp: _PointerCtor;
40
+ readonly _capnp: _Pointer;
41
+ /** Offset, in bytes, from the start of the segment to the beginning of this pointer. */
42
+ byteOffset: number;
43
+ /**
44
+ * The starting segment for this pointer's data. In the case of a far pointer, the actual content this pointer is
45
+ * referencing will be in another segment within the same message.
46
+ */
47
+ segment: Segment;
48
+ constructor(segment: Segment, byteOffset: number, depthLimit?: number);
49
+ toString(): string;
50
+ }
51
+ /**
52
+ * Adopt an orphaned pointer, making the pointer point to the orphaned content without copying it.
53
+ *
54
+ * @param {Orphan<Pointer>} src The orphan to adopt.
55
+ * @param {Pointer} p The the pointer to adopt into.
56
+ * @returns {void}
57
+ */
58
+ export declare function adopt<T extends Pointer>(src: Orphan<T>, p: T): void;
59
+ /**
60
+ * Convert a pointer to an Orphan, zeroing out the pointer and leaving its content untouched. If the content is no
61
+ * longer needed, call `disown()` on the orphaned pointer to erase the contents as well.
62
+ *
63
+ * Call `adopt()` on the orphan with the new target pointer location to move it back into the message; the orphan
64
+ * object is then invalidated after adoption (can only adopt once!).
65
+ *
66
+ * @param {T} p The pointer to turn into an Orphan.
67
+ * @returns {Orphan<T>} An orphaned pointer.
68
+ */
69
+ export declare function disown<T extends Pointer>(p: T): Orphan<T>;
70
+ export declare function dump(p: Pointer): string;
71
+ /**
72
+ * Get the total number of bytes required to hold a list of the provided size with the given length, rounded up to the
73
+ * nearest word.
74
+ *
75
+ * @param {ListElementSize} elementSize A number describing the size of the list elements.
76
+ * @param {number} length The length of the list.
77
+ * @param {ObjectSize} [compositeSize] The size of each element in a composite list; required if
78
+ * `elementSize === ListElementSize.COMPOSITE`.
79
+ * @returns {number} The number of bytes required to hold an element of that size, or `NaN` if that is undefined.
80
+ */
81
+ export declare function getListByteLength(elementSize: ListElementSize, length: number, compositeSize?: ObjectSize): number;
82
+ /**
83
+ * Get the number of bytes required to hold a list element of the provided size. `COMPOSITE` elements do not have a
84
+ * fixed size, and `BIT` elements are packed into exactly a single bit, so these both return `NaN`.
85
+ *
86
+ * @param {ListElementSize} elementSize A number describing the size of the list elements.
87
+ * @returns {number} The number of bytes required to hold an element of that size, or `NaN` if that is undefined.
88
+ */
89
+ export declare function getListElementByteLength(elementSize: ListElementSize): number;
90
+ /**
91
+ * Add an offset to the pointer's offset and return a new Pointer for that address.
92
+ *
93
+ * @param {number} offset The number of bytes to add to the offset.
94
+ * @param {Pointer} p The pointer to add from.
95
+ * @returns {Pointer} A new pointer to the address.
96
+ */
97
+ export declare function add(offset: number, p: Pointer): Pointer;
98
+ /**
99
+ * Replace a pointer with a deep copy of the pointer at `src` and all of its contents.
100
+ *
101
+ * @param {Pointer} src The pointer to copy.
102
+ * @param {Pointer} p The pointer to copy into.
103
+ * @returns {void}
104
+ */
105
+ export declare function copyFrom(src: Pointer, p: Pointer): void;
106
+ /**
107
+ * Recursively erase a pointer, any far pointers/landing pads/tag words, and the content it points to.
108
+ *
109
+ * Note that this will leave "holes" of zeroes in the message, since the space cannot be reclaimed. With packing this
110
+ * will have a negligible effect on the final message size.
111
+ *
112
+ * FIXME: This may need protection against infinite recursion...
113
+ *
114
+ * @param {Pointer} p The pointer to erase.
115
+ * @returns {void}
116
+ */
117
+ export declare function erase(p: Pointer): void;
118
+ /**
119
+ * Set the pointer (and far pointer landing pads, if applicable) to zero. Does not touch the pointer's content.
120
+ *
121
+ * @param {Pointer} p The pointer to erase.
122
+ * @returns {void}
123
+ */
124
+ export declare function erasePointer(p: Pointer): void;
125
+ /**
126
+ * Interpret the pointer as a far pointer, returning its target segment and offset.
127
+ *
128
+ * @param {Pointer} p The pointer to read from.
129
+ * @returns {Pointer} A pointer to the far target.
130
+ */
131
+ export declare function followFar(p: Pointer): Pointer;
132
+ /**
133
+ * If the pointer address references a far pointer, follow it to the location where the actual pointer data is written.
134
+ * Otherwise, returns the pointer unmodified.
135
+ *
136
+ * @param {Pointer} p The pointer to read from.
137
+ * @returns {Pointer} A new pointer representing the target location, or `p` if it is not a far pointer.
138
+ */
139
+ export declare function followFars(p: Pointer): Pointer;
140
+ export declare function getCapabilityId(p: Pointer): number;
141
+ /**
142
+ * Obtain the location of the pointer's content, following far pointers as needed.
143
+ * If the pointer is a struct pointer and `compositeIndex` is set, it will be offset by a multiple of the struct's size.
144
+ *
145
+ * @param {Pointer} p The pointer to read from.
146
+ * @param {boolean} [ignoreCompositeIndex] If true, will not follow the composite struct pointer's composite index and
147
+ * instead return a pointer to the parent list's contents (also the beginning of the first struct).
148
+ * @returns {Pointer} A pointer to the beginning of the pointer's content.
149
+ */
150
+ export declare function getContent(p: Pointer, ignoreCompositeIndex?: boolean): Pointer;
151
+ /**
152
+ * Read the target segment ID from a far pointer.
153
+ *
154
+ * @param {Pointer} p The pointer to read from.
155
+ * @returns {number} The target segment ID.
156
+ */
157
+ export declare function getFarSegmentId(p: Pointer): number;
158
+ /**
159
+ * Get a number indicating the size of the list's elements.
160
+ *
161
+ * @param {Pointer} p The pointer to read from.
162
+ * @returns {ListElementSize} The size of the list's elements.
163
+ */
164
+ export declare function getListElementSize(p: Pointer): ListElementSize;
165
+ /**
166
+ * Get the number of elements in a list pointer. For composite lists, it instead represents the total number of words in
167
+ * the list (not counting the tag word).
168
+ *
169
+ * This method does **not** attempt to distinguish between composite and non-composite lists. To get the correct
170
+ * length for composite lists use `getTargetListLength()` instead.
171
+ *
172
+ * @param {Pointer} p The pointer to read from.
173
+ * @returns {number} The length of the list, or total number of words for composite lists.
174
+ */
175
+ export declare function getListLength(p: Pointer): number;
176
+ /**
177
+ * Get the offset (in words) from the end of a pointer to the start of its content. For struct pointers, this is the
178
+ * beginning of the data section, and for list pointers it is the location of the first element. The value should
179
+ * always be zero for interface pointers.
180
+ *
181
+ * @param {Pointer} p The pointer to read from.
182
+ * @returns {number} The offset, in words, from the end of the pointer to the start of the data section.
183
+ */
184
+ export declare function getOffsetWords(p: Pointer): number;
185
+ /**
186
+ * Look up the pointer's type.
187
+ *
188
+ * @param {Pointer} p The pointer to read from.
189
+ * @returns {PointerType} The type of pointer.
190
+ */
191
+ export declare function getPointerType(p: Pointer): PointerType;
192
+ /**
193
+ * Read the number of data words from this struct pointer.
194
+ *
195
+ * @param {Pointer} p The pointer to read from.
196
+ * @returns {number} The number of data words in the struct.
197
+ */
198
+ export declare function getStructDataWords(p: Pointer): number;
199
+ /**
200
+ * Read the number of pointers contained in this struct pointer.
201
+ *
202
+ * @param {Pointer} p The pointer to read from.
203
+ * @returns {number} The number of pointers in this struct.
204
+ */
205
+ export declare function getStructPointerLength(p: Pointer): number;
206
+ /**
207
+ * Get an object describing this struct pointer's size.
208
+ *
209
+ * @param {Pointer} p The pointer to read from.
210
+ * @returns {ObjectSize} The size of the struct.
211
+ */
212
+ export declare function getStructSize(p: Pointer): ObjectSize;
213
+ /**
214
+ * Get a pointer to this pointer's composite list tag word, following far pointers as needed.
215
+ *
216
+ * @param {Pointer} p The pointer to read from.
217
+ * @returns {Pointer} A pointer to the list's composite tag word.
218
+ */
219
+ export declare function getTargetCompositeListTag(p: Pointer): Pointer;
220
+ /**
221
+ * Get the object size for the target composite list, following far pointers as needed.
222
+ *
223
+ * @param {Pointer} p The pointer to read from.
224
+ * @returns {ObjectSize} An object describing the size of each struct in the list.
225
+ */
226
+ export declare function getTargetCompositeListSize(p: Pointer): ObjectSize;
227
+ /**
228
+ * Get the size of the list elements referenced by this pointer, following far pointers if necessary.
229
+ *
230
+ * @param {Pointer} p The pointer to read from.
231
+ * @returns {ListElementSize} The size of the elements in the list.
232
+ */
233
+ export declare function getTargetListElementSize(p: Pointer): ListElementSize;
234
+ /**
235
+ * Get the length of the list referenced by this pointer, following far pointers if necessary. If the list is a
236
+ * composite list, it will look up the tag word and read the length from there.
237
+ *
238
+ * @param {Pointer} p The pointer to read from.
239
+ * @returns {number} The number of elements in the list.
240
+ */
241
+ export declare function getTargetListLength(p: Pointer): number;
242
+ /**
243
+ * Get the type of a pointer, following far pointers if necessary. For non-far pointers this is equivalent to calling
244
+ * `getPointerType()`.
245
+ *
246
+ * The target of a far pointer can never be another far pointer, and this method will throw if such a situation is
247
+ * encountered.
248
+ *
249
+ * @param {Pointer} p The pointer to read from.
250
+ * @returns {PointerType} The type of pointer referenced by this pointer.
251
+ */
252
+ export declare function getTargetPointerType(p: Pointer): PointerType;
253
+ /**
254
+ * Get the size of the struct referenced by a pointer, following far pointers if necessary.
255
+ *
256
+ * @param {Pointer} p The poiner to read from.
257
+ * @returns {ObjectSize} The size of the struct referenced by this pointer.
258
+ */
259
+ export declare function getTargetStructSize(p: Pointer): ObjectSize;
260
+ /**
261
+ * Initialize a pointer to point at the data in the content segment. If the content segment is not the same as the
262
+ * pointer's segment, this will allocate and write far pointers as needed. Nothing is written otherwise.
263
+ *
264
+ * The return value includes a pointer to write the pointer's actual data to (the eventual far target), and the offset
265
+ * value (in words) to use for that pointer. In the case of double-far pointers this offset will always be zero.
266
+ *
267
+ * @param {Segment} contentSegment The segment containing this pointer's content.
268
+ * @param {number} contentOffset The offset within the content segment for the beginning of this pointer's content.
269
+ * @param {Pointer} p The pointer to initialize.
270
+ * @returns {PointerAllocationResult} An object containing a pointer (where the pointer data should be written), and
271
+ * the value to use as the offset for that pointer.
272
+ */
273
+ export declare function initPointer(contentSegment: Segment, contentOffset: number, p: Pointer): PointerAllocationResult;
274
+ /**
275
+ * Check if the pointer is a double-far pointer.
276
+ *
277
+ * @param {Pointer} p The pointer to read from.
278
+ * @returns {boolean} `true` if it is a double-far pointer, `false` otherwise.
279
+ */
280
+ export declare function isDoubleFar(p: Pointer): boolean;
281
+ /**
282
+ * Quickly check to see if the pointer is "null". A "null" pointer is a zero word, equivalent to an empty struct
283
+ * pointer.
284
+ *
285
+ * @param {Pointer} p The pointer to read from.
286
+ * @returns {boolean} `true` if the pointer is "null".
287
+ */
288
+ export declare function isNull(p: Pointer): boolean;
289
+ /**
290
+ * Relocate a pointer to the given destination, ensuring that it points to the same content. This will create far
291
+ * pointers as needed if the content is in a different segment than the destination. After the relocation the source
292
+ * pointer will be erased and is no longer valid.
293
+ *
294
+ * @param {Pointer} dst The desired location for the `src` pointer. Any existing contents will be erased before
295
+ * relocating!
296
+ * @param {Pointer} src The pointer to relocate.
297
+ * @returns {void}
298
+ */
299
+ export declare function relocateTo(dst: Pointer, src: Pointer): void;
300
+ /**
301
+ * Write a far pointer.
302
+ *
303
+ * @param {boolean} doubleFar Set to `true` if this is a double far pointer.
304
+ * @param {number} offsetWords The offset, in words, to the target pointer.
305
+ * @param {number} segmentId The segment the target pointer is located in.
306
+ * @param {Pointer} p The pointer to write to.
307
+ * @returns {void}
308
+ */
309
+ export declare function setFarPointer(doubleFar: boolean, offsetWords: number, segmentId: number, p: Pointer): void;
310
+ /**
311
+ * Write a raw interface pointer.
312
+ *
313
+ * @param {number} capId The capability ID.
314
+ * @param {Pointer} p The pointer to write to.
315
+ * @returns {void}
316
+ */
317
+ export declare function setInterfacePointer(capId: number, p: Pointer): void;
318
+ /**
319
+ * Write a raw list pointer.
320
+ *
321
+ * @param {number} offsetWords The number of words from the end of this pointer to the beginning of the list content.
322
+ * @param {ListElementSize} size The size of each element in the list.
323
+ * @param {number} length The number of elements in the list.
324
+ * @param {Pointer} p The pointer to write to.
325
+ * @param {ObjectSize} [compositeSize] For composite lists this describes the size of each element in this list. This
326
+ * is required for composite lists.
327
+ * @returns {void}
328
+ */
329
+ export declare function setListPointer(offsetWords: number, size: ListElementSize, length: number, p: Pointer, compositeSize?: ObjectSize): void;
330
+ /**
331
+ * Write a raw struct pointer.
332
+ *
333
+ * @param {number} offsetWords The number of words from the end of this pointer to the beginning of the struct's data
334
+ * section.
335
+ * @param {ObjectSize} size An object describing the size of the struct.
336
+ * @param {Pointer} p The pointer to write to.
337
+ * @returns {void}
338
+ */
339
+ export declare function setStructPointer(offsetWords: number, size: ObjectSize, p: Pointer): void;
340
+ /**
341
+ * Read some bits off a pointer to make sure it has the right pointer data.
342
+ *
343
+ * @param {PointerType} pointerType The expected pointer type.
344
+ * @param {Pointer} p The pointer to validate.
345
+ * @param {ListElementSize} [elementSize] For list pointers, the expected element size. Leave this
346
+ * undefined for struct pointers.
347
+ * @returns {void}
348
+ */
349
+ export declare function validate(pointerType: PointerType, p: Pointer, elementSize?: ListElementSize): void;
350
+ export declare function copyFromList(src: Pointer, dst: Pointer): void;
351
+ export declare function copyFromStruct(src: Pointer, dst: Pointer): void;
352
+ /**
353
+ * Track the allocation of a new Pointer object.
354
+ *
355
+ * This will decrement an internal counter tracking how many bytes have been traversed in the message so far. After
356
+ * a certain limit, this method will throw an error in order to prevent a certain class of DoS attacks.
357
+ *
358
+ * @param {Message} message The message the pointer belongs to.
359
+ * @param {Pointer} p The pointer being allocated.
360
+ * @returns {void}
361
+ */
362
+ export declare function trackPointerAllocation(message: Message, p: Pointer): void;
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer.js ADDED
@@ -0,0 +1,795 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ /**
3
+ * @author jdiaz5513
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.trackPointerAllocation = exports.copyFromStruct = exports.copyFromList = exports.validate = exports.setStructPointer = exports.setListPointer = exports.setInterfacePointer = exports.setFarPointer = exports.relocateTo = exports.isNull = exports.isDoubleFar = exports.initPointer = exports.getTargetStructSize = exports.getTargetPointerType = exports.getTargetListLength = exports.getTargetListElementSize = exports.getTargetCompositeListSize = exports.getTargetCompositeListTag = exports.getStructSize = exports.getStructPointerLength = exports.getStructDataWords = exports.getPointerType = exports.getOffsetWords = exports.getListLength = exports.getListElementSize = exports.getFarSegmentId = exports.getContent = exports.getCapabilityId = exports.followFars = exports.followFar = exports.erasePointer = exports.erase = exports.copyFrom = exports.add = exports.getListElementByteLength = exports.getListByteLength = exports.dump = exports.disown = exports.adopt = exports.Pointer = void 0;
7
+ const tslib_1 = require("tslib");
8
+ const debug_1 = tslib_1.__importDefault(require("debug"));
9
+ const constants_1 = require("../../constants");
10
+ const util_1 = require("../../util");
11
+ const list_element_size_1 = require("../list-element-size");
12
+ const object_size_1 = require("../object-size");
13
+ const orphan_1 = require("./orphan");
14
+ const pointer_allocation_result_1 = require("./pointer-allocation-result");
15
+ const pointer_type_1 = require("./pointer-type");
16
+ const errors_1 = require("../../errors");
17
+ const trace = debug_1.default("capnp:pointer");
18
+ trace("load");
19
+ /**
20
+ * A pointer referencing a single byte location in a segment. This is typically used for Cap'n Proto pointers, but is
21
+ * also sometimes used to reference an offset to a pointer's content or tag words.
22
+ *
23
+ * @export
24
+ * @class Pointer
25
+ */
26
+ class Pointer {
27
+ constructor(segment, byteOffset, depthLimit = constants_1.MAX_DEPTH) {
28
+ this._capnp = { compositeList: false, depthLimit };
29
+ this.segment = segment;
30
+ this.byteOffset = byteOffset;
31
+ if (depthLimit === 0) {
32
+ throw new Error(util_1.format(errors_1.PTR_DEPTH_LIMIT_EXCEEDED, this));
33
+ }
34
+ // Make sure we keep track of all pointer allocations; there's a limit per message (prevent DoS).
35
+ trackPointerAllocation(segment.message, this);
36
+ // NOTE: It's okay to have a pointer to the end of the segment; you'll see this when creating pointers to the
37
+ // beginning of the content of a newly-allocated composite list with zero elements. Unlike other language
38
+ // implementations buffer over/underflows are not a big issue since all buffer access is bounds checked in native
39
+ // code anyway.
40
+ if (byteOffset < 0 || byteOffset > segment.byteLength) {
41
+ throw new Error(util_1.format(errors_1.PTR_OFFSET_OUT_OF_BOUNDS, byteOffset));
42
+ }
43
+ trace("new %s", this);
44
+ }
45
+ toString() {
46
+ return util_1.format("Pointer_%d@%a,%s,limit:%x", this.segment.id, this.byteOffset, dump(this), this._capnp.depthLimit);
47
+ }
48
+ }
49
+ exports.Pointer = Pointer;
50
+ Pointer.adopt = adopt;
51
+ Pointer.copyFrom = copyFrom;
52
+ Pointer.disown = disown;
53
+ Pointer.dump = dump;
54
+ Pointer.isNull = isNull;
55
+ Pointer._capnp = {
56
+ displayName: "Pointer",
57
+ };
58
+ /**
59
+ * Adopt an orphaned pointer, making the pointer point to the orphaned content without copying it.
60
+ *
61
+ * @param {Orphan<Pointer>} src The orphan to adopt.
62
+ * @param {Pointer} p The the pointer to adopt into.
63
+ * @returns {void}
64
+ */
65
+ function adopt(src, p) {
66
+ src._moveTo(p);
67
+ }
68
+ exports.adopt = adopt;
69
+ /**
70
+ * Convert a pointer to an Orphan, zeroing out the pointer and leaving its content untouched. If the content is no
71
+ * longer needed, call `disown()` on the orphaned pointer to erase the contents as well.
72
+ *
73
+ * Call `adopt()` on the orphan with the new target pointer location to move it back into the message; the orphan
74
+ * object is then invalidated after adoption (can only adopt once!).
75
+ *
76
+ * @param {T} p The pointer to turn into an Orphan.
77
+ * @returns {Orphan<T>} An orphaned pointer.
78
+ */
79
+ function disown(p) {
80
+ return new orphan_1.Orphan(p);
81
+ }
82
+ exports.disown = disown;
83
+ function dump(p) {
84
+ return util_1.bufferToHex(p.segment.buffer.slice(p.byteOffset, p.byteOffset + 8));
85
+ }
86
+ exports.dump = dump;
87
+ /**
88
+ * Get the total number of bytes required to hold a list of the provided size with the given length, rounded up to the
89
+ * nearest word.
90
+ *
91
+ * @param {ListElementSize} elementSize A number describing the size of the list elements.
92
+ * @param {number} length The length of the list.
93
+ * @param {ObjectSize} [compositeSize] The size of each element in a composite list; required if
94
+ * `elementSize === ListElementSize.COMPOSITE`.
95
+ * @returns {number} The number of bytes required to hold an element of that size, or `NaN` if that is undefined.
96
+ */
97
+ function getListByteLength(elementSize, length, compositeSize) {
98
+ switch (elementSize) {
99
+ case list_element_size_1.ListElementSize.BIT:
100
+ return util_1.padToWord((length + 7) >>> 3);
101
+ case list_element_size_1.ListElementSize.BYTE:
102
+ case list_element_size_1.ListElementSize.BYTE_2:
103
+ case list_element_size_1.ListElementSize.BYTE_4:
104
+ case list_element_size_1.ListElementSize.BYTE_8:
105
+ case list_element_size_1.ListElementSize.POINTER:
106
+ case list_element_size_1.ListElementSize.VOID:
107
+ return util_1.padToWord(getListElementByteLength(elementSize) * length);
108
+ /* istanbul ignore next */
109
+ case list_element_size_1.ListElementSize.COMPOSITE:
110
+ if (compositeSize === undefined) {
111
+ throw new Error(util_1.format(errors_1.PTR_INVALID_LIST_SIZE, NaN));
112
+ }
113
+ return length * util_1.padToWord(object_size_1.getByteLength(compositeSize));
114
+ /* istanbul ignore next */
115
+ default:
116
+ throw new Error(errors_1.PTR_INVALID_LIST_SIZE);
117
+ }
118
+ }
119
+ exports.getListByteLength = getListByteLength;
120
+ /**
121
+ * Get the number of bytes required to hold a list element of the provided size. `COMPOSITE` elements do not have a
122
+ * fixed size, and `BIT` elements are packed into exactly a single bit, so these both return `NaN`.
123
+ *
124
+ * @param {ListElementSize} elementSize A number describing the size of the list elements.
125
+ * @returns {number} The number of bytes required to hold an element of that size, or `NaN` if that is undefined.
126
+ */
127
+ function getListElementByteLength(elementSize) {
128
+ switch (elementSize) {
129
+ /* istanbul ignore next */
130
+ case list_element_size_1.ListElementSize.BIT:
131
+ return NaN;
132
+ case list_element_size_1.ListElementSize.BYTE:
133
+ return 1;
134
+ case list_element_size_1.ListElementSize.BYTE_2:
135
+ return 2;
136
+ case list_element_size_1.ListElementSize.BYTE_4:
137
+ return 4;
138
+ case list_element_size_1.ListElementSize.BYTE_8:
139
+ case list_element_size_1.ListElementSize.POINTER:
140
+ return 8;
141
+ /* istanbul ignore next */
142
+ case list_element_size_1.ListElementSize.COMPOSITE:
143
+ // Caller has to figure it out based on the tag word.
144
+ return NaN;
145
+ /* istanbul ignore next */
146
+ case list_element_size_1.ListElementSize.VOID:
147
+ return 0;
148
+ /* istanbul ignore next */
149
+ default:
150
+ throw new Error(util_1.format(errors_1.PTR_INVALID_LIST_SIZE, elementSize));
151
+ }
152
+ }
153
+ exports.getListElementByteLength = getListElementByteLength;
154
+ /**
155
+ * Add an offset to the pointer's offset and return a new Pointer for that address.
156
+ *
157
+ * @param {number} offset The number of bytes to add to the offset.
158
+ * @param {Pointer} p The pointer to add from.
159
+ * @returns {Pointer} A new pointer to the address.
160
+ */
161
+ function add(offset, p) {
162
+ return new Pointer(p.segment, p.byteOffset + offset, p._capnp.depthLimit);
163
+ }
164
+ exports.add = add;
165
+ /**
166
+ * Replace a pointer with a deep copy of the pointer at `src` and all of its contents.
167
+ *
168
+ * @param {Pointer} src The pointer to copy.
169
+ * @param {Pointer} p The pointer to copy into.
170
+ * @returns {void}
171
+ */
172
+ function copyFrom(src, p) {
173
+ // If the pointer is the same then this is a noop.
174
+ if (p.segment === src.segment && p.byteOffset === src.byteOffset) {
175
+ trace("ignoring copy operation from identical pointer %s", src);
176
+ return;
177
+ }
178
+ // Make sure we erase this pointer's contents before moving on. If src is null, that's all we do.
179
+ erase(p); // noop if null
180
+ if (isNull(src))
181
+ return;
182
+ switch (getTargetPointerType(src)) {
183
+ case pointer_type_1.PointerType.STRUCT:
184
+ copyFromStruct(src, p);
185
+ break;
186
+ case pointer_type_1.PointerType.LIST:
187
+ copyFromList(src, p);
188
+ break;
189
+ /* istanbul ignore next */
190
+ default:
191
+ throw new Error(util_1.format(errors_1.PTR_INVALID_POINTER_TYPE, getTargetPointerType(p)));
192
+ }
193
+ }
194
+ exports.copyFrom = copyFrom;
195
+ /**
196
+ * Recursively erase a pointer, any far pointers/landing pads/tag words, and the content it points to.
197
+ *
198
+ * Note that this will leave "holes" of zeroes in the message, since the space cannot be reclaimed. With packing this
199
+ * will have a negligible effect on the final message size.
200
+ *
201
+ * FIXME: This may need protection against infinite recursion...
202
+ *
203
+ * @param {Pointer} p The pointer to erase.
204
+ * @returns {void}
205
+ */
206
+ function erase(p) {
207
+ if (isNull(p))
208
+ return;
209
+ // First deal with the contents.
210
+ let c;
211
+ switch (getTargetPointerType(p)) {
212
+ case pointer_type_1.PointerType.STRUCT: {
213
+ const size = getTargetStructSize(p);
214
+ c = getContent(p);
215
+ // Wipe the data section.
216
+ c.segment.fillZeroWords(c.byteOffset, size.dataByteLength / 8);
217
+ // Iterate over all the pointers and nuke them.
218
+ for (let i = 0; i < size.pointerLength; i++) {
219
+ erase(add(i * 8, c));
220
+ }
221
+ break;
222
+ }
223
+ case pointer_type_1.PointerType.LIST: {
224
+ const elementSize = getTargetListElementSize(p);
225
+ const length = getTargetListLength(p);
226
+ let contentWords = util_1.padToWord(length * getListElementByteLength(elementSize));
227
+ c = getContent(p);
228
+ if (elementSize === list_element_size_1.ListElementSize.POINTER) {
229
+ for (let i = 0; i < length; i++) {
230
+ erase(new Pointer(c.segment, c.byteOffset + i * 8, p._capnp.depthLimit - 1));
231
+ }
232
+ // Calling erase on each pointer takes care of the content, nothing left to do here.
233
+ break;
234
+ }
235
+ else if (elementSize === list_element_size_1.ListElementSize.COMPOSITE) {
236
+ // Read some stuff from the tag word.
237
+ const tag = add(-8, c);
238
+ const compositeSize = getStructSize(tag);
239
+ const compositeByteLength = object_size_1.getByteLength(compositeSize);
240
+ contentWords = getOffsetWords(tag);
241
+ // Kill the tag word.
242
+ c.segment.setWordZero(c.byteOffset - 8);
243
+ // Recursively erase each pointer.
244
+ for (let i = 0; i < length; i++) {
245
+ for (let j = 0; j < compositeSize.pointerLength; j++) {
246
+ erase(new Pointer(c.segment, c.byteOffset + i * compositeByteLength + j * 8, p._capnp.depthLimit - 1));
247
+ }
248
+ }
249
+ }
250
+ c.segment.fillZeroWords(c.byteOffset, contentWords);
251
+ break;
252
+ }
253
+ case pointer_type_1.PointerType.OTHER:
254
+ // No content.
255
+ break;
256
+ default:
257
+ throw new Error(util_1.format(errors_1.PTR_INVALID_POINTER_TYPE, getTargetPointerType(p)));
258
+ }
259
+ erasePointer(p);
260
+ }
261
+ exports.erase = erase;
262
+ /**
263
+ * Set the pointer (and far pointer landing pads, if applicable) to zero. Does not touch the pointer's content.
264
+ *
265
+ * @param {Pointer} p The pointer to erase.
266
+ * @returns {void}
267
+ */
268
+ function erasePointer(p) {
269
+ if (getPointerType(p) === pointer_type_1.PointerType.FAR) {
270
+ const landingPad = followFar(p);
271
+ if (isDoubleFar(p)) {
272
+ // Kill the double-far tag word.
273
+ landingPad.segment.setWordZero(landingPad.byteOffset + 8);
274
+ }
275
+ // Kill the landing pad.
276
+ landingPad.segment.setWordZero(landingPad.byteOffset);
277
+ }
278
+ // Finally! Kill the pointer itself...
279
+ p.segment.setWordZero(p.byteOffset);
280
+ }
281
+ exports.erasePointer = erasePointer;
282
+ /**
283
+ * Interpret the pointer as a far pointer, returning its target segment and offset.
284
+ *
285
+ * @param {Pointer} p The pointer to read from.
286
+ * @returns {Pointer} A pointer to the far target.
287
+ */
288
+ function followFar(p) {
289
+ const targetSegment = p.segment.message.getSegment(p.segment.getUint32(p.byteOffset + 4));
290
+ const targetWordOffset = p.segment.getUint32(p.byteOffset) >>> 3;
291
+ return new Pointer(targetSegment, targetWordOffset * 8, p._capnp.depthLimit - 1);
292
+ }
293
+ exports.followFar = followFar;
294
+ /**
295
+ * If the pointer address references a far pointer, follow it to the location where the actual pointer data is written.
296
+ * Otherwise, returns the pointer unmodified.
297
+ *
298
+ * @param {Pointer} p The pointer to read from.
299
+ * @returns {Pointer} A new pointer representing the target location, or `p` if it is not a far pointer.
300
+ */
301
+ function followFars(p) {
302
+ if (getPointerType(p) === pointer_type_1.PointerType.FAR) {
303
+ const landingPad = followFar(p);
304
+ if (isDoubleFar(p))
305
+ landingPad.byteOffset += 8;
306
+ return landingPad;
307
+ }
308
+ return p;
309
+ }
310
+ exports.followFars = followFars;
311
+ function getCapabilityId(p) {
312
+ return p.segment.getUint32(p.byteOffset + 4);
313
+ }
314
+ exports.getCapabilityId = getCapabilityId;
315
+ function isCompositeList(p) {
316
+ return getTargetPointerType(p) === pointer_type_1.PointerType.LIST && getTargetListElementSize(p) === list_element_size_1.ListElementSize.COMPOSITE;
317
+ }
318
+ /**
319
+ * Obtain the location of the pointer's content, following far pointers as needed.
320
+ * If the pointer is a struct pointer and `compositeIndex` is set, it will be offset by a multiple of the struct's size.
321
+ *
322
+ * @param {Pointer} p The pointer to read from.
323
+ * @param {boolean} [ignoreCompositeIndex] If true, will not follow the composite struct pointer's composite index and
324
+ * instead return a pointer to the parent list's contents (also the beginning of the first struct).
325
+ * @returns {Pointer} A pointer to the beginning of the pointer's content.
326
+ */
327
+ function getContent(p, ignoreCompositeIndex) {
328
+ let c;
329
+ if (isDoubleFar(p)) {
330
+ const landingPad = followFar(p);
331
+ c = new Pointer(p.segment.message.getSegment(getFarSegmentId(landingPad)), getOffsetWords(landingPad) * 8);
332
+ }
333
+ else {
334
+ const target = followFars(p);
335
+ c = new Pointer(target.segment, target.byteOffset + 8 + getOffsetWords(target) * 8);
336
+ }
337
+ if (isCompositeList(p))
338
+ c.byteOffset += 8;
339
+ if (!ignoreCompositeIndex && p._capnp.compositeIndex !== undefined) {
340
+ // Seek backwards by one word so we can read the struct size off the tag word.
341
+ c.byteOffset -= 8;
342
+ // Seek ahead by `compositeIndex` multiples of the struct's total size.
343
+ c.byteOffset += 8 + p._capnp.compositeIndex * object_size_1.getByteLength(object_size_1.padToWord(getStructSize(c)));
344
+ }
345
+ return c;
346
+ }
347
+ exports.getContent = getContent;
348
+ /**
349
+ * Read the target segment ID from a far pointer.
350
+ *
351
+ * @param {Pointer} p The pointer to read from.
352
+ * @returns {number} The target segment ID.
353
+ */
354
+ function getFarSegmentId(p) {
355
+ return p.segment.getUint32(p.byteOffset + 4);
356
+ }
357
+ exports.getFarSegmentId = getFarSegmentId;
358
+ /**
359
+ * Get a number indicating the size of the list's elements.
360
+ *
361
+ * @param {Pointer} p The pointer to read from.
362
+ * @returns {ListElementSize} The size of the list's elements.
363
+ */
364
+ function getListElementSize(p) {
365
+ return p.segment.getUint32(p.byteOffset + 4) & constants_1.LIST_SIZE_MASK;
366
+ }
367
+ exports.getListElementSize = getListElementSize;
368
+ /**
369
+ * Get the number of elements in a list pointer. For composite lists, it instead represents the total number of words in
370
+ * the list (not counting the tag word).
371
+ *
372
+ * This method does **not** attempt to distinguish between composite and non-composite lists. To get the correct
373
+ * length for composite lists use `getTargetListLength()` instead.
374
+ *
375
+ * @param {Pointer} p The pointer to read from.
376
+ * @returns {number} The length of the list, or total number of words for composite lists.
377
+ */
378
+ function getListLength(p) {
379
+ return p.segment.getUint32(p.byteOffset + 4) >>> 3;
380
+ }
381
+ exports.getListLength = getListLength;
382
+ /**
383
+ * Get the offset (in words) from the end of a pointer to the start of its content. For struct pointers, this is the
384
+ * beginning of the data section, and for list pointers it is the location of the first element. The value should
385
+ * always be zero for interface pointers.
386
+ *
387
+ * @param {Pointer} p The pointer to read from.
388
+ * @returns {number} The offset, in words, from the end of the pointer to the start of the data section.
389
+ */
390
+ function getOffsetWords(p) {
391
+ const o = p.segment.getInt32(p.byteOffset);
392
+ // Far pointers only have 29 offset bits.
393
+ return o & 2 ? o >> 3 : o >> 2;
394
+ }
395
+ exports.getOffsetWords = getOffsetWords;
396
+ /**
397
+ * Look up the pointer's type.
398
+ *
399
+ * @param {Pointer} p The pointer to read from.
400
+ * @returns {PointerType} The type of pointer.
401
+ */
402
+ function getPointerType(p) {
403
+ return p.segment.getUint32(p.byteOffset) & constants_1.POINTER_TYPE_MASK;
404
+ }
405
+ exports.getPointerType = getPointerType;
406
+ /**
407
+ * Read the number of data words from this struct pointer.
408
+ *
409
+ * @param {Pointer} p The pointer to read from.
410
+ * @returns {number} The number of data words in the struct.
411
+ */
412
+ function getStructDataWords(p) {
413
+ return p.segment.getUint16(p.byteOffset + 4);
414
+ }
415
+ exports.getStructDataWords = getStructDataWords;
416
+ /**
417
+ * Read the number of pointers contained in this struct pointer.
418
+ *
419
+ * @param {Pointer} p The pointer to read from.
420
+ * @returns {number} The number of pointers in this struct.
421
+ */
422
+ function getStructPointerLength(p) {
423
+ return p.segment.getUint16(p.byteOffset + 6);
424
+ }
425
+ exports.getStructPointerLength = getStructPointerLength;
426
+ /**
427
+ * Get an object describing this struct pointer's size.
428
+ *
429
+ * @param {Pointer} p The pointer to read from.
430
+ * @returns {ObjectSize} The size of the struct.
431
+ */
432
+ function getStructSize(p) {
433
+ return new object_size_1.ObjectSize(getStructDataWords(p) * 8, getStructPointerLength(p));
434
+ }
435
+ exports.getStructSize = getStructSize;
436
+ /**
437
+ * Get a pointer to this pointer's composite list tag word, following far pointers as needed.
438
+ *
439
+ * @param {Pointer} p The pointer to read from.
440
+ * @returns {Pointer} A pointer to the list's composite tag word.
441
+ */
442
+ function getTargetCompositeListTag(p) {
443
+ const c = getContent(p);
444
+ // The composite list tag is always one word before the content.
445
+ c.byteOffset -= 8;
446
+ return c;
447
+ }
448
+ exports.getTargetCompositeListTag = getTargetCompositeListTag;
449
+ /**
450
+ * Get the object size for the target composite list, following far pointers as needed.
451
+ *
452
+ * @param {Pointer} p The pointer to read from.
453
+ * @returns {ObjectSize} An object describing the size of each struct in the list.
454
+ */
455
+ function getTargetCompositeListSize(p) {
456
+ return getStructSize(getTargetCompositeListTag(p));
457
+ }
458
+ exports.getTargetCompositeListSize = getTargetCompositeListSize;
459
+ /**
460
+ * Get the size of the list elements referenced by this pointer, following far pointers if necessary.
461
+ *
462
+ * @param {Pointer} p The pointer to read from.
463
+ * @returns {ListElementSize} The size of the elements in the list.
464
+ */
465
+ function getTargetListElementSize(p) {
466
+ return getListElementSize(followFars(p));
467
+ }
468
+ exports.getTargetListElementSize = getTargetListElementSize;
469
+ /**
470
+ * Get the length of the list referenced by this pointer, following far pointers if necessary. If the list is a
471
+ * composite list, it will look up the tag word and read the length from there.
472
+ *
473
+ * @param {Pointer} p The pointer to read from.
474
+ * @returns {number} The number of elements in the list.
475
+ */
476
+ function getTargetListLength(p) {
477
+ const t = followFars(p);
478
+ if (getListElementSize(t) === list_element_size_1.ListElementSize.COMPOSITE) {
479
+ // The content is prefixed by a tag word; it's a struct pointer whose offset contains the list's length.
480
+ return getOffsetWords(getTargetCompositeListTag(p));
481
+ }
482
+ return getListLength(t);
483
+ }
484
+ exports.getTargetListLength = getTargetListLength;
485
+ /**
486
+ * Get the type of a pointer, following far pointers if necessary. For non-far pointers this is equivalent to calling
487
+ * `getPointerType()`.
488
+ *
489
+ * The target of a far pointer can never be another far pointer, and this method will throw if such a situation is
490
+ * encountered.
491
+ *
492
+ * @param {Pointer} p The pointer to read from.
493
+ * @returns {PointerType} The type of pointer referenced by this pointer.
494
+ */
495
+ function getTargetPointerType(p) {
496
+ const t = getPointerType(followFars(p));
497
+ if (t === pointer_type_1.PointerType.FAR)
498
+ throw new Error(util_1.format(errors_1.PTR_INVALID_FAR_TARGET, p));
499
+ return t;
500
+ }
501
+ exports.getTargetPointerType = getTargetPointerType;
502
+ /**
503
+ * Get the size of the struct referenced by a pointer, following far pointers if necessary.
504
+ *
505
+ * @param {Pointer} p The poiner to read from.
506
+ * @returns {ObjectSize} The size of the struct referenced by this pointer.
507
+ */
508
+ function getTargetStructSize(p) {
509
+ return getStructSize(followFars(p));
510
+ }
511
+ exports.getTargetStructSize = getTargetStructSize;
512
+ /**
513
+ * Initialize a pointer to point at the data in the content segment. If the content segment is not the same as the
514
+ * pointer's segment, this will allocate and write far pointers as needed. Nothing is written otherwise.
515
+ *
516
+ * The return value includes a pointer to write the pointer's actual data to (the eventual far target), and the offset
517
+ * value (in words) to use for that pointer. In the case of double-far pointers this offset will always be zero.
518
+ *
519
+ * @param {Segment} contentSegment The segment containing this pointer's content.
520
+ * @param {number} contentOffset The offset within the content segment for the beginning of this pointer's content.
521
+ * @param {Pointer} p The pointer to initialize.
522
+ * @returns {PointerAllocationResult} An object containing a pointer (where the pointer data should be written), and
523
+ * the value to use as the offset for that pointer.
524
+ */
525
+ function initPointer(contentSegment, contentOffset, p) {
526
+ if (p.segment !== contentSegment) {
527
+ // Need a far pointer.
528
+ trace("Initializing far pointer %s -> %s.", p, contentSegment);
529
+ if (!contentSegment.hasCapacity(8)) {
530
+ // GAH! Not enough space in the content segment for a landing pad so we need a double far pointer.
531
+ const landingPad = p.segment.allocate(16);
532
+ trace("GAH! Initializing double-far pointer in %s from %s -> %s.", p, contentSegment, landingPad);
533
+ setFarPointer(true, landingPad.byteOffset / 8, landingPad.segment.id, p);
534
+ setFarPointer(false, contentOffset / 8, contentSegment.id, landingPad);
535
+ landingPad.byteOffset += 8;
536
+ return new pointer_allocation_result_1.PointerAllocationResult(landingPad, 0);
537
+ }
538
+ // Allocate a far pointer landing pad in the target segment.
539
+ const landingPad = contentSegment.allocate(8);
540
+ if (landingPad.segment.id !== contentSegment.id) {
541
+ throw new Error(errors_1.INVARIANT_UNREACHABLE_CODE);
542
+ }
543
+ setFarPointer(false, landingPad.byteOffset / 8, landingPad.segment.id, p);
544
+ return new pointer_allocation_result_1.PointerAllocationResult(landingPad, (contentOffset - landingPad.byteOffset - 8) / 8);
545
+ }
546
+ trace("Initializing intra-segment pointer %s -> %a.", p, contentOffset);
547
+ return new pointer_allocation_result_1.PointerAllocationResult(p, (contentOffset - p.byteOffset - 8) / 8);
548
+ }
549
+ exports.initPointer = initPointer;
550
+ /**
551
+ * Check if the pointer is a double-far pointer.
552
+ *
553
+ * @param {Pointer} p The pointer to read from.
554
+ * @returns {boolean} `true` if it is a double-far pointer, `false` otherwise.
555
+ */
556
+ function isDoubleFar(p) {
557
+ return getPointerType(p) === pointer_type_1.PointerType.FAR && (p.segment.getUint32(p.byteOffset) & constants_1.POINTER_DOUBLE_FAR_MASK) !== 0;
558
+ }
559
+ exports.isDoubleFar = isDoubleFar;
560
+ /**
561
+ * Quickly check to see if the pointer is "null". A "null" pointer is a zero word, equivalent to an empty struct
562
+ * pointer.
563
+ *
564
+ * @param {Pointer} p The pointer to read from.
565
+ * @returns {boolean} `true` if the pointer is "null".
566
+ */
567
+ function isNull(p) {
568
+ return p.segment.isWordZero(p.byteOffset);
569
+ }
570
+ exports.isNull = isNull;
571
+ /**
572
+ * Relocate a pointer to the given destination, ensuring that it points to the same content. This will create far
573
+ * pointers as needed if the content is in a different segment than the destination. After the relocation the source
574
+ * pointer will be erased and is no longer valid.
575
+ *
576
+ * @param {Pointer} dst The desired location for the `src` pointer. Any existing contents will be erased before
577
+ * relocating!
578
+ * @param {Pointer} src The pointer to relocate.
579
+ * @returns {void}
580
+ */
581
+ function relocateTo(dst, src) {
582
+ const t = followFars(src);
583
+ const lo = t.segment.getUint8(t.byteOffset) & 0x03; // discard the offset
584
+ const hi = t.segment.getUint32(t.byteOffset + 4);
585
+ // Make sure anything dst was pointing to is wiped out.
586
+ erase(dst);
587
+ const res = initPointer(t.segment, t.byteOffset + 8 + getOffsetWords(t) * 8, dst);
588
+ // Keep the low 2 bits and write the new offset.
589
+ res.pointer.segment.setUint32(res.pointer.byteOffset, lo | (res.offsetWords << 2));
590
+ // Keep the high 32 bits intact.
591
+ res.pointer.segment.setUint32(res.pointer.byteOffset + 4, hi);
592
+ erasePointer(src);
593
+ }
594
+ exports.relocateTo = relocateTo;
595
+ /**
596
+ * Write a far pointer.
597
+ *
598
+ * @param {boolean} doubleFar Set to `true` if this is a double far pointer.
599
+ * @param {number} offsetWords The offset, in words, to the target pointer.
600
+ * @param {number} segmentId The segment the target pointer is located in.
601
+ * @param {Pointer} p The pointer to write to.
602
+ * @returns {void}
603
+ */
604
+ function setFarPointer(doubleFar, offsetWords, segmentId, p) {
605
+ const A = pointer_type_1.PointerType.FAR;
606
+ const B = doubleFar ? 1 : 0;
607
+ const C = offsetWords;
608
+ const D = segmentId;
609
+ p.segment.setUint32(p.byteOffset, A | (B << 2) | (C << 3));
610
+ p.segment.setUint32(p.byteOffset + 4, D);
611
+ }
612
+ exports.setFarPointer = setFarPointer;
613
+ /**
614
+ * Write a raw interface pointer.
615
+ *
616
+ * @param {number} capId The capability ID.
617
+ * @param {Pointer} p The pointer to write to.
618
+ * @returns {void}
619
+ */
620
+ function setInterfacePointer(capId, p) {
621
+ p.segment.setUint32(p.byteOffset, pointer_type_1.PointerType.OTHER);
622
+ p.segment.setUint32(p.byteOffset + 4, capId);
623
+ }
624
+ exports.setInterfacePointer = setInterfacePointer;
625
+ /**
626
+ * Write a raw list pointer.
627
+ *
628
+ * @param {number} offsetWords The number of words from the end of this pointer to the beginning of the list content.
629
+ * @param {ListElementSize} size The size of each element in the list.
630
+ * @param {number} length The number of elements in the list.
631
+ * @param {Pointer} p The pointer to write to.
632
+ * @param {ObjectSize} [compositeSize] For composite lists this describes the size of each element in this list. This
633
+ * is required for composite lists.
634
+ * @returns {void}
635
+ */
636
+ function setListPointer(offsetWords, size, length, p, compositeSize) {
637
+ const A = pointer_type_1.PointerType.LIST;
638
+ const B = offsetWords;
639
+ const C = size;
640
+ let D = length;
641
+ if (size === list_element_size_1.ListElementSize.COMPOSITE) {
642
+ if (compositeSize === undefined) {
643
+ throw new TypeError(errors_1.TYPE_COMPOSITE_SIZE_UNDEFINED);
644
+ }
645
+ D *= object_size_1.getWordLength(compositeSize);
646
+ }
647
+ p.segment.setUint32(p.byteOffset, A | (B << 2));
648
+ p.segment.setUint32(p.byteOffset + 4, C | (D << 3));
649
+ }
650
+ exports.setListPointer = setListPointer;
651
+ /**
652
+ * Write a raw struct pointer.
653
+ *
654
+ * @param {number} offsetWords The number of words from the end of this pointer to the beginning of the struct's data
655
+ * section.
656
+ * @param {ObjectSize} size An object describing the size of the struct.
657
+ * @param {Pointer} p The pointer to write to.
658
+ * @returns {void}
659
+ */
660
+ function setStructPointer(offsetWords, size, p) {
661
+ const A = pointer_type_1.PointerType.STRUCT;
662
+ const B = offsetWords;
663
+ const C = object_size_1.getDataWordLength(size);
664
+ const D = size.pointerLength;
665
+ p.segment.setUint32(p.byteOffset, A | (B << 2));
666
+ p.segment.setUint16(p.byteOffset + 4, C);
667
+ p.segment.setUint16(p.byteOffset + 6, D);
668
+ }
669
+ exports.setStructPointer = setStructPointer;
670
+ /**
671
+ * Read some bits off a pointer to make sure it has the right pointer data.
672
+ *
673
+ * @param {PointerType} pointerType The expected pointer type.
674
+ * @param {Pointer} p The pointer to validate.
675
+ * @param {ListElementSize} [elementSize] For list pointers, the expected element size. Leave this
676
+ * undefined for struct pointers.
677
+ * @returns {void}
678
+ */
679
+ function validate(pointerType, p, elementSize) {
680
+ if (isNull(p))
681
+ return;
682
+ const t = followFars(p);
683
+ // Check the pointer type.
684
+ const A = t.segment.getUint32(t.byteOffset) & constants_1.POINTER_TYPE_MASK;
685
+ if (A !== pointerType) {
686
+ throw new Error(util_1.format(errors_1.PTR_WRONG_POINTER_TYPE, p, pointerType));
687
+ }
688
+ // Check the list element size, if provided.
689
+ if (elementSize !== undefined) {
690
+ const C = t.segment.getUint32(t.byteOffset + 4) & constants_1.LIST_SIZE_MASK;
691
+ if (C !== elementSize) {
692
+ throw new Error(util_1.format(errors_1.PTR_WRONG_LIST_TYPE, p, list_element_size_1.ListElementSize[elementSize]));
693
+ }
694
+ }
695
+ }
696
+ exports.validate = validate;
697
+ function copyFromList(src, dst) {
698
+ if (dst._capnp.depthLimit <= 0)
699
+ throw new Error(errors_1.PTR_DEPTH_LIMIT_EXCEEDED);
700
+ const srcContent = getContent(src);
701
+ const srcElementSize = getTargetListElementSize(src);
702
+ const srcLength = getTargetListLength(src);
703
+ let srcCompositeSize;
704
+ let srcStructByteLength;
705
+ let dstContent;
706
+ if (srcElementSize === list_element_size_1.ListElementSize.POINTER) {
707
+ dstContent = dst.segment.allocate(srcLength << 3);
708
+ // Recursively copy each pointer in the list.
709
+ for (let i = 0; i < srcLength; i++) {
710
+ const srcPtr = new Pointer(srcContent.segment, srcContent.byteOffset + (i << 3), src._capnp.depthLimit - 1);
711
+ const dstPtr = new Pointer(dstContent.segment, dstContent.byteOffset + (i << 3), dst._capnp.depthLimit - 1);
712
+ copyFrom(srcPtr, dstPtr);
713
+ }
714
+ }
715
+ else if (srcElementSize === list_element_size_1.ListElementSize.COMPOSITE) {
716
+ srcCompositeSize = object_size_1.padToWord(getTargetCompositeListSize(src));
717
+ srcStructByteLength = object_size_1.getByteLength(srcCompositeSize);
718
+ dstContent = dst.segment.allocate(object_size_1.getByteLength(srcCompositeSize) * srcLength + 8);
719
+ // Copy the tag word.
720
+ dstContent.segment.copyWord(dstContent.byteOffset, srcContent.segment, srcContent.byteOffset - 8);
721
+ // Copy the entire contents, including all pointers. This should be more efficient than making `srcLength`
722
+ // copies to skip the pointer sections, and we're about to rewrite all those pointers anyway.
723
+ // PERF: Skip this step if the composite struct only contains pointers.
724
+ if (srcCompositeSize.dataByteLength > 0) {
725
+ const wordLength = object_size_1.getWordLength(srcCompositeSize) * srcLength;
726
+ dstContent.segment.copyWords(dstContent.byteOffset + 8, srcContent.segment, srcContent.byteOffset, wordLength);
727
+ }
728
+ // Recursively copy all the pointers in each struct.
729
+ for (let i = 0; i < srcLength; i++) {
730
+ for (let j = 0; j < srcCompositeSize.pointerLength; j++) {
731
+ const offset = i * srcStructByteLength + srcCompositeSize.dataByteLength + (j << 3);
732
+ const srcPtr = new Pointer(srcContent.segment, srcContent.byteOffset + offset, src._capnp.depthLimit - 1);
733
+ const dstPtr = new Pointer(dstContent.segment, dstContent.byteOffset + offset + 8, dst._capnp.depthLimit - 1);
734
+ copyFrom(srcPtr, dstPtr);
735
+ }
736
+ }
737
+ }
738
+ else {
739
+ const byteLength = util_1.padToWord(srcElementSize === list_element_size_1.ListElementSize.BIT
740
+ ? (srcLength + 7) >>> 3
741
+ : getListElementByteLength(srcElementSize) * srcLength);
742
+ const wordLength = byteLength >>> 3;
743
+ dstContent = dst.segment.allocate(byteLength);
744
+ // Copy all of the list contents word-by-word.
745
+ dstContent.segment.copyWords(dstContent.byteOffset, srcContent.segment, srcContent.byteOffset, wordLength);
746
+ }
747
+ // Initialize the list pointer.
748
+ const res = initPointer(dstContent.segment, dstContent.byteOffset, dst);
749
+ setListPointer(res.offsetWords, srcElementSize, srcLength, res.pointer, srcCompositeSize);
750
+ }
751
+ exports.copyFromList = copyFromList;
752
+ function copyFromStruct(src, dst) {
753
+ if (dst._capnp.depthLimit <= 0)
754
+ throw new Error(errors_1.PTR_DEPTH_LIMIT_EXCEEDED);
755
+ const srcContent = getContent(src);
756
+ const srcSize = getTargetStructSize(src);
757
+ const srcDataWordLength = object_size_1.getDataWordLength(srcSize);
758
+ // Allocate space for the destination content.
759
+ const dstContent = dst.segment.allocate(object_size_1.getByteLength(srcSize));
760
+ // Copy the data section.
761
+ dstContent.segment.copyWords(dstContent.byteOffset, srcContent.segment, srcContent.byteOffset, srcDataWordLength);
762
+ // Copy the pointer section.
763
+ for (let i = 0; i < srcSize.pointerLength; i++) {
764
+ const offset = srcSize.dataByteLength + i * 8;
765
+ const srcPtr = new Pointer(srcContent.segment, srcContent.byteOffset + offset, src._capnp.depthLimit - 1);
766
+ const dstPtr = new Pointer(dstContent.segment, dstContent.byteOffset + offset, dst._capnp.depthLimit - 1);
767
+ copyFrom(srcPtr, dstPtr);
768
+ }
769
+ // Don't touch dst if it's already initialized as a composite list pointer. With composite struct pointers there's
770
+ // no pointer to copy here and we've already copied the contents.
771
+ if (dst._capnp.compositeList)
772
+ return;
773
+ // Initialize the struct pointer.
774
+ const res = initPointer(dstContent.segment, dstContent.byteOffset, dst);
775
+ setStructPointer(res.offsetWords, srcSize, res.pointer);
776
+ }
777
+ exports.copyFromStruct = copyFromStruct;
778
+ /**
779
+ * Track the allocation of a new Pointer object.
780
+ *
781
+ * This will decrement an internal counter tracking how many bytes have been traversed in the message so far. After
782
+ * a certain limit, this method will throw an error in order to prevent a certain class of DoS attacks.
783
+ *
784
+ * @param {Message} message The message the pointer belongs to.
785
+ * @param {Pointer} p The pointer being allocated.
786
+ * @returns {void}
787
+ */
788
+ function trackPointerAllocation(message, p) {
789
+ message._capnp.traversalLimit -= 8;
790
+ if (message._capnp.traversalLimit <= 0) {
791
+ throw new Error(util_1.format(errors_1.PTR_TRAVERSAL_LIMIT_EXCEEDED, p));
792
+ }
793
+ }
794
+ exports.trackPointerAllocation = trackPointerAllocation;
795
+ //# sourceMappingURL=pointer.js.map
workers1/auto3d/node_modules/capnp-ts/src/serialization/pointers/pointer.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"pointer.js","sourceRoot":"","sources":["pointer.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,0DAA8B;AAE9B,+CAAwG;AACxG,qCAA4D;AAC5D,4DAAuD;AACvD,gDAMwB;AAExB,qCAAkC;AAClC,2EAAsE;AACtE,iDAA6C;AAE7C,yCAWsB;AAEtB,MAAM,KAAK,GAAG,eAAS,CAAC,eAAe,CAAC,CAAC;AACzC,KAAK,CAAC,MAAM,CAAC,CAAC;A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