2021-12-01 16:24:29 +00:00
|
|
|
/// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
2021-01-11 22:35:36 +00:00
|
|
|
|
2021-05-17 14:26:01 +00:00
|
|
|
import { Value, is, Set } from '@preserves/core';
|
2021-01-11 22:35:36 +00:00
|
|
|
|
|
|
|
import * as Skeleton from './skeleton.js';
|
|
|
|
import { Bag, ChangeDescription } from './bag.js';
|
|
|
|
import * as Dataflow from './dataflow.js';
|
|
|
|
import { IdentitySet, IdentityMap } from './idcoll.js';
|
|
|
|
|
2021-12-01 16:13:00 +00:00
|
|
|
export class Dataspace implements Partial<Entity> {
|
2021-01-11 22:35:36 +00:00
|
|
|
index = new Skeleton.Index();
|
|
|
|
|
2021-12-01 16:13:00 +00:00
|
|
|
// adjustIndex(a: Value<any>, count: number) {
|
|
|
|
// return this.index.adjustAssertion(a, count);
|
2021-01-15 12:38:15 +00:00
|
|
|
// }
|
|
|
|
|
2021-12-01 16:13:00 +00:00
|
|
|
// subscribe(handler: Skeleton.Analysis) {
|
|
|
|
// this.index.addHandler(handler, handler.callback!);
|
2021-01-15 12:38:15 +00:00
|
|
|
// }
|
|
|
|
|
2021-12-01 16:13:00 +00:00
|
|
|
// unsubscribe(handler: Skeleton.Analysis) {
|
|
|
|
// this.index.removeHandler(handler, handler.callback!);
|
|
|
|
// }
|
2021-01-11 22:35:36 +00:00
|
|
|
|
2021-12-01 16:13:00 +00:00
|
|
|
assert(turn: Turn, rec: Assertion, handle: Handle): void {
|
|
|
|
console.log(preserves`ds ${turn.activeFacet.id} assert ${rec} ${handle}`);
|
|
|
|
throw new Error("Full dataspaces not implemented");
|
2021-01-11 22:35:36 +00:00
|
|
|
}
|
|
|
|
|
2021-12-01 16:13:00 +00:00
|
|
|
retract(turn: Turn, upstreamHandle: Handle): void {
|
|
|
|
console.log(preserves`ds ${turn.activeFacet.id} retract ${upstreamHandle}`);
|
|
|
|
throw new Error("Full dataspaces not implemented");
|
2021-01-11 22:35:36 +00:00
|
|
|
}
|
|
|
|
|
2021-12-01 16:13:00 +00:00
|
|
|
message(turn: Turn, rec: Assertion): void {
|
|
|
|
console.log(preserves`ds ${turn.activeFacet.id} message ${rec}`);
|
|
|
|
throw new Error("Full dataspaces not implemented");
|
2021-01-11 22:35:36 +00:00
|
|
|
}
|
|
|
|
}
|