From 00ec7a02a08bb969c7be02b6f473048a1c6ed056 Mon Sep 17 00:00:00 2001 From: Vaci Date: Mon, 28 Sep 2020 16:47:24 +0100 Subject: [PATCH 001/246] Create maven.yml --- .github/workflows/maven.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 00000000..c8aeb3a2 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,24 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Java CI with Maven + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Maven + run: mvn -B package --file pom.xml From a49d5de4f5feb9c9aac304589d91d3eeb84ce72d Mon Sep 17 00:00:00 2001 From: Vaci Date: Mon, 28 Sep 2020 16:54:06 +0100 Subject: [PATCH 002/246] Only rebuild and test runtime --- .github/workflows/maven.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c8aeb3a2..91e37826 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -5,9 +5,9 @@ name: Java CI with Maven on: push: - branches: [ master ] + branches: [ master, rpc ] pull_request: - branches: [ master ] + branches: [ master, rpc ] jobs: build: @@ -21,4 +21,4 @@ jobs: with: java-version: 1.8 - name: Build with Maven - run: mvn -B package --file pom.xml + run: mvn -B package --file runtime/pom.xml From 73bc7a6569fef30886b32388796df84cfa8d6569 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 27 Sep 2020 23:08:45 +0100 Subject: [PATCH 003/246] use Java version 10 --- runtime/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/pom.xml b/runtime/pom.xml index 1a650458..6c9df080 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -28,6 +28,11 @@ David Renshaw https://github.com/dwrensha + + vaci + Vaci Koblizek + https://github.com/vaci + UTF-8 @@ -60,6 +65,8 @@ 3.3 -Xlint:unchecked + 10 + 10 From 86dfbd123db05d888c121ececc9ca781104e135e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 27 Sep 2020 23:09:05 +0100 Subject: [PATCH 004/246] Serialization to and from AsynchronousByteChannel --- .../main/java/org/capnproto/Serialize.java | 170 +++++++++++++++++- .../java/org/capnproto/SerializeTest.java | 51 ++++++ 2 files changed, 219 insertions(+), 2 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Serialize.java b/runtime/src/main/java/org/capnproto/Serialize.java index 7dbfac06..60b829a5 100644 --- a/runtime/src/main/java/org/capnproto/Serialize.java +++ b/runtime/src/main/java/org/capnproto/Serialize.java @@ -22,11 +22,17 @@ package org.capnproto; import java.io.IOException; -import java.nio.channels.ReadableByteChannel; -import java.nio.channels.WritableByteChannel; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.nio.channels.AsynchronousByteChannel; +import java.nio.channels.CompletionHandler; +import java.nio.channels.ReadableByteChannel; +import java.nio.channels.WritableByteChannel; import java.util.ArrayList; +import java.util.Arrays; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; +import java.util.function.Consumer; public final class Serialize { @@ -201,4 +207,164 @@ public static void write(WritableByteChannel outputChannel, } } } + + static final class AsyncMessageReader { + + private final AsynchronousByteChannel channel; + private final ReaderOptions options; + private final CompletableFuture readCompleted = new CompletableFuture<>(); + + public AsyncMessageReader(AsynchronousByteChannel channel, ReaderOptions options) { + this.channel = channel; + this.options = options; + } + + public CompletableFuture getMessage() { + readHeader(); + return readCompleted; + } + + private void readHeader() { + read(Constants.BYTES_PER_WORD, firstWord -> { + final var segmentCount = 1 + firstWord.getInt(0); + final var segment0Size = firstWord.getInt(4); + + if (segmentCount == 1) { + readSegments(segment0Size, segmentCount, segment0Size, null); + return; + } + + // check before allocating segment size buffer + if (segmentCount > 512) { + readCompleted.completeExceptionally(new IOException("Too many segments")); + return; + } + + read(4 * (segmentCount & ~1), moreSizesRaw -> { + final var moreSizes = new int[segmentCount - 1]; + var totalWords = segment0Size; + + for (int ii = 0; ii < segmentCount - 1; ++ii) { + int size = moreSizesRaw.getInt(ii * 4); + moreSizes[ii] = size; + totalWords += size; + } + + readSegments(totalWords, segmentCount, segment0Size, moreSizes); + }); + }); + } + + private void readSegments(int totalWords, int segmentCount, int segment0Size, int[] moreSizes) { + if (totalWords > options.traversalLimitInWords) { + readCompleted.completeExceptionally( + new DecodeException("Message size exceeds traversal limit.")); + return; + } + + final var segmentSlices = new ByteBuffer[segmentCount]; + if (totalWords == 0) { + for (int ii = 0; ii < segmentCount; ++ii) { + segmentSlices[ii] = ByteBuffer.allocate(0); + } + readCompleted.complete(new MessageReader(segmentSlices, options)); + return; + } + + read(totalWords * Constants.BYTES_PER_WORD, allSegments -> { + allSegments.rewind(); + segmentSlices[0] = allSegments.slice(); + segmentSlices[0].limit(segment0Size * Constants.BYTES_PER_WORD); + segmentSlices[0].order(ByteOrder.LITTLE_ENDIAN); + + int offset = segment0Size; + for (int ii = 1; ii < segmentCount; ++ii) { + allSegments.position(offset * Constants.BYTES_PER_WORD); + var segmentSize = moreSizes[ii-1]; + segmentSlices[ii] = allSegments.slice(); + segmentSlices[ii].limit(segmentSize * Constants.BYTES_PER_WORD); + segmentSlices[ii].order(ByteOrder.LITTLE_ENDIAN); + offset += segmentSize; + } + + readCompleted.complete(new MessageReader(segmentSlices, options)); + }); + } + + private void read(int bytes, Consumer consumer) { + final var buffer = Serialize.makeByteBuffer(bytes); + final var handler = new CompletionHandler() { + @Override + public void completed(Integer result, Object attachment) { + // System.out.println("read " + result + " bytes"); + if (result <= 0) { + var text = result == 0 + ? "Read zero bytes. Is the channel in non-blocking mode?" + : "Premature EOF"; + readCompleted.completeExceptionally(new IOException(text)); + } else if (buffer.hasRemaining()) { + // retry + channel.read(buffer, null, this); + } else { + consumer.accept(buffer); + } + } + + @Override + public void failed(Throwable exc, Object attachment) { + readCompleted.completeExceptionally(exc); + } + }; + + this.channel.read(buffer, null, handler); + } + } + + public static CompletableFuture readAsync(AsynchronousByteChannel channel) { + return readAsync(channel, ReaderOptions.DEFAULT_READER_OPTIONS); + } + + public static CompletableFuture readAsync(AsynchronousByteChannel channel, ReaderOptions options) { + return new AsyncMessageReader(channel, options).getMessage(); + } + + public static CompletableFuture writeAsync(AsynchronousByteChannel outputChannel, MessageBuilder message) { + final var writeCompleted = new CompletableFuture(); + final var segments = message.getSegmentsForOutput(); + assert segments.length > 0: "Empty message"; + final int tableSize = (segments.length + 2) & (~1); + final var table = ByteBuffer.allocate(4 * tableSize); + + table.order(ByteOrder.LITTLE_ENDIAN); + table.putInt(0, segments.length - 1); + + for (int ii = 0; ii < segments.length; ++ii) { + table.putInt(4 * (ii + 1), segments[ii].limit() / 8); + } + + outputChannel.write(table, 0, new CompletionHandler() { + + @Override + public void completed(Integer result, Integer attachment) { + //System.out.println("Wrote " + result + " bytes"); + if (writeCompleted.isCancelled()) { + // TODO do we really want to interrupt here? + return; + } + + if (attachment == segments.length) { + writeCompleted.complete(null); + return; + } + + outputChannel.write(segments[attachment], attachment + 1, this); + } + + @Override + public void failed(Throwable exc, Integer attachment) { + writeCompleted.completeExceptionally(exc); + } + }); + return writeCompleted.copy(); + } } diff --git a/runtime/src/test/java/org/capnproto/SerializeTest.java b/runtime/src/test/java/org/capnproto/SerializeTest.java index 5b5c5f4c..aecd4867 100644 --- a/runtime/src/test/java/org/capnproto/SerializeTest.java +++ b/runtime/src/test/java/org/capnproto/SerializeTest.java @@ -21,7 +21,14 @@ package org.capnproto; +import java.io.IOException; +import java.net.SocketOptions; import java.nio.ByteBuffer; +import java.nio.channels.AsynchronousServerSocketChannel; +import java.nio.channels.AsynchronousSocketChannel; +import java.nio.channels.CompletionHandler; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; import org.junit.Assert; import org.junit.Test; @@ -63,6 +70,50 @@ private void expectSerializesTo(int exampleSegmentCount, byte[] exampleBytes) th MessageReader messageReader = Serialize.read(ByteBuffer.wrap(exampleBytes)); checkSegmentContents(exampleSegmentCount, messageReader.arena); } + + // read via AsyncChannel + expectSerializesToAsync(exampleSegmentCount, exampleBytes); + } + + private void expectSerializesToAsync(int exampleSegmentCount, byte[] exampleBytes) throws IOException { + var done = new CompletableFuture(); + var server = AsynchronousServerSocketChannel.open(); + server.bind(null); + server.accept(null, new CompletionHandler() { + @Override + public void completed(AsynchronousSocketChannel socket, Object attachment) { + socket.write(ByteBuffer.wrap(exampleBytes), null, new CompletionHandler() { + @Override + public void completed(Integer result, Object attachment) { + done.complete(null); + } + + @Override + public void failed(Throwable exc, Object attachment) { + done.completeExceptionally(exc); + } + }); + } + + @Override + public void failed(Throwable exc, Object attachment) { + done.completeExceptionally(exc); + } + }); + + var socket = AsynchronousSocketChannel.open(); + try { + socket.connect(server.getLocalAddress()).get(); + var messageReader = Serialize.readAsync(socket).get(); + checkSegmentContents(exampleSegmentCount, messageReader.arena); + done.get(); + } + catch (InterruptedException exc) { + Assert.fail(exc.getMessage()); + } + catch (ExecutionException exc) { + Assert.fail(exc.getMessage()); + } } @Test From 6c35c0f1d532779997626ae3cffc30fb670b37e5 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 27 Sep 2020 23:09:11 +0100 Subject: [PATCH 005/246] Allow builders and readers to be imbued with a capability table --- .../main/java/org/capnproto/AnyPointer.java | 26 ++++++++++++++++++- .../java/org/capnproto/CapTableBuilder.java | 11 ++++++++ .../java/org/capnproto/CapTableReader.java | 5 ++++ .../main/java/org/capnproto/ClientHook.java | 4 +++ runtime/src/main/java/org/capnproto/Data.java | 10 +++++++ .../org/capnproto/FromPointerBuilder.java | 1 + .../java/org/capnproto/FromPointerReader.java | 1 + .../main/java/org/capnproto/ListBuilder.java | 1 + .../main/java/org/capnproto/ListFactory.java | 14 +++++++++- .../src/main/java/org/capnproto/ListList.java | 4 +-- .../main/java/org/capnproto/ListReader.java | 8 ++++++ .../java/org/capnproto/StructBuilder.java | 7 +++++ .../java/org/capnproto/StructFactory.java | 13 +++++++++- .../main/java/org/capnproto/StructReader.java | 9 ++++++- runtime/src/main/java/org/capnproto/Text.java | 10 +++++++ 15 files changed, 118 insertions(+), 6 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/CapTableBuilder.java create mode 100644 runtime/src/main/java/org/capnproto/CapTableReader.java create mode 100644 runtime/src/main/java/org/capnproto/ClientHook.java diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 71230807..34a05c1d 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -26,9 +26,19 @@ public static final class Factory implements PointerFactory { public final Reader fromPointerReader(SegmentReader segment, int pointer, int nestingLimit) { return new Reader(segment, pointer, nestingLimit); } + public final Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { + var result = new Reader(segment, pointer, nestingLimit); + result.capTable = capTable; + return result; + } public final Builder fromPointerBuilder(SegmentBuilder segment, int pointer) { return new Builder(segment, pointer); } + public final Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { + var result = new Builder(segment, pointer); + result.capTable = capTable; + return result; + } public final Builder initFromPointerBuilder(SegmentBuilder segment, int pointer, int elementCount) { Builder result = new Builder(segment, pointer); result.clear(); @@ -41,6 +51,7 @@ public final static class Reader { final SegmentReader segment; final int pointer; // offset in words final int nestingLimit; + CapTableReader capTable; public Reader(SegmentReader segment, int pointer, int nestingLimit) { this.segment = segment; @@ -48,24 +59,37 @@ public Reader(SegmentReader segment, int pointer, int nestingLimit) { this.nestingLimit = nestingLimit; } + final Reader imbue(CapTableReader capTable) { + var result = new Reader(segment, pointer, nestingLimit); + result.capTable = capTable; + return result; + } + public final boolean isNull() { return WirePointer.isNull(this.segment.buffer.getLong(this.pointer * Constants.BYTES_PER_WORD)); } public final T getAs(FromPointerReader factory) { - return factory.fromPointerReader(this.segment, this.pointer, this.nestingLimit); + return factory.fromPointerReader(this.segment, this.capTable, this.pointer, this.nestingLimit); } } public static final class Builder { final SegmentBuilder segment; final int pointer; + CapTableBuilder capTable; public Builder(SegmentBuilder segment, int pointer) { this.segment = segment; this.pointer = pointer; } + final Builder imbue(CapTableBuilder capTable) { + var result = new Builder(segment, pointer); + result.capTable = capTable; + return result; + } + public final boolean isNull() { return WirePointer.isNull(this.segment.buffer.getLong(this.pointer * Constants.BYTES_PER_WORD)); } diff --git a/runtime/src/main/java/org/capnproto/CapTableBuilder.java b/runtime/src/main/java/org/capnproto/CapTableBuilder.java new file mode 100644 index 00000000..b1f7497b --- /dev/null +++ b/runtime/src/main/java/org/capnproto/CapTableBuilder.java @@ -0,0 +1,11 @@ +package org.capnproto; + +interface CapTableBuilder extends CapTableReader { + int injectCap(ClientHook cap); + + void dropCap(int index); + + default ClientHook[] getTable() { + return new ClientHook[0]; + } +} diff --git a/runtime/src/main/java/org/capnproto/CapTableReader.java b/runtime/src/main/java/org/capnproto/CapTableReader.java new file mode 100644 index 00000000..0b9ddd56 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/CapTableReader.java @@ -0,0 +1,5 @@ +package org.capnproto; + +interface CapTableReader { + ClientHook extractCap(int index); +} diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java new file mode 100644 index 00000000..e8a5e085 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -0,0 +1,4 @@ +package org.capnproto; + +public interface ClientHook { +} diff --git a/runtime/src/main/java/org/capnproto/Data.java b/runtime/src/main/java/org/capnproto/Data.java index dec66223..b751ee5b 100644 --- a/runtime/src/main/java/org/capnproto/Data.java +++ b/runtime/src/main/java/org/capnproto/Data.java @@ -39,6 +39,11 @@ public final Reader fromPointerReader(SegmentReader segment, int pointer, int ne return WireHelpers.readDataPointer(segment, pointer, null, 0, 0); } + @Override + public Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { + return fromPointerReader(segment, pointer, nestingLimit); + } + @Override public final Builder fromPointerBuilderBlobDefault( SegmentBuilder segment, @@ -60,6 +65,11 @@ public final Builder fromPointerBuilder(SegmentBuilder segment, int pointer) { null, 0, 0); } + @Override + public Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { + return fromPointerBuilder(segment, pointer); + } + @Override public final Builder initFromPointerBuilder(SegmentBuilder segment, int pointer, int size) { return WireHelpers.initDataPointer(pointer, segment, size); diff --git a/runtime/src/main/java/org/capnproto/FromPointerBuilder.java b/runtime/src/main/java/org/capnproto/FromPointerBuilder.java index 9fa715b7..1c09e6fb 100644 --- a/runtime/src/main/java/org/capnproto/FromPointerBuilder.java +++ b/runtime/src/main/java/org/capnproto/FromPointerBuilder.java @@ -23,5 +23,6 @@ public interface FromPointerBuilder { T fromPointerBuilder(SegmentBuilder segment, int pointer); + T fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer); T initFromPointerBuilder(SegmentBuilder segment, int pointer, int elementCount); } diff --git a/runtime/src/main/java/org/capnproto/FromPointerReader.java b/runtime/src/main/java/org/capnproto/FromPointerReader.java index 1a1a71b0..3e7135b9 100644 --- a/runtime/src/main/java/org/capnproto/FromPointerReader.java +++ b/runtime/src/main/java/org/capnproto/FromPointerReader.java @@ -23,4 +23,5 @@ public interface FromPointerReader { T fromPointerReader(SegmentReader segment, int pointer, int nestingLimit); + T fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit); } diff --git a/runtime/src/main/java/org/capnproto/ListBuilder.java b/runtime/src/main/java/org/capnproto/ListBuilder.java index 42f5ebcd..b91006a8 100644 --- a/runtime/src/main/java/org/capnproto/ListBuilder.java +++ b/runtime/src/main/java/org/capnproto/ListBuilder.java @@ -34,6 +34,7 @@ T constructBuilder(SegmentBuilder segment, int ptr, final int step; // in bits final int structDataSize; // in bits final short structPointerCount; + CapTableBuilder capTable; public ListBuilder(SegmentBuilder segment, int ptr, int elementCount, int step, diff --git a/runtime/src/main/java/org/capnproto/ListFactory.java b/runtime/src/main/java/org/capnproto/ListFactory.java index bbb84447..e3d6fc0b 100644 --- a/runtime/src/main/java/org/capnproto/ListFactory.java +++ b/runtime/src/main/java/org/capnproto/ListFactory.java @@ -21,7 +21,7 @@ package org.capnproto; -public abstract class ListFactory +public abstract class ListFactory implements ListBuilder.Factory, FromPointerBuilderRefDefault, SetPointerBuilder, @@ -44,6 +44,12 @@ public final Reader fromPointerReaderRefDefault(SegmentReader segment, int point nestingLimit); } + public final Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { + var result = fromPointerReader(segment, pointer, nestingLimit); + result.capTable = capTable; + return result; + } + public final Reader fromPointerReader(SegmentReader segment, int pointer, int nestingLimit) { return fromPointerReaderRefDefault(segment, pointer, null, 0, nestingLimit); } @@ -66,6 +72,12 @@ public Builder fromPointerBuilder(SegmentBuilder segment, int pointer) { null, 0); } + public final Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { + var result = fromPointerBuilder(segment, pointer); + result.capTable = capTable; + return result; + } + public Builder initFromPointerBuilder(SegmentBuilder segment, int pointer, int elementCount) { return WireHelpers.initListPointer(this, pointer, segment, elementCount, this.elementSize); } diff --git a/runtime/src/main/java/org/capnproto/ListList.java b/runtime/src/main/java/org/capnproto/ListList.java index 13488aa2..88d387b6 100644 --- a/runtime/src/main/java/org/capnproto/ListList.java +++ b/runtime/src/main/java/org/capnproto/ListList.java @@ -22,7 +22,7 @@ package org.capnproto; public final class ListList { - public static final class Factory + public static final class Factory extends ListFactory, Reader> { public final ListFactory factory; @@ -68,7 +68,7 @@ public T get(int index) { } } - public static final class Builder extends ListBuilder { + public static final class Builder extends ListBuilder { private final ListFactory factory; public Builder(ListFactory factory, diff --git a/runtime/src/main/java/org/capnproto/ListReader.java b/runtime/src/main/java/org/capnproto/ListReader.java index c63c3688..146785bd 100644 --- a/runtime/src/main/java/org/capnproto/ListReader.java +++ b/runtime/src/main/java/org/capnproto/ListReader.java @@ -37,6 +37,7 @@ T constructReader(SegmentReader segment, final int structDataSize; // in bits final short structPointerCount; final int nestingLimit; + CapTableReader capTable; public ListReader() { this.segment = null; @@ -62,6 +63,12 @@ public ListReader(SegmentReader segment, int ptr, } + ListReader imbue(CapTableReader capTable) { + var result = new ListReader(segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); + result.capTable = capTable; + return result; + } + public int size() { return this.elementCount; } @@ -109,6 +116,7 @@ protected T _getStructElement(StructReader.Factory factory, int index) { protected T _getPointerElement(FromPointerReader factory, int index) { return factory.fromPointerReader(this.segment, + this.capTable, (this.ptr + (int)((long)index * this.step / Constants.BITS_PER_BYTE)) / Constants.BYTES_PER_WORD, this.nestingLimit); } diff --git a/runtime/src/main/java/org/capnproto/StructBuilder.java b/runtime/src/main/java/org/capnproto/StructBuilder.java index 8c3e4f78..c62bcefc 100644 --- a/runtime/src/main/java/org/capnproto/StructBuilder.java +++ b/runtime/src/main/java/org/capnproto/StructBuilder.java @@ -33,6 +33,7 @@ T constructBuilder(SegmentBuilder segment, int data, int pointers, int dataSize, protected final int pointers; // word offset of pointer section protected final int dataSize; // in bits protected final short pointerCount; + protected CapTableBuilder capTable; public StructBuilder(SegmentBuilder segment, int data, int pointers, int dataSize, short pointerCount) { @@ -43,6 +44,12 @@ public StructBuilder(SegmentBuilder segment, int data, this.pointerCount = pointerCount; } + StructBuilder imbue(CapTableBuilder capTable) { + var result = new StructBuilder(this.segment, this.data, this.pointers, this.dataSize, this.pointerCount); + result.capTable = capTable; + return result; + } + protected final boolean _getBooleanField(int offset) { int bitOffset = offset; int position = this.data + (bitOffset / 8); diff --git a/runtime/src/main/java/org/capnproto/StructFactory.java b/runtime/src/main/java/org/capnproto/StructFactory.java index 5ff08e0d..f10c4888 100644 --- a/runtime/src/main/java/org/capnproto/StructFactory.java +++ b/runtime/src/main/java/org/capnproto/StructFactory.java @@ -21,7 +21,7 @@ package org.capnproto; -public abstract class StructFactory +public abstract class StructFactory implements PointerFactory, FromPointerBuilderRefDefault, StructBuilder.Factory, @@ -40,6 +40,12 @@ public final Reader fromPointerReaderRefDefault(SegmentReader segment, int point public final Reader fromPointerReader(SegmentReader segment, int pointer, int nestingLimit) { return fromPointerReaderRefDefault(segment, pointer, null, 0, nestingLimit); } + + public final Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { + var result = fromPointerReaderRefDefault(segment, pointer, null, 0, nestingLimit); + result.capTable = capTable; + return result; + } public final Builder fromPointerBuilderRefDefault(SegmentBuilder segment, int pointer, SegmentReader defaultSegment, int defaultOffset) { return WireHelpers.getWritableStructPointer(this, pointer, segment, this.structSize(), @@ -49,6 +55,11 @@ public final Builder fromPointerBuilder(SegmentBuilder segment, int pointer) { return WireHelpers.getWritableStructPointer(this, pointer, segment, this.structSize(), null, 0); } + public final Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { + var result = fromPointerBuilder(segment, pointer); + result.capTable = capTable; + return result; + } public final Builder initFromPointerBuilder(SegmentBuilder segment, int pointer, int elementCount) { return WireHelpers.initStructPointer(this, pointer, segment, this.structSize()); } diff --git a/runtime/src/main/java/org/capnproto/StructReader.java b/runtime/src/main/java/org/capnproto/StructReader.java index 8a21a216..aa676d58 100644 --- a/runtime/src/main/java/org/capnproto/StructReader.java +++ b/runtime/src/main/java/org/capnproto/StructReader.java @@ -34,6 +34,7 @@ abstract T constructReader(SegmentReader segment, int data, int pointers, protected final int dataSize; // in bits protected final short pointerCount; protected final int nestingLimit; + protected CapTableReader capTable; public StructReader() { this.segment = SegmentReader.EMPTY; @@ -55,6 +56,12 @@ public StructReader(SegmentReader segment, int data, this.nestingLimit = nestingLimit; } + final StructReader imbue(CapTableReader capTable) { + var result = new StructReader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + result.capTable = capTable; + return result; + } + protected final boolean _getBooleanField(int offset) { // XXX should use unsigned operations if (offset < this.dataSize) { @@ -157,6 +164,7 @@ protected final boolean _pointerFieldIsNull(int ptrIndex) { protected final T _getPointerField(FromPointerReader factory, int ptrIndex) { if (ptrIndex < this.pointerCount) { return factory.fromPointerReader(this.segment, + this.capTable, this.pointers + ptrIndex, this.nestingLimit); } else { @@ -200,5 +208,4 @@ protected final T _getPointerField(FromPointerReaderBlobDefault factory, defaultSize); } } - } diff --git a/runtime/src/main/java/org/capnproto/Text.java b/runtime/src/main/java/org/capnproto/Text.java index fdf62cc4..cc129ccc 100644 --- a/runtime/src/main/java/org/capnproto/Text.java +++ b/runtime/src/main/java/org/capnproto/Text.java @@ -41,6 +41,11 @@ public final Reader fromPointerReader(SegmentReader segment, int pointer, int ne return WireHelpers.readTextPointer(segment, pointer, null, 0, 0); } + @Override + public final Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { + return fromPointerReader(segment, pointer, nestingLimit); + } + @Override public final Builder fromPointerBuilderBlobDefault(SegmentBuilder segment, int pointer, java.nio.ByteBuffer defaultBuffer, int defaultOffset, int defaultSize) { @@ -58,6 +63,11 @@ public final Builder fromPointerBuilder(SegmentBuilder segment, int pointer) { null, 0, 0); } + @Override + public Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { + return fromPointerBuilder(segment, pointer); + } + @Override public final Builder initFromPointerBuilder(SegmentBuilder segment, int pointer, int size) { return WireHelpers.initTextPointer(pointer, segment, size); From 57bacc9dd8fc34c79d04e268392bdf594477fc94 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 27 Sep 2020 23:09:16 +0100 Subject: [PATCH 006/246] extract capabilities from wire pointers --- .../main/java/org/capnproto/ClientHook.java | 48 +++++++++++++++++++ .../main/java/org/capnproto/WireHelpers.java | 34 +++++++++++++ .../main/java/org/capnproto/WirePointer.java | 4 ++ 3 files changed, 86 insertions(+) diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index e8a5e085..bda1eaf0 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -1,4 +1,52 @@ package org.capnproto; public interface ClientHook { + + Object NULL_CAPABILITY_BRAND = new Object(); + Object BROKEN_CAPABILITY_BRAND = new Object(); + + default ClientHook getResolved() { + return null; + } + + default Object getBrand() { + return NULL_CAPABILITY_BRAND; + } + + default boolean isNull() { + return getBrand() == NULL_CAPABILITY_BRAND; + } + + default boolean isError() { + return getBrand() == BROKEN_CAPABILITY_BRAND; + } + + default Integer getFd() { + return null; + } + + static ClientHook newBrokenCap(String reason) { + return newBrokenClient(reason, false, BROKEN_CAPABILITY_BRAND); + } + + static ClientHook newBrokenCap(Throwable exc) { + return newBrokenClient(exc, false, BROKEN_CAPABILITY_BRAND); + } + + static ClientHook newNullCap() { + return newBrokenClient(new RuntimeException("Called null capability"), true, NULL_CAPABILITY_BRAND); + } + + static private ClientHook newBrokenClient(String reason, boolean resolved, Object brand) { + return newBrokenClient(new RuntimeException(reason), resolved, brand); + } + + static private ClientHook newBrokenClient(Throwable exc, boolean resolved, Object brand) { + return new ClientHook() { + @Override + public Object getBrand() { + return brand; + } + }; + } } diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 2c9da878..8600a6ae 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -1312,4 +1312,38 @@ static Data.Reader readDataPointer(SegmentReader segment, return new Data.Reader(resolved.segment.buffer, resolved.ptr, size); } + static void setCapabilityPointer(SegmentBuilder segment, CapTableBuilder capTable, int refOffset, ClientHook cap) { + long ref = segment.get(refOffset); + + if (!WirePointer.isNull(ref)) { + zeroObject(segment, refOffset); + } + + if (cap == null) { + // TODO check zeroMemory behaviour + zeroPointerAndFars(segment, refOffset); + } + else { + WirePointer.setCap(segment.buffer, refOffset, capTable.injectCap(cap)); + } + } + + static ClientHook readCapabilityPointer(SegmentReader segment, CapTableReader capTable, int refOffset, int maxValue) { + long ref = segment.get(refOffset); + + if (WirePointer.isNull(ref)) { + return ClientHook.newNullCap(); + } + + if (WirePointer.kind(ref) != WirePointer.OTHER) { + return ClientHook.newBrokenCap("Calling capability extracted from a non-capability pointer."); + } + + var cap = capTable.extractCap(WirePointer.upper32Bits(ref)); + if (cap == null) { + return ClientHook.newBrokenCap("Calling invalid capability pointer."); + } + return cap; + } + } diff --git a/runtime/src/main/java/org/capnproto/WirePointer.java b/runtime/src/main/java/org/capnproto/WirePointer.java index 9b6f6538..ba332923 100644 --- a/runtime/src/main/java/org/capnproto/WirePointer.java +++ b/runtime/src/main/java/org/capnproto/WirePointer.java @@ -85,4 +85,8 @@ public static void setKindAndInlineCompositeListElementCount(ByteBuffer buffer, public static int upper32Bits(long wirePointer) { return (int)(wirePointer >>> 32); } + + public static void setCap(ByteBuffer buffer, int offset, int cap) { + WirePointer.setOffsetAndKind(buffer, offset, (cap << 2) | OTHER); + } } From cf5c4f111983fb25f8e9afa6373bc1b0ab2cf7e9 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 27 Sep 2020 23:09:22 +0100 Subject: [PATCH 007/246] hook interfaces and broken implementations --- .../java/org/capnproto/CallContextHook.java | 19 ++++++++ .../main/java/org/capnproto/ClientHook.java | 46 +++++++++++++++++++ .../main/java/org/capnproto/PipelineHook.java | 10 ++++ .../main/java/org/capnproto/PipelineOp.java | 25 ++++++++++ .../java/org/capnproto/RemotePromise.java | 22 +++++++++ .../src/main/java/org/capnproto/Request.java | 42 +++++++++++++++++ .../main/java/org/capnproto/RequestHook.java | 6 +++ .../src/main/java/org/capnproto/Response.java | 16 +++++++ .../main/java/org/capnproto/ResponseHook.java | 4 ++ 9 files changed, 190 insertions(+) create mode 100644 runtime/src/main/java/org/capnproto/CallContextHook.java create mode 100644 runtime/src/main/java/org/capnproto/PipelineHook.java create mode 100644 runtime/src/main/java/org/capnproto/PipelineOp.java create mode 100644 runtime/src/main/java/org/capnproto/RemotePromise.java create mode 100644 runtime/src/main/java/org/capnproto/Request.java create mode 100644 runtime/src/main/java/org/capnproto/RequestHook.java create mode 100644 runtime/src/main/java/org/capnproto/Response.java create mode 100644 runtime/src/main/java/org/capnproto/ResponseHook.java diff --git a/runtime/src/main/java/org/capnproto/CallContextHook.java b/runtime/src/main/java/org/capnproto/CallContextHook.java new file mode 100644 index 00000000..c5aa043f --- /dev/null +++ b/runtime/src/main/java/org/capnproto/CallContextHook.java @@ -0,0 +1,19 @@ +package org.capnproto; + +import java.util.concurrent.CompletableFuture; + +public interface CallContextHook { + AnyPointer.Reader getParams(); + + void releaseParams(); + + AnyPointer.Builder getResults(); + + CompletableFuture tailCall(RequestHook request); + + void allowCancellation(); + + CompletableFuture onTailCall(); + + ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request); +} diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index bda1eaf0..8e8ad8d6 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -1,18 +1,35 @@ package org.capnproto; +import java.util.concurrent.CompletableFuture; + public interface ClientHook { Object NULL_CAPABILITY_BRAND = new Object(); Object BROKEN_CAPABILITY_BRAND = new Object(); + Request newCall(long interfaceId, short methodId); + + VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context); + default ClientHook getResolved() { return null; } + default CompletableFuture whenMoreResolved() { + return null; + } + default Object getBrand() { return NULL_CAPABILITY_BRAND; } + default CompletableFuture whenResolved() { + var promise = whenMoreResolved(); + return promise != null + ? promise.thenCompose(ClientHook::whenResolved) + : CompletableFuture.completedFuture(null); + } + default boolean isNull() { return getBrand() == NULL_CAPABILITY_BRAND; } @@ -25,6 +42,16 @@ default Integer getFd() { return null; } + final class VoidPromiseAndPipeline { + public final CompletableFuture promise; + public final PipelineHook pipeline; + + VoidPromiseAndPipeline(CompletableFuture promise, PipelineHook pipeline) { + this.promise = promise; + this.pipeline = pipeline; + } + } + static ClientHook newBrokenCap(String reason) { return newBrokenClient(reason, false, BROKEN_CAPABILITY_BRAND); } @@ -43,6 +70,25 @@ static private ClientHook newBrokenClient(String reason, boolean resolved, Objec static private ClientHook newBrokenClient(Throwable exc, boolean resolved, Object brand) { return new ClientHook() { + @Override + public Request newCall(long interfaceId, short methodId) { + return Request.newBrokenRequest(exc); + } + + @Override + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { + return new VoidPromiseAndPipeline(CompletableFuture.failedFuture(exc), null); + } + + @Override + public CompletableFuture whenMoreResolved() { + if (resolved) { + return null; + } else { + return CompletableFuture.failedFuture(exc); + } + } + @Override public Object getBrand() { return brand; diff --git a/runtime/src/main/java/org/capnproto/PipelineHook.java b/runtime/src/main/java/org/capnproto/PipelineHook.java new file mode 100644 index 00000000..d242f2de --- /dev/null +++ b/runtime/src/main/java/org/capnproto/PipelineHook.java @@ -0,0 +1,10 @@ +package org.capnproto; + +interface PipelineHook { + + ClientHook getPipelinedCap(PipelineOp[] ops); + + static PipelineHook newBrokenPipeline(Throwable exc) { + return ops -> ClientHook.newBrokenCap(exc); + } +} diff --git a/runtime/src/main/java/org/capnproto/PipelineOp.java b/runtime/src/main/java/org/capnproto/PipelineOp.java new file mode 100644 index 00000000..5232d30d --- /dev/null +++ b/runtime/src/main/java/org/capnproto/PipelineOp.java @@ -0,0 +1,25 @@ +package org.capnproto; + +final class PipelineOp { + + enum Type { + NOOP, + GET_POINTER_FIELD + } + + final PipelineOp.Type type; + final short pointerIndex; + + private PipelineOp(PipelineOp.Type type, short pointerIndex) { + this.type = type; + this.pointerIndex = pointerIndex; + } + + static PipelineOp Noop() { + return new PipelineOp(Type.NOOP, (short) 0); + } + + static PipelineOp PointerField(short pointerIndex) { + return new PipelineOp(Type.GET_POINTER_FIELD, pointerIndex); + } +} diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java new file mode 100644 index 00000000..9664942c --- /dev/null +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -0,0 +1,22 @@ +package org.capnproto; + +import java.util.concurrent.CompletableFuture; + +class RemotePromise { + + final CompletableFuture response; + final PipelineHook pipeline; + + RemotePromise(CompletableFuture response, PipelineHook pipeline) { + this.response = response; + this.pipeline = pipeline; + } + + public CompletableFuture getResponse() { + return response; + } + + public PipelineHook getHook() { + return pipeline; + } +} diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java new file mode 100644 index 00000000..bedc248e --- /dev/null +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -0,0 +1,42 @@ +package org.capnproto; + +import java.util.concurrent.CompletableFuture; + +public class Request { + + private final AnyPointer.Builder params; + private final RequestHook hook; + + Request(AnyPointer.Builder params, RequestHook hook) { + this.params = params; + this.hook = hook; + } + + AnyPointer.Builder params() { + return params; + } + + CompletableFuture send() { + return null; + } + + static Request newBrokenRequest(Throwable exc) { + final MessageBuilder message = new MessageBuilder(); + + var hook = new RequestHook() { + @Override + public RemotePromise send() { + return new RemotePromise<>(CompletableFuture.failedFuture(exc), null); + } + + @Override + public Object getBrand() { + return null; + } + }; + + var root = message.getRoot(AnyPointer.factory); + return new Request(root, hook); + } +} + diff --git a/runtime/src/main/java/org/capnproto/RequestHook.java b/runtime/src/main/java/org/capnproto/RequestHook.java new file mode 100644 index 00000000..290aecee --- /dev/null +++ b/runtime/src/main/java/org/capnproto/RequestHook.java @@ -0,0 +1,6 @@ +package org.capnproto; + +interface RequestHook { + RemotePromise send(); + Object getBrand(); +} diff --git a/runtime/src/main/java/org/capnproto/Response.java b/runtime/src/main/java/org/capnproto/Response.java new file mode 100644 index 00000000..8c188dac --- /dev/null +++ b/runtime/src/main/java/org/capnproto/Response.java @@ -0,0 +1,16 @@ +package org.capnproto; + +class Response { + + final ResponseHook hook; + final AnyPointer.Reader results; + + public Response(AnyPointer.Reader reader, ResponseHook hook) { + this.hook = hook; + this.results = reader; + } + + public final T getAs(FromPointerReader factory) { + return this.results.getAs(factory); + } +} \ No newline at end of file diff --git a/runtime/src/main/java/org/capnproto/ResponseHook.java b/runtime/src/main/java/org/capnproto/ResponseHook.java new file mode 100644 index 00000000..7111d11d --- /dev/null +++ b/runtime/src/main/java/org/capnproto/ResponseHook.java @@ -0,0 +1,4 @@ +package org.capnproto; + +interface ResponseHook { +} From f999265165c3e7e1fb42d3648b763ddd7aaa0678 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 27 Sep 2020 23:09:29 +0100 Subject: [PATCH 008/246] Generate Capnproto RPC protocol from schema --- .../main/java/org/capnproto/RpcProtocol.java | 4223 +++++++++++++++++ 1 file changed, 4223 insertions(+) create mode 100644 runtime/src/main/java/org/capnproto/RpcProtocol.java diff --git a/runtime/src/main/java/org/capnproto/RpcProtocol.java b/runtime/src/main/java/org/capnproto/RpcProtocol.java new file mode 100644 index 00000000..1a4fc742 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/RpcProtocol.java @@ -0,0 +1,4223 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: rpc.capnp + +package org.capnproto; + +public final class RpcProtocol { + public static class Message { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Message.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.UNIMPLEMENTED; + case 1 : return Which.ABORT; + case 2 : return Which.CALL; + case 3 : return Which.RETURN; + case 4 : return Which.FINISH; + case 5 : return Which.RESOLVE; + case 6 : return Which.RELEASE; + case 7 : return Which.OBSOLETE_SAVE; + case 8 : return Which.BOOTSTRAP; + case 9 : return Which.OBSOLETE_DELETE; + case 10 : return Which.PROVIDE; + case 11 : return Which.ACCEPT; + case 12 : return Which.JOIN; + case 13 : return Which.DISEMBARGO; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isUnimplemented() { + return which() == Message.Which.UNIMPLEMENTED; + } + public final RpcProtocol.Message.Builder getUnimplemented() { + assert which() == Message.Which.UNIMPLEMENTED: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Message.factory, 0, null, 0); + } + public final void setUnimplemented(RpcProtocol.Message.Reader value) { + _setShortField(0, (short)Message.Which.UNIMPLEMENTED.ordinal()); + _setPointerField(RpcProtocol.Message.factory,0, value); + } + public final RpcProtocol.Message.Builder initUnimplemented() { + _setShortField(0, (short)Message.Which.UNIMPLEMENTED.ordinal()); + return _initPointerField(RpcProtocol.Message.factory,0, 0); + } + public final boolean isAbort() { + return which() == Message.Which.ABORT; + } + public final RpcProtocol.Exception.Builder getAbort() { + assert which() == Message.Which.ABORT: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Exception.factory, 0, null, 0); + } + public final void setAbort(RpcProtocol.Exception.Reader value) { + _setShortField(0, (short)Message.Which.ABORT.ordinal()); + _setPointerField(RpcProtocol.Exception.factory,0, value); + } + public final RpcProtocol.Exception.Builder initAbort() { + _setShortField(0, (short)Message.Which.ABORT.ordinal()); + return _initPointerField(RpcProtocol.Exception.factory,0, 0); + } + public final boolean isCall() { + return which() == Message.Which.CALL; + } + public final RpcProtocol.Call.Builder getCall() { + assert which() == Message.Which.CALL: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Call.factory, 0, null, 0); + } + public final void setCall(RpcProtocol.Call.Reader value) { + _setShortField(0, (short)Message.Which.CALL.ordinal()); + _setPointerField(RpcProtocol.Call.factory,0, value); + } + public final RpcProtocol.Call.Builder initCall() { + _setShortField(0, (short)Message.Which.CALL.ordinal()); + return _initPointerField(RpcProtocol.Call.factory,0, 0); + } + public final boolean isReturn() { + return which() == Message.Which.RETURN; + } + public final RpcProtocol.Return.Builder getReturn() { + assert which() == Message.Which.RETURN: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Return.factory, 0, null, 0); + } + public final void setReturn(RpcProtocol.Return.Reader value) { + _setShortField(0, (short)Message.Which.RETURN.ordinal()); + _setPointerField(RpcProtocol.Return.factory,0, value); + } + public final RpcProtocol.Return.Builder initReturn() { + _setShortField(0, (short)Message.Which.RETURN.ordinal()); + return _initPointerField(RpcProtocol.Return.factory,0, 0); + } + public final boolean isFinish() { + return which() == Message.Which.FINISH; + } + public final RpcProtocol.Finish.Builder getFinish() { + assert which() == Message.Which.FINISH: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Finish.factory, 0, null, 0); + } + public final void setFinish(RpcProtocol.Finish.Reader value) { + _setShortField(0, (short)Message.Which.FINISH.ordinal()); + _setPointerField(RpcProtocol.Finish.factory,0, value); + } + public final RpcProtocol.Finish.Builder initFinish() { + _setShortField(0, (short)Message.Which.FINISH.ordinal()); + return _initPointerField(RpcProtocol.Finish.factory,0, 0); + } + public final boolean isResolve() { + return which() == Message.Which.RESOLVE; + } + public final RpcProtocol.Resolve.Builder getResolve() { + assert which() == Message.Which.RESOLVE: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Resolve.factory, 0, null, 0); + } + public final void setResolve(RpcProtocol.Resolve.Reader value) { + _setShortField(0, (short)Message.Which.RESOLVE.ordinal()); + _setPointerField(RpcProtocol.Resolve.factory,0, value); + } + public final RpcProtocol.Resolve.Builder initResolve() { + _setShortField(0, (short)Message.Which.RESOLVE.ordinal()); + return _initPointerField(RpcProtocol.Resolve.factory,0, 0); + } + public final boolean isRelease() { + return which() == Message.Which.RELEASE; + } + public final RpcProtocol.Release.Builder getRelease() { + assert which() == Message.Which.RELEASE: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Release.factory, 0, null, 0); + } + public final void setRelease(RpcProtocol.Release.Reader value) { + _setShortField(0, (short)Message.Which.RELEASE.ordinal()); + _setPointerField(RpcProtocol.Release.factory,0, value); + } + public final RpcProtocol.Release.Builder initRelease() { + _setShortField(0, (short)Message.Which.RELEASE.ordinal()); + return _initPointerField(RpcProtocol.Release.factory,0, 0); + } + public final boolean isObsoleteSave() { + return which() == Message.Which.OBSOLETE_SAVE; + } + public final boolean hasObsoleteSave() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getObsoleteSave() { + assert which() == Message.Which.OBSOLETE_SAVE: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initObsoleteSave() { + _setShortField(0, (short)Message.Which.OBSOLETE_SAVE.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initObsoleteSave(int size) { + _setShortField(0, (short)Message.Which.OBSOLETE_SAVE.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + public final boolean isBootstrap() { + return which() == Message.Which.BOOTSTRAP; + } + public final RpcProtocol.Bootstrap.Builder getBootstrap() { + assert which() == Message.Which.BOOTSTRAP: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Bootstrap.factory, 0, null, 0); + } + public final void setBootstrap(RpcProtocol.Bootstrap.Reader value) { + _setShortField(0, (short)Message.Which.BOOTSTRAP.ordinal()); + _setPointerField(RpcProtocol.Bootstrap.factory,0, value); + } + public final RpcProtocol.Bootstrap.Builder initBootstrap() { + _setShortField(0, (short)Message.Which.BOOTSTRAP.ordinal()); + return _initPointerField(RpcProtocol.Bootstrap.factory,0, 0); + } + public final boolean isObsoleteDelete() { + return which() == Message.Which.OBSOLETE_DELETE; + } + public final boolean hasObsoleteDelete() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getObsoleteDelete() { + assert which() == Message.Which.OBSOLETE_DELETE: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initObsoleteDelete() { + _setShortField(0, (short)Message.Which.OBSOLETE_DELETE.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initObsoleteDelete(int size) { + _setShortField(0, (short)Message.Which.OBSOLETE_DELETE.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + public final boolean isProvide() { + return which() == Message.Which.PROVIDE; + } + public final RpcProtocol.Provide.Builder getProvide() { + assert which() == Message.Which.PROVIDE: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Provide.factory, 0, null, 0); + } + public final void setProvide(RpcProtocol.Provide.Reader value) { + _setShortField(0, (short)Message.Which.PROVIDE.ordinal()); + _setPointerField(RpcProtocol.Provide.factory,0, value); + } + public final RpcProtocol.Provide.Builder initProvide() { + _setShortField(0, (short)Message.Which.PROVIDE.ordinal()); + return _initPointerField(RpcProtocol.Provide.factory,0, 0); + } + public final boolean isAccept() { + return which() == Message.Which.ACCEPT; + } + public final RpcProtocol.Accept.Builder getAccept() { + assert which() == Message.Which.ACCEPT: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Accept.factory, 0, null, 0); + } + public final void setAccept(RpcProtocol.Accept.Reader value) { + _setShortField(0, (short)Message.Which.ACCEPT.ordinal()); + _setPointerField(RpcProtocol.Accept.factory,0, value); + } + public final RpcProtocol.Accept.Builder initAccept() { + _setShortField(0, (short)Message.Which.ACCEPT.ordinal()); + return _initPointerField(RpcProtocol.Accept.factory,0, 0); + } + public final boolean isJoin() { + return which() == Message.Which.JOIN; + } + public final RpcProtocol.Join.Builder getJoin() { + assert which() == Message.Which.JOIN: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Join.factory, 0, null, 0); + } + public final void setJoin(RpcProtocol.Join.Reader value) { + _setShortField(0, (short)Message.Which.JOIN.ordinal()); + _setPointerField(RpcProtocol.Join.factory,0, value); + } + public final RpcProtocol.Join.Builder initJoin() { + _setShortField(0, (short)Message.Which.JOIN.ordinal()); + return _initPointerField(RpcProtocol.Join.factory,0, 0); + } + public final boolean isDisembargo() { + return which() == Message.Which.DISEMBARGO; + } + public final RpcProtocol.Disembargo.Builder getDisembargo() { + assert which() == Message.Which.DISEMBARGO: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Disembargo.factory, 0, null, 0); + } + public final void setDisembargo(RpcProtocol.Disembargo.Reader value) { + _setShortField(0, (short)Message.Which.DISEMBARGO.ordinal()); + _setPointerField(RpcProtocol.Disembargo.factory,0, value); + } + public final RpcProtocol.Disembargo.Builder initDisembargo() { + _setShortField(0, (short)Message.Which.DISEMBARGO.ordinal()); + return _initPointerField(RpcProtocol.Disembargo.factory,0, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.UNIMPLEMENTED; + case 1 : return Which.ABORT; + case 2 : return Which.CALL; + case 3 : return Which.RETURN; + case 4 : return Which.FINISH; + case 5 : return Which.RESOLVE; + case 6 : return Which.RELEASE; + case 7 : return Which.OBSOLETE_SAVE; + case 8 : return Which.BOOTSTRAP; + case 9 : return Which.OBSOLETE_DELETE; + case 10 : return Which.PROVIDE; + case 11 : return Which.ACCEPT; + case 12 : return Which.JOIN; + case 13 : return Which.DISEMBARGO; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isUnimplemented() { + return which() == Message.Which.UNIMPLEMENTED; + } + public boolean hasUnimplemented() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Message.Reader getUnimplemented() { + assert which() == Message.Which.UNIMPLEMENTED: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Message.factory,0,null, 0); + } + + public final boolean isAbort() { + return which() == Message.Which.ABORT; + } + public boolean hasAbort() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Exception.Reader getAbort() { + assert which() == Message.Which.ABORT: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Exception.factory,0,null, 0); + } + + public final boolean isCall() { + return which() == Message.Which.CALL; + } + public boolean hasCall() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Call.Reader getCall() { + assert which() == Message.Which.CALL: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Call.factory,0,null, 0); + } + + public final boolean isReturn() { + return which() == Message.Which.RETURN; + } + public boolean hasReturn() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Return.Reader getReturn() { + assert which() == Message.Which.RETURN: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Return.factory,0,null, 0); + } + + public final boolean isFinish() { + return which() == Message.Which.FINISH; + } + public boolean hasFinish() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Finish.Reader getFinish() { + assert which() == Message.Which.FINISH: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Finish.factory,0,null, 0); + } + + public final boolean isResolve() { + return which() == Message.Which.RESOLVE; + } + public boolean hasResolve() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Resolve.Reader getResolve() { + assert which() == Message.Which.RESOLVE: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Resolve.factory,0,null, 0); + } + + public final boolean isRelease() { + return which() == Message.Which.RELEASE; + } + public boolean hasRelease() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Release.Reader getRelease() { + assert which() == Message.Which.RELEASE: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Release.factory,0,null, 0); + } + + public final boolean isObsoleteSave() { + return which() == Message.Which.OBSOLETE_SAVE; + } + public boolean hasObsoleteSave() { + if (which() != Message.Which.OBSOLETE_SAVE) return false; + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getObsoleteSave() { + assert which() == Message.Which.OBSOLETE_SAVE: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public final boolean isBootstrap() { + return which() == Message.Which.BOOTSTRAP; + } + public boolean hasBootstrap() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Bootstrap.Reader getBootstrap() { + assert which() == Message.Which.BOOTSTRAP: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Bootstrap.factory,0,null, 0); + } + + public final boolean isObsoleteDelete() { + return which() == Message.Which.OBSOLETE_DELETE; + } + public boolean hasObsoleteDelete() { + if (which() != Message.Which.OBSOLETE_DELETE) return false; + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getObsoleteDelete() { + assert which() == Message.Which.OBSOLETE_DELETE: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public final boolean isProvide() { + return which() == Message.Which.PROVIDE; + } + public boolean hasProvide() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Provide.Reader getProvide() { + assert which() == Message.Which.PROVIDE: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Provide.factory,0,null, 0); + } + + public final boolean isAccept() { + return which() == Message.Which.ACCEPT; + } + public boolean hasAccept() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Accept.Reader getAccept() { + assert which() == Message.Which.ACCEPT: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Accept.factory,0,null, 0); + } + + public final boolean isJoin() { + return which() == Message.Which.JOIN; + } + public boolean hasJoin() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Join.Reader getJoin() { + assert which() == Message.Which.JOIN: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Join.factory,0,null, 0); + } + + public final boolean isDisembargo() { + return which() == Message.Which.DISEMBARGO; + } + public boolean hasDisembargo() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Disembargo.Reader getDisembargo() { + assert which() == Message.Which.DISEMBARGO: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Disembargo.factory,0,null, 0); + } + + } + + public enum Which { + UNIMPLEMENTED, + ABORT, + CALL, + RETURN, + FINISH, + RESOLVE, + RELEASE, + OBSOLETE_SAVE, + BOOTSTRAP, + OBSOLETE_DELETE, + PROVIDE, + ACCEPT, + JOIN, + DISEMBARGO, + _NOT_IN_SCHEMA, + } + } + + + public static class Bootstrap { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Bootstrap.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getQuestionId() { + return _getIntField(0); + } + public final void setQuestionId(int value) { + _setIntField(0, value); + } + + public final boolean hasDeprecatedObjectId() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getDeprecatedObjectId() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initDeprecatedObjectId() { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initDeprecatedObjectId(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getQuestionId() { + return _getIntField(0); + } + + public boolean hasDeprecatedObjectId() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getDeprecatedObjectId() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + } + + } + + + public static class Call { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)3); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Call.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getQuestionId() { + return _getIntField(0); + } + public final void setQuestionId(int value) { + _setIntField(0, value); + } + + public final RpcProtocol.MessageTarget.Builder getTarget() { + return _getPointerField(RpcProtocol.MessageTarget.factory, 0, null, 0); + } + public final void setTarget(RpcProtocol.MessageTarget.Reader value) { + _setPointerField(RpcProtocol.MessageTarget.factory,0, value); + } + public final RpcProtocol.MessageTarget.Builder initTarget() { + return _initPointerField(RpcProtocol.MessageTarget.factory,0, 0); + } + public final long getInterfaceId() { + return _getLongField(1); + } + public final void setInterfaceId(long value) { + _setLongField(1, value); + } + + public final short getMethodId() { + return _getShortField(2); + } + public final void setMethodId(short value) { + _setShortField(2, value); + } + + public final RpcProtocol.Payload.Builder getParams() { + return _getPointerField(RpcProtocol.Payload.factory, 1, null, 0); + } + public final void setParams(RpcProtocol.Payload.Reader value) { + _setPointerField(RpcProtocol.Payload.factory,1, value); + } + public final RpcProtocol.Payload.Builder initParams() { + return _initPointerField(RpcProtocol.Payload.factory,1, 0); + } + public final SendResultsTo.Builder getSendResultsTo() { + return new Call.SendResultsTo.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final SendResultsTo.Builder initSendResultsTo() { + _setShortField(3,(short)0); + _clearPointerField(2); + return new Call.SendResultsTo.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean getAllowThirdPartyTailCall() { + return _getBooleanField(128); + } + public final void setAllowThirdPartyTailCall(boolean value) { + _setBooleanField(128, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getQuestionId() { + return _getIntField(0); + } + + public boolean hasTarget() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.MessageTarget.Reader getTarget() { + return _getPointerField(RpcProtocol.MessageTarget.factory,0,null, 0); + } + + public final long getInterfaceId() { + return _getLongField(1); + } + + public final short getMethodId() { + return _getShortField(2); + } + + public boolean hasParams() { + return !_pointerFieldIsNull(1); + } + public RpcProtocol.Payload.Reader getParams() { + return _getPointerField(RpcProtocol.Payload.factory,1,null, 0); + } + + public SendResultsTo.Reader getSendResultsTo() { + return new Call.SendResultsTo.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean getAllowThirdPartyTailCall() { + return _getBooleanField(128); + } + + } + + public static class SendResultsTo { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)3); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Call.SendResultsTo.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(3)) { + case 0 : return Which.CALLER; + case 1 : return Which.YOURSELF; + case 2 : return Which.THIRD_PARTY; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isCaller() { + return which() == Call.SendResultsTo.Which.CALLER; + } + public final org.capnproto.Void getCaller() { + assert which() == Call.SendResultsTo.Which.CALLER: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setCaller(org.capnproto.Void value) { + _setShortField(3, (short)Call.SendResultsTo.Which.CALLER.ordinal()); + } + + public final boolean isYourself() { + return which() == Call.SendResultsTo.Which.YOURSELF; + } + public final org.capnproto.Void getYourself() { + assert which() == Call.SendResultsTo.Which.YOURSELF: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setYourself(org.capnproto.Void value) { + _setShortField(3, (short)Call.SendResultsTo.Which.YOURSELF.ordinal()); + } + + public final boolean isThirdParty() { + return which() == Call.SendResultsTo.Which.THIRD_PARTY; + } + public final boolean hasThirdParty() { + return !_pointerFieldIsNull(2); + } + public org.capnproto.AnyPointer.Builder getThirdParty() { + assert which() == Call.SendResultsTo.Which.THIRD_PARTY: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 2); + } + public org.capnproto.AnyPointer.Builder initThirdParty() { + _setShortField(3, (short)Call.SendResultsTo.Which.THIRD_PARTY.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 2, 0); + } + public org.capnproto.AnyPointer.Builder initThirdParty(int size) { + _setShortField(3, (short)Call.SendResultsTo.Which.THIRD_PARTY.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 2, size); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(3)) { + case 0 : return Which.CALLER; + case 1 : return Which.YOURSELF; + case 2 : return Which.THIRD_PARTY; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isCaller() { + return which() == Call.SendResultsTo.Which.CALLER; + } + public final org.capnproto.Void getCaller() { + assert which() == Call.SendResultsTo.Which.CALLER: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isYourself() { + return which() == Call.SendResultsTo.Which.YOURSELF; + } + public final org.capnproto.Void getYourself() { + assert which() == Call.SendResultsTo.Which.YOURSELF: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isThirdParty() { + return which() == Call.SendResultsTo.Which.THIRD_PARTY; + } + public boolean hasThirdParty() { + if (which() != Call.SendResultsTo.Which.THIRD_PARTY) return false; + return !_pointerFieldIsNull(2); + } + public org.capnproto.AnyPointer.Reader getThirdParty() { + assert which() == Call.SendResultsTo.Which.THIRD_PARTY: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 2); + } + } + + public enum Which { + CALLER, + YOURSELF, + THIRD_PARTY, + _NOT_IN_SCHEMA, + } + } + + + } + + + public static class Return { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)2,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Return.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(3)) { + case 0 : return Which.RESULTS; + case 1 : return Which.EXCEPTION; + case 2 : return Which.CANCELED; + case 3 : return Which.RESULTS_SENT_ELSEWHERE; + case 4 : return Which.TAKE_FROM_OTHER_QUESTION; + case 5 : return Which.ACCEPT_FROM_THIRD_PARTY; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getAnswerId() { + return _getIntField(0); + } + public final void setAnswerId(int value) { + _setIntField(0, value); + } + + public final boolean getReleaseParamCaps() { + return _getBooleanField(32, (boolean)true); + } + public final void setReleaseParamCaps(boolean value) { + _setBooleanField(32, value, (boolean)true); + } + + public final boolean isResults() { + return which() == Return.Which.RESULTS; + } + public final RpcProtocol.Payload.Builder getResults() { + assert which() == Return.Which.RESULTS: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Payload.factory, 0, null, 0); + } + public final void setResults(RpcProtocol.Payload.Reader value) { + _setShortField(3, (short)Return.Which.RESULTS.ordinal()); + _setPointerField(RpcProtocol.Payload.factory,0, value); + } + public final RpcProtocol.Payload.Builder initResults() { + _setShortField(3, (short)Return.Which.RESULTS.ordinal()); + return _initPointerField(RpcProtocol.Payload.factory,0, 0); + } + public final boolean isException() { + return which() == Return.Which.EXCEPTION; + } + public final RpcProtocol.Exception.Builder getException() { + assert which() == Return.Which.EXCEPTION: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Exception.factory, 0, null, 0); + } + public final void setException(RpcProtocol.Exception.Reader value) { + _setShortField(3, (short)Return.Which.EXCEPTION.ordinal()); + _setPointerField(RpcProtocol.Exception.factory,0, value); + } + public final RpcProtocol.Exception.Builder initException() { + _setShortField(3, (short)Return.Which.EXCEPTION.ordinal()); + return _initPointerField(RpcProtocol.Exception.factory,0, 0); + } + public final boolean isCanceled() { + return which() == Return.Which.CANCELED; + } + public final org.capnproto.Void getCanceled() { + assert which() == Return.Which.CANCELED: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setCanceled(org.capnproto.Void value) { + _setShortField(3, (short)Return.Which.CANCELED.ordinal()); + } + + public final boolean isResultsSentElsewhere() { + return which() == Return.Which.RESULTS_SENT_ELSEWHERE; + } + public final org.capnproto.Void getResultsSentElsewhere() { + assert which() == Return.Which.RESULTS_SENT_ELSEWHERE: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setResultsSentElsewhere(org.capnproto.Void value) { + _setShortField(3, (short)Return.Which.RESULTS_SENT_ELSEWHERE.ordinal()); + } + + public final boolean isTakeFromOtherQuestion() { + return which() == Return.Which.TAKE_FROM_OTHER_QUESTION; + } + public final int getTakeFromOtherQuestion() { + assert which() == Return.Which.TAKE_FROM_OTHER_QUESTION: + "Must check which() before get()ing a union member."; + return _getIntField(2); + } + public final void setTakeFromOtherQuestion(int value) { + _setShortField(3, (short)Return.Which.TAKE_FROM_OTHER_QUESTION.ordinal()); + _setIntField(2, value); + } + + public final boolean isAcceptFromThirdParty() { + return which() == Return.Which.ACCEPT_FROM_THIRD_PARTY; + } + public final boolean hasAcceptFromThirdParty() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getAcceptFromThirdParty() { + assert which() == Return.Which.ACCEPT_FROM_THIRD_PARTY: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initAcceptFromThirdParty() { + _setShortField(3, (short)Return.Which.ACCEPT_FROM_THIRD_PARTY.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initAcceptFromThirdParty(int size) { + _setShortField(3, (short)Return.Which.ACCEPT_FROM_THIRD_PARTY.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(3)) { + case 0 : return Which.RESULTS; + case 1 : return Which.EXCEPTION; + case 2 : return Which.CANCELED; + case 3 : return Which.RESULTS_SENT_ELSEWHERE; + case 4 : return Which.TAKE_FROM_OTHER_QUESTION; + case 5 : return Which.ACCEPT_FROM_THIRD_PARTY; + default: return Which._NOT_IN_SCHEMA; + } + } + public final int getAnswerId() { + return _getIntField(0); + } + + public final boolean getReleaseParamCaps() { + return _getBooleanField(32, (boolean)true); + } + + public final boolean isResults() { + return which() == Return.Which.RESULTS; + } + public boolean hasResults() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Payload.Reader getResults() { + assert which() == Return.Which.RESULTS: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Payload.factory,0,null, 0); + } + + public final boolean isException() { + return which() == Return.Which.EXCEPTION; + } + public boolean hasException() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Exception.Reader getException() { + assert which() == Return.Which.EXCEPTION: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Exception.factory,0,null, 0); + } + + public final boolean isCanceled() { + return which() == Return.Which.CANCELED; + } + public final org.capnproto.Void getCanceled() { + assert which() == Return.Which.CANCELED: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isResultsSentElsewhere() { + return which() == Return.Which.RESULTS_SENT_ELSEWHERE; + } + public final org.capnproto.Void getResultsSentElsewhere() { + assert which() == Return.Which.RESULTS_SENT_ELSEWHERE: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isTakeFromOtherQuestion() { + return which() == Return.Which.TAKE_FROM_OTHER_QUESTION; + } + public final int getTakeFromOtherQuestion() { + assert which() == Return.Which.TAKE_FROM_OTHER_QUESTION: + "Must check which() before get()ing a union member."; + return _getIntField(2); + } + + public final boolean isAcceptFromThirdParty() { + return which() == Return.Which.ACCEPT_FROM_THIRD_PARTY; + } + public boolean hasAcceptFromThirdParty() { + if (which() != Return.Which.ACCEPT_FROM_THIRD_PARTY) return false; + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getAcceptFromThirdParty() { + assert which() == Return.Which.ACCEPT_FROM_THIRD_PARTY: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + } + + public enum Which { + RESULTS, + EXCEPTION, + CANCELED, + RESULTS_SENT_ELSEWHERE, + TAKE_FROM_OTHER_QUESTION, + ACCEPT_FROM_THIRD_PARTY, + _NOT_IN_SCHEMA, + } + } + + + public static class Finish { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Finish.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getQuestionId() { + return _getIntField(0); + } + public final void setQuestionId(int value) { + _setIntField(0, value); + } + + public final boolean getReleaseResultCaps() { + return _getBooleanField(32, (boolean)true); + } + public final void setReleaseResultCaps(boolean value) { + _setBooleanField(32, value, (boolean)true); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getQuestionId() { + return _getIntField(0); + } + + public final boolean getReleaseResultCaps() { + return _getBooleanField(32, (boolean)true); + } + + } + + } + + + public static class Resolve { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Resolve.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(2)) { + case 0 : return Which.CAP; + case 1 : return Which.EXCEPTION; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getPromiseId() { + return _getIntField(0); + } + public final void setPromiseId(int value) { + _setIntField(0, value); + } + + public final boolean isCap() { + return which() == Resolve.Which.CAP; + } + public final RpcProtocol.CapDescriptor.Builder getCap() { + assert which() == Resolve.Which.CAP: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.CapDescriptor.factory, 0, null, 0); + } + public final void setCap(RpcProtocol.CapDescriptor.Reader value) { + _setShortField(2, (short)Resolve.Which.CAP.ordinal()); + _setPointerField(RpcProtocol.CapDescriptor.factory,0, value); + } + public final RpcProtocol.CapDescriptor.Builder initCap() { + _setShortField(2, (short)Resolve.Which.CAP.ordinal()); + return _initPointerField(RpcProtocol.CapDescriptor.factory,0, 0); + } + public final boolean isException() { + return which() == Resolve.Which.EXCEPTION; + } + public final RpcProtocol.Exception.Builder getException() { + assert which() == Resolve.Which.EXCEPTION: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Exception.factory, 0, null, 0); + } + public final void setException(RpcProtocol.Exception.Reader value) { + _setShortField(2, (short)Resolve.Which.EXCEPTION.ordinal()); + _setPointerField(RpcProtocol.Exception.factory,0, value); + } + public final RpcProtocol.Exception.Builder initException() { + _setShortField(2, (short)Resolve.Which.EXCEPTION.ordinal()); + return _initPointerField(RpcProtocol.Exception.factory,0, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(2)) { + case 0 : return Which.CAP; + case 1 : return Which.EXCEPTION; + default: return Which._NOT_IN_SCHEMA; + } + } + public final int getPromiseId() { + return _getIntField(0); + } + + public final boolean isCap() { + return which() == Resolve.Which.CAP; + } + public boolean hasCap() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.CapDescriptor.Reader getCap() { + assert which() == Resolve.Which.CAP: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.CapDescriptor.factory,0,null, 0); + } + + public final boolean isException() { + return which() == Resolve.Which.EXCEPTION; + } + public boolean hasException() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.Exception.Reader getException() { + assert which() == Resolve.Which.EXCEPTION: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.Exception.factory,0,null, 0); + } + + } + + public enum Which { + CAP, + EXCEPTION, + _NOT_IN_SCHEMA, + } + } + + + public static class Release { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Release.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getId() { + return _getIntField(0); + } + public final void setId(int value) { + _setIntField(0, value); + } + + public final int getReferenceCount() { + return _getIntField(1); + } + public final void setReferenceCount(int value) { + _setIntField(1, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getId() { + return _getIntField(0); + } + + public final int getReferenceCount() { + return _getIntField(1); + } + + } + + } + + + public static class Disembargo { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Disembargo.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final RpcProtocol.MessageTarget.Builder getTarget() { + return _getPointerField(RpcProtocol.MessageTarget.factory, 0, null, 0); + } + public final void setTarget(RpcProtocol.MessageTarget.Reader value) { + _setPointerField(RpcProtocol.MessageTarget.factory,0, value); + } + public final RpcProtocol.MessageTarget.Builder initTarget() { + return _initPointerField(RpcProtocol.MessageTarget.factory,0, 0); + } + public final Context.Builder getContext() { + return new Disembargo.Context.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Context.Builder initContext() { + _setIntField(0,0); + _setShortField(2,(short)0); + return new Disembargo.Context.Builder(segment, data, pointers, dataSize, pointerCount); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasTarget() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.MessageTarget.Reader getTarget() { + return _getPointerField(RpcProtocol.MessageTarget.factory,0,null, 0); + } + + public Context.Reader getContext() { + return new Disembargo.Context.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + } + + public static class Context { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Disembargo.Context.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(2)) { + case 0 : return Which.SENDER_LOOPBACK; + case 1 : return Which.RECEIVER_LOOPBACK; + case 2 : return Which.ACCEPT; + case 3 : return Which.PROVIDE; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isSenderLoopback() { + return which() == Disembargo.Context.Which.SENDER_LOOPBACK; + } + public final int getSenderLoopback() { + assert which() == Disembargo.Context.Which.SENDER_LOOPBACK: + "Must check which() before get()ing a union member."; + return _getIntField(0); + } + public final void setSenderLoopback(int value) { + _setShortField(2, (short)Disembargo.Context.Which.SENDER_LOOPBACK.ordinal()); + _setIntField(0, value); + } + + public final boolean isReceiverLoopback() { + return which() == Disembargo.Context.Which.RECEIVER_LOOPBACK; + } + public final int getReceiverLoopback() { + assert which() == Disembargo.Context.Which.RECEIVER_LOOPBACK: + "Must check which() before get()ing a union member."; + return _getIntField(0); + } + public final void setReceiverLoopback(int value) { + _setShortField(2, (short)Disembargo.Context.Which.RECEIVER_LOOPBACK.ordinal()); + _setIntField(0, value); + } + + public final boolean isAccept() { + return which() == Disembargo.Context.Which.ACCEPT; + } + public final org.capnproto.Void getAccept() { + assert which() == Disembargo.Context.Which.ACCEPT: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setAccept(org.capnproto.Void value) { + _setShortField(2, (short)Disembargo.Context.Which.ACCEPT.ordinal()); + } + + public final boolean isProvide() { + return which() == Disembargo.Context.Which.PROVIDE; + } + public final int getProvide() { + assert which() == Disembargo.Context.Which.PROVIDE: + "Must check which() before get()ing a union member."; + return _getIntField(0); + } + public final void setProvide(int value) { + _setShortField(2, (short)Disembargo.Context.Which.PROVIDE.ordinal()); + _setIntField(0, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(2)) { + case 0 : return Which.SENDER_LOOPBACK; + case 1 : return Which.RECEIVER_LOOPBACK; + case 2 : return Which.ACCEPT; + case 3 : return Which.PROVIDE; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isSenderLoopback() { + return which() == Disembargo.Context.Which.SENDER_LOOPBACK; + } + public final int getSenderLoopback() { + assert which() == Disembargo.Context.Which.SENDER_LOOPBACK: + "Must check which() before get()ing a union member."; + return _getIntField(0); + } + + public final boolean isReceiverLoopback() { + return which() == Disembargo.Context.Which.RECEIVER_LOOPBACK; + } + public final int getReceiverLoopback() { + assert which() == Disembargo.Context.Which.RECEIVER_LOOPBACK: + "Must check which() before get()ing a union member."; + return _getIntField(0); + } + + public final boolean isAccept() { + return which() == Disembargo.Context.Which.ACCEPT; + } + public final org.capnproto.Void getAccept() { + assert which() == Disembargo.Context.Which.ACCEPT: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isProvide() { + return which() == Disembargo.Context.Which.PROVIDE; + } + public final int getProvide() { + assert which() == Disembargo.Context.Which.PROVIDE: + "Must check which() before get()ing a union member."; + return _getIntField(0); + } + + } + + public enum Which { + SENDER_LOOPBACK, + RECEIVER_LOOPBACK, + ACCEPT, + PROVIDE, + _NOT_IN_SCHEMA, + } + } + + + } + + + public static class Provide { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Provide.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getQuestionId() { + return _getIntField(0); + } + public final void setQuestionId(int value) { + _setIntField(0, value); + } + + public final RpcProtocol.MessageTarget.Builder getTarget() { + return _getPointerField(RpcProtocol.MessageTarget.factory, 0, null, 0); + } + public final void setTarget(RpcProtocol.MessageTarget.Reader value) { + _setPointerField(RpcProtocol.MessageTarget.factory,0, value); + } + public final RpcProtocol.MessageTarget.Builder initTarget() { + return _initPointerField(RpcProtocol.MessageTarget.factory,0, 0); + } + public final boolean hasRecipient() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.AnyPointer.Builder getRecipient() { + return _getPointerField(org.capnproto.AnyPointer.factory, 1); + } + public org.capnproto.AnyPointer.Builder initRecipient() { + return _initPointerField(org.capnproto.AnyPointer.factory, 1, 0); + } + public org.capnproto.AnyPointer.Builder initRecipient(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 1, size); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getQuestionId() { + return _getIntField(0); + } + + public boolean hasTarget() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.MessageTarget.Reader getTarget() { + return _getPointerField(RpcProtocol.MessageTarget.factory,0,null, 0); + } + + public boolean hasRecipient() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.AnyPointer.Reader getRecipient() { + return _getPointerField(org.capnproto.AnyPointer.factory, 1); + } + } + + } + + + public static class Accept { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Accept.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getQuestionId() { + return _getIntField(0); + } + public final void setQuestionId(int value) { + _setIntField(0, value); + } + + public final boolean hasProvision() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getProvision() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initProvision() { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initProvision(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + public final boolean getEmbargo() { + return _getBooleanField(32); + } + public final void setEmbargo(boolean value) { + _setBooleanField(32, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getQuestionId() { + return _getIntField(0); + } + + public boolean hasProvision() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getProvision() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public final boolean getEmbargo() { + return _getBooleanField(32); + } + + } + + } + + + public static class Join { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Join.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getQuestionId() { + return _getIntField(0); + } + public final void setQuestionId(int value) { + _setIntField(0, value); + } + + public final RpcProtocol.MessageTarget.Builder getTarget() { + return _getPointerField(RpcProtocol.MessageTarget.factory, 0, null, 0); + } + public final void setTarget(RpcProtocol.MessageTarget.Reader value) { + _setPointerField(RpcProtocol.MessageTarget.factory,0, value); + } + public final RpcProtocol.MessageTarget.Builder initTarget() { + return _initPointerField(RpcProtocol.MessageTarget.factory,0, 0); + } + public final boolean hasKeyPart() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.AnyPointer.Builder getKeyPart() { + return _getPointerField(org.capnproto.AnyPointer.factory, 1); + } + public org.capnproto.AnyPointer.Builder initKeyPart() { + return _initPointerField(org.capnproto.AnyPointer.factory, 1, 0); + } + public org.capnproto.AnyPointer.Builder initKeyPart(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 1, size); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getQuestionId() { + return _getIntField(0); + } + + public boolean hasTarget() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.MessageTarget.Reader getTarget() { + return _getPointerField(RpcProtocol.MessageTarget.factory,0,null, 0); + } + + public boolean hasKeyPart() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.AnyPointer.Reader getKeyPart() { + return _getPointerField(org.capnproto.AnyPointer.factory, 1); + } + } + + } + + + public static class MessageTarget { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return MessageTarget.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(2)) { + case 0 : return Which.IMPORTED_CAP; + case 1 : return Which.PROMISED_ANSWER; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isImportedCap() { + return which() == MessageTarget.Which.IMPORTED_CAP; + } + public final int getImportedCap() { + assert which() == MessageTarget.Which.IMPORTED_CAP: + "Must check which() before get()ing a union member."; + return _getIntField(0); + } + public final void setImportedCap(int value) { + _setShortField(2, (short)MessageTarget.Which.IMPORTED_CAP.ordinal()); + _setIntField(0, value); + } + + public final boolean isPromisedAnswer() { + return which() == MessageTarget.Which.PROMISED_ANSWER; + } + public final RpcProtocol.PromisedAnswer.Builder getPromisedAnswer() { + assert which() == MessageTarget.Which.PROMISED_ANSWER: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.PromisedAnswer.factory, 0, null, 0); + } + public final void setPromisedAnswer(RpcProtocol.PromisedAnswer.Reader value) { + _setShortField(2, (short)MessageTarget.Which.PROMISED_ANSWER.ordinal()); + _setPointerField(RpcProtocol.PromisedAnswer.factory,0, value); + } + public final RpcProtocol.PromisedAnswer.Builder initPromisedAnswer() { + _setShortField(2, (short)MessageTarget.Which.PROMISED_ANSWER.ordinal()); + return _initPointerField(RpcProtocol.PromisedAnswer.factory,0, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(2)) { + case 0 : return Which.IMPORTED_CAP; + case 1 : return Which.PROMISED_ANSWER; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isImportedCap() { + return which() == MessageTarget.Which.IMPORTED_CAP; + } + public final int getImportedCap() { + assert which() == MessageTarget.Which.IMPORTED_CAP: + "Must check which() before get()ing a union member."; + return _getIntField(0); + } + + public final boolean isPromisedAnswer() { + return which() == MessageTarget.Which.PROMISED_ANSWER; + } + public boolean hasPromisedAnswer() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.PromisedAnswer.Reader getPromisedAnswer() { + assert which() == MessageTarget.Which.PROMISED_ANSWER: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.PromisedAnswer.factory,0,null, 0); + } + + } + + public enum Which { + IMPORTED_CAP, + PROMISED_ANSWER, + _NOT_IN_SCHEMA, + } + } + + + public static class Payload { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)2); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Payload.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasContent() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getContent() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initContent() { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initContent(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + public final boolean hasCapTable() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Builder getCapTable() { + return _getPointerField(RpcProtocol.CapDescriptor.listFactory, 1, null, 0); + } + public final void setCapTable(org.capnproto.StructList.Reader value) { + _setPointerField(RpcProtocol.CapDescriptor.listFactory, 1, value); + } + public final org.capnproto.StructList.Builder initCapTable(int size) { + return _initPointerField(RpcProtocol.CapDescriptor.listFactory, 1, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasContent() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getContent() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public final boolean hasCapTable() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Reader getCapTable() { + return _getPointerField(RpcProtocol.CapDescriptor.listFactory, 1, null, 0); + } + + } + + } + + + public static class CapDescriptor { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return CapDescriptor.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.NONE; + case 1 : return Which.SENDER_HOSTED; + case 2 : return Which.SENDER_PROMISE; + case 3 : return Which.RECEIVER_HOSTED; + case 4 : return Which.RECEIVER_ANSWER; + case 5 : return Which.THIRD_PARTY_HOSTED; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isNone() { + return which() == CapDescriptor.Which.NONE; + } + public final org.capnproto.Void getNone() { + assert which() == CapDescriptor.Which.NONE: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setNone(org.capnproto.Void value) { + _setShortField(0, (short)CapDescriptor.Which.NONE.ordinal()); + } + + public final boolean isSenderHosted() { + return which() == CapDescriptor.Which.SENDER_HOSTED; + } + public final int getSenderHosted() { + assert which() == CapDescriptor.Which.SENDER_HOSTED: + "Must check which() before get()ing a union member."; + return _getIntField(1); + } + public final void setSenderHosted(int value) { + _setShortField(0, (short)CapDescriptor.Which.SENDER_HOSTED.ordinal()); + _setIntField(1, value); + } + + public final boolean isSenderPromise() { + return which() == CapDescriptor.Which.SENDER_PROMISE; + } + public final int getSenderPromise() { + assert which() == CapDescriptor.Which.SENDER_PROMISE: + "Must check which() before get()ing a union member."; + return _getIntField(1); + } + public final void setSenderPromise(int value) { + _setShortField(0, (short)CapDescriptor.Which.SENDER_PROMISE.ordinal()); + _setIntField(1, value); + } + + public final boolean isReceiverHosted() { + return which() == CapDescriptor.Which.RECEIVER_HOSTED; + } + public final int getReceiverHosted() { + assert which() == CapDescriptor.Which.RECEIVER_HOSTED: + "Must check which() before get()ing a union member."; + return _getIntField(1); + } + public final void setReceiverHosted(int value) { + _setShortField(0, (short)CapDescriptor.Which.RECEIVER_HOSTED.ordinal()); + _setIntField(1, value); + } + + public final boolean isReceiverAnswer() { + return which() == CapDescriptor.Which.RECEIVER_ANSWER; + } + public final RpcProtocol.PromisedAnswer.Builder getReceiverAnswer() { + assert which() == CapDescriptor.Which.RECEIVER_ANSWER: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.PromisedAnswer.factory, 0, null, 0); + } + public final void setReceiverAnswer(RpcProtocol.PromisedAnswer.Reader value) { + _setShortField(0, (short)CapDescriptor.Which.RECEIVER_ANSWER.ordinal()); + _setPointerField(RpcProtocol.PromisedAnswer.factory,0, value); + } + public final RpcProtocol.PromisedAnswer.Builder initReceiverAnswer() { + _setShortField(0, (short)CapDescriptor.Which.RECEIVER_ANSWER.ordinal()); + return _initPointerField(RpcProtocol.PromisedAnswer.factory,0, 0); + } + public final boolean isThirdPartyHosted() { + return which() == CapDescriptor.Which.THIRD_PARTY_HOSTED; + } + public final RpcProtocol.ThirdPartyCapDescriptor.Builder getThirdPartyHosted() { + assert which() == CapDescriptor.Which.THIRD_PARTY_HOSTED: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.ThirdPartyCapDescriptor.factory, 0, null, 0); + } + public final void setThirdPartyHosted(RpcProtocol.ThirdPartyCapDescriptor.Reader value) { + _setShortField(0, (short)CapDescriptor.Which.THIRD_PARTY_HOSTED.ordinal()); + _setPointerField(RpcProtocol.ThirdPartyCapDescriptor.factory,0, value); + } + public final RpcProtocol.ThirdPartyCapDescriptor.Builder initThirdPartyHosted() { + _setShortField(0, (short)CapDescriptor.Which.THIRD_PARTY_HOSTED.ordinal()); + return _initPointerField(RpcProtocol.ThirdPartyCapDescriptor.factory,0, 0); + } + public final byte getAttachedFd() { + return _getByteField(2, (byte)-1); + } + public final void setAttachedFd(byte value) { + _setByteField(2, value, (byte)-1); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.NONE; + case 1 : return Which.SENDER_HOSTED; + case 2 : return Which.SENDER_PROMISE; + case 3 : return Which.RECEIVER_HOSTED; + case 4 : return Which.RECEIVER_ANSWER; + case 5 : return Which.THIRD_PARTY_HOSTED; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isNone() { + return which() == CapDescriptor.Which.NONE; + } + public final org.capnproto.Void getNone() { + assert which() == CapDescriptor.Which.NONE: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isSenderHosted() { + return which() == CapDescriptor.Which.SENDER_HOSTED; + } + public final int getSenderHosted() { + assert which() == CapDescriptor.Which.SENDER_HOSTED: + "Must check which() before get()ing a union member."; + return _getIntField(1); + } + + public final boolean isSenderPromise() { + return which() == CapDescriptor.Which.SENDER_PROMISE; + } + public final int getSenderPromise() { + assert which() == CapDescriptor.Which.SENDER_PROMISE: + "Must check which() before get()ing a union member."; + return _getIntField(1); + } + + public final boolean isReceiverHosted() { + return which() == CapDescriptor.Which.RECEIVER_HOSTED; + } + public final int getReceiverHosted() { + assert which() == CapDescriptor.Which.RECEIVER_HOSTED: + "Must check which() before get()ing a union member."; + return _getIntField(1); + } + + public final boolean isReceiverAnswer() { + return which() == CapDescriptor.Which.RECEIVER_ANSWER; + } + public boolean hasReceiverAnswer() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.PromisedAnswer.Reader getReceiverAnswer() { + assert which() == CapDescriptor.Which.RECEIVER_ANSWER: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.PromisedAnswer.factory,0,null, 0); + } + + public final boolean isThirdPartyHosted() { + return which() == CapDescriptor.Which.THIRD_PARTY_HOSTED; + } + public boolean hasThirdPartyHosted() { + return !_pointerFieldIsNull(0); + } + public RpcProtocol.ThirdPartyCapDescriptor.Reader getThirdPartyHosted() { + assert which() == CapDescriptor.Which.THIRD_PARTY_HOSTED: + "Must check which() before get()ing a union member."; + return _getPointerField(RpcProtocol.ThirdPartyCapDescriptor.factory,0,null, 0); + } + + public final byte getAttachedFd() { + return _getByteField(2, (byte)-1); + } + + } + + public enum Which { + NONE, + SENDER_HOSTED, + SENDER_PROMISE, + RECEIVER_HOSTED, + RECEIVER_ANSWER, + THIRD_PARTY_HOSTED, + _NOT_IN_SCHEMA, + } + } + + + public static class PromisedAnswer { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return PromisedAnswer.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getQuestionId() { + return _getIntField(0); + } + public final void setQuestionId(int value) { + _setIntField(0, value); + } + + public final boolean hasTransform() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.StructList.Builder getTransform() { + return _getPointerField(RpcProtocol.PromisedAnswer.Op.listFactory, 0, null, 0); + } + public final void setTransform(org.capnproto.StructList.Reader value) { + _setPointerField(RpcProtocol.PromisedAnswer.Op.listFactory, 0, value); + } + public final org.capnproto.StructList.Builder initTransform(int size) { + return _initPointerField(RpcProtocol.PromisedAnswer.Op.listFactory, 0, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getQuestionId() { + return _getIntField(0); + } + + public final boolean hasTransform() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.StructList.Reader getTransform() { + return _getPointerField(RpcProtocol.PromisedAnswer.Op.listFactory, 0, null, 0); + } + + } + + public static class Op { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return PromisedAnswer.Op.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.NOOP; + case 1 : return Which.GET_POINTER_FIELD; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isNoop() { + return which() == PromisedAnswer.Op.Which.NOOP; + } + public final org.capnproto.Void getNoop() { + assert which() == PromisedAnswer.Op.Which.NOOP: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setNoop(org.capnproto.Void value) { + _setShortField(0, (short)PromisedAnswer.Op.Which.NOOP.ordinal()); + } + + public final boolean isGetPointerField() { + return which() == PromisedAnswer.Op.Which.GET_POINTER_FIELD; + } + public final short getGetPointerField() { + assert which() == PromisedAnswer.Op.Which.GET_POINTER_FIELD: + "Must check which() before get()ing a union member."; + return _getShortField(1); + } + public final void setGetPointerField(short value) { + _setShortField(0, (short)PromisedAnswer.Op.Which.GET_POINTER_FIELD.ordinal()); + _setShortField(1, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.NOOP; + case 1 : return Which.GET_POINTER_FIELD; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isNoop() { + return which() == PromisedAnswer.Op.Which.NOOP; + } + public final org.capnproto.Void getNoop() { + assert which() == PromisedAnswer.Op.Which.NOOP: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isGetPointerField() { + return which() == PromisedAnswer.Op.Which.GET_POINTER_FIELD; + } + public final short getGetPointerField() { + assert which() == PromisedAnswer.Op.Which.GET_POINTER_FIELD: + "Must check which() before get()ing a union member."; + return _getShortField(1); + } + + } + + public enum Which { + NOOP, + GET_POINTER_FIELD, + _NOT_IN_SCHEMA, + } + } + + + } + + + public static class ThirdPartyCapDescriptor { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return ThirdPartyCapDescriptor.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasId() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getId() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initId() { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initId(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + public final int getVineId() { + return _getIntField(0); + } + public final void setVineId(int value) { + _setIntField(0, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasId() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getId() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public final int getVineId() { + return _getIntField(0); + } + + } + + } + + + public static class Exception { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Exception.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasReason() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getReason() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setReason(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setReason(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initReason(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + public final boolean getObsoleteIsCallersFault() { + return _getBooleanField(0); + } + public final void setObsoleteIsCallersFault(boolean value) { + _setBooleanField(0, value); + } + + public final short getObsoleteDurability() { + return _getShortField(1); + } + public final void setObsoleteDurability(short value) { + _setShortField(1, value); + } + + public final RpcProtocol.Exception.Type getType() { + switch(_getShortField(2)) { + case 0 : return RpcProtocol.Exception.Type.FAILED; + case 1 : return RpcProtocol.Exception.Type.OVERLOADED; + case 2 : return RpcProtocol.Exception.Type.DISCONNECTED; + case 3 : return RpcProtocol.Exception.Type.UNIMPLEMENTED; + default: return RpcProtocol.Exception.Type._NOT_IN_SCHEMA; + } + } + public final void setType(RpcProtocol.Exception.Type value) { + _setShortField(2, (short)value.ordinal()); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasReason() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getReason() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + public final boolean getObsoleteIsCallersFault() { + return _getBooleanField(0); + } + + public final short getObsoleteDurability() { + return _getShortField(1); + } + + public final RpcProtocol.Exception.Type getType() { + switch(_getShortField(2)) { + case 0 : return RpcProtocol.Exception.Type.FAILED; + case 1 : return RpcProtocol.Exception.Type.OVERLOADED; + case 2 : return RpcProtocol.Exception.Type.DISCONNECTED; + case 3 : return RpcProtocol.Exception.Type.UNIMPLEMENTED; + default: return RpcProtocol.Exception.Type._NOT_IN_SCHEMA; + } + } + + } + + public enum Type { + FAILED, + OVERLOADED, + DISCONNECTED, + UNIMPLEMENTED, + _NOT_IN_SCHEMA, + } + + } + + + +public static final class Schemas { +public static final org.capnproto.SegmentReader b_91b79f1f808db032 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0032\u00b0\u008d\u0080\u001f\u009f\u00b7\u0091" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u000e\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0000\u0000\u0000\u0017\u0003\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u004d\u0065\u0073\u0073\u0061\u0067\u0065\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0038\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0079\u0001\u0000\u0000\u0072\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0078\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0084\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0081\u0001\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u007c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0088\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0085\u0001\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0080\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u008c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0004\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0089\u0001\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0084\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0090\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u00fb\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u008d\u0001\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0088\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0094\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u00fa\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0091\u0001\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u008c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0098\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0007\u0000\u00f9\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0095\u0001\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0090\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u009c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0009\u0000\u00f8\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0099\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0098\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00a4\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u00f7\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00a1\u0001\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00a0\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00ac\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\n\u0000\u00f6\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00a9\u0001\u0000\u0000\u007a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00a8\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00b4\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000b\u0000\u00f5\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b1\u0001\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00ac\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00b8\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000c\u0000\u00f4\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b5\u0001\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b0\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00bc\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\r\u0000\u00f3\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000c\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b9\u0001\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b4\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00c0\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0008\u0000\u00f2\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\r\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00bd\u0001\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00bc\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00c8\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0075\u006e\u0069\u006d\u0070\u006c\u0065\u006d" + + "\u0065\u006e\u0074\u0065\u0064\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0032\u00b0\u008d\u0080\u001f\u009f\u00b7\u0091" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0062\u006f\u0072\u0074\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u006c\u006c\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d4\u004c\u009d\u0078\u00ce\u0053\u006a\u0083" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0074\u0075\u0072\u006e\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u003a\u0057\u00b3\u003d\u008d\u00b2\u0019\u009e" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0069\u006e\u0069\u0073\u0068\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u000e\u00f8\u00c2\u00b2\u002e\u007d\u00d3" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0073\u006f\u006c\u0076\u0065\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006e\u0008\u0089\u00fa\u0055\u0096\u00c2\u00bb" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u006c\u0065\u0061\u0073\u0065\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0097\u0074\u00d0\u007d\r\u006c\u001a\u00ad" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006f\u0062\u0073\u006f\u006c\u0065\u0074\u0065" + + "\u0053\u0061\u0076\u0065\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0062\u006f\u006f\u0074\u0073\u0074\u0072\u0061" + + "\u0070\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c4\u006e\u0017\u0031\u0080\u00cf\u004c\u00e9" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006f\u0062\u0073\u006f\u006c\u0065\u0074\u0065" + + "\u0044\u0065\u006c\u0065\u0074\u0065\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0072\u006f\u0076\u0069\u0064\u0065\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u005a\u00ac\u00c1\u00fb\u006b\u0004\u006a\u009c" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0063\u0063\u0065\u0070\u0074\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0016\u0040\u0055\u0090\u0062\u00b5\u00c9\u00d4" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006a\u006f\u0069\u006e\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00af\u0001\u00e0\u0090\u0004\u0098\u00e1\u00fb" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0069\u0073\u0065\u006d\u0062\u0061\u0072" + + "\u0067\u006f\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0011\u0037\u00bd\u000f\u008b\u0036\u0064\u00f9" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_e94ccf8031176ec4 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00c4\u006e\u0017\u0031\u0080\u00cf\u004c\u00e9" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00d2\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0042\u006f\u006f\u0074\u0073\u0074\u0072\u0061" + + "\u0070\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u009a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0034\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0040\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + + "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0065\u0070\u0072\u0065\u0063\u0061\u0074" + + "\u0065\u0064\u004f\u0062\u006a\u0065\u0063\u0074" + + "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_836a53ce789d4cd4 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00d4\u004c\u009d\u0078\u00ce\u0053\u006a\u0083" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00aa\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0043\u0061\u006c\u006c\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u001c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b5\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00c0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00bd\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00c4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c1\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00cc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c9\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00d4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d1\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00cc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00d8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0099\u005f\u00ab\u001a\u00f6\u00b0\u00e8\u00da" + + "\u00d5\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0080\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c1\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00d0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + + "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c1\u00fb\u0013\u0058\u0054\u0014\u00bc\u0095" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0074\u0065\u0072\u0066\u0061\u0063" + + "\u0065\u0049\u0064\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006d\u0065\u0074\u0068\u006f\u0064\u0049\u0064" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0061\u0072\u0061\u006d\u0073\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u003b\u0074\u0096\u003d\"\u0061\u000e\u009a" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u0065\u006e\u0064\u0052\u0065\u0073\u0075" + + "\u006c\u0074\u0073\u0054\u006f\u0000\u0000\u0000" + + "\u0061\u006c\u006c\u006f\u0077\u0054\u0068\u0069" + + "\u0072\u0064\u0050\u0061\u0072\u0074\u0079\u0054" + + "\u0061\u0069\u006c\u0043\u0061\u006c\u006c\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_dae8b0f61aab5f99 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0099\u005f\u00ab\u001a\u00f6\u00b0\u00e8\u00da" + + "\u0015\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u00d4\u004c\u009d\u0078\u00ce\u0053\u006a\u0083" + + "\u0003\u0000\u0007\u0000\u0001\u0000\u0003\u0000" + + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u001a\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0043\u0061\u006c\u006c\u002e\u0073\u0065\u006e" + + "\u0064\u0052\u0065\u0073\u0075\u006c\u0074\u0073" + + "\u0054\u006f\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u00fd\u00ff\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0050\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\\\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0063\u0061\u006c\u006c\u0065\u0072\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0079\u006f\u0075\u0072\u0073\u0065\u006c\u0066" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0068\u0069\u0072\u0064\u0050\u0061\u0072" + + "\u0074\u0079\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_9e19b28d3db3573a = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u003a\u0057\u00b3\u003d\u008d\u00b2\u0019\u009e" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0006\u0000" + + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ba\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0000\u0000\u0000\u00c7\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0052\u0065\u0074\u0075\u0072\u006e\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0020\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d1\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00dc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0020\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d9\u0000\u0000\u0000\u008a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00dc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00e8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e5\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00ec\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e9\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00f4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0004\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00f1\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00f0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00fc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00f9\u0000\u0000\u0000\u00aa\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00fc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0008\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u00fb\u00ff\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0005\u0001\u0000\u0000\u00b2\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0007\u0000\u00fa\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0011\u0001\u0000\u0000\u00aa\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0014\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0020\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0061\u006e\u0073\u0077\u0065\u0072\u0049\u0064" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u006c\u0065\u0061\u0073\u0065\u0050" + + "\u0061\u0072\u0061\u006d\u0043\u0061\u0070\u0073" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0073\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u003b\u0074\u0096\u003d\"\u0061\u000e\u009a" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u0078\u0063\u0065\u0070\u0074\u0069\u006f" + + "\u006e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u006e\u0063\u0065\u006c\u0065\u0064" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0073\u0053" + + "\u0065\u006e\u0074\u0045\u006c\u0073\u0065\u0077" + + "\u0068\u0065\u0072\u0065\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u006b\u0065\u0046\u0072\u006f\u006d" + + "\u004f\u0074\u0068\u0065\u0072\u0051\u0075\u0065" + + "\u0073\u0074\u0069\u006f\u006e\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0063\u0063\u0065\u0070\u0074\u0046\u0072" + + "\u006f\u006d\u0054\u0068\u0069\u0072\u0064\u0050" + + "\u0061\u0072\u0074\u0079\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_d37d2eb2c2f80e63 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0063\u000e\u00f8\u00c2\u00b2\u002e\u007d\u00d3" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ba\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0046\u0069\u006e\u0069\u0073\u0068\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0020\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0092\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0034\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0040\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + + "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u006c\u0065\u0061\u0073\u0065\u0052" + + "\u0065\u0073\u0075\u006c\u0074\u0043\u0061\u0070" + + "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_bbc29655fa89086e = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u006e\u0008\u0089\u00fa\u0055\u0096\u00c2\u00bb" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0052\u0065\u0073\u006f\u006c\u0076\u0065\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u0000\u0000\u0000\"\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0050\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\\\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0070\u0072\u006f\u006d\u0069\u0073\u0065\u0049" + + "\u0064\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b0\u00b8\u0086\u000b\u00c4\u00dd\u0023\u0085" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u0078\u0063\u0065\u0070\u0074\u0069\u006f" + + "\u006e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_ad1a6c0d7dd07497 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0097\u0074\u00d0\u007d\r\u006c\u001a\u00ad" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0052\u0065\u006c\u0065\u0061\u0073\u0065\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0038\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0066\u0065\u0072\u0065\u006e\u0063" + + "\u0065\u0043\u006f\u0075\u006e\u0074\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_f964368b0fbd3711 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0011\u0037\u00bd\u000f\u008b\u0036\u0064\u00f9" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00da\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0044\u0069\u0073\u0065\u006d\u0062\u0061\u0072" + + "\u0067\u006f\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u00dd\u005b\u0065\u00df\u00b4\u0062\u00d5" + + "\u002d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c1\u00fb\u0013\u0058\u0054\u0014\u00bc\u0095" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u006f\u006e\u0074\u0065\u0078\u0074\u0000" + ""); +public static final org.capnproto.SegmentReader b_d562b4df655bdd4d = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u004d\u00dd\u005b\u0065\u00df\u00b4\u0062\u00d5" + + "\u001b\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0011\u0037\u00bd\u000f\u008b\u0036\u0064\u00f9" + + "\u0001\u0000\u0007\u0000\u0001\u0000\u0004\u0000" + + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u001a\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0044\u0069\u0073\u0065\u006d\u0062\u0061\u0072" + + "\u0067\u006f\u002e\u0063\u006f\u006e\u0074\u0065" + + "\u0078\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0060\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u006c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u0000\u0000\u0000\u008a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0078\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0075\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u007c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0079\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0080\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0073\u0065\u006e\u0064\u0065\u0072\u004c\u006f" + + "\u006f\u0070\u0062\u0061\u0063\u006b\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0063\u0065\u0069\u0076\u0065\u0072" + + "\u004c\u006f\u006f\u0070\u0062\u0061\u0063\u006b" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0063\u0063\u0065\u0070\u0074\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0072\u006f\u0076\u0069\u0064\u0065\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_9c6a046bfbc1ac5a = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u005a\u00ac\u00c1\u00fb\u006b\u0004\u006a\u009c" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0050\u0072\u006f\u0076\u0069\u0064\u0065\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0050\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\\\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + + "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c1\u00fb\u0013\u0058\u0054\u0014\u00bc\u0095" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0063\u0069\u0070\u0069\u0065\u006e" + + "\u0074\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_d4c9b56290554016 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0016\u0040\u0055\u0090\u0062\u00b5\u00c9\u00d4" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ba\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0041\u0063\u0063\u0065\u0070\u0074\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0058\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0020\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0055\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0050\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\\\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + + "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0072\u006f\u0076\u0069\u0073\u0069\u006f" + + "\u006e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u006d\u0062\u0061\u0072\u0067\u006f\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_fbe1980490e001af = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00af\u0001\u00e0\u0090\u0004\u0098\u00e1\u00fb" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00aa\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u004a\u006f\u0069\u006e\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0058\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + + "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c1\u00fb\u0013\u0058\u0054\u0014\u00bc\u0095" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006b\u0065\u0079\u0050\u0061\u0072\u0074\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_95bc14545813fbc1 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00c1\u00fb\u0013\u0058\u0054\u0014\u00bc\u0095" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00f2\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u004d\u0065\u0073\u0073\u0061\u0067\u0065\u0054" + + "\u0061\u0072\u0067\u0065\u0074\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0030\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u003c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0069\u006d\u0070\u006f\u0072\u0074\u0065\u0064" + + "\u0043\u0061\u0070\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0072\u006f\u006d\u0069\u0073\u0065\u0064" + + "\u0041\u006e\u0073\u0077\u0065\u0072\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00a0\u001c\u006f\u00cd\u00d6\u00b1\u0000\u00d8" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_9a0e61223d96743b = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u003b\u0074\u0096\u003d\"\u0061\u000e\u009a" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0050\u0061\u0079\u006c\u006f\u0061\u0064\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0048\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0063\u006f\u006e\u0074\u0065\u006e\u0074\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u0054\u0061\u0062\u006c\u0065" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b0\u00b8\u0086\u000b\u00c4\u00dd\u0023\u0085" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_8523ddc40b86b8b0 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00b0\u00b8\u0086\u000b\u00c4\u00dd\u0023\u0085" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0006\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00f2\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0043\u0061\u0070\u0044\u0065\u0073\u0063\u0072" + + "\u0069\u0070\u0074\u006f\u0072\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u001c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b5\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00bc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00fe\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b9\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00c4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u00fd\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c1\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00cc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u00fc\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c9\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00d4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0004\u0000\u00fb\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d1\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00dc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u00fa\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d9\u0000\u0000\u0000\u008a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00dc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00e8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e5\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00f0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006e\u006f\u006e\u0065\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u0065\u006e\u0064\u0065\u0072\u0048\u006f" + + "\u0073\u0074\u0065\u0064\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u0065\u006e\u0064\u0065\u0072\u0050\u0072" + + "\u006f\u006d\u0069\u0073\u0065\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0063\u0065\u0069\u0076\u0065\u0072" + + "\u0048\u006f\u0073\u0074\u0065\u0064\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0063\u0065\u0069\u0076\u0065\u0072" + + "\u0041\u006e\u0073\u0077\u0065\u0072\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00a0\u001c\u006f\u00cd\u00d6\u00b1\u0000\u00d8" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0068\u0069\u0072\u0064\u0050\u0061\u0072" + + "\u0074\u0079\u0048\u006f\u0073\u0074\u0065\u0064" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u007d\u0002\u00f0\u00e1\u00fd\u0007\u0070\u00d3" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0074\u0074\u0061\u0063\u0068\u0065\u0064" + + "\u0046\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0006\u0000\u00ff\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_d800b1d6cd6f1ca0 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00a0\u001c\u006f\u00cd\u00d6\u00b1\u0000\u00d8" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00fa\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0050\u0072\u006f\u006d\u0069\u0073\u0065\u0064" + + "\u0041\u006e\u0073\u0077\u0065\u0072\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0081\u0090\u0056\u0015\u0044\u0094\u0016\u00f3" + + "\u0001\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u004f\u0070\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0030\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + + "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0072\u0061\u006e\u0073\u0066\u006f\u0072" + + "\u006d\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0081\u0090\u0056\u0015\u0044\u0094\u0016\u00f3" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_f316944415569081 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0081\u0090\u0056\u0015\u0044\u0094\u0016\u00f3" + + "\u001f\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00a0\u001c\u006f\u00cd\u00d6\u00b1\u0000\u00d8" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0012\u0001\u0000\u0000" + + "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0050\u0072\u006f\u006d\u0069\u0073\u0065\u0064" + + "\u0041\u006e\u0073\u0077\u0065\u0072\u002e\u004f" + + "\u0070\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00fe\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0082\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0038\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006e\u006f\u006f\u0070\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0067\u0065\u0074\u0050\u006f\u0069\u006e\u0074" + + "\u0065\u0072\u0046\u0069\u0065\u006c\u0064\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_d37007fde1f0027d = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u007d\u0002\u00f0\u00e1\u00fd\u0007\u0070\u00d3" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0042\u0001\u0000\u0000" + + "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0054\u0068\u0069\u0072\u0064\u0050\u0061\u0072" + + "\u0074\u0079\u0043\u0061\u0070\u0044\u0065\u0073" + + "\u0063\u0072\u0069\u0070\u0074\u006f\u0072\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0076\u0069\u006e\u0065\u0049\u0064\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_d625b7063acf691a = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00d2\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f" + + "\u006e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0058\u00bd\u004c\u003f\u00e2\u0096\u008c\u00b2" + + "\u0001\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0054\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\\\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0068\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u0000\u0000\u0000\u00ba\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0068\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0074\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0071\u0000\u0000\u0000\u009a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0080\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u007d\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0078\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0084\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0072\u0065\u0061\u0073\u006f\u006e\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006f\u0062\u0073\u006f\u006c\u0065\u0074\u0065" + + "\u0049\u0073\u0043\u0061\u006c\u006c\u0065\u0072" + + "\u0073\u0046\u0061\u0075\u006c\u0074\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006f\u0062\u0073\u006f\u006c\u0065\u0074\u0065" + + "\u0044\u0075\u0072\u0061\u0062\u0069\u006c\u0069" + + "\u0074\u0079\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + + "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0058\u00bd\u004c\u003f\u00e2\u0096\u008c\u00b2" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_b28c96e23f4cbd58 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0058\u00bd\u004c\u003f\u00e2\u0096\u008c\u00b2" + + "\u001a\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00fa\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0067\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + + "\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f" + + "\u006e\u002e\u0054\u0079\u0070\u0065\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0061\u0069\u006c\u0065\u0064\u0000\u0000" + + "\u006f\u0076\u0065\u0072\u006c\u006f\u0061\u0064" + + "\u0065\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0069\u0073\u0063\u006f\u006e\u006e\u0065" + + "\u0063\u0074\u0065\u0064\u0000\u0000\u0000\u0000" + + "\u0075\u006e\u0069\u006d\u0070\u006c\u0065\u006d" + + "\u0065\u006e\u0074\u0065\u0064\u0000\u0000\u0000" + ""); +} +} + From 0d03705cfc5c86cf6dd57979f568ebd609cf7460 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 27 Sep 2020 23:14:43 +0100 Subject: [PATCH 009/246] conversions between PipelineOps and RPC schema --- .../main/java/org/capnproto/PipelineOp.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/runtime/src/main/java/org/capnproto/PipelineOp.java b/runtime/src/main/java/org/capnproto/PipelineOp.java index 5232d30d..067954f1 100644 --- a/runtime/src/main/java/org/capnproto/PipelineOp.java +++ b/runtime/src/main/java/org/capnproto/PipelineOp.java @@ -22,4 +22,39 @@ static PipelineOp Noop() { static PipelineOp PointerField(short pointerIndex) { return new PipelineOp(Type.GET_POINTER_FIELD, pointerIndex); } + + static void FromPipelineOps(PipelineOp[] ops, RpcProtocol.PromisedAnswer.Builder builder) { + var transforms = builder.initTransform(ops.length); + for (int ii = 0; ii < ops.length; ++ii) { + switch (ops[ii].type) { + case NOOP: + transforms.get(ii).setNoop(null); + break; + case GET_POINTER_FIELD: + transforms.get(ii).setGetPointerField(ops[ii].pointerIndex); + break; + } + } + } + + static PipelineOp[] ToPipelineOps(RpcProtocol.PromisedAnswer.Reader reader) { + var transforms = reader.getTransform(); + var ops = new PipelineOp[transforms.size()]; + for (int ii = 0; ii < ops.length; ++ii) { + var transform = transforms.get(ii); + switch (transform.which()) { + case NOOP: + ops[ii] = Noop(); + break; + case GET_POINTER_FIELD: + ops[ii] = PointerField(transform.getGetPointerField()); + break; + default: + // TODO improve error handling here + // Unsupported pipeline ops + return null; + } + } + return ops; + } } From 59c2859881754b0f8afe1639744befd79c104dc3 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 27 Sep 2020 23:20:33 +0100 Subject: [PATCH 010/246] implement cap table builder and reader --- .../org/capnproto/BuilderCapabilityTable.java | 34 +++++++++++++++++++ .../org/capnproto/ReaderCapabilityTable.java | 17 ++++++++++ 2 files changed, 51 insertions(+) create mode 100644 runtime/src/main/java/org/capnproto/BuilderCapabilityTable.java create mode 100644 runtime/src/main/java/org/capnproto/ReaderCapabilityTable.java diff --git a/runtime/src/main/java/org/capnproto/BuilderCapabilityTable.java b/runtime/src/main/java/org/capnproto/BuilderCapabilityTable.java new file mode 100644 index 00000000..5996c472 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/BuilderCapabilityTable.java @@ -0,0 +1,34 @@ +package org.capnproto; + +import java.util.ArrayList; +import java.util.List; + +class BuilderCapabilityTable implements CapTableBuilder { + + private final List table = new ArrayList<>(); + + BuilderCapabilityTable() { + } + + @Override + public ClientHook extractCap(int index) { + return table.get(index); + } + + @Override + public int injectCap(ClientHook cap) { + int index = table.size(); + table.add(cap); + return index; + } + + @Override + public void dropCap(int index) { + table.set(index, null); + } + + @Override + public ClientHook[] getTable() { + return table.toArray(new ClientHook[0]); + } +} diff --git a/runtime/src/main/java/org/capnproto/ReaderCapabilityTable.java b/runtime/src/main/java/org/capnproto/ReaderCapabilityTable.java new file mode 100644 index 00000000..a1ba09b3 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/ReaderCapabilityTable.java @@ -0,0 +1,17 @@ +package org.capnproto; + +import java.util.List; + +class ReaderCapabilityTable implements CapTableReader { + + final List table; + + ReaderCapabilityTable(List table) { + this.table = table; + } + + @Override + public ClientHook extractCap(int index) { + return index < table.size() ? table.get(index) : null; + } +} From 77133166839ce7576d01b0a699a02fae9e062d5e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 28 Sep 2020 00:42:37 +0100 Subject: [PATCH 011/246] incoming and outgoing rpc messages --- .../org/capnproto/IncomingRpcMessage.java | 10 +++ .../org/capnproto/OutgoingRpcMessage.java | 14 +++ .../main/java/org/capnproto/RpcSystem.java | 4 + .../java/org/capnproto/TwoPartyRpcSystem.java | 4 + .../org/capnproto/TwoPartyVatNetwork.java | 88 +++++++++++++++++++ .../main/java/org/capnproto/VatNetwork.java | 13 +++ 6 files changed, 133 insertions(+) create mode 100644 runtime/src/main/java/org/capnproto/IncomingRpcMessage.java create mode 100644 runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java create mode 100644 runtime/src/main/java/org/capnproto/RpcSystem.java create mode 100644 runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java create mode 100644 runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java create mode 100644 runtime/src/main/java/org/capnproto/VatNetwork.java diff --git a/runtime/src/main/java/org/capnproto/IncomingRpcMessage.java b/runtime/src/main/java/org/capnproto/IncomingRpcMessage.java new file mode 100644 index 00000000..c3982978 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/IncomingRpcMessage.java @@ -0,0 +1,10 @@ +package org.capnproto; + +import java.util.List; + +public interface IncomingRpcMessage { + + AnyPointer.Reader getBody(); + + List getAttachedFds(); +} diff --git a/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java b/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java new file mode 100644 index 00000000..7b342d1c --- /dev/null +++ b/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java @@ -0,0 +1,14 @@ +package org.capnproto; + +import java.util.List; + +public interface OutgoingRpcMessage { + + AnyPointer.Builder getBody(); + + void setFds(List fds); + + void send(); + + int sizeInWords(); +} diff --git a/runtime/src/main/java/org/capnproto/RpcSystem.java b/runtime/src/main/java/org/capnproto/RpcSystem.java new file mode 100644 index 00000000..60f5aab6 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/RpcSystem.java @@ -0,0 +1,4 @@ +package org.capnproto; + +public class RpcSystem { +} diff --git a/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java b/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java new file mode 100644 index 00000000..16718436 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java @@ -0,0 +1,4 @@ +package org.capnproto; + +public class TwoPartyRpcSystem extends RpcSystem { +} diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java new file mode 100644 index 00000000..caf46991 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -0,0 +1,88 @@ +package org.capnproto; + +import java.nio.channels.AsynchronousByteChannel; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class TwoPartyVatNetwork implements VatNetwork, VatNetwork.Connection { + + private CompletableFuture writeCompleted = CompletableFuture.completedFuture(null); + private final AsynchronousByteChannel channel; + + public TwoPartyVatNetwork(AsynchronousByteChannel channel) { + this.channel = channel; + } + + @Override + public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { + return new OutgoingMessage(firstSegmentWordSize); + } + + @Override + public CompletableFuture receiveIncomingMessage() { + return Serialize.readAsync(channel).thenApply(message -> { + return new IncomingMessage(message); + }); + } + + final class OutgoingMessage implements OutgoingRpcMessage { + + final MessageBuilder message; + List fds = List.of(); + + OutgoingMessage(int firstSegmentWordSize) { + this.message = new MessageBuilder(firstSegmentWordSize); + } + + @Override + public AnyPointer.Builder getBody() { + return message.getRoot(AnyPointer.factory); + } + + @Override + public void setFds(List fds) { + this.fds = fds; + } + + @Override + public void send() { + writeCompleted = writeCompleted.thenCompose( + x -> Serialize.writeAsync(channel, message) + ); + } + + @Override + public int sizeInWords() { + int size = 0; + for (var segment: message.getSegmentsForOutput()) { + size += segment.position(); + } + return size / 2; + } + } + + final class IncomingMessage implements IncomingRpcMessage { + + final MessageReader message; + final List fds; + + IncomingMessage(MessageReader message) { + this(message, List.of()); + } + + IncomingMessage(MessageReader message, List fds) { + this.message = message; + this.fds = fds; + } + + @Override + public AnyPointer.Reader getBody() { + return message.getRoot(AnyPointer.factory); + } + + @Override + public List getAttachedFds() { + return fds; + } + } +} diff --git a/runtime/src/main/java/org/capnproto/VatNetwork.java b/runtime/src/main/java/org/capnproto/VatNetwork.java new file mode 100644 index 00000000..16a4c21d --- /dev/null +++ b/runtime/src/main/java/org/capnproto/VatNetwork.java @@ -0,0 +1,13 @@ +package org.capnproto; + +import java.util.concurrent.CompletableFuture; + +public interface VatNetwork { + + interface Connection { + + OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize); + + CompletableFuture receiveIncomingMessage(); + } +} From 385746dc4fa20cf725aa92e919f5f68a475919e2 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 28 Sep 2020 01:00:01 +0100 Subject: [PATCH 012/246] add two-party RPC protocol --- .../org/capnproto/RpcTwoPartyProtocol.java | 635 ++++++++++++++++++ .../org/capnproto/TwoPartyVatNetwork.java | 17 +- 2 files changed, 651 insertions(+), 1 deletion(-) create mode 100644 runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java diff --git a/runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java b/runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java new file mode 100644 index 00000000..d6a0c4be --- /dev/null +++ b/runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java @@ -0,0 +1,635 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: rpc-twoparty.capnp + +package org.capnproto; + +public final class RpcTwoPartyProtocol { + public enum Side { + SERVER, + CLIENT, + _NOT_IN_SCHEMA, + } + + public static class VatId { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return VatId.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final RpcTwoPartyProtocol.Side getSide() { + switch(_getShortField(0)) { + case 0 : return RpcTwoPartyProtocol.Side.SERVER; + case 1 : return RpcTwoPartyProtocol.Side.CLIENT; + default: return RpcTwoPartyProtocol.Side._NOT_IN_SCHEMA; + } + } + public final void setSide(RpcTwoPartyProtocol.Side value) { + _setShortField(0, (short)value.ordinal()); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final RpcTwoPartyProtocol.Side getSide() { + switch(_getShortField(0)) { + case 0 : return RpcTwoPartyProtocol.Side.SERVER; + case 1 : return RpcTwoPartyProtocol.Side.CLIENT; + default: return RpcTwoPartyProtocol.Side._NOT_IN_SCHEMA; + } + } + + } + + } + + + public static class ProvisionId { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return ProvisionId.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getJoinId() { + return _getIntField(0); + } + public final void setJoinId(int value) { + _setIntField(0, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getJoinId() { + return _getIntField(0); + } + + } + + } + + + public static class RecipientId { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return RecipientId.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + } + + } + + + public static class ThirdPartyCapId { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return ThirdPartyCapId.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + } + + } + + + public static class JoinKeyPart { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return JoinKeyPart.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getJoinId() { + return _getIntField(0); + } + public final void setJoinId(int value) { + _setIntField(0, value); + } + + public final short getPartCount() { + return _getShortField(2); + } + public final void setPartCount(short value) { + _setShortField(2, value); + } + + public final short getPartNum() { + return _getShortField(3); + } + public final void setPartNum(short value) { + _setShortField(3, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getJoinId() { + return _getIntField(0); + } + + public final short getPartCount() { + return _getShortField(2); + } + + public final short getPartNum() { + return _getShortField(3); + } + + } + + } + + + public static class JoinResult { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return JoinResult.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getJoinId() { + return _getIntField(0); + } + public final void setJoinId(int value) { + _setIntField(0, value); + } + + public final boolean getSucceeded() { + return _getBooleanField(32); + } + public final void setSucceeded(boolean value) { + _setBooleanField(32, value); + } + + public final boolean hasCap() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getCap() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initCap() { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initCap(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getJoinId() { + return _getIntField(0); + } + + public final boolean getSucceeded() { + return _getBooleanField(32); + } + + public boolean hasCap() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getCap() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + } + + } + + + +public static final class Schemas { +public static final org.capnproto.SegmentReader b_9fd69ebc87b9719c = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u009c\u0071\u00b9\u0087\u00bc\u009e\u00d6\u009f" + + "\u0019\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00f2\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u0037\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + + "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0053\u0069\u0064\u0065\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0011\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u0065\u0072\u0076\u0065\u0072\u0000\u0000" + + "\u0063\u006c\u0069\u0065\u006e\u0074\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_d20b909fee733a8e = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u008e\u003a\u0073\u00ee\u009f\u0090\u000b\u00d2" + + "\u0019\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00fa\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + + "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0056\u0061\u0074\u0049\u0064\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0073\u0069\u0064\u0065\u0000\u0000\u0000\u0000" + + "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u009c\u0071\u00b9\u0087\u00bc\u009e\u00d6\u009f" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_b88d09a9c5f39817 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0017\u0098\u00f3\u00c5\u00a9\u0009\u008d\u00b8" + + "\u0019\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u002a\u0001\u0000\u0000" + + "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + + "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0050\u0072\u006f\u0076\u0069\u0073\u0069" + + "\u006f\u006e\u0049\u0064\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006a\u006f\u0069\u006e\u0049\u0064\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_89f389b6fd4082c1 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00c1\u0082\u0040\u00fd\u00b6\u0089\u00f3\u0089" + + "\u0019\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u002a\u0001\u0000\u0000" + + "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + + "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0052\u0065\u0063\u0069\u0070\u0069\u0065" + + "\u006e\u0074\u0049\u0064\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); +public static final org.capnproto.SegmentReader b_b47f4979672cb59d = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u009d\u00b5\u002c\u0067\u0079\u0049\u007f\u00b4" + + "\u0019\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u004a\u0001\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + + "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0068\u0069\u0072\u0064\u0050\u0061" + + "\u0072\u0074\u0079\u0043\u0061\u0070\u0049\u0064" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); +public static final org.capnproto.SegmentReader b_95b29059097fca83 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0083\u00ca\u007f\u0009\u0059\u0090\u00b2\u0095" + + "\u0019\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u002a\u0001\u0000\u0000" + + "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + + "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004a\u006f\u0069\u006e\u004b\u0065\u0079" + + "\u0050\u0061\u0072\u0074\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0058\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006a\u006f\u0069\u006e\u0049\u0064\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0061\u0072\u0074\u0043\u006f\u0075\u006e" + + "\u0074\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0061\u0072\u0074\u004e\u0075\u006d\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_9d263a3630b7ebee = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00ee\u00eb\u00b7\u0030\u0036\u003a\u0026\u009d" + + "\u0019\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\"\u0001\u0000\u0000" + + "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + + "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + + "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004a\u006f\u0069\u006e\u0052\u0065\u0073" + + "\u0075\u006c\u0074\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0020\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0000\u0000\u0000\"\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0058\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006a\u006f\u0069\u006e\u0049\u0064\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u0075\u0063\u0063\u0065\u0065\u0064\u0065" + + "\u0064\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +} +} + diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java index caf46991..75d822a4 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -8,9 +8,24 @@ public class TwoPartyVatNetwork implements VatNetwork, VatNetwork.Connection { private CompletableFuture writeCompleted = CompletableFuture.completedFuture(null); private final AsynchronousByteChannel channel; + private final RpcTwoPartyProtocol.Side side; + private final MessageBuilder peerVatId = new MessageBuilder(4); - public TwoPartyVatNetwork(AsynchronousByteChannel channel) { + public TwoPartyVatNetwork(AsynchronousByteChannel channel, RpcTwoPartyProtocol.Side side) { this.channel = channel; + this.side = side; + this.peerVatId.initRoot(RpcTwoPartyProtocol.VatId.factory).setSide( + side == RpcTwoPartyProtocol.Side.CLIENT + ? RpcTwoPartyProtocol.Side.SERVER + : RpcTwoPartyProtocol.Side.CLIENT); + } + + public RpcTwoPartyProtocol.Side getSide() { + return side; + } + + public RpcTwoPartyProtocol.VatId.Reader getPeerVatId() { + return peerVatId.getRoot(RpcTwoPartyProtocol.VatId.factory).asReader(); } @Override From e1548e88e8402bca7c1cac7ee97f54139d562fd0 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 28 Sep 2020 08:32:52 +0100 Subject: [PATCH 013/246] RPC exception serialization --- .../main/java/org/capnproto/RpcException.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 runtime/src/main/java/org/capnproto/RpcException.java diff --git a/runtime/src/main/java/org/capnproto/RpcException.java b/runtime/src/main/java/org/capnproto/RpcException.java new file mode 100644 index 00000000..a3202be0 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/RpcException.java @@ -0,0 +1,52 @@ +package org.capnproto; + +public final class RpcException extends java.lang.Exception { + + public enum Type { + UNKNOWN, + UNIMPLEMENTED, + FAILED + } + + private Type type; + + public RpcException(Type type, String message) { + super(message); + this.type = type; + } + + public final Type getType() { + return type; + } + + public static RpcException unimplemented(String message) { + return new RpcException(Type.UNIMPLEMENTED, message); + } + + public static RpcException failed(String message) { + return new RpcException(Type.FAILED, message); + } + + static void fromException(Throwable exc, RpcProtocol.Exception.Builder builder) { + builder.setReason(exc.getMessage()); + builder.setType(RpcProtocol.Exception.Type.FAILED); + } + + static RpcException toException(RpcProtocol.Exception.Reader reader) { + var type = RpcException.Type.UNKNOWN; + + switch (reader.getType()) { + case UNIMPLEMENTED: + type = RpcException.Type.UNIMPLEMENTED; + break; + case FAILED: + type = RpcException.Type.FAILED; + break; + case DISCONNECTED: + case OVERLOADED: + default: + break; + } + return new RpcException(type, reader.getReason().toString()); + } +} From 76c81a76a2efa82626a4fb126752ac84f03f7d39 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 28 Sep 2020 09:09:17 +0100 Subject: [PATCH 014/246] start to flesh out RPC connection state --- .../src/main/java/org/capnproto/RpcState.java | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 runtime/src/main/java/org/capnproto/RpcState.java diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java new file mode 100644 index 00000000..a2e4581a --- /dev/null +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -0,0 +1,150 @@ +package org.capnproto; + +import java.util.List; +import java.util.concurrent.CompletableFuture; + +final class RpcState { + + static final class Question { + List paramExports; + boolean isAwaitingReturn = false; + boolean isTailCall = false; + boolean skipFinish = false; + CompletableFuture response = new CompletableFuture<>(); + + void reject(Throwable exc) { + response.completeExceptionally(exc); + } + + void answer(RpcResponse response) { + this.response.complete(response); + } + } + + static final class Answer { + boolean active = false; + PipelineHook pipeline; + CompletableFuture redirectedResults; + RpcCallContext callContext; + List resultExports; + } + + static final class Export { + int refcount; + ClientHook clientHook; + CompletableFuture resolveOp; + } + + static final class Import { + ImportClient importClient; + RpcClient appClient; + CompletableFuture promise; + // If non-null, the import is a promise. + } + + final static class Embargo { + CompletableFuture fulfiller; + } + + interface RpcResponse extends ResponseHook { + AnyPointer.Reader getResults(); + } + + class RpcCallContext implements CallContextHook { + + final int answerId; + final long interfaceId; + final short methodId; + + // request + IncomingRpcMessage request; + final AnyPointer.Reader params; + + // response + RpcResponse response; + RpcProtocol.Return.Builder returnMessage; + boolean redirectResults = false; + + final CompletableFuture cancelled; + + RpcCallContext(int answerId, IncomingRpcMessage request, List capTable, + AnyPointer.Reader params, boolean redirectResults, + CompletableFuture cancelled, + long interfaceId, short methodId) { + this.answerId = answerId; + this.interfaceId = interfaceId; + this.methodId = methodId; + this.request = request; + this.params = params.imbue(new ReaderCapabilityTable(capTable)); + this.redirectResults = redirectResults; + this.cancelled = cancelled; + } + + @Override + public AnyPointer.Reader getParams() { + return this.params; + } + + @Override + public void releaseParams() { + this.request = null; + } + + @Override + public AnyPointer.Builder getResults() { + return null; + } + + @Override + public CompletableFuture tailCall(RequestHook request) { + return null; + } + + @Override + public void allowCancellation() { + } + + @Override + public CompletableFuture onTailCall() { + return null; + } + + @Override + public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { + return null; + } + } + + abstract class RpcClient implements ClientHook { + + public abstract Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds); + + public abstract ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target); + + public ClientHook getInnermostClient() { + return this; + } + + @Override + public Request newCall(long interfaceId, short methodId) { + return null; + } + + @Override + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { + return null; + } + } + + class ImportClient extends RpcClient { + @Override + public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { + return null; + } + + @Override + public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { + return null; + } + } +} From 10f8f5e7d54311c0c39e49eef05f980ef0ccb764 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 28 Sep 2020 14:21:31 +0100 Subject: [PATCH 015/246] implement import and export tables --- .../main/java/org/capnproto/ExportTable.java | 56 +++++++++++++++++++ .../main/java/org/capnproto/ImportTable.java | 40 +++++++++++++ .../src/main/java/org/capnproto/RpcState.java | 40 ++++++++++++- 3 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 runtime/src/main/java/org/capnproto/ExportTable.java create mode 100644 runtime/src/main/java/org/capnproto/ImportTable.java diff --git a/runtime/src/main/java/org/capnproto/ExportTable.java b/runtime/src/main/java/org/capnproto/ExportTable.java new file mode 100644 index 00000000..74ae69d1 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/ExportTable.java @@ -0,0 +1,56 @@ +package org.capnproto; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.PriorityQueue; +import java.util.Queue; +import java.util.function.Consumer; + +abstract class ExportTable implements Iterable { + + final HashMap slots = new HashMap<>(); + final Queue freeIds = new PriorityQueue<>(); + int max = 0; + + protected abstract T newExportable(); + + public T find(int id) { + return slots.get(id); + } + + public T erase(int id, T entry) { + var value = slots.get(id); + if (value == entry) { + freeIds.add(id); + return slots.remove(id); + } else { + return null; + } + } + + public T next() { + if (freeIds.isEmpty()) { + var id = max; + max++; + var value = newExportable(); + slots.put(id, value); + return value; + } else { + var id = freeIds.remove(); + var value = newExportable(); + slots.put(id, value); + return value; + } + } + + @Override + public Iterator iterator() { + return slots.values().iterator(); + } + + @Override + public void forEach(Consumer action) { + slots.values().forEach(action); + } +} + diff --git a/runtime/src/main/java/org/capnproto/ImportTable.java b/runtime/src/main/java/org/capnproto/ImportTable.java new file mode 100644 index 00000000..b15d2ea1 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/ImportTable.java @@ -0,0 +1,40 @@ +package org.capnproto; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.function.Consumer; + +abstract class ImportTable implements Iterable { + + private final HashMap slots = new HashMap<>(); + + protected abstract T newImportable(); + + public T put(int id) { + return slots.computeIfAbsent(id, key -> newImportable()); + } + + public T find(int id) { + return slots.get(id); + } + + public T erase(int id, T entry) { + var removed = slots.remove(id, entry); + assert removed; + return entry; + } + + public T erase(int id) { + return slots.remove(id); + } + + @Override + public Iterator iterator() { + return slots.values().iterator(); + } + + @Override + public void forEach(Consumer action) { + slots.values().forEach(action); + } +} diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index a2e4581a..bc47a24b 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -1,7 +1,8 @@ package org.capnproto; -import java.util.List; +import java.util.*; import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; final class RpcState { @@ -46,6 +47,43 @@ final static class Embargo { CompletableFuture fulfiller; } + private final ExportTable exports = new ExportTable() { + @Override + protected Export newExportable() { + return new Export(); + } + }; + + private final ExportTable questions = new ExportTable() { + @Override + protected Question newExportable() { + return new Question(); + } + }; + + private final ImportTable answers = new ImportTable() { + @Override + protected Answer newImportable() { + return new Answer(); + } + }; + + private final ImportTable imports = new ImportTable() { + @Override + protected Import newImportable() { + return new Import(); + } + }; + + private final ExportTable embargos = new ExportTable() { + @Override + protected Embargo newExportable() { + return new Embargo(); + } + }; + + private final HashMap exportsByCap = new HashMap<>(); + interface RpcResponse extends ResponseHook { AnyPointer.Reader getResults(); } From 7ee0a60b5e80bfb2cb135139d1ab3d2a5126daba Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 28 Sep 2020 14:31:43 +0100 Subject: [PATCH 016/246] stub handlers and test cases for incoming rpc messages --- .../src/main/java/org/capnproto/RpcState.java | 60 +++++++++++++++++++ .../test/java/org/capnproto/RpcStateTest.java | 40 +++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 runtime/src/test/java/org/capnproto/RpcStateTest.java diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index bc47a24b..14922536 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -83,6 +83,64 @@ protected Embargo newExportable() { }; private final HashMap exportsByCap = new HashMap<>(); + + void handleMessage(IncomingRpcMessage message) { + var reader = message.getBody().getAs(RpcProtocol.Message.factory); + + switch (reader.which()) { + case UNIMPLEMENTED: + handleUnimplemented(reader.getUnimplemented()); + break; + case ABORT: + handleAbort(reader.getAbort()); + break; + case BOOTSTRAP: + handleBootstrap(message, reader.getBootstrap()); + break; + case CALL: + handleCall(message, reader.getCall()); + return; + case RETURN: + handleReturn(message, reader.getReturn()); + break; + case FINISH: + handleFinish(reader.getFinish()); + break; + case RESOLVE: + handleResolve(message, reader.getResolve()); + break; + case DISEMBARGO: + handleDisembargo(reader.getDisembargo()); + break; + default: + // TODO send unimplemented response + break; + } + } + + void handleUnimplemented(RpcProtocol.Message.Reader message) { + } + + void handleAbort(RpcProtocol.Exception.Reader abort) { + } + + void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bootstrap) { + } + + void handleCall(IncomingRpcMessage message, RpcProtocol.Call.Reader call) { + } + + void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callReturn) { + } + + void handleFinish(RpcProtocol.Finish.Reader finish) { + } + + void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { + } + + void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { + } interface RpcResponse extends ResponseHook { AnyPointer.Reader getResults(); @@ -185,4 +243,6 @@ public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { return null; } } + + } diff --git a/runtime/src/test/java/org/capnproto/RpcStateTest.java b/runtime/src/test/java/org/capnproto/RpcStateTest.java new file mode 100644 index 00000000..935103c6 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/RpcStateTest.java @@ -0,0 +1,40 @@ +package org.capnproto; + +import org.junit.Test; + +import static org.junit.Assert.*; + +public class RpcStateTest { + + @Test + public void handleUnimplemented() { + } + + @Test + public void handleAbort() { + } + + @Test + public void handleBootstrap() { + } + + @Test + public void handleCall() { + } + + @Test + public void handleReturn() { + } + + @Test + public void handleFinish() { + } + + @Test + public void handleResolve() { + } + + @Test + public void handleDisembargo() { + } +} \ No newline at end of file From 66ae27e80514ae975b30f98439cdda6e335cdb18 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 28 Sep 2020 14:44:25 +0100 Subject: [PATCH 017/246] mock rpc connection --- .../org/capnproto/IncomingRpcMessage.java | 4 +- .../org/capnproto/OutgoingRpcMessage.java | 3 +- .../src/main/java/org/capnproto/RpcState.java | 8 ++- .../test/java/org/capnproto/RpcStateTest.java | 69 +++++++++++++++++++ 4 files changed, 81 insertions(+), 3 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/IncomingRpcMessage.java b/runtime/src/main/java/org/capnproto/IncomingRpcMessage.java index c3982978..60b4c5dd 100644 --- a/runtime/src/main/java/org/capnproto/IncomingRpcMessage.java +++ b/runtime/src/main/java/org/capnproto/IncomingRpcMessage.java @@ -6,5 +6,7 @@ public interface IncomingRpcMessage { AnyPointer.Reader getBody(); - List getAttachedFds(); + default List getAttachedFds() { + return List.of(); + } } diff --git a/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java b/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java index 7b342d1c..be744dc9 100644 --- a/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java +++ b/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java @@ -6,7 +6,8 @@ public interface OutgoingRpcMessage { AnyPointer.Builder getBody(); - void setFds(List fds); + default void setFds(List fds) { + } void send(); diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 14922536..5483194f 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -83,7 +83,13 @@ protected Embargo newExportable() { }; private final HashMap exportsByCap = new HashMap<>(); - + private final VatNetwork.Connection connection; + + + RpcState(VatNetwork.Connection connection) { + this.connection = connection; + } + void handleMessage(IncomingRpcMessage message) { var reader = message.getBody().getAs(RpcProtocol.Message.factory); diff --git a/runtime/src/test/java/org/capnproto/RpcStateTest.java b/runtime/src/test/java/org/capnproto/RpcStateTest.java index 935103c6..72bf771a 100644 --- a/runtime/src/test/java/org/capnproto/RpcStateTest.java +++ b/runtime/src/test/java/org/capnproto/RpcStateTest.java @@ -1,13 +1,81 @@ package org.capnproto; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; import org.junit.Test; +import java.util.ArrayDeque; +import java.util.Queue; +import java.util.concurrent.CompletableFuture; + import static org.junit.Assert.*; public class RpcStateTest { + class TestMessage implements IncomingRpcMessage { + + MessageBuilder builder = new MessageBuilder(); + + @Override + public AnyPointer.Reader getBody() { + return builder.getRoot(AnyPointer.factory).asReader(); + } + } + + class TestConnection implements VatNetwork.Connection { + + @Override + public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { + var message = new MessageBuilder(); + + return new OutgoingRpcMessage() { + @Override + public AnyPointer.Builder getBody() { + return message.getRoot(AnyPointer.factory); + } + + @Override + public void send() { + sent.add(this); + } + + @Override + public int sizeInWords() { + return 0; + } + }; + } + + @Override + public CompletableFuture receiveIncomingMessage() { + return null; + } + } + + TestConnection connection; + RpcState rpc; + final Queue sent = new ArrayDeque<>(); + + @Before + public void setUp() throws Exception { + connection = new TestConnection(); + rpc = new RpcState(connection); + } + + @After + public void tearDown() throws Exception { + connection = null; + rpc = null; + sent.clear(); + } + @Test public void handleUnimplemented() { + var msg = new TestMessage(); + msg.builder.getRoot(RpcProtocol.Message.factory).initUnimplemented(); + rpc.handleMessage(msg); + Assert.assertTrue(sent.isEmpty()); } @Test @@ -37,4 +105,5 @@ public void handleResolve() { @Test public void handleDisembargo() { } + } \ No newline at end of file From b3c5b030c5abd106c269649387e0ff0205916df5 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 28 Sep 2020 16:43:38 +0100 Subject: [PATCH 018/246] handle bootstrapping request --- .../main/java/org/capnproto/AnyPointer.java | 4 + .../main/java/org/capnproto/Capability.java | 15 ++ .../main/java/org/capnproto/ExportTable.java | 12 +- .../src/main/java/org/capnproto/RpcState.java | 220 ++++++++++++++++-- .../test/java/org/capnproto/RpcStateTest.java | 18 +- 5 files changed, 238 insertions(+), 31 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/Capability.java diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 34a05c1d..64f4acce 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -110,6 +110,10 @@ public final void setAs(SetPointerBuilder factory, U reader) { factory.setPointerBuilder(this.segment, this.pointer, reader); } + public final void setAsCapability(Capability.Client cap) { + WireHelpers.setCapabilityPointer(this.segment, capTable, this.pointer, cap.hook); + } + public final Reader asReader() { return new Reader(segment, pointer, java.lang.Integer.MAX_VALUE); } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java new file mode 100644 index 00000000..05338c37 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -0,0 +1,15 @@ +package org.capnproto; + +public class Capability { + + public static class Client { + + final ClientHook hook; + + public Client(ClientHook hook) { + this.hook = hook; + } + + } + +} diff --git a/runtime/src/main/java/org/capnproto/ExportTable.java b/runtime/src/main/java/org/capnproto/ExportTable.java index 74ae69d1..d199130e 100644 --- a/runtime/src/main/java/org/capnproto/ExportTable.java +++ b/runtime/src/main/java/org/capnproto/ExportTable.java @@ -6,14 +6,12 @@ import java.util.Queue; import java.util.function.Consumer; -abstract class ExportTable implements Iterable { +class ExportTable implements Iterable { final HashMap slots = new HashMap<>(); final Queue freeIds = new PriorityQueue<>(); int max = 0; - protected abstract T newExportable(); - public T find(int id) { return slots.get(id); } @@ -28,18 +26,16 @@ public T erase(int id, T entry) { } } - public T next() { + public int next(T value) { if (freeIds.isEmpty()) { var id = max; max++; - var value = newExportable(); slots.put(id, value); - return value; + return id; } else { var id = freeIds.remove(); - var value = newExportable(); slots.put(id, value); - return value; + return id; } } diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 5483194f..93e6a6d9 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -2,6 +2,7 @@ import java.util.*; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; import java.util.function.Consumer; final class RpcState { @@ -33,7 +34,7 @@ static final class Answer { static final class Export { int refcount; ClientHook clientHook; - CompletableFuture resolveOp; + CompletionStage resolveOp; } static final class Import { @@ -47,19 +48,8 @@ final static class Embargo { CompletableFuture fulfiller; } - private final ExportTable exports = new ExportTable() { - @Override - protected Export newExportable() { - return new Export(); - } - }; - - private final ExportTable questions = new ExportTable() { - @Override - protected Question newExportable() { - return new Question(); - } - }; + private final ExportTable exports = new ExportTable(); + private final ExportTable questions = new ExportTable(); private final ImportTable answers = new ImportTable() { @Override @@ -75,19 +65,20 @@ protected Import newImportable() { } }; - private final ExportTable embargos = new ExportTable() { - @Override - protected Embargo newExportable() { - return new Embargo(); - } - }; + private final ExportTable embargos = new ExportTable(); private final HashMap exportsByCap = new HashMap<>(); private final VatNetwork.Connection connection; + private final Capability.Client bootstrapInterface; + private Throwable disconnected = null; - - RpcState(VatNetwork.Connection connection) { + RpcState(VatNetwork.Connection connection, Capability.Client bootstrapInterface) { this.connection = connection; + this.bootstrapInterface = bootstrapInterface; + } + + boolean isDisconnected() { + return this.disconnected != null; } void handleMessage(IncomingRpcMessage message) { @@ -131,6 +122,47 @@ void handleAbort(RpcProtocol.Exception.Reader abort) { } void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bootstrap) { + if (isDisconnected()) { + return; + } + + var answerId = bootstrap.getQuestionId(); + var answer = answers.put(answerId); + if (answer.active) { + // questionId already in use + return; + } + answer.active = true; + + var capTable = new BuilderCapabilityTable(); + var response = connection.newOutgoingMessage(1024); + + var ret = response.getBody().getAs(RpcProtocol.Message.factory).initReturn(); + ret.setAnswerId(answerId); + + var payload = ret.initResults(); + var content = payload.getContent().imbue(capTable); + content.setAsCapability(bootstrapInterface); + + var capTableArray = capTable.getTable(); + assert capTableArray.length != 0; + + var capHook = capTableArray[0]; + assert capHook != null; + + var fds = List.of(); + response.setFds(List.of()); + + answer.resultExports = writeDescriptors(capTableArray, payload, fds); + answer.pipeline = ops -> ops.length == 0 + ? capHook + : ClientHook.newBrokenCap("Invalid pipeline transform."); + + response.send(); + + assert answer.active; + assert answer.resultExports != null; + assert answer.pipeline != null; } void handleCall(IncomingRpcMessage message, RpcProtocol.Call.Reader call) { @@ -148,6 +180,150 @@ void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolv void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { } + + private List writeDescriptors(ClientHook[] capTable, RpcProtocol.Payload.Builder payload, List fds) { + if (capTable.length == 0) { + return List.of(); + } + + var capTableBuilder = payload.initCapTable(capTable.length); + var exports = new ArrayList(); + for (int ii = 0; ii < capTable.length; ++ii) { + var cap = capTable[ii]; + if (cap == null) { + capTableBuilder.get(ii).setNone(null); + continue; + } + + var exportId = writeDescriptor(cap, capTableBuilder.get(ii), fds); + if (exportId != null) { + exports.add(exportId); + } + } + return exports; + } + + private Integer writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builder descriptor, List fds) { + ClientHook inner = cap; + for (;;) { + var resolved = inner.getResolved(); + if (resolved != null) { + inner = resolved; + } else { + break; + } + } + + var fd = inner.getFd(); + if (fd != null) { + fds.add(fd); + } + + if (inner.getBrand() == this) { + return ((RpcClient) inner).writeDescriptor(descriptor, fds); + } + + var exportId = exportsByCap.get(inner); + if (exportId != null) { + // We've already seen and exported this capability before. + var export = exports.find(exportId); + export.refcount++; + descriptor.setSenderHosted(exportId); + return exportId; + } + + // This is the first time we've seen this capability. + var export = new Export(); + export.refcount = 1; + export.clientHook = inner; + exportId = exports.next(export); + + var wrapped = inner.whenMoreResolved(); + if (wrapped != null) { + // This is a promise. Arrange for the `Resolve` message to be sent later. + export.resolveOp = resolveExportedPromise(exportId, wrapped); + descriptor.setSenderPromise(exportId); + } + else { + descriptor.setSenderHosted(exportId); + } + return exportId; + } + + CompletionStage resolveExportedPromise(int exportId, CompletionStage promise) { + + return promise.thenCompose(resolution -> { + if (isDisconnected()) { + return CompletableFuture.completedFuture(null); + } + + resolution = getInnermostClient(resolution); + + var exp = exports.find(exportId); + exportsByCap.remove(exp.clientHook); + exp.clientHook = resolution; + + if (exp.clientHook.getBrand() != this) { + // We're resolving to a local capability. If we're resolving to a promise, we might be + // able to reuse our export table entry and avoid sending a message. + var more = exp.clientHook.whenMoreResolved(); + if (more != null) { + // We're replacing a promise with another local promise. In this case, we might actually + // be able to just reuse the existing export table entry to represent the new promise -- + // unless it already has an entry. Let's check. + + var insertResult = exportsByCap.put(exp.clientHook, exportId); + // TODO check this behaviour + if (insertResult == null) { + // The new promise was not already in the table, therefore the existing export table + // entry has now been repurposed to represent it. There is no need to send a resolve + // message at all. We do, however, have to start resolving the next promise. + return resolveExportedPromise(exportId, more); + } + } + } + + // send a Resolve message + var message = connection.newOutgoingMessage(1024); + var resolve = message.getBody().initAs(RpcProtocol.Message.factory).initResolve(); + resolve.setPromiseId(exportId); + var fds = List.of(); + writeDescriptor(exp.clientHook, resolve.initCap(), fds); + message.setFds(fds); + message.send(); + return CompletableFuture.completedFuture(null); + }).whenComplete((value, exc) -> { + if (exc == null) { + return; + } + var message = connection.newOutgoingMessage(1024); + var resolve = message.getBody().initAs(RpcProtocol.Message.factory).initResolve(); + resolve.setPromiseId(exportId); + RpcException.fromException(exc, resolve.initException()); + message.send(); + + // TODO disconnect? + }); + } + + ClientHook getInnermostClient(ClientHook client) { + for (;;) { + var inner = client.getResolved(); + if (inner != null) { + client = inner; + } + else { + break; + } + } + + if (client.getBrand() == this) { + return ((RpcClient)client).getInnermostClient(); + } + + return client; + } + interface RpcResponse extends ResponseHook { AnyPointer.Reader getResults(); } diff --git a/runtime/src/test/java/org/capnproto/RpcStateTest.java b/runtime/src/test/java/org/capnproto/RpcStateTest.java index 72bf771a..1d0e64e0 100644 --- a/runtime/src/test/java/org/capnproto/RpcStateTest.java +++ b/runtime/src/test/java/org/capnproto/RpcStateTest.java @@ -54,13 +54,15 @@ public CompletableFuture receiveIncomingMessage() { } TestConnection connection; + Capability.Client bootstrapInterface; RpcState rpc; final Queue sent = new ArrayDeque<>(); @Before public void setUp() throws Exception { connection = new TestConnection(); - rpc = new RpcState(connection); + bootstrapInterface = new Capability.Client(ClientHook.newNullCap()); + rpc = new RpcState(connection, bootstrapInterface); } @After @@ -84,6 +86,20 @@ public void handleAbort() { @Test public void handleBootstrap() { + var msg = new TestMessage(); + var bootstrap = msg.builder.getRoot(RpcProtocol.Message.factory).initBootstrap(); + bootstrap.setQuestionId(0); + rpc.handleMessage(msg); + Assert.assertFalse(sent.isEmpty()); + var reply = sent.remove(); + var rpcMsg = reply.getBody().getAs(RpcProtocol.Message.factory); + Assert.assertEquals(rpcMsg.which(), RpcProtocol.Message.Which.RETURN); + var ret = rpcMsg.getReturn(); + Assert.assertEquals(ret.getAnswerId(), 0); + Assert.assertEquals(ret.which(), RpcProtocol.Return.Which.RESULTS); + var results = ret.getResults(); + Assert.assertEquals(results.getCapTable().size(), 1); // got a capability! + Assert.assertTrue(results.hasContent()); } @Test From 37fe39bcde958910caa4198a2120169b54b6085e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 28 Sep 2020 18:26:07 +0100 Subject: [PATCH 019/246] implement unimplemented --- .../src/main/java/org/capnproto/RpcState.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 93e6a6d9..6b2cfbe0 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -116,6 +116,38 @@ void handleMessage(IncomingRpcMessage message) { } void handleUnimplemented(RpcProtocol.Message.Reader message) { + switch (message.which()) { + case RESOLVE: + var resolve = message.getResolve(); + switch (resolve.which()) { + case CAP: + var cap = resolve.getCap(); + switch (cap.which()) { + case NONE: + break; + case SENDER_HOSTED: + releaseExport(cap.getSenderHosted(), 1); + break; + case SENDER_PROMISE: + releaseExport(cap.getSenderPromise(), 1); + break; + case RECEIVER_ANSWER: + break; + case RECEIVER_HOSTED: + break; + case THIRD_PARTY_HOSTED: + releaseExport(cap.getThirdPartyHosted().getVineId(), 1); + break; + } + break; + case EXCEPTION: + break; + } + break; + default: + // Peer unimplemented + break; + } } void handleAbort(RpcProtocol.Exception.Reader abort) { @@ -306,6 +338,24 @@ CompletionStage resolveExportedPromise(int exportId, CompletionStage Date: Mon, 28 Sep 2020 21:59:55 +0100 Subject: [PATCH 020/246] implement local, queued and promised hooks --- .../main/java/org/capnproto/Capability.java | 102 +++++- .../main/java/org/capnproto/QueuedClient.java | 47 +++ .../src/main/java/org/capnproto/RpcState.java | 297 +++++++++++++++++- .../test/java/org/capnproto/RpcStateTest.java | 10 +- 4 files changed, 447 insertions(+), 9 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/QueuedClient.java diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 05338c37..07187489 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -1,6 +1,8 @@ package org.capnproto; -public class Capability { +import java.util.concurrent.CompletableFuture; + +public final class Capability { public static class Client { @@ -9,7 +11,105 @@ public static class Client { public Client(ClientHook hook) { this.hook = hook; } + } + + static ClientHook newLocalPromiseClient(CompletableFuture promise) { + return new QueuedClient(promise); + } + + static class LocalRequest implements RequestHook { + + final MessageBuilder message = new MessageBuilder(); + final long interfaceId; + final short methodId; + ClientHook client; + + LocalRequest(long interfaceId, short methodId, ClientHook client) { + this.interfaceId = interfaceId; + this.methodId = methodId; + this.client = client; + } + @Override + public RemotePromise send() { + var cancelPaf = new CompletableFuture(); + var context = new LocalCallContext(message, client, cancelPaf); + var promiseAndPipeline = client.call(interfaceId, methodId, context); + var promise = promiseAndPipeline.promise.thenApply(x -> { + context.getResults(); // force allocation + return context.response; + }); + + return new RemotePromise(promise, promiseAndPipeline.pipeline); + } + + @Override + public Object getBrand() { + return null; + } } + static class LocalResponse implements ResponseHook { + final MessageBuilder message = new MessageBuilder(); + } + + static class LocalCallContext implements CallContextHook { + + final CompletableFuture cancelAllowed; + MessageBuilder request; + Response response; + AnyPointer.Builder responseBuilder; + ClientHook clientRef; + + LocalCallContext(MessageBuilder request, + ClientHook clientRef, + CompletableFuture cancelAllowed) { + this.request = request; + this.clientRef = clientRef; + this.cancelAllowed = cancelAllowed; + } + + @Override + public AnyPointer.Reader getParams() { + return request.getRoot(AnyPointer.factory).asReader(); + } + + @Override + public void releaseParams() { + this.request = null; + } + + @Override + public AnyPointer.Builder getResults() { + if (this.response == null) { + var localResponse = new LocalResponse(); + this.responseBuilder = localResponse.message.getRoot(AnyPointer.factory); + this.response = new Response(this.responseBuilder.asReader(), localResponse); + } + return this.responseBuilder; + } + + @Override + public void allowCancellation() { + this.cancelAllowed.complete(null); + } + + @Override + public CompletableFuture tailCall(RequestHook request) { + // TODO implement tailCall + return null; + } + + @Override + public CompletableFuture onTailCall() { + // TODO implement onTailCall + return null; + } + + @Override + public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { + // TODO implement directTailCall + return null; + } + } } diff --git a/runtime/src/main/java/org/capnproto/QueuedClient.java b/runtime/src/main/java/org/capnproto/QueuedClient.java new file mode 100644 index 00000000..886de671 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/QueuedClient.java @@ -0,0 +1,47 @@ +package org.capnproto; + +import java.util.concurrent.CompletableFuture; + +class QueuedClient implements ClientHook { + + final CompletableFuture promise; + final CompletableFuture promiseForCallForwarding; + final CompletableFuture promiseForClientResolution; + final CompletableFuture setResolutionOp; + ClientHook redirect; + + QueuedClient(CompletableFuture promise) { + // TODO revisit futures + this.promise = promise.copy(); + this.promiseForCallForwarding = promise.copy(); + this.promiseForClientResolution = promise.copy(); + this.setResolutionOp = promise.thenAccept(inner -> { + this.redirect = inner; + }).exceptionally(exc -> { + this.redirect = ClientHook.newBrokenCap(exc); + return null; + }); + } + + @Override + public Request newCall(long interfaceId, short methodId) { + var hook = new Capability.LocalRequest(interfaceId, methodId, this); + var root = hook.message.getRoot(AnyPointer.factory); + return new Request<>(root, hook); + } + + @Override + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { + return null; + } + + @Override + public ClientHook getResolved() { + return redirect; + } + + @Override + public CompletableFuture whenMoreResolved() { + return promiseForClientResolution; + } +} diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 6b2cfbe0..1e55de8d 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -81,7 +81,7 @@ boolean isDisconnected() { return this.disconnected != null; } - void handleMessage(IncomingRpcMessage message) { + void handleMessage(IncomingRpcMessage message) throws RpcException { var reader = message.getBody().getAs(RpcProtocol.Message.factory); switch (reader.which()) { @@ -110,7 +110,12 @@ void handleMessage(IncomingRpcMessage message) { handleDisembargo(reader.getDisembargo()); break; default: - // TODO send unimplemented response + if (!isDisconnected()) { + // boomin' back atcha + var msg = connection.newOutgoingMessage(1024); + msg.getBody().initAs(RpcProtocol.Message.factory).setUnimplemented(reader); + msg.send(); + } break; } } @@ -150,7 +155,8 @@ void handleUnimplemented(RpcProtocol.Message.Reader message) { } } - void handleAbort(RpcProtocol.Exception.Reader abort) { + void handleAbort(RpcProtocol.Exception.Reader abort) throws RpcException { + throw RpcException.toException(abort); } void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bootstrap) { @@ -338,7 +344,6 @@ CompletionStage resolveExportedPromise(int exportId, CompletionStage receiveCaps(StructList.Reader capTable, List fds) { + var result = new ArrayList(); + for (var cap: capTable) { + result.add(receiveCap(cap, fds)); + } + return result; + } + + private ClientHook receiveCap(RpcProtocol.CapDescriptor.Reader descriptor, List fds) { + // TODO AutoCloseFd + Integer fd = null; + + int fdIndex = descriptor.getAttachedFd(); + if (fdIndex >= 0 && fdIndex < fds.size()) { + fd = fds.get(fdIndex); + if (fd != null) { + fds.set(fdIndex, null); + } + } + + switch (descriptor.which()) { + case NONE: + return null; + + case SENDER_HOSTED: + return importCap(descriptor.getSenderHosted(), false, fd); + + case SENDER_PROMISE: + return importCap(descriptor.getSenderPromise(), true, fd); + + case RECEIVER_HOSTED: + var exp = exports.find(descriptor.getReceiverHosted()); + if (exp == null) { + return ClientHook.newBrokenCap("invalid 'receiverHosted' export ID"); + } + if (exp.clientHook.getBrand() == this) { + // TODO Tribble 4-way race! + return exp.clientHook; + } + + return exp.clientHook; + + case RECEIVER_ANSWER: + var promisedAnswer = descriptor.getReceiverAnswer(); + var answer = answers.find(promisedAnswer.getQuestionId()); + var ops = PipelineOp.ToPipelineOps(promisedAnswer); + + if (answer == null || !answer.active || answer.pipeline == null || ops == null) { + return ClientHook.newBrokenCap("invalid 'receiverAnswer'"); + } + + var result = answer.pipeline.getPipelinedCap(ops); + if (result == null) { + return ClientHook.newBrokenCap("Unrecognised pipeline ops"); + } + + if (result.getBrand() == this) { + // TODO Tribble 4-way race! + return result; + } + + return result; + + case THIRD_PARTY_HOSTED: + return ClientHook.newBrokenCap("Third party caps not supported"); + + default: + return ClientHook.newBrokenCap("unknown CapDescriptor type"); + } + } + + + private ClientHook importCap(int importId, boolean isPromise, Integer fd) { + // Receive a new import. + + var imp = imports.put(importId); + + if (imp.importClient == null) { + imp.importClient = new ImportClient(importId, fd); + } + else { + imp.importClient.setFdIfMissing(fd); + } + imp.importClient.addRemoteRef(); + + if (!isPromise) { + imp.appClient = imp.importClient; + return imp.importClient; + } + + if (imp.appClient != null) { + return imp.appClient; + } + + imp.promise = new CompletableFuture(); + var result = new PromiseClient(imp.importClient, imp.promise, importId); + imp.appClient = result; + return result; + } + + ClientHook writeTarget(ClientHook cap, RpcProtocol.MessageTarget.Builder target) { + return cap.getBrand() == this + ? ((RpcClient)cap).writeTarget(target) + : cap; + } + ClientHook getInnermostClient(ClientHook client) { for (;;) { var inner = client.getResolved(); @@ -465,16 +576,194 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } class ImportClient extends RpcClient { + + final int importId; + int remoteRefCount = 0; + Integer fd; + + ImportClient(int importId, Integer fd) { + this.importId = importId; + this.fd = fd; + } + + void addRemoteRef() { + this.remoteRefCount++; + } + + void setFdIfMissing(Integer fd) { + if (this.fd == null) { + this.fd = fd; + } + } + + public void dispose() { + // TODO manage destruction... + var imp = imports.find(importId); + if (imp != null) { + if (imp.importClient == this) { + imports.erase(importId, imp); + } + } + + if (remoteRefCount > 0 && !isDisconnected()) { + var message = connection.newOutgoingMessage(1024); + var builder = message.getBody().initAs(RpcProtocol.Message.factory).initRelease(); + builder.setId(importId); + builder.setReferenceCount(remoteRefCount); + message.send(); + } + } + @Override public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { + descriptor.setReceiverHosted(importId); return null; } @Override public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { + target.setImportedCap(importId); + return null; + } + + @Override + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { + return null; + } + + @Override + public CompletableFuture whenMoreResolved() { return null; } } + enum ResolutionType { + UNRESOLVED, + REMOTE, + REFLECTED, + MERGED, + BROKEN + } + + class PromiseClient extends RpcClient { + final ClientHook cap; + final Integer importId; + final CompletableFuture promise; + boolean receivedCall = false; + ResolutionType resolutionType = ResolutionType.UNRESOLVED; + + public PromiseClient(RpcClient initial, + CompletableFuture eventual, + Integer importId) { + this.cap = initial; + this.importId = importId; + this.promise = eventual.thenApply(resolution -> { + return resolve(resolution); + }); + } + + public boolean isResolved() { + return resolutionType != ResolutionType.UNRESOLVED; + } + + private ClientHook resolve(ClientHook replacement) { + assert !isResolved(); + + var replacementBrand = replacement.getBrand(); + boolean isSameConnection = replacementBrand == RpcState.this; + if (isSameConnection) { + var promise = replacement.whenMoreResolved(); + if (promise != null) { + var other = (PromiseClient)replacement; + while (other.resolutionType == ResolutionType.MERGED) { + replacement = other.cap; + other = (PromiseClient)replacement; + assert replacement.getBrand() == replacementBrand; + } + + if (other.isResolved()) { + resolutionType = other.resolutionType; + } + else { + other.receivedCall = other.receivedCall || receivedCall; + resolutionType = ResolutionType.MERGED; + } + } + else { + resolutionType = ResolutionType.REMOTE; + } + } + else { + if (replacementBrand == NULL_CAPABILITY_BRAND || + replacementBrand == BROKEN_CAPABILITY_BRAND) { + resolutionType = ResolutionType.BROKEN; + } + else { + resolutionType = ResolutionType.REFLECTED; + } + } + + assert isResolved(); + + // TODO Flow control + + if (resolutionType == ResolutionType.REFLECTED && receivedCall && !isDisconnected()) { + var message = connection.newOutgoingMessage(1024); + var disembargo = message.getBody().initAs(RpcProtocol.Message.factory).initDisembargo(); + { + var redirect = RpcState.this.writeTarget(cap, disembargo.initTarget()); + assert redirect == null; + } + + var embargo = new Embargo(); + var embargoId = embargos.next(embargo); + disembargo.getContext().setSenderLoopback(embargoId); + + embargo.fulfiller = new CompletableFuture<>(); + + final ClientHook finalReplacement = replacement; + var embargoPromise = embargo.fulfiller.thenApply(x -> { + return finalReplacement; + }); + + replacement = Capability.newLocalPromiseClient(embargoPromise); + message.send(); + + } + return replacement; + } + + ClientHook writeTarget(ClientHook cap, RpcProtocol.MessageTarget.Builder target) { + if (cap.getBrand() == this) { + return ((RpcClient)cap).writeTarget(target); + } + else { + return cap; + } + } + + @Override + public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder target, List fds) { + receivedCall = true; + return RpcState.this.writeDescriptor(cap, target, fds); + } + + @Override + public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { + receivedCall = true; + return RpcState.this.writeTarget(cap, target); + } + + @Override + public ClientHook getInnermostClient() { + receivedCall = true; + return RpcState.this.getInnermostClient(cap); + } + + @Override + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { + return null; + } + } } diff --git a/runtime/src/test/java/org/capnproto/RpcStateTest.java b/runtime/src/test/java/org/capnproto/RpcStateTest.java index 1d0e64e0..43faab31 100644 --- a/runtime/src/test/java/org/capnproto/RpcStateTest.java +++ b/runtime/src/test/java/org/capnproto/RpcStateTest.java @@ -9,8 +9,6 @@ import java.util.Queue; import java.util.concurrent.CompletableFuture; -import static org.junit.Assert.*; - public class RpcStateTest { class TestMessage implements IncomingRpcMessage { @@ -73,7 +71,7 @@ public void tearDown() throws Exception { } @Test - public void handleUnimplemented() { + public void handleUnimplemented() throws RpcException { var msg = new TestMessage(); msg.builder.getRoot(RpcProtocol.Message.factory).initUnimplemented(); rpc.handleMessage(msg); @@ -82,10 +80,14 @@ public void handleUnimplemented() { @Test public void handleAbort() { + var msg = new TestMessage(); + var builder = msg.builder.getRoot(RpcProtocol.Message.factory); + RpcException.fromException(RpcException.failed("Test abort"), builder.initAbort()); + Assert.assertThrows(RpcException.class, () -> rpc.handleMessage(msg)); } @Test - public void handleBootstrap() { + public void handleBootstrap() throws RpcException { var msg = new TestMessage(); var bootstrap = msg.builder.getRoot(RpcProtocol.Message.factory).initBootstrap(); bootstrap.setQuestionId(0); From 37c93cc5d2d30fc193f88c0ffa300b5820a0438f Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 28 Sep 2020 22:16:38 +0100 Subject: [PATCH 021/246] implement request send --- .../src/main/java/org/capnproto/QueuedClient.java | 2 +- runtime/src/main/java/org/capnproto/Request.java | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/QueuedClient.java b/runtime/src/main/java/org/capnproto/QueuedClient.java index 886de671..9c53bb54 100644 --- a/runtime/src/main/java/org/capnproto/QueuedClient.java +++ b/runtime/src/main/java/org/capnproto/QueuedClient.java @@ -27,7 +27,7 @@ class QueuedClient implements ClientHook { public Request newCall(long interfaceId, short methodId) { var hook = new Capability.LocalRequest(interfaceId, methodId, this); var root = hook.message.getRoot(AnyPointer.factory); - return new Request<>(root, hook); + return new Request<>(root, AnyPointer.factory, hook); } @Override diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index bedc248e..9a00f951 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -5,10 +5,12 @@ public class Request { private final AnyPointer.Builder params; - private final RequestHook hook; + private final FromPointerReader results; + private RequestHook hook; - Request(AnyPointer.Builder params, RequestHook hook) { + Request(AnyPointer.Builder params, FromPointerReader results, RequestHook hook) { this.params = params; + this.results = results; this.hook = hook; } @@ -17,7 +19,11 @@ AnyPointer.Builder params() { } CompletableFuture send() { - return null; + var typelessPromise = hook.send(); + hook = null; // prevent reuse + return typelessPromise.getResponse().thenApply(response -> { + return response.getAs(results); + }); } static Request newBrokenRequest(Throwable exc) { @@ -36,7 +42,7 @@ public Object getBrand() { }; var root = message.getRoot(AnyPointer.factory); - return new Request(root, hook); + return new Request(root, null, hook); } } From f5e4630aef93899a953de42984352c50398f85bb Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 29 Sep 2020 12:24:49 +0100 Subject: [PATCH 022/246] implement capability client and server --- .../main/java/org/capnproto/AnyPointer.java | 13 ++ .../main/java/org/capnproto/CallContext.java | 46 ++++ .../main/java/org/capnproto/Capability.java | 203 ++++++++++++++++++ .../java/org/capnproto/QueuedPipeline.java | 28 +++ .../src/main/java/org/capnproto/Request.java | 4 +- 5 files changed, 292 insertions(+), 2 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/CallContext.java create mode 100644 runtime/src/main/java/org/capnproto/QueuedPipeline.java diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 64f4acce..9a43473c 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -72,6 +72,19 @@ public final boolean isNull() { public final T getAs(FromPointerReader factory) { return factory.fromPointerReader(this.segment, this.capTable, this.pointer, this.nestingLimit); } + + public final ClientHook getPipelinedCap(PipelineOp[] ops) { + for (var op: ops) { + switch (op.type) { + case NOOP: + break; + case GET_POINTER_FIELD: + break; + } + } + // TODO implement getPipelinedCap + return null; + } } public static final class Builder { diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java new file mode 100644 index 00000000..42b02f3b --- /dev/null +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -0,0 +1,46 @@ +package org.capnproto; + +import java.util.concurrent.CompletableFuture; + +public class CallContext { + + final CallContextHook hook; + final FromPointerReader params; + final FromPointerBuilder results; + + CallContext(FromPointerReader params, + FromPointerBuilder results, + CallContextHook hook) { + this.hook = hook; + this.params = params; + this.results = results; + } + + public final Params getParams() { + return hook.getParams().getAs(params); + } + + public final void releaseParams() { + this.hook.releaseParams(); + } + + public final Results getResults() { + return this.hook.getResults().getAs(results); + } + + public final Results initResults() { + return this.hook.getResults().initAs(results); + } + + public final CompletableFuture tailCall(Request tailRequest) { + return hook.tailCall(tailRequest.hook); + } + + public final void allowCancellation() { + this.hook.allowCancellation(); + } + + public final CallContextHook getHook() { + return this.hook; + } +} diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 07187489..b38c3c44 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -8,9 +8,197 @@ public static class Client { final ClientHook hook; + public Client() { + this.hook = null; + } + public Client(ClientHook hook) { this.hook = hook; } + + public Client(Server server) { + this(server.makeLocalClient()); + } + + public Client(CompletableFuture promise) { + this(Capability.newLocalPromiseClient(promise)); + } + + public Client(Throwable exc) { + this(ClientHook.newBrokenCap(exc)); + } + + public ClientHook getHook() { + return this.hook; + } + + CompletableFuture whenResolved() { + return hook.whenResolved(); + } + + Request typelessRequest( + long interfaceId, + short methodId) { + return hook.newCall(interfaceId, methodId); + } + + public Request newCall(FromPointerBuilder builder, + FromPointerReader reader, + long interfaceId, short methodId) { + var request = hook.newCall(interfaceId, methodId); + return new Request (request.params, reader, request.hook); + } + + public Request newCall(long interfaceId, short methodId) { + return hook.newCall(interfaceId, methodId); + } + } + + public abstract static class Server { + + private static final Object BRAND = new Object(); + ClientHook hook; + + public ClientHook makeLocalClient() { + return new LocalClient(); + } + + private final class LocalClient implements ClientHook { + + CompletableFuture resolveTask; + ClientHook resolved; + boolean blocked = false; + Exception brokenException; + + LocalClient() { + Server.this.hook = this; + startResolveTask(); + } + + @Override + public Request newCall(long interfaceId, short methodId) { + var hook = new LocalRequest(interfaceId, methodId, this); + var root = hook.message.getRoot(AnyPointer.factory); + return new Request<>(root, AnyPointer.factory, hook); + } + + @Override + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { + assert !blocked: "Blocked condition not implemented"; + if (blocked) { + // TODO implement blocked behaviour + return null; + } + + // TODO re-visit promises + var promise = callInternal(interfaceId, methodId, ctx); + var forked = promise.copy(); + + CompletableFuture pipelinePromise = promise.thenApply(x -> { + ctx.releaseParams(); + return new LocalPipeline(ctx); + }); + + pipelinePromise = ctx.onTailCall().applyToEither(pipelinePromise, pipeline -> { + return pipeline; + }); + + return new VoidPromiseAndPipeline(forked, new QueuedPipeline(pipelinePromise)); + } + + @Override + public CompletableFuture whenResolved() { + return null; + } + + @Override + public Object getBrand() { + return BRAND; + } + + CompletableFuture callInternal(long interfaceId, short methodId, CallContextHook context) { + var result = dispatchCall( + interfaceId, + methodId, + new CallContext(AnyPointer.factory, AnyPointer.factory, context)); + if (result.streaming) { + // TODO streaming + return null; + } + else { + return result.promise; + } + } + + void startResolveTask() { + var resolver = Server.this.shortenPath(); + if (resolver == null) { + return; + } + this.resolveTask = resolver.thenAccept(client -> { + this.resolved = client.getHook(); + }); + } + } + + public final class DispatchCallResult { + private final CompletableFuture promise; + private final boolean streaming; + + public DispatchCallResult(CompletableFuture promise) { + this.promise = promise; + this.streaming = false; + } + + DispatchCallResult(Throwable exc) { + this.promise = CompletableFuture.failedFuture(exc); + this.streaming = false; + } + + DispatchCallResult(CompletableFuture promise, boolean isStreaming) { + this.promise = promise; + this.streaming = isStreaming; + } + + public CompletableFuture getPromise() { + return promise; + } + + public boolean isStreaming() { + return streaming; + } + } + + public CompletableFuture shortenPath() { + return null; + } + + protected Client thisCap() { + return new Client(hook); + } + + protected final CallContext internalGetTypedContext( + FromPointerReader paramsFactory, + FromPointerBuilder resultsFactory, + CallContext typeless) { + return new CallContext<>(paramsFactory, resultsFactory, typeless.hook); + } + + public abstract DispatchCallResult dispatchCall(long interfaceId, short methodId, CallContext context); + + protected DispatchCallResult internalUnimplemented(String actualInterfaceName, long requestedTypeId) { + return new DispatchCallResult(RpcException.unimplemented( + "Method not implemented. " + actualInterfaceName + " " + requestedTypeId)); + } + protected DispatchCallResult internalUnimplemented(String interfaceName, long typeId, short methodId) { + return new DispatchCallResult(RpcException.unimplemented( + "Method not implemented. " + interfaceName + " " + typeId + " " + methodId)); + } + + protected DispatchCallResult internalUnimplemented(String interfaceName, String methodName, long typeId, short methodId) { + return new DispatchCallResult(RpcException.unimplemented( + "Method not implemented. " + interfaceName + " " + typeId + " " + methodName + " " + methodId)); + } } static ClientHook newLocalPromiseClient(CompletableFuture promise) { @@ -49,6 +237,21 @@ public Object getBrand() { } } + static final class LocalPipeline implements PipelineHook { + final CallContextHook context; + final AnyPointer.Reader results; + + public LocalPipeline(CallContextHook context) { + this.context = context; + this.results = context.getResults().asReader(); + } + + @Override + public final ClientHook getPipelinedCap(PipelineOp[] ops) { + return this.results.getPipelinedCap(ops); + } + } + static class LocalResponse implements ResponseHook { final MessageBuilder message = new MessageBuilder(); } diff --git a/runtime/src/main/java/org/capnproto/QueuedPipeline.java b/runtime/src/main/java/org/capnproto/QueuedPipeline.java new file mode 100644 index 00000000..8256563e --- /dev/null +++ b/runtime/src/main/java/org/capnproto/QueuedPipeline.java @@ -0,0 +1,28 @@ +package org.capnproto; + +import java.util.concurrent.CompletableFuture; + +final class QueuedPipeline implements PipelineHook { + + final CompletableFuture promise; + final CompletableFuture selfResolutionOp; + PipelineHook redirect; + + public QueuedPipeline(CompletableFuture promiseParam) { + this.promise = promiseParam.copy(); + this.selfResolutionOp = promise.handle((pipeline, exc) -> { + this.redirect = exc == null + ? pipeline + : PipelineHook.newBrokenPipeline(exc); + return null; + }); + } + + @Override + public final ClientHook getPipelinedCap(PipelineOp[] ops) { + return redirect != null + ? redirect.getPipelinedCap(ops) + : new QueuedClient(this.promise.thenApply( + pipeline -> pipeline.getPipelinedCap(ops))); + } +} diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index 9a00f951..36cdc306 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -4,9 +4,9 @@ public class Request { - private final AnyPointer.Builder params; + final AnyPointer.Builder params; private final FromPointerReader results; - private RequestHook hook; + RequestHook hook; Request(AnyPointer.Builder params, FromPointerReader results, RequestHook hook) { this.params = params; From 4a77f678191d01f74159b2971f5a7bf0e759a0cd Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 29 Sep 2020 14:08:23 +0100 Subject: [PATCH 023/246] twoparty rpc --- .../main/java/org/capnproto/AnyPointer.java | 7 + .../main/java/org/capnproto/CallContext.java | 4 +- .../main/java/org/capnproto/Capability.java | 81 +- .../main/java/org/capnproto/ClientHook.java | 47 +- .../main/java/org/capnproto/ExportTable.java | 21 +- .../main/java/org/capnproto/PipelineHook.java | 2 +- .../main/java/org/capnproto/QueuedClient.java | 4 +- .../src/main/java/org/capnproto/Request.java | 30 +- .../src/main/java/org/capnproto/RpcState.java | 708 +++++++++++++++++- .../main/java/org/capnproto/RpcSystem.java | 42 +- .../java/org/capnproto/TwoPartyClient.java | 33 + .../java/org/capnproto/TwoPartyRpcSystem.java | 14 +- .../java/org/capnproto/TwoPartyServer.java | 64 ++ .../org/capnproto/TwoPartyVatNetwork.java | 35 +- .../main/java/org/capnproto/VatNetwork.java | 8 +- .../main/java/org/capnproto/WireHelpers.java | 6 +- .../test/java/org/capnproto/RpcStateTest.java | 5 +- .../test/java/org/capnproto/TwoPartyTest.java | 216 ++++++ .../test/java/org/capnproto/demo/Demo.java | 371 +++++++++ .../java/org/capnproto/demo/democap.capnp | 12 + .../java/org/capnproto/demo/democap.capnp.c++ | 190 +++++ .../java/org/capnproto/demo/democap.capnp.h | 216 ++++++ .../java/org/capnproto/demo/demoparams.capnp | 23 + 23 files changed, 2017 insertions(+), 122 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/TwoPartyClient.java create mode 100644 runtime/src/main/java/org/capnproto/TwoPartyServer.java create mode 100644 runtime/src/test/java/org/capnproto/TwoPartyTest.java create mode 100644 runtime/src/test/java/org/capnproto/demo/Demo.java create mode 100644 runtime/src/test/java/org/capnproto/demo/democap.capnp create mode 100644 runtime/src/test/java/org/capnproto/demo/democap.capnp.c++ create mode 100644 runtime/src/test/java/org/capnproto/demo/democap.capnp.h create mode 100644 runtime/src/test/java/org/capnproto/demo/demoparams.capnp diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 9a43473c..5c3fac27 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -73,12 +73,19 @@ public final T getAs(FromPointerReader factory) { return factory.fromPointerReader(this.segment, this.capTable, this.pointer, this.nestingLimit); } + public final Capability.Client getAsCapability() { + return new Capability.Client( + WireHelpers.readCapabilityPointer(this.segment, capTable, this.pointer, 0)); + } + public final ClientHook getPipelinedCap(PipelineOp[] ops) { for (var op: ops) { switch (op.type) { case NOOP: break; case GET_POINTER_FIELD: + var index = op.pointerIndex; + // TODO getpointerfield break; } } diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java index 42b02f3b..a01d9e6c 100644 --- a/runtime/src/main/java/org/capnproto/CallContext.java +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -5,8 +5,8 @@ public class CallContext { final CallContextHook hook; - final FromPointerReader params; - final FromPointerBuilder results; + private final FromPointerReader params; + private final FromPointerBuilder results; CallContext(FromPointerReader params, FromPointerBuilder results, diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index b38c3c44..9706fd0c 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -25,7 +25,7 @@ public Client(CompletableFuture promise) { } public Client(Throwable exc) { - this(ClientHook.newBrokenCap(exc)); + this(newBrokenCap(exc)); } public ClientHook getHook() { @@ -46,12 +46,16 @@ public Request newCall(FromPointerBuilder builder, FromPointerReader reader, long interfaceId, short methodId) { var request = hook.newCall(interfaceId, methodId); - return new Request (request.params, reader, request.hook); + return new Request (builder, reader, request.params, request.hook); } public Request newCall(long interfaceId, short methodId) { return hook.newCall(interfaceId, methodId); } + + private static ClientHook makeLocalClient(Capability.Server server) { + return server.makeLocalClient(); + } } public abstract static class Server { @@ -79,7 +83,7 @@ private final class LocalClient implements ClientHook { public Request newCall(long interfaceId, short methodId) { var hook = new LocalRequest(interfaceId, methodId, this); var root = hook.message.getRoot(AnyPointer.factory); - return new Request<>(root, AnyPointer.factory, hook); + return new Request<>(AnyPointer.factory, AnyPointer.factory, root, hook); } @Override @@ -99,9 +103,11 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext return new LocalPipeline(ctx); }); - pipelinePromise = ctx.onTailCall().applyToEither(pipelinePromise, pipeline -> { - return pipeline; - }); + var tailCall = ctx.onTailCall(); + // TODO implement tailCall + if (tailCall != null) { + pipelinePromise = tailCall.applyToEither(pipelinePromise, pipeline -> pipeline); + } return new VoidPromiseAndPipeline(forked, new QueuedPipeline(pipelinePromise)); } @@ -116,11 +122,11 @@ public Object getBrand() { return BRAND; } - CompletableFuture callInternal(long interfaceId, short methodId, CallContextHook context) { + CompletableFuture callInternal(long interfaceId, short methodId, CallContextHook context) { var result = dispatchCall( interfaceId, methodId, - new CallContext(AnyPointer.factory, AnyPointer.factory, context)); + new CallContext<>(AnyPointer.factory, AnyPointer.factory, context)); if (result.streaming) { // TODO streaming return null; @@ -141,11 +147,11 @@ void startResolveTask() { } } - public final class DispatchCallResult { - private final CompletableFuture promise; + final class DispatchCallResult { + private final CompletableFuture promise; private final boolean streaming; - public DispatchCallResult(CompletableFuture promise) { + public DispatchCallResult(CompletableFuture promise) { this.promise = promise; this.streaming = false; } @@ -155,7 +161,7 @@ public DispatchCallResult(CompletableFuture promise) { this.streaming = false; } - DispatchCallResult(CompletableFuture promise, boolean isStreaming) { + DispatchCallResult(CompletableFuture promise, boolean isStreaming) { this.promise = promise; this.streaming = isStreaming; } @@ -201,10 +207,14 @@ protected DispatchCallResult internalUnimplemented(String interfaceName, String } } - static ClientHook newLocalPromiseClient(CompletableFuture promise) { + public static ClientHook newLocalPromiseClient(CompletableFuture promise) { return new QueuedClient(promise); } + public static PipelineHook newLocalPromisePipeline(CompletableFuture promise) { + return new QueuedPipeline(promise); + } + static class LocalRequest implements RequestHook { final MessageBuilder message = new MessageBuilder(); @@ -315,4 +325,49 @@ public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { return null; } } + + public static ClientHook newBrokenCap(String reason) { + return newBrokenClient(reason, false, ClientHook.BROKEN_CAPABILITY_BRAND); + } + + public static ClientHook newBrokenCap(Throwable exc) { + return newBrokenClient(exc, false, ClientHook.BROKEN_CAPABILITY_BRAND); + } + + public static ClientHook newNullCap() { + return newBrokenClient(new RuntimeException("Called null capability"), true, ClientHook.NULL_CAPABILITY_BRAND); + } + + static private ClientHook newBrokenClient(String reason, boolean resolved, Object brand) { + return newBrokenClient(new RuntimeException(reason), resolved, brand); + } + + static private ClientHook newBrokenClient(Throwable exc, boolean resolved, Object brand) { + return new ClientHook() { + @Override + public Request newCall(long interfaceId, short methodId) { + return Request.newBrokenRequest(exc); + } + + @Override + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { + return new VoidPromiseAndPipeline(CompletableFuture.failedFuture(exc), null); + } + + @Override + public CompletableFuture whenMoreResolved() { + if (resolved) { + return null; + } else { + return CompletableFuture.failedFuture(exc); + } + } + + @Override + public Object getBrand() { + return brand; + } + }; + } + } diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index 8e8ad8d6..9dc49aed 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -43,56 +43,13 @@ default Integer getFd() { } final class VoidPromiseAndPipeline { - public final CompletableFuture promise; + public final CompletableFuture promise; public final PipelineHook pipeline; - VoidPromiseAndPipeline(CompletableFuture promise, PipelineHook pipeline) { + VoidPromiseAndPipeline(CompletableFuture promise, PipelineHook pipeline) { this.promise = promise; this.pipeline = pipeline; } } - static ClientHook newBrokenCap(String reason) { - return newBrokenClient(reason, false, BROKEN_CAPABILITY_BRAND); - } - - static ClientHook newBrokenCap(Throwable exc) { - return newBrokenClient(exc, false, BROKEN_CAPABILITY_BRAND); - } - - static ClientHook newNullCap() { - return newBrokenClient(new RuntimeException("Called null capability"), true, NULL_CAPABILITY_BRAND); - } - - static private ClientHook newBrokenClient(String reason, boolean resolved, Object brand) { - return newBrokenClient(new RuntimeException(reason), resolved, brand); - } - - static private ClientHook newBrokenClient(Throwable exc, boolean resolved, Object brand) { - return new ClientHook() { - @Override - public Request newCall(long interfaceId, short methodId) { - return Request.newBrokenRequest(exc); - } - - @Override - public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { - return new VoidPromiseAndPipeline(CompletableFuture.failedFuture(exc), null); - } - - @Override - public CompletableFuture whenMoreResolved() { - if (resolved) { - return null; - } else { - return CompletableFuture.failedFuture(exc); - } - } - - @Override - public Object getBrand() { - return brand; - } - }; - } } diff --git a/runtime/src/main/java/org/capnproto/ExportTable.java b/runtime/src/main/java/org/capnproto/ExportTable.java index d199130e..f91a7e0b 100644 --- a/runtime/src/main/java/org/capnproto/ExportTable.java +++ b/runtime/src/main/java/org/capnproto/ExportTable.java @@ -6,12 +6,14 @@ import java.util.Queue; import java.util.function.Consumer; -class ExportTable implements Iterable { +abstract class ExportTable implements Iterable { final HashMap slots = new HashMap<>(); final Queue freeIds = new PriorityQueue<>(); int max = 0; + abstract T newExportable(int id); + public T find(int id) { return slots.get(id); } @@ -26,17 +28,12 @@ public T erase(int id, T entry) { } } - public int next(T value) { - if (freeIds.isEmpty()) { - var id = max; - max++; - slots.put(id, value); - return id; - } else { - var id = freeIds.remove(); - slots.put(id, value); - return id; - } + public T next() { + int id = freeIds.isEmpty() ? max++ : freeIds.remove(); + var value = newExportable(id); + var prev = slots.put(id, value); + assert prev == null; + return value; } @Override diff --git a/runtime/src/main/java/org/capnproto/PipelineHook.java b/runtime/src/main/java/org/capnproto/PipelineHook.java index d242f2de..f926c542 100644 --- a/runtime/src/main/java/org/capnproto/PipelineHook.java +++ b/runtime/src/main/java/org/capnproto/PipelineHook.java @@ -5,6 +5,6 @@ interface PipelineHook { ClientHook getPipelinedCap(PipelineOp[] ops); static PipelineHook newBrokenPipeline(Throwable exc) { - return ops -> ClientHook.newBrokenCap(exc); + return ops -> Capability.newBrokenCap(exc); } } diff --git a/runtime/src/main/java/org/capnproto/QueuedClient.java b/runtime/src/main/java/org/capnproto/QueuedClient.java index 9c53bb54..64171f12 100644 --- a/runtime/src/main/java/org/capnproto/QueuedClient.java +++ b/runtime/src/main/java/org/capnproto/QueuedClient.java @@ -18,7 +18,7 @@ class QueuedClient implements ClientHook { this.setResolutionOp = promise.thenAccept(inner -> { this.redirect = inner; }).exceptionally(exc -> { - this.redirect = ClientHook.newBrokenCap(exc); + this.redirect = Capability.newBrokenCap(exc); return null; }); } @@ -27,7 +27,7 @@ class QueuedClient implements ClientHook { public Request newCall(long interfaceId, short methodId) { var hook = new Capability.LocalRequest(interfaceId, methodId, this); var root = hook.message.getRoot(AnyPointer.factory); - return new Request<>(root, AnyPointer.factory, hook); + return new Request<>(AnyPointer.factory, AnyPointer.factory, root, hook); } @Override diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index 36cdc306..38c931ce 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -4,25 +4,29 @@ public class Request { - final AnyPointer.Builder params; - private final FromPointerReader results; + AnyPointer.Builder params; + private final FromPointerBuilder paramsBuilder; + private final FromPointerReader resultsReader; RequestHook hook; - Request(AnyPointer.Builder params, FromPointerReader results, RequestHook hook) { + Request(FromPointerBuilder paramsBuilder, + FromPointerReader resultsReader, + AnyPointer.Builder params, RequestHook hook) { + this.paramsBuilder = paramsBuilder; + this.resultsReader = resultsReader; this.params = params; - this.results = results; this.hook = hook; } - AnyPointer.Builder params() { - return params; + Params params() { + return params.getAs(paramsBuilder); } CompletableFuture send() { var typelessPromise = hook.send(); hook = null; // prevent reuse return typelessPromise.getResponse().thenApply(response -> { - return response.getAs(results); + return response.getAs(resultsReader); }); } @@ -42,7 +46,17 @@ public Object getBrand() { }; var root = message.getRoot(AnyPointer.factory); - return new Request(root, null, hook); + return new Request(null, null, root, hook); + } + + static Request newTypelessRequest(AnyPointer.Builder root, RequestHook hook) { + return new Request<>(AnyPointer.factory, AnyPointer.factory, root, hook); + } + + static Request fromTypeless(FromPointerBuilder params, + FromPointerReader results, + Request typeless) { + return new Request<>(params, results, typeless.params(), typeless.hook); } } diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 1e55de8d..0742d19e 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -3,15 +3,20 @@ import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; -import java.util.function.Consumer; final class RpcState { static final class Question { + final int id; List paramExports; boolean isAwaitingReturn = false; boolean isTailCall = false; boolean skipFinish = false; + + Question(int id) { + this.id = id; + } + CompletableFuture response = new CompletableFuture<>(); void reject(Throwable exc) { @@ -32,9 +37,14 @@ static final class Answer { } static final class Export { + final int id; int refcount; ClientHook clientHook; CompletionStage resolveOp; + + Export(int id) { + this.id = id; + } } static final class Import { @@ -45,11 +55,27 @@ static final class Import { } final static class Embargo { - CompletableFuture fulfiller; + final int id; + CompletableFuture disembargo; + + Embargo(int id) { + this.id = id; + } } - private final ExportTable exports = new ExportTable(); - private final ExportTable questions = new ExportTable(); + private final ExportTable exports = new ExportTable() { + @Override + Export newExportable(int id) { + return new Export(id); + } + }; + + private final ExportTable questions = new ExportTable() { + @Override + Question newExportable(int id) { + return new Question(id); + } + }; private final ImportTable answers = new ImportTable() { @Override @@ -65,25 +91,95 @@ protected Import newImportable() { } }; - private final ExportTable embargos = new ExportTable(); + private final ExportTable embargos = new ExportTable() { + @Override + Embargo newExportable(int id) { + return new Embargo(id); + } + }; private final HashMap exportsByCap = new HashMap<>(); private final VatNetwork.Connection connection; private final Capability.Client bootstrapInterface; private Throwable disconnected = null; + private CompletableFuture messageReady = CompletableFuture.completedFuture(null); RpcState(VatNetwork.Connection connection, Capability.Client bootstrapInterface) { this.connection = connection; this.bootstrapInterface = bootstrapInterface; } - boolean isDisconnected() { + final boolean isDisconnected() { return this.disconnected != null; } - void handleMessage(IncomingRpcMessage message) throws RpcException { + final boolean isConnected() { + return !isDisconnected(); + } + + ClientHook restore() { + var question = questions.next(); + question.isAwaitingReturn = true; + question.paramExports = List.of(); + var message = connection.newOutgoingMessage(64); + var builder = message.getBody().initAs(RpcProtocol.Message.factory).initBootstrap(); + builder.setQuestionId(question.id); + message.send(); + var pipeline = new RpcPipeline(question); + return pipeline.getPipelinedCap(new PipelineOp[0]); + } + + // run message loop once + final CompletableFuture runOnce() { + + if (isDisconnected()) { + return CompletableFuture.failedFuture(disconnected); + } + + if (!messageReady.isDone()) { + return messageReady; + } + + messageReady = connection.receiveIncomingMessage().thenAccept(message -> { + try { + handleMessage(message); + } + catch (Exception exc) { + this.disconnected = exc; + } + }).exceptionally(exc -> { + this.disconnected = exc; + return null; + }); + + return messageReady; + } + + // run message loop until promise is completed + public final CompletableFuture messageLoop(CompletableFuture done) { + if (done.isDone()) { + return done; + } + + if (isDisconnected()) { + done.completeExceptionally(disconnected); + return done; + } + + return connection.receiveIncomingMessage().thenCompose(message -> { + try { + handleMessage(message); + } + catch (Exception exc) { + done.completeExceptionally(exc); + } + return messageLoop(done); + }); + } + + synchronized void handleMessage(IncomingRpcMessage message) throws RpcException { var reader = message.getBody().getAs(RpcProtocol.Message.factory); - + System.out.println(reader.which()); switch (reader.which()) { case UNIMPLEMENTED: handleUnimplemented(reader.getUnimplemented()); @@ -194,7 +290,7 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo answer.resultExports = writeDescriptors(capTableArray, payload, fds); answer.pipeline = ops -> ops.length == 0 ? capHook - : ClientHook.newBrokenCap("Invalid pipeline transform."); + : Capability.newBrokenCap("Invalid pipeline transform."); response.send(); @@ -204,9 +300,148 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo } void handleCall(IncomingRpcMessage message, RpcProtocol.Call.Reader call) { + var cap = getMessageTarget(call.getTarget()); + if (cap == null) { + return; + } + + boolean redirectResults; + switch (call.getSendResultsTo().which()) { + case CALLER: + redirectResults = false; + break; + case YOURSELF: + redirectResults = true; + break; + default: + assert false: "Unsupported 'Call.sendResultsTo'."; + return; + } + + var payload = call.getParams(); + var capTableArray = receiveCaps(payload.getCapTable(), message.getAttachedFds()); + var answerId = call.getQuestionId(); + var cancel = new CompletableFuture(); + var context = new RpcCallContext( + answerId, message, capTableArray, + payload.getContent(), redirectResults, cancel, + call.getInterfaceId(), call.getMethodId()); + + { + var answer = answers.put(answerId); + assert !answer.active : "questionId is already in use"; + if (answer.active) { + return; + } + + answer.active = true; + answer.callContext = context; + } + + var pap = startCall(call.getInterfaceId(), call.getMethodId(), cap, context); + { + var answer = answers.find(answerId); + assert answer != null; + answer.pipeline = pap.pipeline; + + if (redirectResults) { + answer.redirectedResults = pap.promise.thenApply(x -> { + return context.consumeRedirectedResponse(); + }); + // TODO cancellation deferral + } + else { + pap.promise.thenAccept(x -> { + context.sendReturn(); + }).exceptionally(exc -> { + context.sendErrorReturn(exc); + // TODO wait on the cancellation... + return null; + }); + } + } + } + + private ClientHook.VoidPromiseAndPipeline startCall(long interfaceId, short methodId, ClientHook cap, RpcCallContext context) { + // TODO gateways...? + return cap.call(interfaceId, methodId, context); } void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callReturn) { + var exportsToRelease = new ArrayList(); + + var question = questions.find(callReturn.getAnswerId()); + assert question != null : "Invalid question ID in Return message."; + if (question == null) { + return; + } + + assert question.isAwaitingReturn: "Duplicate Return"; + if (!question.isAwaitingReturn) { + return; + } + + question.isAwaitingReturn = false; + if (callReturn.getReleaseParamCaps()) { + exportsToRelease.addAll(question.paramExports); + question.paramExports = List.of(); + } + + assert !callReturn.isTakeFromOtherQuestion(): "Not implemented"; + if (callReturn.isTakeFromOtherQuestion()) { + // TODO process isTakeFromOtherQuestion... + return; + } + + switch (callReturn.which()) { + case RESULTS: + if (question.isTailCall) { + // TODO resultsSentElsewhere + return; + } + var payload = callReturn.getResults(); + var capTable = receiveCaps(payload.getCapTable(), message.getAttachedFds()); + var response = new RpcResponseImpl(question, message, capTable, payload.getContent()); + question.answer(response); + break; + case EXCEPTION: + assert !question.isTailCall : "Tail call `Return` must set `resultsSentElsewhere`, not `exception`."; + if (question.isTailCall) { + return; + } + question.reject(RpcException.toException(callReturn.getException())); + break; + case CANCELED: + assert false : "Return message falsely claims call was canceled."; + break; + case RESULTS_SENT_ELSEWHERE: + assert question.isTailCall : "`Return` had `resultsSentElsewhere` but this was not a tail call."; + if (!question.isTailCall) { + return; + } + // Tail calls are fulfilled with a null pointer. + question.answer(() -> null); + break; + + case TAKE_FROM_OTHER_QUESTION: + var other = callReturn.getTakeFromOtherQuestion(); + var answer = answers.find(other); + assert answer != null : "`Return.takeFromOtherQuestion` had invalid answer ID."; + if (answer == null) { + return; + } + assert answer.redirectedResults != null : "`Return.takeFromOtherQuestion` referenced a call that did not use `sendResultsTo.yourself`."; + if (answer.redirectedResults == null) { + return; + } + question.response = answer.redirectedResults; + answer.redirectedResults = null; + break; + default: + assert false : "Unknown 'Return' type."; + return; + } + } void handleFinish(RpcProtocol.Finish.Reader finish) { @@ -218,7 +453,6 @@ void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolv void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { } - private List writeDescriptors(ClientHook[] capTable, RpcProtocol.Payload.Builder payload, List fds) { if (capTable.length == 0) { return List.of(); @@ -271,21 +505,20 @@ private Integer writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builde } // This is the first time we've seen this capability. - var export = new Export(); + var export = exports.next(); export.refcount = 1; export.clientHook = inner; - exportId = exports.next(export); var wrapped = inner.whenMoreResolved(); if (wrapped != null) { // This is a promise. Arrange for the `Resolve` message to be sent later. - export.resolveOp = resolveExportedPromise(exportId, wrapped); - descriptor.setSenderPromise(exportId); + export.resolveOp = resolveExportedPromise(export.id, wrapped); + descriptor.setSenderPromise(export.id); } else { - descriptor.setSenderHosted(exportId); + descriptor.setSenderHosted(export.id); } - return exportId; + return export.id; } CompletionStage resolveExportedPromise(int exportId, CompletionStage promise) { @@ -394,7 +627,7 @@ private ClientHook receiveCap(RpcProtocol.CapDescriptor.Reader descriptor, List< case RECEIVER_HOSTED: var exp = exports.find(descriptor.getReceiverHosted()); if (exp == null) { - return ClientHook.newBrokenCap("invalid 'receiverHosted' export ID"); + return Capability.newBrokenCap("invalid 'receiverHosted' export ID"); } if (exp.clientHook.getBrand() == this) { // TODO Tribble 4-way race! @@ -409,12 +642,12 @@ private ClientHook receiveCap(RpcProtocol.CapDescriptor.Reader descriptor, List< var ops = PipelineOp.ToPipelineOps(promisedAnswer); if (answer == null || !answer.active || answer.pipeline == null || ops == null) { - return ClientHook.newBrokenCap("invalid 'receiverAnswer'"); + return Capability.newBrokenCap("invalid 'receiverAnswer'"); } var result = answer.pipeline.getPipelinedCap(ops); if (result == null) { - return ClientHook.newBrokenCap("Unrecognised pipeline ops"); + return Capability.newBrokenCap("Unrecognised pipeline ops"); } if (result.getBrand() == this) { @@ -425,14 +658,13 @@ private ClientHook receiveCap(RpcProtocol.CapDescriptor.Reader descriptor, List< return result; case THIRD_PARTY_HOSTED: - return ClientHook.newBrokenCap("Third party caps not supported"); + return Capability.newBrokenCap("Third party caps not supported"); default: - return ClientHook.newBrokenCap("unknown CapDescriptor type"); + return Capability.newBrokenCap("unknown CapDescriptor type"); } } - private ClientHook importCap(int importId, boolean isPromise, Integer fd) { // Receive a new import. @@ -467,6 +699,39 @@ ClientHook writeTarget(ClientHook cap, RpcProtocol.MessageTarget.Builder target) : cap; } + ClientHook getMessageTarget(RpcProtocol.MessageTarget.Reader target) { + switch (target.which()) { + case IMPORTED_CAP: + var exp = exports.find(target.getImportedCap()); + assert exp != null: "Message target is not a current export ID."; + return exp != null ? exp.clientHook : null; + + case PROMISED_ANSWER: + var promisedAnswer = target.getPromisedAnswer(); + var base = answers.find(promisedAnswer.getQuestionId()); + assert base != null && base.active: "PromisedAnswer.questionId is not a current question."; + if (base == null || !base.active) { + return null; + } + + var pipeline = base.pipeline; + if (pipeline == null) { + pipeline = PipelineHook.newBrokenPipeline( + RpcException.failed("Pipeline call on a request that returned no capabilities or was already closed.")); + } + + var ops = PipelineOp.ToPipelineOps(promisedAnswer); + if (ops == null) { + return null; + } + return pipeline.getPipelinedCap(ops); + + default: + assert false: "Unknown message target type. " + target.which(); + return null; + } + } + ClientHook getInnermostClient(ClientHook client) { for (;;) { var inner = client.getResolved(); @@ -489,6 +754,79 @@ interface RpcResponse extends ResponseHook { AnyPointer.Reader getResults(); } + interface RpcServerResponse { + AnyPointer.Builder getResultsBuilder(); + } + + static class RpcResponseImpl implements RpcResponse { + private final Question question; + private final IncomingRpcMessage message; + private final AnyPointer.Reader results; + + RpcResponseImpl(Question question, + IncomingRpcMessage message, + List capTable, + AnyPointer.Reader results) { + this.question = question; + this.message = message; + this.results = results.imbue(new ReaderCapabilityTable(capTable)); + } + + public AnyPointer.Reader getResults() { + return results; + } + } + + class RpcServerResponseImpl implements RpcServerResponse { + + final OutgoingRpcMessage message; + final RpcProtocol.Payload.Builder payload; + final BuilderCapabilityTable capTable = new BuilderCapabilityTable(); + + RpcServerResponseImpl(OutgoingRpcMessage message, RpcProtocol.Payload.Builder payload) { + this.message = message; + this.payload = payload; + } + + @Override + public AnyPointer.Builder getResultsBuilder() { + return payload.getContent().imbue(capTable); + } + + List send() { + var capTable = this.capTable.getTable(); + var fds = List.of(); + var exports = writeDescriptors(capTable, payload, fds); + // TODO process FDs + message.setFds(fds); + + for (int ii = 0; ii < capTable.length; ++ii) { + var slot = capTable[ii]; + if (slot != null) { + capTable[ii] = getInnermostClient(slot); + } + } + + message.send(); + return exports; + } + } + + private static class LocallyRedirectedRpcResponse implements RpcServerResponse, RpcResponse { + + private final MessageBuilder message = new MessageBuilder(); + + @Override + public AnyPointer.Builder getResultsBuilder() { + return message.getRoot(AnyPointer.factory); + } + + @Override + public AnyPointer.Reader getResults() { + return getResultsBuilder().asReader(); + } + } + class RpcCallContext implements CallContextHook { final int answerId; @@ -500,9 +838,13 @@ class RpcCallContext implements CallContextHook { final AnyPointer.Reader params; // response - RpcResponse response; + RpcServerResponse response; RpcProtocol.Return.Builder returnMessage; boolean redirectResults = false; + boolean responseSent = false; + + boolean cancelRequested = false; + boolean cancelAllowed = false; final CompletableFuture cancelled; @@ -531,7 +873,20 @@ public void releaseParams() { @Override public AnyPointer.Builder getResults() { - return null; + if (response != null) { + return response.getResultsBuilder(); + } + + if (redirectResults || isDisconnected()) { + response = new LocallyRedirectedRpcResponse(); + } + else { + var message = connection.newOutgoingMessage(1024); + returnMessage = message.getBody().initAs(RpcProtocol.Message.factory).initReturn(); + response = new RpcServerResponseImpl(message, returnMessage.getResults()); + } + + return response.getResultsBuilder(); } @Override @@ -552,6 +907,147 @@ public CompletableFuture onTailCall() { public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { return null; } + + RpcResponse consumeRedirectedResponse() { + assert this.redirectResults; + + if (this.response == null) { + getResults(); // force initialization of response + } + + return ((LocallyRedirectedRpcResponse)this.response); + } + + void sendReturn() { + assert !redirectResults; + + if (!this.cancelRequested && isDisconnected()) { + assert false: "Cancellation should have been requested on disconnect."; + return; + } + + if (this.response == null) { + getResults(); // force initialization + } + + this.returnMessage.setAnswerId(this.answerId); + this.returnMessage.setReleaseParamCaps(false); + + List exports; + try { + exports = ((RpcServerResponseImpl)response).send(); + } + catch (Throwable exc) { + this.responseSent = false; + sendErrorReturn(exc); + } + } + + void sendErrorReturn(Throwable exc) { + assert !redirectResults; + + if (!isFirstResponder()) { + return; + } + + if (isConnected()) { + var message = connection.newOutgoingMessage(1024); + var builder = message.getBody().initAs(RpcProtocol.Message.factory).initReturn(); + builder.setAnswerId(this.answerId); + builder.setReleaseParamCaps(false); + RpcException.fromException(exc, builder.initException()); + message.send(); + } + + cleanupAnswerTable(null, false); + } + + boolean isFirstResponder() { + if (this.responseSent) { + return false; + } + this.responseSent = true; + return true; + } + + void cleanupAnswerTable(List resultExports, boolean shouldFreePipeline) { + if (this.cancelRequested) { + assert resultExports.size() == 0; + answers.erase(this.answerId); + return; + } + else { + var answer = answers.find(answerId); + answer.callContext = null; + answer.resultExports = resultExports; + + if (shouldFreePipeline) { + assert resultExports.size() == 0; + answer.pipeline = null; + } + } + } + } + + enum PipelineState { + WAITING, RESOLVED, BROKEN + } + + class RpcPipeline implements PipelineHook { + + private final Question question; + private PipelineState state = PipelineState.WAITING; + private RpcResponse resolved; + private Throwable broken; + + final HashMap, ClientHook> clientMap = new HashMap<>(); + final CompletionStage redirectLater; + final CompletionStage resolveSelf; + + RpcPipeline(Question question, + CompletionStage redirectLater) { + this.question = question; + this.redirectLater = redirectLater; + this.resolveSelf = this.redirectLater + .thenAccept(response -> { + this.state = PipelineState.RESOLVED; + this.resolved = response; + }) + .exceptionally(exc -> { + this.state = PipelineState.BROKEN; + this.broken = exc; + return null; + }); + } + + RpcPipeline(Question question) { + // never resolves + this.question = question; + this.redirectLater = null; + this.resolveSelf = null; + } + + @Override + public ClientHook getPipelinedCap(PipelineOp[] ops) { + // TODO avoid conversion to/from ArrayList? + var key = new ArrayList<>(Arrays.asList(ops)); + var hook = this.clientMap.computeIfAbsent(key, k -> { + switch (state) { + case WAITING: + if (redirectLater != null) { + // TODO implement redirect + assert false: "redirection not implemented"; + return null; + } + return new PipelineClient(question, ops); + case RESOLVED: + return resolved.getResults().getPipelinedCap(ops); + default: + return Capability.newBrokenCap(broken); + } + }); + return hook; + } } abstract class RpcClient implements ClientHook { @@ -566,13 +1062,130 @@ public ClientHook getInnermostClient() { @Override public Request newCall(long interfaceId, short methodId) { - return null; + return newCallNoIntercept(interfaceId, methodId); } @Override public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { return null; } + + public VoidPromiseAndPipeline callNoIntercept(long interfaceId, short methodId, CallContextHook context) { + var params = context.getParams(); + var request = newCallNoIntercept(interfaceId, methodId); + var x = request.params; + context.allowCancellation(); + return context.directTailCall(request.hook); + } + + private Request newCallNoIntercept(long interfaceId, short methodId) { + if (isDisconnected()) { + return Request.newBrokenRequest(disconnected); + } + + var request = new RpcRequest(this); + var callBuilder = request.getCall(); + callBuilder.setInterfaceId(interfaceId); + callBuilder.setMethodId(methodId); + var root = request.getRoot(); + return Request.newTypelessRequest(root, request); + } + } + + class RpcRequest implements RequestHook { + + final RpcClient target; + final OutgoingRpcMessage message; + final BuilderCapabilityTable capTable = new BuilderCapabilityTable(); + final RpcProtocol.Call.Builder callBuilder; + final AnyPointer.Builder paramsBuilder; + + RpcRequest(RpcClient target) { + this.target = target; + this.message = connection.newOutgoingMessage(1024); + this.callBuilder = message.getBody().getAs(RpcProtocol.Message.factory).initCall(); + this.paramsBuilder = callBuilder.getParams().getContent(); + } + + AnyPointer.Builder getRoot() { + return this.paramsBuilder; + } + RpcProtocol.Call.Builder getCall() { + return this.callBuilder; + } + + @Override + public RemotePromise send() { + if (isDisconnected()) { + return new RemotePromise<>(CompletableFuture.failedFuture(disconnected), null); + } + + var redirect = this.target.writeTarget(this.callBuilder.getTarget()); + if (redirect != null) { + var replacement = redirect.newCall( + this.callBuilder.getInterfaceId(), this.callBuilder.getMethodId()); + replacement.params = paramsBuilder; + return replacement.hook.send(); + } + + var question = sendInternal(false); + + // The pipeline must get notified of resolution before the app does to maintain ordering. + var pipeline = new RpcPipeline(question, question.response); + + // drive the message loop until the question is answered + var appPromise = messageLoop(question.response).thenApply(response -> { + var results = response.getResults(); + return new Response(results, response); + }); + + return new RemotePromise<>(appPromise, pipeline); + } + + Question sendInternal(boolean isTailCall) { + // TODO refactor + var fds = List.of(); + var exports = writeDescriptors(capTable.getTable(), callBuilder.getParams(), fds); + message.setFds(fds); + var question = questions.next(); + question.isAwaitingReturn = true; + question.isTailCall = isTailCall; + question.paramExports = exports; + + callBuilder.setQuestionId(question.id); + if (isTailCall) { + callBuilder.getSendResultsTo().getYourself(); + } + try { + message.send(); + } catch (Exception exc) { + question.isAwaitingReturn = false; + question.skipFinish = true; + question.reject(exc); + } + return question; + } + + @Override + public Object getBrand() { + return RpcState.this; + } + + final class TailInfo { + int questionId; + CompletableFuture promise; + PipelineHook pipeline; + } + + TailInfo tailSend() { + if (isDisconnected()) { + // Disconnected; fall back to a regular send() which will fail appropriately. + return null; + } + + // TODO implement tail-calls + return null; + } } class ImportClient extends RpcClient { @@ -715,14 +1328,13 @@ private ClientHook resolve(ClientHook replacement) { assert redirect == null; } - var embargo = new Embargo(); - var embargoId = embargos.next(embargo); - disembargo.getContext().setSenderLoopback(embargoId); + var embargo = embargos.next(); + disembargo.getContext().setSenderLoopback(embargo.id); - embargo.fulfiller = new CompletableFuture<>(); + embargo.disembargo = new CompletableFuture<>(); final ClientHook finalReplacement = replacement; - var embargoPromise = embargo.fulfiller.thenApply(x -> { + var embargoPromise = embargo.disembargo.thenApply(x -> { return finalReplacement; }); @@ -766,4 +1378,40 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } } + class PipelineClient extends RpcClient { + + private final Question question; + private final PipelineOp[] ops; + + PipelineClient(Question question, PipelineOp[] ops) { + this.question = question; + this.ops = ops; + } + + @Override + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { + return null; + } + + @Override + public CompletableFuture whenMoreResolved() { + return null; + } + + @Override + public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { + var promisedAnswer = descriptor.initReceiverAnswer(); + promisedAnswer.setQuestionId(question.id); + PipelineOp.FromPipelineOps(ops, promisedAnswer); + return null; + } + + @Override + public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { + var builder = target.initPromisedAnswer(); + builder.setQuestionId(question.id); + PipelineOp.FromPipelineOps(ops, builder); + return null; + } + } } diff --git a/runtime/src/main/java/org/capnproto/RpcSystem.java b/runtime/src/main/java/org/capnproto/RpcSystem.java index 60f5aab6..d6bb2907 100644 --- a/runtime/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime/src/main/java/org/capnproto/RpcSystem.java @@ -1,4 +1,44 @@ package org.capnproto; -public class RpcSystem { +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +public abstract class RpcSystem { + + final Network network; + final Capability.Client bootstrapInterface; + final Map connections = new HashMap<>(); + CompletableFuture acceptCompleted = CompletableFuture.completedFuture(null); + + public RpcSystem(Network network, Capability.Client bootstrapInterface) { + this.network = network; + this.bootstrapInterface = bootstrapInterface; + } + + public void accept(VatNetwork.Connection connection) { + getConnectionState(connection); + } + + synchronized RpcState getConnectionState(VatNetwork.Connection connection) { + return connections.computeIfAbsent(connection, key -> + new RpcState(key, bootstrapInterface)); + } + + public final CompletableFuture runOnce() { + var done = acceptLoop(); + for (var conn : connections.values()) { + done = CompletableFuture.anyOf(done, conn.runOnce()); + } + return done; + } + + + CompletableFuture acceptLoop() { + if (this.acceptCompleted.isDone()) { + CompletableFuture accepted = this.network.baseAccept(); + this.acceptCompleted = accepted.thenAccept(this::accept); + } + return this.acceptCompleted; + } } diff --git a/runtime/src/main/java/org/capnproto/TwoPartyClient.java b/runtime/src/main/java/org/capnproto/TwoPartyClient.java new file mode 100644 index 00000000..1707e031 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/TwoPartyClient.java @@ -0,0 +1,33 @@ +package org.capnproto; + +import java.nio.channels.AsynchronousByteChannel; + +public class TwoPartyClient { + + private final TwoPartyVatNetwork network; + private final TwoPartyRpcSystem rpcSystem; + + public TwoPartyClient(AsynchronousByteChannel channel) { + this(channel, null); + } + + public TwoPartyClient(AsynchronousByteChannel channel, Capability.Client bootstrapInterface) { + this(channel, bootstrapInterface, RpcTwoPartyProtocol.Side.CLIENT); + } + + public TwoPartyClient(AsynchronousByteChannel channel, + Capability.Client bootstrapInterface, + RpcTwoPartyProtocol.Side side) { + this.network = new TwoPartyVatNetwork(channel, side); + this.rpcSystem = new TwoPartyRpcSystem(network, bootstrapInterface); + } + + public Capability.Client bootstrap() { + var message = new MessageBuilder(); + var vatId = message.getRoot(RpcTwoPartyProtocol.VatId.factory); + vatId.setSide(network.getSide() == RpcTwoPartyProtocol.Side.CLIENT + ? RpcTwoPartyProtocol.Side.SERVER + : RpcTwoPartyProtocol.Side.CLIENT); + return rpcSystem.bootstrap(vatId.asReader()); + } +} diff --git a/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java b/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java index 16718436..d7996b1c 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java @@ -1,4 +1,16 @@ package org.capnproto; -public class TwoPartyRpcSystem extends RpcSystem { +public class TwoPartyRpcSystem + extends RpcSystem { + + public TwoPartyRpcSystem(TwoPartyVatNetwork network, Capability.Client bootstrapInterface) { + super(network, bootstrapInterface); + } + + public Capability.Client bootstrap(RpcTwoPartyProtocol.VatId.Reader vatId) { + var connection = this.network.baseConnect(vatId); + var state = getConnectionState(connection); + var hook = state.restore(); + return new Capability.Client(hook); + } } diff --git a/runtime/src/main/java/org/capnproto/TwoPartyServer.java b/runtime/src/main/java/org/capnproto/TwoPartyServer.java new file mode 100644 index 00000000..8a27315c --- /dev/null +++ b/runtime/src/main/java/org/capnproto/TwoPartyServer.java @@ -0,0 +1,64 @@ +package org.capnproto; + +import java.nio.channels.AsynchronousByteChannel; +import java.nio.channels.AsynchronousServerSocketChannel; +import java.nio.channels.AsynchronousSocketChannel; +import java.nio.channels.CompletionHandler; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class TwoPartyServer { + + private class AcceptedConnection { + final AsynchronousByteChannel channel; + final TwoPartyVatNetwork network; + final TwoPartyRpcSystem rpcSystem; + + AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousByteChannel channel) { + this.channel = channel; + this.network = new TwoPartyVatNetwork(channel, RpcTwoPartyProtocol.Side.SERVER); + this.rpcSystem = new TwoPartyRpcSystem(network, bootstrapInterface); + } + + public CompletableFuture runOnce() { + return this.rpcSystem.runOnce(); + } + } + + private final Capability.Client bootstrapInterface; + private final List connections = new ArrayList<>(); + private final List listeners = new ArrayList<>(); + + public TwoPartyServer(Capability.Client bootstrapInterface) { + this.bootstrapInterface = bootstrapInterface; + } + + private synchronized void accept(AsynchronousByteChannel channel) { + var connection = new AcceptedConnection(this.bootstrapInterface, channel); + this.connections.add(connection); + } + + public void listen(AsynchronousServerSocketChannel listener) { + listener.accept(null, new CompletionHandler() { + @Override + public void completed(AsynchronousSocketChannel channel, Object attachment) { + accept(channel); + listen(listener); + } + + @Override + public void failed(Throwable exc, Object attachment) { + listeners.remove(listener); + } + }); + } + + public synchronized CompletableFuture runOnce() { + var done = new CompletableFuture(); + for (var conn: connections) { + done = CompletableFuture.anyOf(done, conn.runOnce()); + } + return done; + } +} diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 75d822a4..3a204691 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -3,13 +3,18 @@ import java.nio.channels.AsynchronousByteChannel; import java.util.List; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; -public class TwoPartyVatNetwork implements VatNetwork, VatNetwork.Connection { +public class TwoPartyVatNetwork + implements VatNetwork, VatNetwork.Connection { private CompletableFuture writeCompleted = CompletableFuture.completedFuture(null); + private final Executor executor = Executors.newSingleThreadExecutor(); private final AsynchronousByteChannel channel; private final RpcTwoPartyProtocol.Side side; private final MessageBuilder peerVatId = new MessageBuilder(4); + private boolean accepted; public TwoPartyVatNetwork(AsynchronousByteChannel channel, RpcTwoPartyProtocol.Side side) { this.channel = channel; @@ -28,6 +33,24 @@ public RpcTwoPartyProtocol.VatId.Reader getPeerVatId() { return peerVatId.getRoot(RpcTwoPartyProtocol.VatId.factory).asReader(); } + private Connection connect(RpcTwoPartyProtocol.VatId.Reader vatId) { + if (vatId.getSide() != side) { + return this; + } + return null; + } + + private CompletableFuture accept() { + if (side == RpcTwoPartyProtocol.Side.SERVER & !accepted) { + accepted = true; + return CompletableFuture.completedFuture(this); + } + else { + // never completes + return new CompletableFuture<>(); + } + } + @Override public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { return new OutgoingMessage(firstSegmentWordSize); @@ -40,6 +63,16 @@ public CompletableFuture receiveIncomingMessage() { }); } + @Override + public Connection baseConnect(RpcTwoPartyProtocol.VatId.Reader hostId) { + return this.connect(hostId); + } + + @Override + public CompletableFuture baseAccept() { + return this.accept().thenApply(conn -> conn); + } + final class OutgoingMessage implements OutgoingRpcMessage { final MessageBuilder message; diff --git a/runtime/src/main/java/org/capnproto/VatNetwork.java b/runtime/src/main/java/org/capnproto/VatNetwork.java index 16a4c21d..96c2cf11 100644 --- a/runtime/src/main/java/org/capnproto/VatNetwork.java +++ b/runtime/src/main/java/org/capnproto/VatNetwork.java @@ -1,13 +1,17 @@ package org.capnproto; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; -public interface VatNetwork { +public interface VatNetwork { interface Connection { OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize); CompletableFuture receiveIncomingMessage(); - } + } + + Connection baseConnect(VatId hostId); + CompletableFuture baseAccept(); } diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 8600a6ae..72a1e1e3 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -1332,16 +1332,16 @@ static ClientHook readCapabilityPointer(SegmentReader segment, CapTableReader ca long ref = segment.get(refOffset); if (WirePointer.isNull(ref)) { - return ClientHook.newNullCap(); + return Capability.newNullCap(); } if (WirePointer.kind(ref) != WirePointer.OTHER) { - return ClientHook.newBrokenCap("Calling capability extracted from a non-capability pointer."); + return Capability.newBrokenCap("Calling capability extracted from a non-capability pointer."); } var cap = capTable.extractCap(WirePointer.upper32Bits(ref)); if (cap == null) { - return ClientHook.newBrokenCap("Calling invalid capability pointer."); + return Capability.newBrokenCap("Calling invalid capability pointer."); } return cap; } diff --git a/runtime/src/test/java/org/capnproto/RpcStateTest.java b/runtime/src/test/java/org/capnproto/RpcStateTest.java index 43faab31..4d5f2e9b 100644 --- a/runtime/src/test/java/org/capnproto/RpcStateTest.java +++ b/runtime/src/test/java/org/capnproto/RpcStateTest.java @@ -8,6 +8,8 @@ import java.util.ArrayDeque; import java.util.Queue; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; public class RpcStateTest { @@ -23,6 +25,7 @@ public AnyPointer.Reader getBody() { class TestConnection implements VatNetwork.Connection { + Executor executor = Executors.newSingleThreadExecutor(); @Override public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { var message = new MessageBuilder(); @@ -59,7 +62,7 @@ public CompletableFuture receiveIncomingMessage() { @Before public void setUp() throws Exception { connection = new TestConnection(); - bootstrapInterface = new Capability.Client(ClientHook.newNullCap()); + bootstrapInterface = new Capability.Client(Capability.newNullCap()); rpc = new RpcState(connection, bootstrapInterface); } diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java new file mode 100644 index 00000000..2b00a390 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -0,0 +1,216 @@ +package org.capnproto; + +import org.capnproto.demo.Demo; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; +import java.nio.channels.AsynchronousServerSocketChannel; +import java.nio.channels.AsynchronousSocketChannel; +import java.nio.channels.CompletionHandler; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +import static org.junit.Assert.*; + +class TestCap0 { + + static final class Client extends org.capnproto.Capability.Client { + public Client() { super(); } + + public Client(ClientHook hook) { super(hook); } + + public Client(Capability.Client cap) { super(cap.getHook()); } + + public Client(Capability.Server server) { super(server); } + + public org.capnproto.Request testMethod0Request() { + return newCall(Demo.TestParams0.factory, Demo.TestResults0.factory, 0xa65f4a3d7f622e6bL, (short) 0); + } + + public org.capnproto.Request testMethod1Request() { + return newCall(Demo.TestParams1.factory, Demo.TestResults1.factory, 0xa65f4a3d7f622e6bL, (short) 1); + } + } + + static abstract class Server extends org.capnproto.Capability.Server { + + public class TestMethod0Context extends CallContext { + public TestMethod0Context(CallContextHook hook) { + super(Demo.TestParams0.factory, Demo.TestResults0.factory, hook); + } + } + + public class TestMethod1Context extends CallContext { + public TestMethod1Context(CallContextHook hook) { + super(Demo.TestParams1.factory, Demo.TestResults1.factory, hook); + } + } + + @Override + public DispatchCallResult dispatchCall(long interfaceId, short methodId, CallContext context) { + if (interfaceId == 0xa65f4a3d7f622e6bL) { + return dispatchCallInternal(methodId, context); + } + return internalUnimplemented(Demo.class.getName(), interfaceId); + } + + private DispatchCallResult dispatchCallInternal(short methodId, CallContext ctx) { + switch (methodId) { + case 0: + return new DispatchCallResult(testMethod0(new TestMethod0Context(ctx.getHook()))); + case 1: + return new DispatchCallResult(testMethod1(new TestMethod1Context(ctx.getHook()))); + default: + return internalUnimplemented(Demo.class.getName(), 0xa27d3c231c7b9202L, methodId); + } + } + + public CompletableFuture testMethod0(TestMethod0Context ctx) { + return CompletableFuture.failedFuture(RpcException.unimplemented("testMethod0")); + } + + public CompletableFuture testMethod1(TestMethod1Context ctx) { + return CompletableFuture.failedFuture(RpcException.unimplemented("testMethod1")); + } + } +} + +class TestCap1 { + + static final class Client extends org.capnproto.Capability.Client { + public Client() { super(); } + + public Client(ClientHook hook) { super(hook); } + + public Client(Capability.Client cap) { super(cap.getHook()); } + + public Client(Capability.Server server) { super(server); } + } + + static abstract class Server extends org.capnproto.Capability.Server { + + @Override + public DispatchCallResult dispatchCall(long interfaceId, short methodId, CallContext context) { + if (interfaceId == 0x81da3f8f6079c216L) { + return dispatchCallInternal(methodId, context); + } + return internalUnimplemented(Demo.class.getName(), interfaceId); + } + + private DispatchCallResult dispatchCallInternal(short methodId, CallContext ctx) { + switch (methodId) { + default: + return internalUnimplemented(Demo.class.getName(), 0x81da3f8f6079c216L, methodId); + } + } + } +} + +class TestCap0Impl extends TestCap0.Server { + + final TestCap1.Client testCap1 = new TestCap1.Client(new TestCap1Impl()); + + public CompletableFuture testMethod0(TestCap0.Server.TestMethod0Context ctx) { + var params = ctx.getParams(); + var results = ctx.getResults(); + results.setResult0(params.getParam0()); + return CompletableFuture.completedFuture(null); + } + + public CompletableFuture testMethod1(TestCap0.Server.TestMethod1Context ctx) { + var params = ctx.getParams(); + var results = ctx.getResults(); + var res0 = results.getResult0(); + res0.setAsCapability(testCap1); + return CompletableFuture.completedFuture(null); + } +} + +class TestCap1Impl extends TestCap1.Server { +} + +public class TwoPartyTest { + + AsynchronousServerSocketChannel serverSocket; + AsynchronousSocketChannel clientSocket; + TwoPartyClient client; + + @Before + public void setUp() throws Exception { + this.serverSocket = AsynchronousServerSocketChannel.open(); + this.serverSocket.bind(null); + + this.clientSocket = AsynchronousSocketChannel.open(); + this.clientSocket.connect(this.serverSocket.getLocalAddress()).get(); + + this.client = new TwoPartyClient(clientSocket); + } + + @After + public void tearDown() throws Exception { + this.clientSocket.close(); + this.serverSocket.close(); + this.client = null; + } + + @Test + public void testNullCap() { + + var server = new TwoPartyServer(new Capability.Client()); + server.listen(serverSocket); + var cap = this.client.bootstrap(); + var resolved = cap.whenResolved(); + resolved.join(); + } + + @Test + public void testBasic() throws ExecutionException, InterruptedException { + var capServer = new TestCap0Impl(); + var server = new TwoPartyServer(new TestCap0.Client(capServer)); + server.listen(serverSocket); + var demoClient = new TestCap0.Client(this.client.bootstrap()); + var request = demoClient.testMethod0Request(); + var params = request.params(); + params.setParam0(4321); + var resultsPromise = request.send(); + while (!resultsPromise.isDone()) { + CompletableFuture.anyOf(resultsPromise, server.runOnce()).join(); + } + Assert.assertTrue(resultsPromise.isDone()); + var results = resultsPromise.get(); + Assert.assertEquals(params.getParam0(), results.getResult0()); + } + + @Test + public void testReturnCap() throws ExecutionException, InterruptedException { + // send a capabilty back from the server to the client + var capServer = new TestCap0Impl(); + var server = new TwoPartyServer(new TestCap0.Client(capServer)); + server.listen(serverSocket); + var demoClient = new TestCap0.Client(this.client.bootstrap()); + var request = demoClient.testMethod1Request(); + var params = request.params(); + var resultsPromise = request.send(); + while (!resultsPromise.isDone()) { + CompletableFuture.anyOf(resultsPromise, server.runOnce()).join(); + } + Assert.assertTrue(resultsPromise.isDone()); + var results = resultsPromise.get(); + var any = results.getResult0(); + var cap1 = any.getAsCapability(); + } + + @Test + public void testLocalServer() throws ExecutionException, InterruptedException { + var demo = new TestCap0Impl(); + var client = new TestCap0.Client(demo); + var request = client.testMethod0Request(); + var params = request.params(); + params.setParam0(4321); + var results = request.send().get(); + Assert.assertEquals(params.getParam0(), results.getResult0()); + } +} \ No newline at end of file diff --git a/runtime/src/test/java/org/capnproto/demo/Demo.java b/runtime/src/test/java/org/capnproto/demo/Demo.java new file mode 100644 index 00000000..2b531ddc --- /dev/null +++ b/runtime/src/test/java/org/capnproto/demo/Demo.java @@ -0,0 +1,371 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: demoparams.capnp + +package org.capnproto.demo; + +public final class Demo { + public static class TestParams0 { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return TestParams0.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getParam0() { + return _getIntField(0); + } + public final void setParam0(int value) { + _setIntField(0, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getParam0() { + return _getIntField(0); + } + + } + + } + + + public static class TestResults0 { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return TestResults0.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getResult0() { + return _getIntField(0); + } + public final void setResult0(int value) { + _setIntField(0, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getResult0() { + return _getIntField(0); + } + + } + + } + + + public static class TestParams1 { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return TestParams1.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasParam0() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getParam0() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initParam0() { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initParam0(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasParam0() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getParam0() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + } + + } + + + public static class TestResults1 { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return TestResults1.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasResult0() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getResult0() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initResult0() { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initResult0(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasResult0() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getResult0() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + } + + } + + + +public static final class Schemas { +public static final org.capnproto.SegmentReader b_b301b4acd180f012 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0012\u00f0\u0080\u00d1\u00ac\u00b4\u0001\u00b3" + + "\u0011\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0065\u006d\u006f\u0070\u0061\u0072\u0061" + + "\u006d\u0073\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0065\u0073\u0074\u0050\u0061\u0072" + + "\u0061\u006d\u0073\u0030\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0070\u0061\u0072\u0061\u006d\u0030\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_96a42e5421b52881 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0081\u0028\u00b5\u0021\u0054\u002e\u00a4\u0096" + + "\u0011\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00f2\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0065\u006d\u006f\u0070\u0061\u0072\u0061" + + "\u006d\u0073\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0065\u0073\u0074\u0052\u0065\u0073" + + "\u0075\u006c\u0074\u0073\u0030\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_e10363a8b6220957 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0057\u0009\"\u00b6\u00a8\u0063\u0003\u00e1" + + "\u0011\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0065\u006d\u006f\u0070\u0061\u0072\u0061" + + "\u006d\u0073\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0065\u0073\u0074\u0050\u0061\u0072" + + "\u0061\u006d\u0073\u0031\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0070\u0061\u0072\u0061\u006d\u0030\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_99852ee4d45ddb3e = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u003e\u00db\u005d\u00d4\u00e4\u002e\u0085\u0099" + + "\u0011\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00f2\u0000\u0000\u0000" + + "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0065\u006d\u006f\u0070\u0061\u0072\u0061" + + "\u006d\u0073\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0065\u0073\u0074\u0052\u0065\u0073" + + "\u0075\u006c\u0074\u0073\u0031\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +} +} + diff --git a/runtime/src/test/java/org/capnproto/demo/democap.capnp b/runtime/src/test/java/org/capnproto/demo/democap.capnp new file mode 100644 index 00000000..a1954467 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/demo/democap.capnp @@ -0,0 +1,12 @@ +@0xf29f4ba3b0a5a945; + +using Params = import "demoparams.capnp"; + +interface TestCap0 { + testMethod0 @0 Params.TestParams0 -> Params.TestResults0; + testMethod1 @1 Params.TestParams1 -> Params.TestResults1; +} + +interface TestCap1 { +} + diff --git a/runtime/src/test/java/org/capnproto/demo/democap.capnp.c++ b/runtime/src/test/java/org/capnproto/demo/democap.capnp.c++ new file mode 100644 index 00000000..bcdec32c --- /dev/null +++ b/runtime/src/test/java/org/capnproto/demo/democap.capnp.c++ @@ -0,0 +1,190 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: democap.capnp + +#include "democap.capnp.h" + +namespace capnp { +namespace schemas { +static const ::capnp::_::AlignedData<40> b_a65f4a3d7f622e6b = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 107, 46, 98, 127, 61, 74, 95, 166, + 14, 0, 0, 0, 3, 0, 0, 0, + 69, 169, 165, 176, 163, 75, 159, 242, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 186, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 135, 0, 0, 0, + 113, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 109, 111, 99, 97, 112, 46, + 99, 97, 112, 110, 112, 58, 84, 101, + 115, 116, 67, 97, 112, 48, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 240, 128, 209, 172, 180, 1, 179, + 129, 40, 181, 33, 84, 46, 164, 150, + 49, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 87, 9, 34, 182, 168, 99, 3, 225, + 62, 219, 93, 212, 228, 46, 133, 153, + 29, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 7, 0, 0, 0, + 116, 101, 115, 116, 77, 101, 116, 104, + 111, 100, 48, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 116, 101, 115, 116, 77, 101, 116, 104, + 111, 100, 49, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 1, 0, 1, 0, } +}; +::capnp::word const* const bp_a65f4a3d7f622e6b = b_a65f4a3d7f622e6b.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_a65f4a3d7f622e6b[] = { + &s_96a42e5421b52881, + &s_99852ee4d45ddb3e, + &s_b301b4acd180f012, + &s_e10363a8b6220957, +}; +static const uint16_t m_a65f4a3d7f622e6b[] = {0, 1}; +const ::capnp::_::RawSchema s_a65f4a3d7f622e6b = { + 0xa65f4a3d7f622e6b, b_a65f4a3d7f622e6b.words, 40, d_a65f4a3d7f622e6b, m_a65f4a3d7f622e6b, + 4, 2, nullptr, nullptr, nullptr, { &s_a65f4a3d7f622e6b, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<18> b_81da3f8f6079c216 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 22, 194, 121, 96, 143, 63, 218, 129, + 14, 0, 0, 0, 3, 0, 0, 0, + 69, 169, 165, 176, 163, 75, 159, 242, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 186, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 7, 0, 0, 0, + 25, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 109, 111, 99, 97, 112, 46, + 99, 97, 112, 110, 112, 58, 84, 101, + 115, 116, 67, 97, 112, 49, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 3, 0, 5, 0, + 0, 0, 0, 0, 1, 0, 1, 0, } +}; +::capnp::word const* const bp_81da3f8f6079c216 = b_81da3f8f6079c216.words; +#if !CAPNP_LITE +const ::capnp::_::RawSchema s_81da3f8f6079c216 = { + 0x81da3f8f6079c216, b_81da3f8f6079c216.words, 18, nullptr, nullptr, + 0, 0, nullptr, nullptr, nullptr, { &s_81da3f8f6079c216, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +} // namespace schemas +} // namespace capnp + +// ======================================================================================= + + +#if !CAPNP_LITE +::capnp::Request< ::TestParams0, ::TestResults0> +TestCap0::Client::testMethod0Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { + return newCall< ::TestParams0, ::TestResults0>( + 0xa65f4a3d7f622e6bull, 0, sizeHint); +} +::kj::Promise TestCap0::Server::testMethod0(TestMethod0Context) { + return ::capnp::Capability::Server::internalUnimplemented( + "democap.capnp:TestCap0", "testMethod0", + 0xa65f4a3d7f622e6bull, 0); +} +::capnp::Request< ::TestParams1, ::TestResults1> +TestCap0::Client::testMethod1Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { + return newCall< ::TestParams1, ::TestResults1>( + 0xa65f4a3d7f622e6bull, 1, sizeHint); +} +::kj::Promise TestCap0::Server::testMethod1(TestMethod1Context) { + return ::capnp::Capability::Server::internalUnimplemented( + "democap.capnp:TestCap0", "testMethod1", + 0xa65f4a3d7f622e6bull, 1); +} +::capnp::Capability::Server::DispatchCallResult TestCap0::Server::dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (interfaceId) { + case 0xa65f4a3d7f622e6bull: + return dispatchCallInternal(methodId, context); + default: + return internalUnimplemented("democap.capnp:TestCap0", interfaceId); + } +} +::capnp::Capability::Server::DispatchCallResult TestCap0::Server::dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (methodId) { + case 0: + return { + testMethod0(::capnp::Capability::Server::internalGetTypedContext< + ::TestParams0, ::TestResults0>(context)), + false + }; + case 1: + return { + testMethod1(::capnp::Capability::Server::internalGetTypedContext< + ::TestParams1, ::TestResults1>(context)), + false + }; + default: + (void)context; + return ::capnp::Capability::Server::internalUnimplemented( + "democap.capnp:TestCap0", + 0xa65f4a3d7f622e6bull, methodId); + } +} +#endif // !CAPNP_LITE + +// TestCap0 +#if !CAPNP_LITE +constexpr ::capnp::Kind TestCap0::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* TestCap0::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +#if !CAPNP_LITE +::capnp::Capability::Server::DispatchCallResult TestCap1::Server::dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (interfaceId) { + case 0x81da3f8f6079c216ull: + return dispatchCallInternal(methodId, context); + default: + return internalUnimplemented("democap.capnp:TestCap1", interfaceId); + } +} +::capnp::Capability::Server::DispatchCallResult TestCap1::Server::dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (methodId) { + default: + (void)context; + return ::capnp::Capability::Server::internalUnimplemented( + "democap.capnp:TestCap1", + 0x81da3f8f6079c216ull, methodId); + } +} +#endif // !CAPNP_LITE + +// TestCap1 +#if !CAPNP_LITE +constexpr ::capnp::Kind TestCap1::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* TestCap1::_capnpPrivate::schema; +#endif // !CAPNP_LITE + + + diff --git a/runtime/src/test/java/org/capnproto/demo/democap.capnp.h b/runtime/src/test/java/org/capnproto/demo/democap.capnp.h new file mode 100644 index 00000000..b60b09e1 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/demo/democap.capnp.h @@ -0,0 +1,216 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: democap.capnp + +#pragma once + +#include +#include +#if !CAPNP_LITE +#include +#endif // !CAPNP_LITE + +#if CAPNP_VERSION != 8000 +#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." +#endif + +#include "demoparams.capnp.h" + +namespace capnp { +namespace schemas { + +CAPNP_DECLARE_SCHEMA(a65f4a3d7f622e6b); +CAPNP_DECLARE_SCHEMA(81da3f8f6079c216); + +} // namespace schemas +} // namespace capnp + + +struct TestCap0 { + TestCap0() = delete; + +#if !CAPNP_LITE + class Client; + class Server; +#endif // !CAPNP_LITE + + + #if !CAPNP_LITE + struct _capnpPrivate { + CAPNP_DECLARE_INTERFACE_HEADER(a65f4a3d7f622e6b) + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + }; + #endif // !CAPNP_LITE +}; + +struct TestCap1 { + TestCap1() = delete; + +#if !CAPNP_LITE + class Client; + class Server; +#endif // !CAPNP_LITE + + + #if !CAPNP_LITE + struct _capnpPrivate { + CAPNP_DECLARE_INTERFACE_HEADER(81da3f8f6079c216) + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + }; + #endif // !CAPNP_LITE +}; + +// ======================================================================================= + +#if !CAPNP_LITE +class TestCap0::Client + : public virtual ::capnp::Capability::Client { +public: + typedef TestCap0 Calls; + typedef TestCap0 Reads; + + Client(decltype(nullptr)); + explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); + template ()>> + Client(::kj::Own<_t>&& server); + template ()>> + Client(::kj::Promise<_t>&& promise); + Client(::kj::Exception&& exception); + Client(Client&) = default; + Client(Client&&) = default; + Client& operator=(Client& other); + Client& operator=(Client&& other); + + ::capnp::Request< ::TestParams0, ::TestResults0> testMethod0Request( + ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); + ::capnp::Request< ::TestParams1, ::TestResults1> testMethod1Request( + ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); + +protected: + Client() = default; +}; + +class TestCap0::Server + : public virtual ::capnp::Capability::Server { +public: + typedef TestCap0 Serves; + + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) + override; + +protected: + typedef ::capnp::CallContext< ::TestParams0, ::TestResults0> TestMethod0Context; + virtual ::kj::Promise testMethod0(TestMethod0Context context); + typedef ::capnp::CallContext< ::TestParams1, ::TestResults1> TestMethod1Context; + virtual ::kj::Promise testMethod1(TestMethod1Context context); + + inline ::TestCap0::Client thisCap() { + return ::capnp::Capability::Server::thisCap() + .template castAs< ::TestCap0>(); + } + + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); +}; +#endif // !CAPNP_LITE + +#if !CAPNP_LITE +class TestCap1::Client + : public virtual ::capnp::Capability::Client { +public: + typedef TestCap1 Calls; + typedef TestCap1 Reads; + + Client(decltype(nullptr)); + explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); + template ()>> + Client(::kj::Own<_t>&& server); + template ()>> + Client(::kj::Promise<_t>&& promise); + Client(::kj::Exception&& exception); + Client(Client&) = default; + Client(Client&&) = default; + Client& operator=(Client& other); + Client& operator=(Client&& other); + + +protected: + Client() = default; +}; + +class TestCap1::Server + : public virtual ::capnp::Capability::Server { +public: + typedef TestCap1 Serves; + + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) + override; + +protected: + + inline ::TestCap1::Client thisCap() { + return ::capnp::Capability::Server::thisCap() + .template castAs< ::TestCap1>(); + } + + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); +}; +#endif // !CAPNP_LITE + +// ======================================================================================= + +#if !CAPNP_LITE +inline TestCap0::Client::Client(decltype(nullptr)) + : ::capnp::Capability::Client(nullptr) {} +inline TestCap0::Client::Client( + ::kj::Own< ::capnp::ClientHook>&& hook) + : ::capnp::Capability::Client(::kj::mv(hook)) {} +template +inline TestCap0::Client::Client(::kj::Own<_t>&& server) + : ::capnp::Capability::Client(::kj::mv(server)) {} +template +inline TestCap0::Client::Client(::kj::Promise<_t>&& promise) + : ::capnp::Capability::Client(::kj::mv(promise)) {} +inline TestCap0::Client::Client(::kj::Exception&& exception) + : ::capnp::Capability::Client(::kj::mv(exception)) {} +inline ::TestCap0::Client& TestCap0::Client::operator=(Client& other) { + ::capnp::Capability::Client::operator=(other); + return *this; +} +inline ::TestCap0::Client& TestCap0::Client::operator=(Client&& other) { + ::capnp::Capability::Client::operator=(kj::mv(other)); + return *this; +} + +#endif // !CAPNP_LITE +#if !CAPNP_LITE +inline TestCap1::Client::Client(decltype(nullptr)) + : ::capnp::Capability::Client(nullptr) {} +inline TestCap1::Client::Client( + ::kj::Own< ::capnp::ClientHook>&& hook) + : ::capnp::Capability::Client(::kj::mv(hook)) {} +template +inline TestCap1::Client::Client(::kj::Own<_t>&& server) + : ::capnp::Capability::Client(::kj::mv(server)) {} +template +inline TestCap1::Client::Client(::kj::Promise<_t>&& promise) + : ::capnp::Capability::Client(::kj::mv(promise)) {} +inline TestCap1::Client::Client(::kj::Exception&& exception) + : ::capnp::Capability::Client(::kj::mv(exception)) {} +inline ::TestCap1::Client& TestCap1::Client::operator=(Client& other) { + ::capnp::Capability::Client::operator=(other); + return *this; +} +inline ::TestCap1::Client& TestCap1::Client::operator=(Client&& other) { + ::capnp::Capability::Client::operator=(kj::mv(other)); + return *this; +} + +#endif // !CAPNP_LITE + diff --git a/runtime/src/test/java/org/capnproto/demo/demoparams.capnp b/runtime/src/test/java/org/capnproto/demo/demoparams.capnp new file mode 100644 index 00000000..5c2cae42 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/demo/demoparams.capnp @@ -0,0 +1,23 @@ +@0x91b57797d64253c4; + +using Java = import "/capnp/java.capnp"; +$Java.package("org.capnproto.demo"); +$Java.outerClassname("Demo"); + +struct TestParams0 { + param0 @0 :Int32; +} + +struct TestResults0 { + result0 @0 :Int32; +} + +struct TestParams1 { + param0 @0 :AnyPointer; +} + +struct TestResults1 { + result0 @0 :AnyPointer; +} + + From 395973276587e8b00d06ef0c4d9ca276a700a332 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 30 Sep 2020 17:23:15 +0100 Subject: [PATCH 024/246] handle resolve --- .../src/main/java/org/capnproto/RpcState.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 0742d19e..f11df613 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -448,6 +448,41 @@ void handleFinish(RpcProtocol.Finish.Reader finish) { } void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { + + ClientHook replacement = null; + Throwable exc = null; + + switch (resolve.which()) { + case CAP: + replacement = receiveCap(resolve.getCap(), message.getAttachedFds()); + break; + case EXCEPTION: + exc = new RuntimeException(resolve.getException().getReason().toString()); + break; + default: + assert false; + return; + } + + var imp = imports.find(resolve.getPromiseId()); + if (imp == null) { + return; + } + + var fulfiller = imp.promise; + if (fulfiller != null) { + if (exc != null) { + fulfiller.completeExceptionally(exc); + } + else { + fulfiller.complete(replacement); + } + } + else if (imp.importClient != null) { + // It appears this is a valid entry on the import table, but was not expected to be a + // promise. + assert false; + } } void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { From a505c035741d78cd3222c25fd4bcbb2aca65bc8d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 1 Oct 2020 10:07:27 +0100 Subject: [PATCH 025/246] extend fromPointerReader to accept capTable --- .../src/main/java/org/capnproto/FromPointerBuilder.java | 8 +++++++- .../src/main/java/org/capnproto/FromPointerReader.java | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/FromPointerBuilder.java b/runtime/src/main/java/org/capnproto/FromPointerBuilder.java index 1c09e6fb..5476e24a 100644 --- a/runtime/src/main/java/org/capnproto/FromPointerBuilder.java +++ b/runtime/src/main/java/org/capnproto/FromPointerBuilder.java @@ -23,6 +23,12 @@ public interface FromPointerBuilder { T fromPointerBuilder(SegmentBuilder segment, int pointer); - T fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer); + default T fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { + + return fromPointerBuilder(segment, pointer); + } T initFromPointerBuilder(SegmentBuilder segment, int pointer, int elementCount); + default T initFromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, int elementCount) { + return initFromPointerBuilder(segment, pointer, elementCount); + } } diff --git a/runtime/src/main/java/org/capnproto/FromPointerReader.java b/runtime/src/main/java/org/capnproto/FromPointerReader.java index 3e7135b9..042afe9d 100644 --- a/runtime/src/main/java/org/capnproto/FromPointerReader.java +++ b/runtime/src/main/java/org/capnproto/FromPointerReader.java @@ -23,5 +23,8 @@ public interface FromPointerReader { T fromPointerReader(SegmentReader segment, int pointer, int nestingLimit); - T fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit); + + default T fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { + return fromPointerReader(segment, pointer, nestingLimit); + } } From 4dada053735513afe66688cd0d807ade2f1f6d8e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 2 Oct 2020 21:27:11 +0100 Subject: [PATCH 026/246] make CallContext constructor public --- runtime/src/main/java/org/capnproto/CallContext.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java index a01d9e6c..49279f03 100644 --- a/runtime/src/main/java/org/capnproto/CallContext.java +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -8,7 +8,7 @@ public class CallContext { private final FromPointerReader params; private final FromPointerBuilder results; - CallContext(FromPointerReader params, + public CallContext(FromPointerReader params, FromPointerBuilder results, CallContextHook hook) { this.hook = hook; From 9c5e080f9034596f9730697dd1aa604cf1c645e3 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 2 Oct 2020 21:35:37 +0100 Subject: [PATCH 027/246] regenerated rpc schemas --- .../main/java/org/capnproto/RpcProtocol.java | 843 ++++++++++-------- .../org/capnproto/RpcTwoPartyProtocol.java | 165 ++-- 2 files changed, 558 insertions(+), 450 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcProtocol.java b/runtime/src/main/java/org/capnproto/RpcProtocol.java index 1a4fc742..4e25b766 100644 --- a/runtime/src/main/java/org/capnproto/RpcProtocol.java +++ b/runtime/src/main/java/org/capnproto/RpcProtocol.java @@ -54,114 +54,114 @@ public final Reader asReader() { public final boolean isUnimplemented() { return which() == Message.Which.UNIMPLEMENTED; } - public final RpcProtocol.Message.Builder getUnimplemented() { + public final org.capnproto.RpcProtocol.Message.Builder getUnimplemented() { assert which() == Message.Which.UNIMPLEMENTED: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Message.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Message.factory, 0, null, 0); } - public final void setUnimplemented(RpcProtocol.Message.Reader value) { + public final void setUnimplemented(org.capnproto.RpcProtocol.Message.Reader value) { _setShortField(0, (short)Message.Which.UNIMPLEMENTED.ordinal()); - _setPointerField(RpcProtocol.Message.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Message.factory,0, value); } - public final RpcProtocol.Message.Builder initUnimplemented() { + public final org.capnproto.RpcProtocol.Message.Builder initUnimplemented() { _setShortField(0, (short)Message.Which.UNIMPLEMENTED.ordinal()); - return _initPointerField(RpcProtocol.Message.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Message.factory,0, 0); } public final boolean isAbort() { return which() == Message.Which.ABORT; } - public final RpcProtocol.Exception.Builder getAbort() { + public final org.capnproto.RpcProtocol.Exception.Builder getAbort() { assert which() == Message.Which.ABORT: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Exception.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Exception.factory, 0, null, 0); } - public final void setAbort(RpcProtocol.Exception.Reader value) { + public final void setAbort(org.capnproto.RpcProtocol.Exception.Reader value) { _setShortField(0, (short)Message.Which.ABORT.ordinal()); - _setPointerField(RpcProtocol.Exception.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Exception.factory,0, value); } - public final RpcProtocol.Exception.Builder initAbort() { + public final org.capnproto.RpcProtocol.Exception.Builder initAbort() { _setShortField(0, (short)Message.Which.ABORT.ordinal()); - return _initPointerField(RpcProtocol.Exception.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Exception.factory,0, 0); } public final boolean isCall() { return which() == Message.Which.CALL; } - public final RpcProtocol.Call.Builder getCall() { + public final org.capnproto.RpcProtocol.Call.Builder getCall() { assert which() == Message.Which.CALL: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Call.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Call.factory, 0, null, 0); } - public final void setCall(RpcProtocol.Call.Reader value) { + public final void setCall(org.capnproto.RpcProtocol.Call.Reader value) { _setShortField(0, (short)Message.Which.CALL.ordinal()); - _setPointerField(RpcProtocol.Call.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Call.factory,0, value); } - public final RpcProtocol.Call.Builder initCall() { + public final org.capnproto.RpcProtocol.Call.Builder initCall() { _setShortField(0, (short)Message.Which.CALL.ordinal()); - return _initPointerField(RpcProtocol.Call.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Call.factory,0, 0); } public final boolean isReturn() { return which() == Message.Which.RETURN; } - public final RpcProtocol.Return.Builder getReturn() { + public final org.capnproto.RpcProtocol.Return.Builder getReturn() { assert which() == Message.Which.RETURN: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Return.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Return.factory, 0, null, 0); } - public final void setReturn(RpcProtocol.Return.Reader value) { + public final void setReturn(org.capnproto.RpcProtocol.Return.Reader value) { _setShortField(0, (short)Message.Which.RETURN.ordinal()); - _setPointerField(RpcProtocol.Return.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Return.factory,0, value); } - public final RpcProtocol.Return.Builder initReturn() { + public final org.capnproto.RpcProtocol.Return.Builder initReturn() { _setShortField(0, (short)Message.Which.RETURN.ordinal()); - return _initPointerField(RpcProtocol.Return.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Return.factory,0, 0); } public final boolean isFinish() { return which() == Message.Which.FINISH; } - public final RpcProtocol.Finish.Builder getFinish() { + public final org.capnproto.RpcProtocol.Finish.Builder getFinish() { assert which() == Message.Which.FINISH: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Finish.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Finish.factory, 0, null, 0); } - public final void setFinish(RpcProtocol.Finish.Reader value) { + public final void setFinish(org.capnproto.RpcProtocol.Finish.Reader value) { _setShortField(0, (short)Message.Which.FINISH.ordinal()); - _setPointerField(RpcProtocol.Finish.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Finish.factory,0, value); } - public final RpcProtocol.Finish.Builder initFinish() { + public final org.capnproto.RpcProtocol.Finish.Builder initFinish() { _setShortField(0, (short)Message.Which.FINISH.ordinal()); - return _initPointerField(RpcProtocol.Finish.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Finish.factory,0, 0); } public final boolean isResolve() { return which() == Message.Which.RESOLVE; } - public final RpcProtocol.Resolve.Builder getResolve() { + public final org.capnproto.RpcProtocol.Resolve.Builder getResolve() { assert which() == Message.Which.RESOLVE: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Resolve.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Resolve.factory, 0, null, 0); } - public final void setResolve(RpcProtocol.Resolve.Reader value) { + public final void setResolve(org.capnproto.RpcProtocol.Resolve.Reader value) { _setShortField(0, (short)Message.Which.RESOLVE.ordinal()); - _setPointerField(RpcProtocol.Resolve.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Resolve.factory,0, value); } - public final RpcProtocol.Resolve.Builder initResolve() { + public final org.capnproto.RpcProtocol.Resolve.Builder initResolve() { _setShortField(0, (short)Message.Which.RESOLVE.ordinal()); - return _initPointerField(RpcProtocol.Resolve.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Resolve.factory,0, 0); } public final boolean isRelease() { return which() == Message.Which.RELEASE; } - public final RpcProtocol.Release.Builder getRelease() { + public final org.capnproto.RpcProtocol.Release.Builder getRelease() { assert which() == Message.Which.RELEASE: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Release.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Release.factory, 0, null, 0); } - public final void setRelease(RpcProtocol.Release.Reader value) { + public final void setRelease(org.capnproto.RpcProtocol.Release.Reader value) { _setShortField(0, (short)Message.Which.RELEASE.ordinal()); - _setPointerField(RpcProtocol.Release.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Release.factory,0, value); } - public final RpcProtocol.Release.Builder initRelease() { + public final org.capnproto.RpcProtocol.Release.Builder initRelease() { _setShortField(0, (short)Message.Which.RELEASE.ordinal()); - return _initPointerField(RpcProtocol.Release.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Release.factory,0, 0); } public final boolean isObsoleteSave() { return which() == Message.Which.OBSOLETE_SAVE; @@ -186,18 +186,18 @@ public org.capnproto.AnyPointer.Builder initObsoleteSave(int size) { public final boolean isBootstrap() { return which() == Message.Which.BOOTSTRAP; } - public final RpcProtocol.Bootstrap.Builder getBootstrap() { + public final org.capnproto.RpcProtocol.Bootstrap.Builder getBootstrap() { assert which() == Message.Which.BOOTSTRAP: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Bootstrap.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Bootstrap.factory, 0, null, 0); } - public final void setBootstrap(RpcProtocol.Bootstrap.Reader value) { + public final void setBootstrap(org.capnproto.RpcProtocol.Bootstrap.Reader value) { _setShortField(0, (short)Message.Which.BOOTSTRAP.ordinal()); - _setPointerField(RpcProtocol.Bootstrap.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Bootstrap.factory,0, value); } - public final RpcProtocol.Bootstrap.Builder initBootstrap() { + public final org.capnproto.RpcProtocol.Bootstrap.Builder initBootstrap() { _setShortField(0, (short)Message.Which.BOOTSTRAP.ordinal()); - return _initPointerField(RpcProtocol.Bootstrap.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Bootstrap.factory,0, 0); } public final boolean isObsoleteDelete() { return which() == Message.Which.OBSOLETE_DELETE; @@ -222,66 +222,66 @@ public org.capnproto.AnyPointer.Builder initObsoleteDelete(int size) { public final boolean isProvide() { return which() == Message.Which.PROVIDE; } - public final RpcProtocol.Provide.Builder getProvide() { + public final org.capnproto.RpcProtocol.Provide.Builder getProvide() { assert which() == Message.Which.PROVIDE: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Provide.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Provide.factory, 0, null, 0); } - public final void setProvide(RpcProtocol.Provide.Reader value) { + public final void setProvide(org.capnproto.RpcProtocol.Provide.Reader value) { _setShortField(0, (short)Message.Which.PROVIDE.ordinal()); - _setPointerField(RpcProtocol.Provide.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Provide.factory,0, value); } - public final RpcProtocol.Provide.Builder initProvide() { + public final org.capnproto.RpcProtocol.Provide.Builder initProvide() { _setShortField(0, (short)Message.Which.PROVIDE.ordinal()); - return _initPointerField(RpcProtocol.Provide.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Provide.factory,0, 0); } public final boolean isAccept() { return which() == Message.Which.ACCEPT; } - public final RpcProtocol.Accept.Builder getAccept() { + public final org.capnproto.RpcProtocol.Accept.Builder getAccept() { assert which() == Message.Which.ACCEPT: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Accept.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Accept.factory, 0, null, 0); } - public final void setAccept(RpcProtocol.Accept.Reader value) { + public final void setAccept(org.capnproto.RpcProtocol.Accept.Reader value) { _setShortField(0, (short)Message.Which.ACCEPT.ordinal()); - _setPointerField(RpcProtocol.Accept.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Accept.factory,0, value); } - public final RpcProtocol.Accept.Builder initAccept() { + public final org.capnproto.RpcProtocol.Accept.Builder initAccept() { _setShortField(0, (short)Message.Which.ACCEPT.ordinal()); - return _initPointerField(RpcProtocol.Accept.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Accept.factory,0, 0); } public final boolean isJoin() { return which() == Message.Which.JOIN; } - public final RpcProtocol.Join.Builder getJoin() { + public final org.capnproto.RpcProtocol.Join.Builder getJoin() { assert which() == Message.Which.JOIN: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Join.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Join.factory, 0, null, 0); } - public final void setJoin(RpcProtocol.Join.Reader value) { + public final void setJoin(org.capnproto.RpcProtocol.Join.Reader value) { _setShortField(0, (short)Message.Which.JOIN.ordinal()); - _setPointerField(RpcProtocol.Join.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Join.factory,0, value); } - public final RpcProtocol.Join.Builder initJoin() { + public final org.capnproto.RpcProtocol.Join.Builder initJoin() { _setShortField(0, (short)Message.Which.JOIN.ordinal()); - return _initPointerField(RpcProtocol.Join.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Join.factory,0, 0); } public final boolean isDisembargo() { return which() == Message.Which.DISEMBARGO; } - public final RpcProtocol.Disembargo.Builder getDisembargo() { + public final org.capnproto.RpcProtocol.Disembargo.Builder getDisembargo() { assert which() == Message.Which.DISEMBARGO: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Disembargo.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Disembargo.factory, 0, null, 0); } - public final void setDisembargo(RpcProtocol.Disembargo.Reader value) { + public final void setDisembargo(org.capnproto.RpcProtocol.Disembargo.Reader value) { _setShortField(0, (short)Message.Which.DISEMBARGO.ordinal()); - _setPointerField(RpcProtocol.Disembargo.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Disembargo.factory,0, value); } - public final RpcProtocol.Disembargo.Builder initDisembargo() { + public final org.capnproto.RpcProtocol.Disembargo.Builder initDisembargo() { _setShortField(0, (short)Message.Which.DISEMBARGO.ordinal()); - return _initPointerField(RpcProtocol.Disembargo.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Disembargo.factory,0, 0); } } @@ -315,10 +315,10 @@ public final boolean isUnimplemented() { public boolean hasUnimplemented() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Message.Reader getUnimplemented() { + public org.capnproto.RpcProtocol.Message.Reader getUnimplemented() { assert which() == Message.Which.UNIMPLEMENTED: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Message.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Message.factory,0,null, 0); } public final boolean isAbort() { @@ -327,10 +327,10 @@ public final boolean isAbort() { public boolean hasAbort() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Exception.Reader getAbort() { + public org.capnproto.RpcProtocol.Exception.Reader getAbort() { assert which() == Message.Which.ABORT: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Exception.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Exception.factory,0,null, 0); } public final boolean isCall() { @@ -339,10 +339,10 @@ public final boolean isCall() { public boolean hasCall() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Call.Reader getCall() { + public org.capnproto.RpcProtocol.Call.Reader getCall() { assert which() == Message.Which.CALL: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Call.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Call.factory,0,null, 0); } public final boolean isReturn() { @@ -351,10 +351,10 @@ public final boolean isReturn() { public boolean hasReturn() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Return.Reader getReturn() { + public org.capnproto.RpcProtocol.Return.Reader getReturn() { assert which() == Message.Which.RETURN: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Return.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Return.factory,0,null, 0); } public final boolean isFinish() { @@ -363,10 +363,10 @@ public final boolean isFinish() { public boolean hasFinish() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Finish.Reader getFinish() { + public org.capnproto.RpcProtocol.Finish.Reader getFinish() { assert which() == Message.Which.FINISH: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Finish.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Finish.factory,0,null, 0); } public final boolean isResolve() { @@ -375,10 +375,10 @@ public final boolean isResolve() { public boolean hasResolve() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Resolve.Reader getResolve() { + public org.capnproto.RpcProtocol.Resolve.Reader getResolve() { assert which() == Message.Which.RESOLVE: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Resolve.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Resolve.factory,0,null, 0); } public final boolean isRelease() { @@ -387,10 +387,10 @@ public final boolean isRelease() { public boolean hasRelease() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Release.Reader getRelease() { + public org.capnproto.RpcProtocol.Release.Reader getRelease() { assert which() == Message.Which.RELEASE: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Release.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Release.factory,0,null, 0); } public final boolean isObsoleteSave() { @@ -411,10 +411,10 @@ public final boolean isBootstrap() { public boolean hasBootstrap() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Bootstrap.Reader getBootstrap() { + public org.capnproto.RpcProtocol.Bootstrap.Reader getBootstrap() { assert which() == Message.Which.BOOTSTRAP: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Bootstrap.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Bootstrap.factory,0,null, 0); } public final boolean isObsoleteDelete() { @@ -435,10 +435,10 @@ public final boolean isProvide() { public boolean hasProvide() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Provide.Reader getProvide() { + public org.capnproto.RpcProtocol.Provide.Reader getProvide() { assert which() == Message.Which.PROVIDE: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Provide.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Provide.factory,0,null, 0); } public final boolean isAccept() { @@ -447,10 +447,10 @@ public final boolean isAccept() { public boolean hasAccept() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Accept.Reader getAccept() { + public org.capnproto.RpcProtocol.Accept.Reader getAccept() { assert which() == Message.Which.ACCEPT: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Accept.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Accept.factory,0,null, 0); } public final boolean isJoin() { @@ -459,10 +459,10 @@ public final boolean isJoin() { public boolean hasJoin() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Join.Reader getJoin() { + public org.capnproto.RpcProtocol.Join.Reader getJoin() { assert which() == Message.Which.JOIN: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Join.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Join.factory,0,null, 0); } public final boolean isDisembargo() { @@ -471,10 +471,10 @@ public final boolean isDisembargo() { public boolean hasDisembargo() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Disembargo.Reader getDisembargo() { + public org.capnproto.RpcProtocol.Disembargo.Reader getDisembargo() { assert which() == Message.Which.DISEMBARGO: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Disembargo.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Disembargo.factory,0,null, 0); } } @@ -604,14 +604,14 @@ public final void setQuestionId(int value) { _setIntField(0, value); } - public final RpcProtocol.MessageTarget.Builder getTarget() { - return _getPointerField(RpcProtocol.MessageTarget.factory, 0, null, 0); + public final org.capnproto.RpcProtocol.MessageTarget.Builder getTarget() { + return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory, 0, null, 0); } - public final void setTarget(RpcProtocol.MessageTarget.Reader value) { - _setPointerField(RpcProtocol.MessageTarget.factory,0, value); + public final void setTarget(org.capnproto.RpcProtocol.MessageTarget.Reader value) { + _setPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, value); } - public final RpcProtocol.MessageTarget.Builder initTarget() { - return _initPointerField(RpcProtocol.MessageTarget.factory,0, 0); + public final org.capnproto.RpcProtocol.MessageTarget.Builder initTarget() { + return _initPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, 0); } public final long getInterfaceId() { return _getLongField(1); @@ -627,14 +627,14 @@ public final void setMethodId(short value) { _setShortField(2, value); } - public final RpcProtocol.Payload.Builder getParams() { - return _getPointerField(RpcProtocol.Payload.factory, 1, null, 0); + public final org.capnproto.RpcProtocol.Payload.Builder getParams() { + return _getPointerField(org.capnproto.RpcProtocol.Payload.factory, 1, null, 0); } - public final void setParams(RpcProtocol.Payload.Reader value) { - _setPointerField(RpcProtocol.Payload.factory,1, value); + public final void setParams(org.capnproto.RpcProtocol.Payload.Reader value) { + _setPointerField(org.capnproto.RpcProtocol.Payload.factory,1, value); } - public final RpcProtocol.Payload.Builder initParams() { - return _initPointerField(RpcProtocol.Payload.factory,1, 0); + public final org.capnproto.RpcProtocol.Payload.Builder initParams() { + return _initPointerField(org.capnproto.RpcProtocol.Payload.factory,1, 0); } public final SendResultsTo.Builder getSendResultsTo() { return new Call.SendResultsTo.Builder(segment, data, pointers, dataSize, pointerCount); @@ -666,8 +666,8 @@ public final int getQuestionId() { public boolean hasTarget() { return !_pointerFieldIsNull(0); } - public RpcProtocol.MessageTarget.Reader getTarget() { - return _getPointerField(RpcProtocol.MessageTarget.factory,0,null, 0); + public org.capnproto.RpcProtocol.MessageTarget.Reader getTarget() { + return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0,null, 0); } public final long getInterfaceId() { @@ -681,8 +681,8 @@ public final short getMethodId() { public boolean hasParams() { return !_pointerFieldIsNull(1); } - public RpcProtocol.Payload.Reader getParams() { - return _getPointerField(RpcProtocol.Payload.factory,1,null, 0); + public org.capnproto.RpcProtocol.Payload.Reader getParams() { + return _getPointerField(org.capnproto.RpcProtocol.Payload.factory,1,null, 0); } public SendResultsTo.Reader getSendResultsTo() { @@ -890,34 +890,34 @@ public final void setReleaseParamCaps(boolean value) { public final boolean isResults() { return which() == Return.Which.RESULTS; } - public final RpcProtocol.Payload.Builder getResults() { + public final org.capnproto.RpcProtocol.Payload.Builder getResults() { assert which() == Return.Which.RESULTS: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Payload.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Payload.factory, 0, null, 0); } - public final void setResults(RpcProtocol.Payload.Reader value) { + public final void setResults(org.capnproto.RpcProtocol.Payload.Reader value) { _setShortField(3, (short)Return.Which.RESULTS.ordinal()); - _setPointerField(RpcProtocol.Payload.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Payload.factory,0, value); } - public final RpcProtocol.Payload.Builder initResults() { + public final org.capnproto.RpcProtocol.Payload.Builder initResults() { _setShortField(3, (short)Return.Which.RESULTS.ordinal()); - return _initPointerField(RpcProtocol.Payload.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Payload.factory,0, 0); } public final boolean isException() { return which() == Return.Which.EXCEPTION; } - public final RpcProtocol.Exception.Builder getException() { + public final org.capnproto.RpcProtocol.Exception.Builder getException() { assert which() == Return.Which.EXCEPTION: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Exception.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Exception.factory, 0, null, 0); } - public final void setException(RpcProtocol.Exception.Reader value) { + public final void setException(org.capnproto.RpcProtocol.Exception.Reader value) { _setShortField(3, (short)Return.Which.EXCEPTION.ordinal()); - _setPointerField(RpcProtocol.Exception.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Exception.factory,0, value); } - public final RpcProtocol.Exception.Builder initException() { + public final org.capnproto.RpcProtocol.Exception.Builder initException() { _setShortField(3, (short)Return.Which.EXCEPTION.ordinal()); - return _initPointerField(RpcProtocol.Exception.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Exception.factory,0, 0); } public final boolean isCanceled() { return which() == Return.Which.CANCELED; @@ -1008,10 +1008,10 @@ public final boolean isResults() { public boolean hasResults() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Payload.Reader getResults() { + public org.capnproto.RpcProtocol.Payload.Reader getResults() { assert which() == Return.Which.RESULTS: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Payload.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Payload.factory,0,null, 0); } public final boolean isException() { @@ -1020,10 +1020,10 @@ public final boolean isException() { public boolean hasException() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Exception.Reader getException() { + public org.capnproto.RpcProtocol.Exception.Reader getException() { assert which() == Return.Which.EXCEPTION: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Exception.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Exception.factory,0,null, 0); } public final boolean isCanceled() { @@ -1186,34 +1186,34 @@ public final void setPromiseId(int value) { public final boolean isCap() { return which() == Resolve.Which.CAP; } - public final RpcProtocol.CapDescriptor.Builder getCap() { + public final org.capnproto.RpcProtocol.CapDescriptor.Builder getCap() { assert which() == Resolve.Which.CAP: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.CapDescriptor.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.CapDescriptor.factory, 0, null, 0); } - public final void setCap(RpcProtocol.CapDescriptor.Reader value) { + public final void setCap(org.capnproto.RpcProtocol.CapDescriptor.Reader value) { _setShortField(2, (short)Resolve.Which.CAP.ordinal()); - _setPointerField(RpcProtocol.CapDescriptor.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.CapDescriptor.factory,0, value); } - public final RpcProtocol.CapDescriptor.Builder initCap() { + public final org.capnproto.RpcProtocol.CapDescriptor.Builder initCap() { _setShortField(2, (short)Resolve.Which.CAP.ordinal()); - return _initPointerField(RpcProtocol.CapDescriptor.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.CapDescriptor.factory,0, 0); } public final boolean isException() { return which() == Resolve.Which.EXCEPTION; } - public final RpcProtocol.Exception.Builder getException() { + public final org.capnproto.RpcProtocol.Exception.Builder getException() { assert which() == Resolve.Which.EXCEPTION: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Exception.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Exception.factory, 0, null, 0); } - public final void setException(RpcProtocol.Exception.Reader value) { + public final void setException(org.capnproto.RpcProtocol.Exception.Reader value) { _setShortField(2, (short)Resolve.Which.EXCEPTION.ordinal()); - _setPointerField(RpcProtocol.Exception.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.Exception.factory,0, value); } - public final RpcProtocol.Exception.Builder initException() { + public final org.capnproto.RpcProtocol.Exception.Builder initException() { _setShortField(2, (short)Resolve.Which.EXCEPTION.ordinal()); - return _initPointerField(RpcProtocol.Exception.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.Exception.factory,0, 0); } } @@ -1239,10 +1239,10 @@ public final boolean isCap() { public boolean hasCap() { return !_pointerFieldIsNull(0); } - public RpcProtocol.CapDescriptor.Reader getCap() { + public org.capnproto.RpcProtocol.CapDescriptor.Reader getCap() { assert which() == Resolve.Which.CAP: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.CapDescriptor.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.CapDescriptor.factory,0,null, 0); } public final boolean isException() { @@ -1251,10 +1251,10 @@ public final boolean isException() { public boolean hasException() { return !_pointerFieldIsNull(0); } - public RpcProtocol.Exception.Reader getException() { + public org.capnproto.RpcProtocol.Exception.Reader getException() { assert which() == Resolve.Which.EXCEPTION: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.Exception.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.Exception.factory,0,null, 0); } } @@ -1357,14 +1357,14 @@ public static final class Builder extends org.capnproto.StructBuilder { public final Reader asReader() { return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); } - public final RpcProtocol.MessageTarget.Builder getTarget() { - return _getPointerField(RpcProtocol.MessageTarget.factory, 0, null, 0); + public final org.capnproto.RpcProtocol.MessageTarget.Builder getTarget() { + return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory, 0, null, 0); } - public final void setTarget(RpcProtocol.MessageTarget.Reader value) { - _setPointerField(RpcProtocol.MessageTarget.factory,0, value); + public final void setTarget(org.capnproto.RpcProtocol.MessageTarget.Reader value) { + _setPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, value); } - public final RpcProtocol.MessageTarget.Builder initTarget() { - return _initPointerField(RpcProtocol.MessageTarget.factory,0, 0); + public final org.capnproto.RpcProtocol.MessageTarget.Builder initTarget() { + return _initPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, 0); } public final Context.Builder getContext() { return new Disembargo.Context.Builder(segment, data, pointers, dataSize, pointerCount); @@ -1385,8 +1385,8 @@ public static final class Reader extends org.capnproto.StructReader { public boolean hasTarget() { return !_pointerFieldIsNull(0); } - public RpcProtocol.MessageTarget.Reader getTarget() { - return _getPointerField(RpcProtocol.MessageTarget.factory,0,null, 0); + public org.capnproto.RpcProtocol.MessageTarget.Reader getTarget() { + return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0,null, 0); } public Context.Reader getContext() { @@ -1585,14 +1585,14 @@ public final void setQuestionId(int value) { _setIntField(0, value); } - public final RpcProtocol.MessageTarget.Builder getTarget() { - return _getPointerField(RpcProtocol.MessageTarget.factory, 0, null, 0); + public final org.capnproto.RpcProtocol.MessageTarget.Builder getTarget() { + return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory, 0, null, 0); } - public final void setTarget(RpcProtocol.MessageTarget.Reader value) { - _setPointerField(RpcProtocol.MessageTarget.factory,0, value); + public final void setTarget(org.capnproto.RpcProtocol.MessageTarget.Reader value) { + _setPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, value); } - public final RpcProtocol.MessageTarget.Builder initTarget() { - return _initPointerField(RpcProtocol.MessageTarget.factory,0, 0); + public final org.capnproto.RpcProtocol.MessageTarget.Builder initTarget() { + return _initPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, 0); } public final boolean hasRecipient() { return !_pointerFieldIsNull(1); @@ -1621,8 +1621,8 @@ public final int getQuestionId() { public boolean hasTarget() { return !_pointerFieldIsNull(0); } - public RpcProtocol.MessageTarget.Reader getTarget() { - return _getPointerField(RpcProtocol.MessageTarget.factory,0,null, 0); + public org.capnproto.RpcProtocol.MessageTarget.Reader getTarget() { + return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0,null, 0); } public boolean hasRecipient() { @@ -1752,14 +1752,14 @@ public final void setQuestionId(int value) { _setIntField(0, value); } - public final RpcProtocol.MessageTarget.Builder getTarget() { - return _getPointerField(RpcProtocol.MessageTarget.factory, 0, null, 0); + public final org.capnproto.RpcProtocol.MessageTarget.Builder getTarget() { + return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory, 0, null, 0); } - public final void setTarget(RpcProtocol.MessageTarget.Reader value) { - _setPointerField(RpcProtocol.MessageTarget.factory,0, value); + public final void setTarget(org.capnproto.RpcProtocol.MessageTarget.Reader value) { + _setPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, value); } - public final RpcProtocol.MessageTarget.Builder initTarget() { - return _initPointerField(RpcProtocol.MessageTarget.factory,0, 0); + public final org.capnproto.RpcProtocol.MessageTarget.Builder initTarget() { + return _initPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, 0); } public final boolean hasKeyPart() { return !_pointerFieldIsNull(1); @@ -1788,8 +1788,8 @@ public final int getQuestionId() { public boolean hasTarget() { return !_pointerFieldIsNull(0); } - public RpcProtocol.MessageTarget.Reader getTarget() { - return _getPointerField(RpcProtocol.MessageTarget.factory,0,null, 0); + public org.capnproto.RpcProtocol.MessageTarget.Reader getTarget() { + return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0,null, 0); } public boolean hasKeyPart() { @@ -1854,18 +1854,18 @@ public final void setImportedCap(int value) { public final boolean isPromisedAnswer() { return which() == MessageTarget.Which.PROMISED_ANSWER; } - public final RpcProtocol.PromisedAnswer.Builder getPromisedAnswer() { + public final org.capnproto.RpcProtocol.PromisedAnswer.Builder getPromisedAnswer() { assert which() == MessageTarget.Which.PROMISED_ANSWER: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.PromisedAnswer.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory, 0, null, 0); } - public final void setPromisedAnswer(RpcProtocol.PromisedAnswer.Reader value) { + public final void setPromisedAnswer(org.capnproto.RpcProtocol.PromisedAnswer.Reader value) { _setShortField(2, (short)MessageTarget.Which.PROMISED_ANSWER.ordinal()); - _setPointerField(RpcProtocol.PromisedAnswer.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0, value); } - public final RpcProtocol.PromisedAnswer.Builder initPromisedAnswer() { + public final org.capnproto.RpcProtocol.PromisedAnswer.Builder initPromisedAnswer() { _setShortField(2, (short)MessageTarget.Which.PROMISED_ANSWER.ordinal()); - return _initPointerField(RpcProtocol.PromisedAnswer.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0, 0); } } @@ -1896,10 +1896,10 @@ public final boolean isPromisedAnswer() { public boolean hasPromisedAnswer() { return !_pointerFieldIsNull(0); } - public RpcProtocol.PromisedAnswer.Reader getPromisedAnswer() { + public org.capnproto.RpcProtocol.PromisedAnswer.Reader getPromisedAnswer() { assert which() == MessageTarget.Which.PROMISED_ANSWER: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.PromisedAnswer.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0,null, 0); } } @@ -1956,14 +1956,14 @@ public org.capnproto.AnyPointer.Builder initContent(int size) { public final boolean hasCapTable() { return !_pointerFieldIsNull(1); } - public final org.capnproto.StructList.Builder getCapTable() { - return _getPointerField(RpcProtocol.CapDescriptor.listFactory, 1, null, 0); + public final org.capnproto.StructList.Builder getCapTable() { + return _getPointerField(org.capnproto.RpcProtocol.CapDescriptor.listFactory, 1, null, 0); } - public final void setCapTable(org.capnproto.StructList.Reader value) { - _setPointerField(RpcProtocol.CapDescriptor.listFactory, 1, value); + public final void setCapTable(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.RpcProtocol.CapDescriptor.listFactory, 1, value); } - public final org.capnproto.StructList.Builder initCapTable(int size) { - return _initPointerField(RpcProtocol.CapDescriptor.listFactory, 1, size); + public final org.capnproto.StructList.Builder initCapTable(int size) { + return _initPointerField(org.capnproto.RpcProtocol.CapDescriptor.listFactory, 1, size); } } @@ -1981,8 +1981,8 @@ public org.capnproto.AnyPointer.Reader getContent() { public final boolean hasCapTable() { return !_pointerFieldIsNull(1); } - public final org.capnproto.StructList.Reader getCapTable() { - return _getPointerField(RpcProtocol.CapDescriptor.listFactory, 1, null, 0); + public final org.capnproto.StructList.Reader getCapTable() { + return _getPointerField(org.capnproto.RpcProtocol.CapDescriptor.listFactory, 1, null, 0); } } @@ -2083,34 +2083,34 @@ public final void setReceiverHosted(int value) { public final boolean isReceiverAnswer() { return which() == CapDescriptor.Which.RECEIVER_ANSWER; } - public final RpcProtocol.PromisedAnswer.Builder getReceiverAnswer() { + public final org.capnproto.RpcProtocol.PromisedAnswer.Builder getReceiverAnswer() { assert which() == CapDescriptor.Which.RECEIVER_ANSWER: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.PromisedAnswer.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory, 0, null, 0); } - public final void setReceiverAnswer(RpcProtocol.PromisedAnswer.Reader value) { + public final void setReceiverAnswer(org.capnproto.RpcProtocol.PromisedAnswer.Reader value) { _setShortField(0, (short)CapDescriptor.Which.RECEIVER_ANSWER.ordinal()); - _setPointerField(RpcProtocol.PromisedAnswer.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0, value); } - public final RpcProtocol.PromisedAnswer.Builder initReceiverAnswer() { + public final org.capnproto.RpcProtocol.PromisedAnswer.Builder initReceiverAnswer() { _setShortField(0, (short)CapDescriptor.Which.RECEIVER_ANSWER.ordinal()); - return _initPointerField(RpcProtocol.PromisedAnswer.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0, 0); } public final boolean isThirdPartyHosted() { return which() == CapDescriptor.Which.THIRD_PARTY_HOSTED; } - public final RpcProtocol.ThirdPartyCapDescriptor.Builder getThirdPartyHosted() { + public final org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.Builder getThirdPartyHosted() { assert which() == CapDescriptor.Which.THIRD_PARTY_HOSTED: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.ThirdPartyCapDescriptor.factory, 0, null, 0); + return _getPointerField(org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.factory, 0, null, 0); } - public final void setThirdPartyHosted(RpcProtocol.ThirdPartyCapDescriptor.Reader value) { + public final void setThirdPartyHosted(org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.Reader value) { _setShortField(0, (short)CapDescriptor.Which.THIRD_PARTY_HOSTED.ordinal()); - _setPointerField(RpcProtocol.ThirdPartyCapDescriptor.factory,0, value); + _setPointerField(org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.factory,0, value); } - public final RpcProtocol.ThirdPartyCapDescriptor.Builder initThirdPartyHosted() { + public final org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.Builder initThirdPartyHosted() { _setShortField(0, (short)CapDescriptor.Which.THIRD_PARTY_HOSTED.ordinal()); - return _initPointerField(RpcProtocol.ThirdPartyCapDescriptor.factory,0, 0); + return _initPointerField(org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.factory,0, 0); } public final byte getAttachedFd() { return _getByteField(2, (byte)-1); @@ -2179,10 +2179,10 @@ public final boolean isReceiverAnswer() { public boolean hasReceiverAnswer() { return !_pointerFieldIsNull(0); } - public RpcProtocol.PromisedAnswer.Reader getReceiverAnswer() { + public org.capnproto.RpcProtocol.PromisedAnswer.Reader getReceiverAnswer() { assert which() == CapDescriptor.Which.RECEIVER_ANSWER: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.PromisedAnswer.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0,null, 0); } public final boolean isThirdPartyHosted() { @@ -2191,10 +2191,10 @@ public final boolean isThirdPartyHosted() { public boolean hasThirdPartyHosted() { return !_pointerFieldIsNull(0); } - public RpcProtocol.ThirdPartyCapDescriptor.Reader getThirdPartyHosted() { + public org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.Reader getThirdPartyHosted() { assert which() == CapDescriptor.Which.THIRD_PARTY_HOSTED: "Must check which() before get()ing a union member."; - return _getPointerField(RpcProtocol.ThirdPartyCapDescriptor.factory,0,null, 0); + return _getPointerField(org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.factory,0,null, 0); } public final byte getAttachedFd() { @@ -2253,14 +2253,14 @@ public final void setQuestionId(int value) { public final boolean hasTransform() { return !_pointerFieldIsNull(0); } - public final org.capnproto.StructList.Builder getTransform() { - return _getPointerField(RpcProtocol.PromisedAnswer.Op.listFactory, 0, null, 0); + public final org.capnproto.StructList.Builder getTransform() { + return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.Op.listFactory, 0, null, 0); } - public final void setTransform(org.capnproto.StructList.Reader value) { - _setPointerField(RpcProtocol.PromisedAnswer.Op.listFactory, 0, value); + public final void setTransform(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.RpcProtocol.PromisedAnswer.Op.listFactory, 0, value); } - public final org.capnproto.StructList.Builder initTransform(int size) { - return _initPointerField(RpcProtocol.PromisedAnswer.Op.listFactory, 0, size); + public final org.capnproto.StructList.Builder initTransform(int size) { + return _initPointerField(org.capnproto.RpcProtocol.PromisedAnswer.Op.listFactory, 0, size); } } @@ -2276,8 +2276,8 @@ public final int getQuestionId() { public final boolean hasTransform() { return !_pointerFieldIsNull(0); } - public final org.capnproto.StructList.Reader getTransform() { - return _getPointerField(RpcProtocol.PromisedAnswer.Op.listFactory, 0, null, 0); + public final org.capnproto.StructList.Reader getTransform() { + return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.Op.listFactory, 0, null, 0); } } @@ -2514,16 +2514,16 @@ public final void setObsoleteDurability(short value) { _setShortField(1, value); } - public final RpcProtocol.Exception.Type getType() { + public final org.capnproto.RpcProtocol.Exception.Type getType() { switch(_getShortField(2)) { - case 0 : return RpcProtocol.Exception.Type.FAILED; - case 1 : return RpcProtocol.Exception.Type.OVERLOADED; - case 2 : return RpcProtocol.Exception.Type.DISCONNECTED; - case 3 : return RpcProtocol.Exception.Type.UNIMPLEMENTED; - default: return RpcProtocol.Exception.Type._NOT_IN_SCHEMA; + case 0 : return org.capnproto.RpcProtocol.Exception.Type.FAILED; + case 1 : return org.capnproto.RpcProtocol.Exception.Type.OVERLOADED; + case 2 : return org.capnproto.RpcProtocol.Exception.Type.DISCONNECTED; + case 3 : return org.capnproto.RpcProtocol.Exception.Type.UNIMPLEMENTED; + default: return org.capnproto.RpcProtocol.Exception.Type._NOT_IN_SCHEMA; } } - public final void setType(RpcProtocol.Exception.Type value) { + public final void setType(org.capnproto.RpcProtocol.Exception.Type value) { _setShortField(2, (short)value.ordinal()); } @@ -2549,13 +2549,13 @@ public final short getObsoleteDurability() { return _getShortField(1); } - public final RpcProtocol.Exception.Type getType() { + public final org.capnproto.RpcProtocol.Exception.Type getType() { switch(_getShortField(2)) { - case 0 : return RpcProtocol.Exception.Type.FAILED; - case 1 : return RpcProtocol.Exception.Type.OVERLOADED; - case 2 : return RpcProtocol.Exception.Type.DISCONNECTED; - case 3 : return RpcProtocol.Exception.Type.UNIMPLEMENTED; - default: return RpcProtocol.Exception.Type._NOT_IN_SCHEMA; + case 0 : return org.capnproto.RpcProtocol.Exception.Type.FAILED; + case 1 : return org.capnproto.RpcProtocol.Exception.Type.OVERLOADED; + case 2 : return org.capnproto.RpcProtocol.Exception.Type.DISCONNECTED; + case 3 : return org.capnproto.RpcProtocol.Exception.Type.UNIMPLEMENTED; + default: return org.capnproto.RpcProtocol.Exception.Type._NOT_IN_SCHEMA; } } @@ -2578,19 +2578,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0032\u00b0\u008d\u0080\u001f\u009f\u00b7\u0091" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0001\u0000\u0007\u0000\u0000\u0000\u000e\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0000\u0000\u0000\u0017\u0003\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0017\u0003\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u004d\u0065\u0073\u0073\u0061\u0067\u0065\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u004d\u0065" + + "\u0073\u0073\u0061\u0067\u0065\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0038\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + @@ -2812,20 +2816,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u00c4\u006e\u0017\u0031\u0080\u00cf\u004c\u00e9" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00d2\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00c2\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0042\u006f\u006f\u0074\u0073\u0074\u0072\u0061" + - "\u0070\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0042\u006f" + + "\u006f\u0074\u0073\u0074\u0072\u0061\u0070\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -2865,19 +2872,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u00d4\u004c\u009d\u0078\u00ce\u0053\u006a\u0083" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00aa\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u009a\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0043\u0061\u006c\u006c\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0043\u0061" + + "\u006c\u006c\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u001c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -2988,21 +2999,25 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0099\u005f\u00ab\u001a\u00f6\u00b0\u00e8\u00da" + - "\u0015\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u0033\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + "\u00d4\u004c\u009d\u0078\u00ce\u0053\u006a\u0083" + "\u0003\u0000\u0007\u0000\u0001\u0000\u0003\u0000" + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u001a\u0001\u0000\u0000" + + "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0043\u0061" + + "\u006c\u006c\u002e\u0073\u0065\u006e\u0064\u0052" + + "\u0065\u0073\u0075\u006c\u0074\u0073\u0054\u006f" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0043\u0061\u006c\u006c\u002e\u0073\u0065\u006e" + - "\u0064\u0052\u0065\u0073\u0075\u006c\u0074\u0073" + - "\u0054\u006f\u0000\u0000\u0000\u0000\u0000\u0000" + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + @@ -3055,19 +3070,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u003a\u0057\u00b3\u003d\u008d\u00b2\u0019\u009e" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0006\u0000" + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ba\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00aa\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0000\u0000\u0000\u00c7\u0001\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u00c7\u0001\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0052\u0065\u0074\u0075\u0072\u006e\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0052\u0065" + + "\u0074\u0075\u0072\u006e\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0020\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -3205,19 +3224,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0063\u000e\u00f8\u00c2\u00b2\u002e\u007d\u00d3" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ba\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00aa\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0046\u0069\u006e\u0069\u0073\u0068\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0046\u0069" + + "\u006e\u0069\u0073\u0068\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -3257,19 +3280,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u006e\u0008\u0089\u00fa\u0055\u0096\u00c2\u00bb" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0052\u0065\u0073\u006f\u006c\u0076\u0065\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0052\u0065" + + "\u0073\u006f\u006c\u0076\u0065\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -3323,19 +3350,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0097\u0074\u00d0\u007d\r\u006c\u001a\u00ad" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0052\u0065\u006c\u0065\u0061\u0073\u0065\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0052\u0065" + + "\u006c\u0065\u0061\u0073\u0065\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -3373,20 +3404,24 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0011\u0037\u00bd\u000f\u008b\u0036\u0064\u00f9" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00da\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ca\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0044\u0069\u0073\u0065\u006d\u0062\u0061\u0072" + - "\u0067\u006f\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0044\u0069" + + "\u0073\u0065\u006d\u0062\u0061\u0072\u0067\u006f" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -3416,21 +3451,25 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u004d\u00dd\u005b\u0065\u00df\u00b4\u0062\u00d5" + - "\u001b\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0039\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0011\u0037\u00bd\u000f\u008b\u0036\u0064\u00f9" + "\u0001\u0000\u0007\u0000\u0001\u0000\u0004\u0000" + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u001a\u0001\u0000\u0000" + + "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0044\u0069\u0073\u0065\u006d\u0062\u0061\u0072" + - "\u0067\u006f\u002e\u0063\u006f\u006e\u0074\u0065" + - "\u0078\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0044\u0069" + + "\u0073\u0065\u006d\u0062\u0061\u0072\u0067\u006f" + + "\u002e\u0063\u006f\u006e\u0074\u0065\u0078\u0074" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0010\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + @@ -3499,19 +3538,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u005a\u00ac\u00c1\u00fb\u006b\u0004\u006a\u009c" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0050\u0072\u006f\u0076\u0069\u0064\u0065\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0050\u0072" + + "\u006f\u0076\u0069\u0064\u0065\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -3565,19 +3608,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0016\u0040\u0055\u0090\u0062\u00b5\u00c9\u00d4" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ba\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00aa\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0041\u0063\u0063\u0065\u0070\u0074\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0041\u0063" + + "\u0063\u0065\u0070\u0074\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -3631,19 +3678,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u00af\u0001\u00e0\u0090\u0004\u0098\u00e1\u00fb" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00aa\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u009a\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u004a\u006f\u0069\u006e\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u004a\u006f" + + "\u0069\u006e\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -3696,20 +3747,24 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u00c1\u00fb\u0013\u0058\u0054\u0014\u00bc\u0095" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00f2\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u004d\u0065\u0073\u0073\u0061\u0067\u0065\u0054" + - "\u0061\u0072\u0067\u0065\u0074\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u004d\u0065" + + "\u0073\u0073\u0061\u0067\u0065\u0054\u0061\u0072" + + "\u0067\u0065\u0074\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + @@ -3748,19 +3803,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u003b\u0074\u0096\u003d\"\u0061\u000e\u009a" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0050\u0061\u0079\u006c\u006f\u0061\u0064\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0050\u0061" + + "\u0079\u006c\u006f\u0061\u0064\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -3802,20 +3861,24 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u00b0\u00b8\u0086\u000b\u00c4\u00dd\u0023\u0085" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0006\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00f2\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0043\u0061\u0070\u0044\u0065\u0073\u0063\u0072" + - "\u0069\u0070\u0074\u006f\u0072\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0043\u0061" + + "\u0070\u0044\u0065\u0073\u0063\u0072\u0069\u0070" + + "\u0074\u006f\u0072\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u001c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + @@ -3934,20 +3997,24 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u00a0\u001c\u006f\u00cd\u00d6\u00b1\u0000\u00d8" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00fa\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0039\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0050\u0072\u006f\u006d\u0069\u0073\u0065\u0064" + - "\u0041\u006e\u0073\u0077\u0065\u0072\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0050\u0072" + + "\u006f\u006d\u0069\u0073\u0065\u0064\u0041\u006e" + + "\u0073\u0077\u0065\u0072\u0000\u0000\u0000\u0000" + "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0081\u0090\u0056\u0015\u0044\u0094\u0016\u00f3" + "\u0001\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + @@ -3993,21 +4060,24 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0081\u0090\u0056\u0015\u0044\u0094\u0016\u00f3" + - "\u001f\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u003d\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u00a0\u001c\u006f\u00cd\u00d6\u00b1\u0000\u00d8" + "\u0000\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0012\u0001\u0000\u0000" + - "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0050\u0072\u006f\u006d\u0069\u0073\u0065\u0064" + - "\u0041\u006e\u0073\u0077\u0065\u0072\u002e\u004f" + - "\u0070\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0050\u0072" + + "\u006f\u006d\u0069\u0073\u0065\u0064\u0041\u006e" + + "\u0073\u0077\u0065\u0072\u002e\u004f\u0070\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + @@ -4045,21 +4115,25 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u007d\u0002\u00f0\u00e1\u00fd\u0007\u0070\u00d3" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0042\u0001\u0000\u0000" + - "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0032\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0054\u0068\u0069\u0072\u0064\u0050\u0061\u0072" + - "\u0074\u0079\u0043\u0061\u0070\u0044\u0065\u0073" + - "\u0063\u0072\u0069\u0070\u0074\u006f\u0072\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0054\u0068" + + "\u0069\u0072\u0064\u0050\u0061\u0072\u0074\u0079" + + "\u0043\u0061\u0070\u0044\u0065\u0073\u0063\u0072" + + "\u0069\u0070\u0074\u006f\u0072\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -4096,20 +4170,23 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00d2\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00c2\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f" + - "\u006e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0045\u0078" + + "\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0000" + "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0058\u00bd\u004c\u003f\u00e2\u0096\u008c\u00b2" + "\u0001\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + @@ -4183,20 +4260,24 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0058\u00bd\u004c\u003f\u00e2\u0096\u008c\u00b2" + - "\u001a\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0038\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00fa\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0067\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0067\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002e\u0063\u0061\u0070\u006e\u0070\u003a" + - "\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f" + - "\u006e\u002e\u0054\u0079\u0070\u0065\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + + "\u0063\u0061\u0070\u006e\u0070\u003a\u0045\u0078" + + "\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u002e" + + "\u0054\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0010\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + diff --git a/runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java b/runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java index d6a0c4be..05bdbd10 100644 --- a/runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java +++ b/runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java @@ -38,14 +38,14 @@ public static final class Builder extends org.capnproto.StructBuilder { public final Reader asReader() { return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); } - public final RpcTwoPartyProtocol.Side getSide() { + public final org.capnproto.RpcTwoPartyProtocol.Side getSide() { switch(_getShortField(0)) { - case 0 : return RpcTwoPartyProtocol.Side.SERVER; - case 1 : return RpcTwoPartyProtocol.Side.CLIENT; - default: return RpcTwoPartyProtocol.Side._NOT_IN_SCHEMA; + case 0 : return org.capnproto.RpcTwoPartyProtocol.Side.SERVER; + case 1 : return org.capnproto.RpcTwoPartyProtocol.Side.CLIENT; + default: return org.capnproto.RpcTwoPartyProtocol.Side._NOT_IN_SCHEMA; } } - public final void setSide(RpcTwoPartyProtocol.Side value) { + public final void setSide(org.capnproto.RpcTwoPartyProtocol.Side value) { _setShortField(0, (short)value.ordinal()); } @@ -56,11 +56,11 @@ public static final class Reader extends org.capnproto.StructReader { super(segment, data, pointers, dataSize, pointerCount, nestingLimit); } - public final RpcTwoPartyProtocol.Side getSide() { + public final org.capnproto.RpcTwoPartyProtocol.Side getSide() { switch(_getShortField(0)) { - case 0 : return RpcTwoPartyProtocol.Side.SERVER; - case 1 : return RpcTwoPartyProtocol.Side.CLIENT; - default: return RpcTwoPartyProtocol.Side._NOT_IN_SCHEMA; + case 0 : return org.capnproto.RpcTwoPartyProtocol.Side.SERVER; + case 1 : return org.capnproto.RpcTwoPartyProtocol.Side.CLIENT; + default: return org.capnproto.RpcTwoPartyProtocol.Side._NOT_IN_SCHEMA; } } @@ -360,20 +360,24 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u009c\u0071\u00b9\u0087\u00bc\u009e\u00d6\u009f" + - "\u0019\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0037\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00f2\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u0037\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0037\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + - "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0053\u0069\u0064\u0065\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + + "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + + "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u0053" + + "\u0069\u0064\u0065\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0008\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -388,20 +392,24 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u008e\u003a\u0073\u00ee\u009f\u0090\u000b\u00d2" + - "\u0019\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0037\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00fa\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + - "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0056\u0061\u0074\u0049\u0064\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + + "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + + "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u0056" + + "\u0061\u0074\u0049\u0064\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -423,21 +431,25 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0017\u0098\u00f3\u00c5\u00a9\u0009\u008d\u00b8" + - "\u0019\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0037\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u002a\u0001\u0000\u0000" + - "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u001a\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + - "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0050\u0072\u006f\u0076\u0069\u0073\u0069" + - "\u006f\u006e\u0049\u0064\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + + "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + + "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u0050" + + "\u0072\u006f\u0076\u0069\u0073\u0069\u006f\u006e" + + "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -459,62 +471,73 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u00c1\u0082\u0040\u00fd\u00b6\u0089\u00f3\u0089" + - "\u0019\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0037\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u002a\u0001\u0000\u0000" + - "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u001a\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + - "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0052\u0065\u0063\u0069\u0070\u0069\u0065" + - "\u006e\u0074\u0049\u0064\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + + "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + + "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u0052" + + "\u0065\u0063\u0069\u0070\u0069\u0065\u006e\u0074" + + "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); public static final org.capnproto.SegmentReader b_b47f4979672cb59d = org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u009d\u00b5\u002c\u0067\u0079\u0049\u007f\u00b4" + - "\u0019\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0037\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u004a\u0001\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u003a\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + - "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0068\u0069\u0072\u0064\u0050\u0061" + - "\u0072\u0074\u0079\u0043\u0061\u0070\u0049\u0064" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + + "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + + "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u0054" + + "\u0068\u0069\u0072\u0064\u0050\u0061\u0072\u0074" + + "\u0079\u0043\u0061\u0070\u0049\u0064\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); public static final org.capnproto.SegmentReader b_95b29059097fca83 = org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0083\u00ca\u007f\u0009\u0059\u0090\u00b2\u0095" + - "\u0019\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0037\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u002a\u0001\u0000\u0000" + - "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u001a\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + - "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004a\u006f\u0069\u006e\u004b\u0065\u0079" + - "\u0050\u0061\u0072\u0074\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + + "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + + "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u004a" + + "\u006f\u0069\u006e\u004b\u0065\u0079\u0050\u0061" + + "\u0072\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -567,21 +590,25 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u00ee\u00eb\u00b7\u0030\u0036\u003a\u0026\u009d" + - "\u0019\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0037\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\"\u0001\u0000\u0000" + - "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0012\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u002f\u0072\u0070" + - "\u0063\u002d\u0074\u0077\u006f\u0070\u0061\u0072" + - "\u0074\u0079\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004a\u006f\u0069\u006e\u0052\u0065\u0073" + - "\u0075\u006c\u0074\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + + "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + + "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u004a" + + "\u006f\u0069\u006e\u0052\u0065\u0073\u0075\u006c" + + "\u0074\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + From 7d3e79091bc7dc5747fd9117c209b30948d0528d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 2 Oct 2020 21:36:29 +0100 Subject: [PATCH 028/246] add runOnce to Client --- runtime/src/main/java/org/capnproto/TwoPartyClient.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime/src/main/java/org/capnproto/TwoPartyClient.java b/runtime/src/main/java/org/capnproto/TwoPartyClient.java index 1707e031..474dd86e 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyClient.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyClient.java @@ -1,6 +1,7 @@ package org.capnproto; import java.nio.channels.AsynchronousByteChannel; +import java.util.concurrent.CompletableFuture; public class TwoPartyClient { @@ -30,4 +31,8 @@ public Capability.Client bootstrap() { : RpcTwoPartyProtocol.Side.CLIENT); return rpcSystem.bootstrap(vatId.asReader()); } + + public synchronized CompletableFuture runOnce() { + return this.rpcSystem.runOnce(); + } } From 194c0ada2a7276f7a092c15d927fb002de7dd27e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 2 Oct 2020 21:43:30 +0100 Subject: [PATCH 029/246] correct setter of capability pointer --- runtime/src/main/java/org/capnproto/WirePointer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/WirePointer.java b/runtime/src/main/java/org/capnproto/WirePointer.java index ba332923..167b649d 100644 --- a/runtime/src/main/java/org/capnproto/WirePointer.java +++ b/runtime/src/main/java/org/capnproto/WirePointer.java @@ -86,7 +86,13 @@ public static int upper32Bits(long wirePointer) { return (int)(wirePointer >>> 32); } + public static boolean isCapability(long wirePointer) { + // lower 30 bits are all zero + return offsetAndKind(wirePointer) == OTHER; + } + public static void setCap(ByteBuffer buffer, int offset, int cap) { - WirePointer.setOffsetAndKind(buffer, offset, (cap << 2) | OTHER); + setOffsetAndKind(buffer, offset, OTHER); + buffer.putInt(offset*8 + 4, cap); } } From 7ae49a8f6ae7f2bf18a9ec0253caef7bf255932e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 2 Oct 2020 21:44:52 +0100 Subject: [PATCH 030/246] RpcState bug fixes correctly brand RpcClient don't run message loop inside promise imbue payload --- runtime/src/main/java/org/capnproto/RpcState.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index f11df613..1214bc21 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -1108,11 +1108,15 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext public VoidPromiseAndPipeline callNoIntercept(long interfaceId, short methodId, CallContextHook context) { var params = context.getParams(); var request = newCallNoIntercept(interfaceId, methodId); - var x = request.params; context.allowCancellation(); return context.directTailCall(request.hook); } + @Override + public final Object getBrand() { + return RpcState.this; + } + private Request newCallNoIntercept(long interfaceId, short methodId) { if (isDisconnected()) { return Request.newBrokenRequest(disconnected); @@ -1139,7 +1143,7 @@ class RpcRequest implements RequestHook { this.target = target; this.message = connection.newOutgoingMessage(1024); this.callBuilder = message.getBody().getAs(RpcProtocol.Message.factory).initCall(); - this.paramsBuilder = callBuilder.getParams().getContent(); + this.paramsBuilder = callBuilder.getParams().getContent().imbue(this.capTable); } AnyPointer.Builder getRoot() { @@ -1168,8 +1172,7 @@ public RemotePromise send() { // The pipeline must get notified of resolution before the app does to maintain ordering. var pipeline = new RpcPipeline(question, question.response); - // drive the message loop until the question is answered - var appPromise = messageLoop(question.response).thenApply(response -> { + var appPromise = question.response.thenApply(response -> { var results = response.getResults(); return new Response(results, response); }); @@ -1202,7 +1205,7 @@ Question sendInternal(boolean isTailCall) { } @Override - public Object getBrand() { + public final Object getBrand() { return RpcState.this; } From 1913b6d5ea338a813242a58eab1f7d5e50dcb49d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 2 Oct 2020 21:47:04 +0100 Subject: [PATCH 031/246] minor scope changes to cap client and server --- .../main/java/org/capnproto/Capability.java | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 9706fd0c..7762809c 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -4,6 +4,14 @@ public final class Capability { + static abstract class BuilderContext { + CapTableBuilder capTable; + } + + static class ReaderContext { + CapTableReader capTable; + } + public static class Client { final ClientHook hook; @@ -17,7 +25,7 @@ public Client(ClientHook hook) { } public Client(Server server) { - this(server.makeLocalClient()); + this(makeLocalClient(server)); } public Client(CompletableFuture promise) { @@ -28,8 +36,8 @@ public Client(Throwable exc) { this(newBrokenCap(exc)); } - public ClientHook getHook() { - return this.hook; + private static ClientHook makeLocalClient(Server server) { + return server.makeLocalClient(); } CompletableFuture whenResolved() { @@ -42,37 +50,29 @@ Request typelessRequest( return hook.newCall(interfaceId, methodId); } - public Request newCall(FromPointerBuilder builder, + protected Request newCall(FromPointerBuilder builder, FromPointerReader reader, long interfaceId, short methodId) { var request = hook.newCall(interfaceId, methodId); return new Request (builder, reader, request.params, request.hook); } - - public Request newCall(long interfaceId, short methodId) { - return hook.newCall(interfaceId, methodId); - } - - private static ClientHook makeLocalClient(Capability.Server server) { - return server.makeLocalClient(); - } } public abstract static class Server { private static final Object BRAND = new Object(); - ClientHook hook; + private ClientHook hook; - public ClientHook makeLocalClient() { + ClientHook makeLocalClient() { return new LocalClient(); } private final class LocalClient implements ClientHook { - CompletableFuture resolveTask; - ClientHook resolved; - boolean blocked = false; - Exception brokenException; + private CompletableFuture resolveTask; + private ClientHook resolved; + private boolean blocked = false; + private Exception brokenException; LocalClient() { Server.this.hook = this; @@ -142,12 +142,12 @@ void startResolveTask() { return; } this.resolveTask = resolver.thenAccept(client -> { - this.resolved = client.getHook(); + this.resolved = client.hook; }); } } - final class DispatchCallResult { + public static final class DispatchCallResult { private final CompletableFuture promise; private final boolean streaming; @@ -180,7 +180,7 @@ public CompletableFuture shortenPath() { } protected Client thisCap() { - return new Client(hook); + return new Client(this.hook); } protected final CallContext internalGetTypedContext( @@ -190,12 +190,14 @@ protected final CallContext internalGetTypedC return new CallContext<>(paramsFactory, resultsFactory, typeless.hook); } - public abstract DispatchCallResult dispatchCall(long interfaceId, short methodId, CallContext context); + public abstract DispatchCallResult dispatchCall(long interfaceId, short methodId, + CallContext context); protected DispatchCallResult internalUnimplemented(String actualInterfaceName, long requestedTypeId) { return new DispatchCallResult(RpcException.unimplemented( "Method not implemented. " + actualInterfaceName + " " + requestedTypeId)); } + protected DispatchCallResult internalUnimplemented(String interfaceName, long typeId, short methodId) { return new DispatchCallResult(RpcException.unimplemented( "Method not implemented. " + interfaceName + " " + typeId + " " + methodId)); From c938938808463de1b4ec7644c6f0472b6ad430e0 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 2 Oct 2020 21:47:25 +0100 Subject: [PATCH 032/246] CapTables everywhere! Imbue readers and writers with capTables. Ensure caps are removed when pointers are zeroed out. --- .../main/java/org/capnproto/AnyPointer.java | 53 +++--- runtime/src/main/java/org/capnproto/Data.java | 23 ++- .../org/capnproto/FromPointerBuilder.java | 13 +- .../FromPointerBuilderBlobDefault.java | 7 +- .../FromPointerBuilderRefDefault.java | 7 +- .../java/org/capnproto/FromPointerReader.java | 7 +- .../FromPointerReaderRefDefault.java | 5 +- .../main/java/org/capnproto/ListBuilder.java | 18 +- .../main/java/org/capnproto/ListFactory.java | 31 ++-- .../main/java/org/capnproto/ListReader.java | 13 +- .../java/org/capnproto/SetPointerBuilder.java | 2 +- .../java/org/capnproto/StructBuilder.java | 33 ++-- .../java/org/capnproto/StructFactory.java | 31 ++-- .../main/java/org/capnproto/StructList.java | 10 +- .../main/java/org/capnproto/StructReader.java | 17 +- runtime/src/main/java/org/capnproto/Text.java | 28 ++- .../main/java/org/capnproto/WireHelpers.java | 124 ++++++++----- .../test/java/org/capnproto/LayoutTest.java | 2 +- .../test/java/org/capnproto/TwoPartyTest.java | 26 ++- .../test/java/org/capnproto/demo/Demo.java | 164 ++++++++++++++---- .../java/org/capnproto/demo/demoparams.capnp | 2 + 21 files changed, 388 insertions(+), 228 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 5c3fac27..9e5d6c91 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -23,35 +23,24 @@ public final class AnyPointer { public static final class Factory implements PointerFactory { - public final Reader fromPointerReader(SegmentReader segment, int pointer, int nestingLimit) { - return new Reader(segment, pointer, nestingLimit); - } public final Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { - var result = new Reader(segment, pointer, nestingLimit); - result.capTable = capTable; - return result; - } - public final Builder fromPointerBuilder(SegmentBuilder segment, int pointer) { - return new Builder(segment, pointer); + return new Reader(segment, capTable, pointer, nestingLimit); } public final Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { - var result = new Builder(segment, pointer); - result.capTable = capTable; - return result; + return new Builder(segment, capTable, pointer); } - public final Builder initFromPointerBuilder(SegmentBuilder segment, int pointer, int elementCount) { - Builder result = new Builder(segment, pointer); + public final Builder initFromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, int elementCount) { + Builder result = new Builder(segment, capTable, pointer); result.clear(); return result; } } public static final Factory factory = new Factory(); - public final static class Reader { + public final static class Reader extends Capability.ReaderContext { final SegmentReader segment; final int pointer; // offset in words final int nestingLimit; - CapTableReader capTable; public Reader(SegmentReader segment, int pointer, int nestingLimit) { this.segment = segment; @@ -59,6 +48,13 @@ public Reader(SegmentReader segment, int pointer, int nestingLimit) { this.nestingLimit = nestingLimit; } + public Reader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { + this.segment = segment; + this.pointer = pointer; + this.nestingLimit = nestingLimit; + this.capTable = capTable; + } + final Reader imbue(CapTableReader capTable) { var result = new Reader(segment, pointer, nestingLimit); result.capTable = capTable; @@ -94,20 +90,23 @@ public final ClientHook getPipelinedCap(PipelineOp[] ops) { } } - public static final class Builder { + public static final class Builder extends Capability.BuilderContext { final SegmentBuilder segment; final int pointer; - CapTableBuilder capTable; public Builder(SegmentBuilder segment, int pointer) { this.segment = segment; this.pointer = pointer; } + Builder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { + this.segment = segment; + this.pointer = pointer; + this.capTable = capTable; + } + final Builder imbue(CapTableBuilder capTable) { - var result = new Builder(segment, pointer); - result.capTable = capTable; - return result; + return new Builder(segment, capTable, pointer); } public final boolean isNull() { @@ -115,19 +114,19 @@ public final boolean isNull() { } public final T getAs(FromPointerBuilder factory) { - return factory.fromPointerBuilder(this.segment, this.pointer); + return factory.fromPointerBuilder(this.segment, this.capTable, this.pointer); } public final T initAs(FromPointerBuilder factory) { - return factory.initFromPointerBuilder(this.segment, this.pointer, 0); + return factory.initFromPointerBuilder(this.segment, this.capTable, this.pointer, 0); } public final T initAs(FromPointerBuilder factory, int elementCount) { - return factory.initFromPointerBuilder(this.segment, this.pointer, elementCount); + return factory.initFromPointerBuilder(this.segment, this.capTable, this.pointer, elementCount); } public final void setAs(SetPointerBuilder factory, U reader) { - factory.setPointerBuilder(this.segment, this.pointer, reader); + factory.setPointerBuilder(this.segment, this.capTable, this.pointer, reader); } public final void setAsCapability(Capability.Client cap) { @@ -135,11 +134,11 @@ public final void setAsCapability(Capability.Client cap) { } public final Reader asReader() { - return new Reader(segment, pointer, java.lang.Integer.MAX_VALUE); + return new Reader(segment, this.capTable, pointer, java.lang.Integer.MAX_VALUE); } public final void clear() { - WireHelpers.zeroObject(this.segment, this.pointer); + WireHelpers.zeroObject(this.segment, this.capTable, this.pointer); this.segment.buffer.putLong(this.pointer * 8, 0L); } } diff --git a/runtime/src/main/java/org/capnproto/Data.java b/runtime/src/main/java/org/capnproto/Data.java index b751ee5b..b97def10 100644 --- a/runtime/src/main/java/org/capnproto/Data.java +++ b/runtime/src/main/java/org/capnproto/Data.java @@ -40,44 +40,41 @@ public final Reader fromPointerReader(SegmentReader segment, int pointer, int ne } @Override - public Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { - return fromPointerReader(segment, pointer, nestingLimit); + public final Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { + return WireHelpers.readDataPointer(segment, pointer, null, 0, 0); } @Override public final Builder fromPointerBuilderBlobDefault( SegmentBuilder segment, + CapTableBuilder capTable, int pointer, java.nio.ByteBuffer defaultBuffer, int defaultOffset, int defaultSize) { return WireHelpers.getWritableDataPointer(pointer, segment, + capTable, defaultBuffer, defaultOffset, defaultSize); } - @Override - public final Builder fromPointerBuilder(SegmentBuilder segment, int pointer) { + public final Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { return WireHelpers.getWritableDataPointer(pointer, segment, + capTable, null, 0, 0); } @Override - public Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { - return fromPointerBuilder(segment, pointer); - } - - @Override - public final Builder initFromPointerBuilder(SegmentBuilder segment, int pointer, int size) { - return WireHelpers.initDataPointer(pointer, segment, size); + public final Builder initFromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, int size) { + return WireHelpers.initDataPointer(pointer, segment, capTable, size); } @Override - public final void setPointerBuilder(SegmentBuilder segment, int pointer, Reader value) { - WireHelpers.setDataPointer(pointer, segment, value); + public final void setPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, Reader value) { + WireHelpers.setDataPointer(pointer, segment, capTable, value); } } public static final Factory factory = new Factory(); diff --git a/runtime/src/main/java/org/capnproto/FromPointerBuilder.java b/runtime/src/main/java/org/capnproto/FromPointerBuilder.java index 5476e24a..1a2342af 100644 --- a/runtime/src/main/java/org/capnproto/FromPointerBuilder.java +++ b/runtime/src/main/java/org/capnproto/FromPointerBuilder.java @@ -22,13 +22,14 @@ package org.capnproto; public interface FromPointerBuilder { - T fromPointerBuilder(SegmentBuilder segment, int pointer); - default T fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { - + default T fromPointerBuilder(SegmentBuilder segment, int pointer) { return fromPointerBuilder(segment, pointer); } - T initFromPointerBuilder(SegmentBuilder segment, int pointer, int elementCount); - default T initFromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, int elementCount) { - return initFromPointerBuilder(segment, pointer, elementCount); + + T fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer); + + default T initFromPointerBuilder(SegmentBuilder segment, int pointer, int elementCount) { + return initFromPointerBuilder(segment, null, pointer, elementCount); } + T initFromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, int elementCount); } diff --git a/runtime/src/main/java/org/capnproto/FromPointerBuilderBlobDefault.java b/runtime/src/main/java/org/capnproto/FromPointerBuilderBlobDefault.java index 377fb3a6..3004beec 100644 --- a/runtime/src/main/java/org/capnproto/FromPointerBuilderBlobDefault.java +++ b/runtime/src/main/java/org/capnproto/FromPointerBuilderBlobDefault.java @@ -22,6 +22,11 @@ package org.capnproto; public interface FromPointerBuilderBlobDefault { - T fromPointerBuilderBlobDefault(SegmentBuilder segment, int pointer, + default T fromPointerBuilderBlobDefault(SegmentBuilder segment, int pointer, + java.nio.ByteBuffer defaultBuffer, int defaultOffset, int defaultSize) { + return fromPointerBuilderBlobDefault(segment, null, pointer, defaultBuffer, defaultOffset, defaultSize); + } + + T fromPointerBuilderBlobDefault(SegmentBuilder segment, CapTableBuilder capTable, int pointer, java.nio.ByteBuffer defaultBuffer, int defaultOffset, int defaultSize); } diff --git a/runtime/src/main/java/org/capnproto/FromPointerBuilderRefDefault.java b/runtime/src/main/java/org/capnproto/FromPointerBuilderRefDefault.java index 50c8b3d2..44d56e85 100644 --- a/runtime/src/main/java/org/capnproto/FromPointerBuilderRefDefault.java +++ b/runtime/src/main/java/org/capnproto/FromPointerBuilderRefDefault.java @@ -22,5 +22,10 @@ package org.capnproto; public interface FromPointerBuilderRefDefault { - T fromPointerBuilderRefDefault(SegmentBuilder segment, int pointer, SegmentReader defaultSegment, int defaultOffset); + + default T fromPointerBuilderRefDefault(SegmentBuilder segment, int pointer, SegmentReader defaultSegment, int defaultOffset) { + return fromPointerBuilderRefDefault(segment, null, pointer, defaultSegment, defaultOffset); + } + + T fromPointerBuilderRefDefault(SegmentBuilder segment, CapTableBuilder capTable, int pointer, SegmentReader defaultSegment, int defaultOffset); } diff --git a/runtime/src/main/java/org/capnproto/FromPointerReader.java b/runtime/src/main/java/org/capnproto/FromPointerReader.java index 042afe9d..5738cc57 100644 --- a/runtime/src/main/java/org/capnproto/FromPointerReader.java +++ b/runtime/src/main/java/org/capnproto/FromPointerReader.java @@ -22,9 +22,8 @@ package org.capnproto; public interface FromPointerReader { - T fromPointerReader(SegmentReader segment, int pointer, int nestingLimit); - - default T fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { - return fromPointerReader(segment, pointer, nestingLimit); + default T fromPointerReader(SegmentReader segment, int pointer, int nestingLimit) { + return fromPointerReader(segment, null, pointer, nestingLimit); } + T fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit); } diff --git a/runtime/src/main/java/org/capnproto/FromPointerReaderRefDefault.java b/runtime/src/main/java/org/capnproto/FromPointerReaderRefDefault.java index e6d05e02..cf301638 100644 --- a/runtime/src/main/java/org/capnproto/FromPointerReaderRefDefault.java +++ b/runtime/src/main/java/org/capnproto/FromPointerReaderRefDefault.java @@ -22,5 +22,8 @@ package org.capnproto; public interface FromPointerReaderRefDefault { - T fromPointerReaderRefDefault(SegmentReader segment, int pointer, SegmentReader defaultSegment, int defaultOffset, int nestingLimit); + default T fromPointerReaderRefDefault(SegmentReader segment, int pointer, SegmentReader defaultSegment, int defaultOffset, int nestingLimit) { + return fromPointerReaderRefDefault(segment, null, pointer, defaultSegment, defaultOffset, nestingLimit); + } + T fromPointerReaderRefDefault(SegmentReader segment, CapTableReader capTable, int pointer, SegmentReader defaultSegment, int defaultOffset, int nestingLimit); } diff --git a/runtime/src/main/java/org/capnproto/ListBuilder.java b/runtime/src/main/java/org/capnproto/ListBuilder.java index b91006a8..7af8840e 100644 --- a/runtime/src/main/java/org/capnproto/ListBuilder.java +++ b/runtime/src/main/java/org/capnproto/ListBuilder.java @@ -21,11 +21,22 @@ package org.capnproto; -public class ListBuilder { +import java.util.List; + +public class ListBuilder extends Capability.BuilderContext { public interface Factory { T constructBuilder(SegmentBuilder segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount); + default T constructBuilder(SegmentBuilder segment, CapTableBuilder capTable, int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount) { + var result = constructBuilder(segment, ptr, elementCount, step, structDataSize, structPointerCount); + if (result instanceof Capability.BuilderContext) { + ((Capability.BuilderContext) result).capTable = capTable; + } + return result; + } } final SegmentBuilder segment; @@ -34,7 +45,6 @@ T constructBuilder(SegmentBuilder segment, int ptr, final int step; // in bits final int structDataSize; // in bits final short structPointerCount; - CapTableBuilder capTable; public ListBuilder(SegmentBuilder segment, int ptr, int elementCount, int step, @@ -120,6 +130,7 @@ protected final T _getStructElement(StructBuilder.Factory factory, int in int structPointers = (structData + (this.structDataSize / 8)) / 8; return factory.constructBuilder(this.segment, + this.capTable, structData, structPointers, this.structDataSize, @@ -129,18 +140,21 @@ protected final T _getStructElement(StructBuilder.Factory factory, int in protected final T _getPointerElement(FromPointerBuilder factory, int index) { return factory.fromPointerBuilder( this.segment, + this.capTable, (this.ptr + (int)((long)index * this.step / Constants.BITS_PER_BYTE)) / Constants.BYTES_PER_WORD); } protected final T _initPointerElement(FromPointerBuilder factory, int index, int elementCount) { return factory.initFromPointerBuilder( this.segment, + this.capTable, (this.ptr + (int)((long)index * this.step / Constants.BITS_PER_BYTE)) / Constants.BYTES_PER_WORD, elementCount); } protected final void _setPointerElement(SetPointerBuilder factory, int index, Reader value) { factory.setPointerBuilder(this.segment, + this.capTable, (this.ptr + (int)((long)index * this.step / Constants.BITS_PER_BYTE)) / Constants.BYTES_PER_WORD, value); } diff --git a/runtime/src/main/java/org/capnproto/ListFactory.java b/runtime/src/main/java/org/capnproto/ListFactory.java index e3d6fc0b..61752c2d 100644 --- a/runtime/src/main/java/org/capnproto/ListFactory.java +++ b/runtime/src/main/java/org/capnproto/ListFactory.java @@ -32,12 +32,13 @@ public abstract class ListFactory { T constructReader(SegmentReader segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount, int nestingLimit); + default T constructReader(SegmentBuilder segment, CapTableReader capTable, int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount, int nestingLimit) { + var result = constructReader(segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); + if (result instanceof Capability.ReaderContext) { + ((Capability.ReaderContext) result).capTable = capTable; + } + return result; + } } final SegmentReader segment; @@ -37,7 +46,6 @@ T constructReader(SegmentReader segment, final int structDataSize; // in bits final short structPointerCount; final int nestingLimit; - CapTableReader capTable; public ListReader() { this.segment = null; @@ -60,7 +68,6 @@ public ListReader(SegmentReader segment, int ptr, this.structDataSize = structDataSize; this.structPointerCount = structPointerCount; this.nestingLimit = nestingLimit; - } ListReader imbue(CapTableReader capTable) { diff --git a/runtime/src/main/java/org/capnproto/SetPointerBuilder.java b/runtime/src/main/java/org/capnproto/SetPointerBuilder.java index 636c3a23..c1566e13 100644 --- a/runtime/src/main/java/org/capnproto/SetPointerBuilder.java +++ b/runtime/src/main/java/org/capnproto/SetPointerBuilder.java @@ -22,5 +22,5 @@ package org.capnproto; public interface SetPointerBuilder { - void setPointerBuilder(SegmentBuilder segment, int pointer, Reader value); + void setPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, Reader value); } diff --git a/runtime/src/main/java/org/capnproto/StructBuilder.java b/runtime/src/main/java/org/capnproto/StructBuilder.java index c62bcefc..0bded78a 100644 --- a/runtime/src/main/java/org/capnproto/StructBuilder.java +++ b/runtime/src/main/java/org/capnproto/StructBuilder.java @@ -21,10 +21,18 @@ package org.capnproto; -public class StructBuilder { +public class StructBuilder extends Capability.BuilderContext { public interface Factory { T constructBuilder(SegmentBuilder segment, int data, int pointers, int dataSize, short pointerCount); + default T constructBuilder(SegmentBuilder segment, CapTableBuilder capTable, int data, int pointers, int dataSize, + short pointerCount) { + var result = constructBuilder(segment, data, pointers, dataSize, pointerCount); + if (result instanceof Capability.BuilderContext) { + ((Capability.BuilderContext) result).capTable = capTable; + } + return result; + } StructSize structSize(); } @@ -33,7 +41,6 @@ T constructBuilder(SegmentBuilder segment, int data, int pointers, int dataSize, protected final int pointers; // word offset of pointer section protected final int dataSize; // in bits protected final short pointerCount; - protected CapTableBuilder capTable; public StructBuilder(SegmentBuilder segment, int data, int pointers, int dataSize, short pointerCount) { @@ -44,12 +51,6 @@ public StructBuilder(SegmentBuilder segment, int data, this.pointerCount = pointerCount; } - StructBuilder imbue(CapTableBuilder capTable) { - var result = new StructBuilder(this.segment, this.data, this.pointers, this.dataSize, this.pointerCount); - result.capTable = capTable; - return result; - } - protected final boolean _getBooleanField(int offset) { int bitOffset = offset; int position = this.data + (bitOffset / 8); @@ -179,30 +180,30 @@ protected final boolean _pointerFieldIsNull(int ptrIndex) { protected final void _clearPointerField(int ptrIndex) { int pointer = this.pointers + ptrIndex; - WireHelpers.zeroObject(this.segment, pointer); + WireHelpers.zeroObject(this.segment, this.capTable, pointer); this.segment.buffer.putLong(pointer * 8, 0L); } protected final T _getPointerField(FromPointerBuilder factory, int index) { - return factory.fromPointerBuilder(this.segment, this.pointers + index); + return factory.fromPointerBuilder(this.segment, this.capTable, this.pointers + index); } protected final T _getPointerField(FromPointerBuilderRefDefault factory, int index, SegmentReader defaultSegment, int defaultOffset) { - return factory.fromPointerBuilderRefDefault(this.segment, this.pointers + index, defaultSegment, defaultOffset); + return factory.fromPointerBuilderRefDefault(this.segment, this.capTable, this.pointers + index, defaultSegment, defaultOffset); } protected final T _getPointerField(FromPointerBuilderBlobDefault factory, int index, java.nio.ByteBuffer defaultBuffer, int defaultOffset, int defaultSize) { - return factory.fromPointerBuilderBlobDefault(this.segment, this.pointers + index, defaultBuffer, defaultOffset, defaultSize); + return factory.fromPointerBuilderBlobDefault(this.segment, this.capTable, this.pointers + index, defaultBuffer, defaultOffset, defaultSize); } protected final T _initPointerField(FromPointerBuilder factory, int index, int elementCount) { - return factory.initFromPointerBuilder(this.segment, this.pointers + index, elementCount); + return factory.initFromPointerBuilder(this.segment, this.capTable, this.pointers + index, elementCount); } protected final void _setPointerField(SetPointerBuilder factory, int index, Reader value) { - factory.setPointerBuilder(this.segment, this.pointers + index, value); + factory.setPointerBuilder(this.segment, this.capTable, this.pointers + index, value); } protected final void _copyContentFrom(StructReader other) { @@ -251,14 +252,16 @@ protected final void _copyContentFrom(StructReader other) { // Zero out all pointers in the target. for (int ii = 0; ii < this.pointerCount; ++ii) { - WireHelpers.zeroObject(this.segment, this.pointers + ii); + WireHelpers.zeroObject(this.segment, this.capTable, this.pointers + ii); } this.segment.buffer.putLong(this.pointers * Constants.BYTES_PER_WORD, 0); for (int ii = 0; ii < sharedPointerCount; ++ii) { WireHelpers.copyPointer(this.segment, + this.capTable, this.pointers + ii, other.segment, + other.capTable, other.pointers + ii, other.nestingLimit); } diff --git a/runtime/src/main/java/org/capnproto/StructFactory.java b/runtime/src/main/java/org/capnproto/StructFactory.java index f10c4888..615cae70 100644 --- a/runtime/src/main/java/org/capnproto/StructFactory.java +++ b/runtime/src/main/java/org/capnproto/StructFactory.java @@ -28,44 +28,35 @@ public abstract class StructFactory, FromPointerReaderRefDefault, StructReader.Factory { - public final Reader fromPointerReaderRefDefault(SegmentReader segment, int pointer, + public final Reader fromPointerReaderRefDefault(SegmentReader segment, CapTableReader capTable, int pointer, SegmentReader defaultSegment, int defaultOffset, int nestingLimit) { return WireHelpers.readStructPointer(this, segment, + capTable, pointer, defaultSegment, defaultOffset, nestingLimit); } - public final Reader fromPointerReader(SegmentReader segment, int pointer, int nestingLimit) { - return fromPointerReaderRefDefault(segment, pointer, null, 0, nestingLimit); - } public final Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { - var result = fromPointerReaderRefDefault(segment, pointer, null, 0, nestingLimit); - result.capTable = capTable; - return result; + return fromPointerReaderRefDefault(segment, capTable, pointer, null, 0, nestingLimit); } - public final Builder fromPointerBuilderRefDefault(SegmentBuilder segment, int pointer, + public final Builder fromPointerBuilderRefDefault(SegmentBuilder segment, CapTableBuilder capTable, int pointer, SegmentReader defaultSegment, int defaultOffset) { - return WireHelpers.getWritableStructPointer(this, pointer, segment, this.structSize(), + return WireHelpers.getWritableStructPointer(this, pointer, segment, capTable, this.structSize(), defaultSegment, defaultOffset); } - public final Builder fromPointerBuilder(SegmentBuilder segment, int pointer) { - return WireHelpers.getWritableStructPointer(this, pointer, segment, this.structSize(), - null, 0); - } public final Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { - var result = fromPointerBuilder(segment, pointer); - result.capTable = capTable; - return result; + return WireHelpers.getWritableStructPointer(this, pointer, segment, capTable, this.structSize(), + null, 0); } - public final Builder initFromPointerBuilder(SegmentBuilder segment, int pointer, int elementCount) { - return WireHelpers.initStructPointer(this, pointer, segment, this.structSize()); + public final Builder initFromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, int elementCount) { + return WireHelpers.initStructPointer(this, pointer, segment, capTable, this.structSize()); } - public final void setPointerBuilder(SegmentBuilder segment, int pointer, Reader value) { - WireHelpers.setStructPointer(segment, pointer, value); + public final void setPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, Reader value) { + WireHelpers.setStructPointer(segment, capTable, pointer, value); } public abstract Reader asReader(Builder builder); diff --git a/runtime/src/main/java/org/capnproto/StructList.java b/runtime/src/main/java/org/capnproto/StructList.java index b97ad924..df803879 100644 --- a/runtime/src/main/java/org/capnproto/StructList.java +++ b/runtime/src/main/java/org/capnproto/StructList.java @@ -56,9 +56,10 @@ public final Builder constructBuilder(SegmentBuilder segment, } @Override - public final Builder fromPointerBuilderRefDefault(SegmentBuilder segment, int pointer, + public final Builder fromPointerBuilderRefDefault(SegmentBuilder segment, CapTableBuilder capTable, int pointer, SegmentReader defaultSegment, int defaultOffset) { return WireHelpers.getWritableStructListPointer(this, + capTable, pointer, segment, factory.structSize(), @@ -67,8 +68,9 @@ public final Builder fromPointerBuilderRefDefault(SegmentBuilder } @Override - public final Builder fromPointerBuilder(SegmentBuilder segment, int pointer) { + public final Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { return WireHelpers.getWritableStructListPointer(this, + capTable, pointer, segment, factory.structSize(), @@ -76,9 +78,9 @@ public final Builder fromPointerBuilder(SegmentBuilder segment, } @Override - public final Builder initFromPointerBuilder(SegmentBuilder segment, int pointer, + public final Builder initFromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, int elementCount) { - return WireHelpers.initStructListPointer(this, pointer, segment, elementCount, factory.structSize()); + return WireHelpers.initStructListPointer(this, capTable, pointer, segment, elementCount, factory.structSize()); } } diff --git a/runtime/src/main/java/org/capnproto/StructReader.java b/runtime/src/main/java/org/capnproto/StructReader.java index aa676d58..9f1b5573 100644 --- a/runtime/src/main/java/org/capnproto/StructReader.java +++ b/runtime/src/main/java/org/capnproto/StructReader.java @@ -21,11 +21,20 @@ package org.capnproto; -public class StructReader { +public class StructReader extends Capability.ReaderContext { public interface Factory { - abstract T constructReader(SegmentReader segment, int data, int pointers, + T constructReader(SegmentReader segment, int data, int pointers, int dataSize, short pointerCount, int nestingLimit); + default T constructReader(SegmentReader segment, CapTableReader capTable, int data, int pointers, + int dataSize, short pointerCount, + int nestingLimit) { + var result = constructReader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + if (result instanceof Capability.ReaderContext) { + ((Capability.ReaderContext) result).capTable = capTable; + } + return result; + } } protected final SegmentReader segment; @@ -34,7 +43,6 @@ abstract T constructReader(SegmentReader segment, int data, int pointers, protected final int dataSize; // in bits protected final short pointerCount; protected final int nestingLimit; - protected CapTableReader capTable; public StructReader() { this.segment = SegmentReader.EMPTY; @@ -169,6 +177,7 @@ protected final T _getPointerField(FromPointerReader factory, int ptrInde this.nestingLimit); } else { return factory.fromPointerReader(SegmentReader.EMPTY, + this.capTable, 0, this.nestingLimit); } @@ -179,12 +188,14 @@ protected final T _getPointerField(FromPointerReaderRefDefault factory, i SegmentReader defaultSegment, int defaultOffset) { if (ptrIndex < this.pointerCount) { return factory.fromPointerReaderRefDefault(this.segment, + this.capTable, this.pointers + ptrIndex, defaultSegment, defaultOffset, this.nestingLimit); } else { return factory.fromPointerReaderRefDefault(SegmentReader.EMPTY, + this.capTable, 0, defaultSegment, defaultOffset, diff --git a/runtime/src/main/java/org/capnproto/Text.java b/runtime/src/main/java/org/capnproto/Text.java index cc129ccc..50d15f4f 100644 --- a/runtime/src/main/java/org/capnproto/Text.java +++ b/runtime/src/main/java/org/capnproto/Text.java @@ -36,46 +36,38 @@ public final Reader fromPointerReaderBlobDefault(SegmentReader segment, int poin return WireHelpers.readTextPointer(segment, pointer, defaultBuffer, defaultOffset, defaultSize); } - @Override - public final Reader fromPointerReader(SegmentReader segment, int pointer, int nestingLimit) { - return WireHelpers.readTextPointer(segment, pointer, null, 0, 0); - } - @Override public final Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { - return fromPointerReader(segment, pointer, nestingLimit); + return WireHelpers.readTextPointer(segment, pointer, null, 0, 0); } @Override - public final Builder fromPointerBuilderBlobDefault(SegmentBuilder segment, int pointer, - java.nio.ByteBuffer defaultBuffer, int defaultOffset, int defaultSize) { + public final Builder fromPointerBuilderBlobDefault(SegmentBuilder segment, CapTableBuilder capTable, int pointer, + java.nio.ByteBuffer defaultBuffer, int defaultOffset, int defaultSize) { return WireHelpers.getWritableTextPointer(pointer, segment, + capTable, defaultBuffer, defaultOffset, defaultSize); } @Override - public final Builder fromPointerBuilder(SegmentBuilder segment, int pointer) { + public final Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { return WireHelpers.getWritableTextPointer(pointer, segment, + capTable, null, 0, 0); } @Override - public Builder fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { - return fromPointerBuilder(segment, pointer); - } - - @Override - public final Builder initFromPointerBuilder(SegmentBuilder segment, int pointer, int size) { - return WireHelpers.initTextPointer(pointer, segment, size); + public Builder initFromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, int size) { + return WireHelpers.initTextPointer(pointer, segment, capTable, size); } @Override - public final void setPointerBuilder(SegmentBuilder segment, int pointer, Reader value) { - WireHelpers.setTextPointer(pointer, segment, value); + public void setPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, Reader value) { + WireHelpers.setTextPointer(pointer, segment, capTable, value); } } public static final Factory factory = new Factory(); diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 72a1e1e3..f96ca2c7 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -49,12 +49,13 @@ static class AllocateResult { static AllocateResult allocate(int refOffset, SegmentBuilder segment, + CapTableBuilder capTable, int amount, // in words byte kind) { long ref = segment.get(refOffset); if (!WirePointer.isNull(ref)) { - zeroObject(segment, refOffset); + zeroObject(segment, capTable, refOffset); } if (amount == 0 && kind == WirePointer.STRUCT) { @@ -174,7 +175,7 @@ static FollowFarsResult followFars(long ref, int refTarget, SegmentReader segmen } } - static void zeroObject(SegmentBuilder segment, int refOffset) { + static void zeroObject(SegmentBuilder segment, CapTableBuilder capTable, int refOffset) { //# Zero out the pointed-to object. Use when the pointer is //# about to be overwritten making the target object no longer //# reachable. @@ -187,7 +188,7 @@ static void zeroObject(SegmentBuilder segment, int refOffset) { switch (WirePointer.kind(ref)) { case WirePointer.STRUCT: case WirePointer.LIST: - zeroObject(segment, ref, WirePointer.target(refOffset, ref)); + zeroObject(segment, capTable, ref, WirePointer.target(refOffset, ref)); break; case WirePointer.FAR: { segment = segment.getArena().getSegment(FarPointer.getSegmentId(ref)); @@ -197,13 +198,13 @@ static void zeroObject(SegmentBuilder segment, int refOffset) { if (FarPointer.isDoubleFar(ref)) { SegmentBuilder otherSegment = segment.getArena().getSegment(FarPointer.getSegmentId(ref)); if (otherSegment.isWritable()) { - zeroObject(otherSegment, padOffset + 1, FarPointer.positionInSegment(pad)); + zeroObject(otherSegment, capTable, padOffset + 1, FarPointer.positionInSegment(pad)); } segment.buffer.putLong(padOffset * 8, 0L); segment.buffer.putLong((padOffset + 1) * 8, 0L); } else { - zeroObject(segment, padOffset); + zeroObject(segment, capTable, padOffset); segment.buffer.putLong(padOffset * 8, 0L); } } @@ -211,12 +212,20 @@ static void zeroObject(SegmentBuilder segment, int refOffset) { break; } case WirePointer.OTHER: { - // TODO + assert WirePointer.isCapability(ref) : "Unknown pointer type"; + if (WirePointer.isCapability(ref)) { + var capIndex = WirePointer.upper32Bits(ref); + assert capTable != null: "Cannot zero out capability pointer with no capTable"; + if (capTable != null) { + capTable.dropCap(capIndex); + } + } + break; } } } - static void zeroObject(SegmentBuilder segment, long tag, int ptr) { + static void zeroObject(SegmentBuilder segment, CapTableBuilder capTable, long tag, int ptr) { //# We shouldn't zero out external data linked into the message. if (!segment.isWritable()) return; @@ -225,7 +234,7 @@ static void zeroObject(SegmentBuilder segment, long tag, int ptr) { int pointerSection = ptr + StructPointer.dataSize(tag); int count = StructPointer.ptrCount(tag); for (int ii = 0; ii < count; ++ii) { - zeroObject(segment, pointerSection + ii); + zeroObject(segment, capTable, pointerSection + ii); } memset(segment.buffer, ptr * Constants.BYTES_PER_WORD, (byte)0, StructPointer.wordSize(tag) * Constants.BYTES_PER_WORD); @@ -248,7 +257,7 @@ static void zeroObject(SegmentBuilder segment, long tag, int ptr) { case ElementSize.POINTER: { int count = ListPointer.elementCount(tag); for (int ii = 0; ii < count; ++ii) { - zeroObject(segment, ptr + ii); + zeroObject(segment, capTable, ptr + ii); } memset(segment.buffer, ptr * Constants.BYTES_PER_WORD, (byte)0, count * Constants.BYTES_PER_WORD); @@ -267,7 +276,7 @@ static void zeroObject(SegmentBuilder segment, long tag, int ptr) { for (int ii = 0; ii < count; ++ii) { pos += dataSize; for (int jj = 0; jj < pointerCount; ++jj) { - zeroObject(segment, pos); + zeroObject(segment, capTable, pos); pos += Constants.POINTER_SIZE_IN_WORDS; } } @@ -392,9 +401,17 @@ static T initStructPointer(StructBuilder.Factory factory, int refOffset, SegmentBuilder segment, StructSize size) { - AllocateResult allocation = allocate(refOffset, segment, size.total(), WirePointer.STRUCT); + return initStructPointer(factory, refOffset, segment, null, size); + } + + static T initStructPointer(StructBuilder.Factory factory, + int refOffset, + SegmentBuilder segment, + CapTableBuilder capTable, + StructSize size) { + AllocateResult allocation = allocate(refOffset, segment, capTable, size.total(), WirePointer.STRUCT); StructPointer.setFromStructSize(allocation.segment.buffer, allocation.refOffset, size); - return factory.constructBuilder(allocation.segment, allocation.ptr * Constants.BYTES_PER_WORD, + return factory.constructBuilder(allocation.segment, capTable, allocation.ptr * Constants.BYTES_PER_WORD, allocation.ptr + size.data, size.data * 64, size.pointers); } @@ -402,6 +419,7 @@ static T initStructPointer(StructBuilder.Factory factory, static T getWritableStructPointer(StructBuilder.Factory factory, int refOffset, SegmentBuilder segment, + CapTableBuilder capTable, StructSize size, SegmentReader defaultSegment, int defaultOffset) { @@ -409,7 +427,7 @@ static T getWritableStructPointer(StructBuilder.Factory factory, int target = WirePointer.target(refOffset, ref); if (WirePointer.isNull(ref)) { if (defaultSegment == null) { - return initStructPointer(factory, refOffset, segment, size); + return initStructPointer(factory, refOffset, segment, capTable, size); } else { throw new RuntimeException("unimplemented"); } @@ -432,7 +450,7 @@ static T getWritableStructPointer(StructBuilder.Factory factory, //# Don't let allocate() zero out the object just yet. zeroPointerAndFars(segment, refOffset); - AllocateResult allocation = allocate(refOffset, segment, + AllocateResult allocation = allocate(refOffset, segment, capTable, totalSize, WirePointer.STRUCT); StructPointer.set(allocation.segment.buffer, allocation.refOffset, @@ -458,11 +476,11 @@ static T getWritableStructPointer(StructBuilder.Factory factory, memset(resolved.segment.buffer, resolved.ptr * Constants.BYTES_PER_WORD, (byte)0, (oldDataSize + oldPointerCount * Constants.WORDS_PER_POINTER) * Constants.BYTES_PER_WORD); - return factory.constructBuilder(allocation.segment, allocation.ptr * Constants.BYTES_PER_WORD, + return factory.constructBuilder(allocation.segment, capTable, allocation.ptr * Constants.BYTES_PER_WORD, newPointerSection, newDataSize * Constants.BITS_PER_WORD, newPointerCount); } else { - return factory.constructBuilder(resolved.segment, resolved.ptr * Constants.BYTES_PER_WORD, + return factory.constructBuilder(resolved.segment, capTable, resolved.ptr * Constants.BYTES_PER_WORD, oldPointerSection, oldDataSize * Constants.BITS_PER_WORD, oldPointerCount); } @@ -470,6 +488,7 @@ static T getWritableStructPointer(StructBuilder.Factory factory, } static T initListPointer(ListBuilder.Factory factory, + CapTableBuilder capTable, int refOffset, SegmentBuilder segment, int elementCount, @@ -480,7 +499,7 @@ static T initListPointer(ListBuilder.Factory factory, int pointerCount = ElementSize.pointersPerElement(elementSize); int step = dataSize + pointerCount * Constants.BITS_PER_POINTER; int wordCount = roundBitsUpToWords((long)elementCount * (long)step); - AllocateResult allocation = allocate(refOffset, segment, wordCount, WirePointer.LIST); + AllocateResult allocation = allocate(refOffset, segment, capTable, wordCount, WirePointer.LIST); ListPointer.set(allocation.segment.buffer, allocation.refOffset, elementSize, elementCount); @@ -490,6 +509,7 @@ static T initListPointer(ListBuilder.Factory factory, } static T initStructListPointer(ListBuilder.Factory factory, + CapTableBuilder capTable, int refOffset, SegmentBuilder segment, int elementCount, @@ -498,7 +518,7 @@ static T initStructListPointer(ListBuilder.Factory factory, //# Allocate the list, prefixed by a single WirePointer. int wordCount = elementCount * wordsPerElement; - AllocateResult allocation = allocate(refOffset, segment, Constants.POINTER_SIZE_IN_WORDS + wordCount, + AllocateResult allocation = allocate(refOffset, segment, capTable, Constants.POINTER_SIZE_IN_WORDS + wordCount, WirePointer.LIST); //# Initialize the pointer. @@ -516,6 +536,7 @@ static T initStructListPointer(ListBuilder.Factory factory, static T getWritableListPointer(ListBuilder.Factory factory, int origRefOffset, SegmentBuilder origSegment, + CapTableBuilder capTable, byte elementSize, SegmentReader defaultSegment, int defaultOffset) { @@ -572,6 +593,7 @@ static T getWritableListPointer(ListBuilder.Factory factory, } static T getWritableStructListPointer(ListBuilder.Factory factory, + CapTableBuilder capTable, int origRefOffset, SegmentBuilder origSegment, StructSize elementSize, @@ -624,7 +646,7 @@ static T getWritableStructListPointer(ListBuilder.Factory factory, //# Don't let allocate() zero out the object just yet. zeroPointerAndFars(origSegment, origRefOffset); - AllocateResult allocation = allocate(origRefOffset, origSegment, + AllocateResult allocation = allocate(origRefOffset, origSegment, capTable, totalSize + Constants.POINTER_SIZE_IN_WORDS, WirePointer.LIST); @@ -678,7 +700,7 @@ static T getWritableStructListPointer(ListBuilder.Factory factory, if (oldSize == ElementSize.VOID) { //# Nothing to copy, just allocate a new list. - return initStructListPointer(factory, origRefOffset, origSegment, + return initStructListPointer(factory, capTable, origRefOffset, origSegment, elementCount, elementSize); } else { //# Upgrading to an inline composite list. @@ -704,7 +726,7 @@ static T getWritableStructListPointer(ListBuilder.Factory factory, //# Don't let allocate() zero out the object just yet. zeroPointerAndFars(origSegment, origRefOffset); - AllocateResult allocation = allocate(origRefOffset, origSegment, + AllocateResult allocation = allocate(origRefOffset, origSegment, capTable, totalWords + Constants.POINTER_SIZE_IN_WORDS, WirePointer.LIST); @@ -754,12 +776,13 @@ static T getWritableStructListPointer(ListBuilder.Factory factory, // size is in bytes static Text.Builder initTextPointer(int refOffset, SegmentBuilder segment, + CapTableBuilder capTable, int size) { //# The byte list must include a NUL terminator. int byteSize = size + 1; //# Allocate the space. - AllocateResult allocation = allocate(refOffset, segment, roundBytesUpToWords(byteSize), + AllocateResult allocation = allocate(refOffset, segment, capTable, roundBytesUpToWords(byteSize), WirePointer.LIST); //# Initialize the pointer. @@ -770,8 +793,9 @@ static Text.Builder initTextPointer(int refOffset, static Text.Builder setTextPointer(int refOffset, SegmentBuilder segment, + CapTableBuilder capTable, Text.Reader value) { - Text.Builder builder = initTextPointer(refOffset, segment, value.size); + Text.Builder builder = initTextPointer(refOffset, segment, capTable, value.size); ByteBuffer slice = value.buffer.duplicate(); slice.position(value.offset); @@ -783,6 +807,7 @@ static Text.Builder setTextPointer(int refOffset, static Text.Builder getWritableTextPointer(int refOffset, SegmentBuilder segment, + CapTableBuilder capTable, ByteBuffer defaultBuffer, int defaultOffset, int defaultSize) { @@ -792,7 +817,7 @@ static Text.Builder getWritableTextPointer(int refOffset, if (defaultBuffer == null) { return new Text.Builder(); } else { - Text.Builder builder = initTextPointer(refOffset, segment, defaultSize); + Text.Builder builder = initTextPointer(refOffset, segment, capTable, defaultSize); // TODO is there a way to do this with bulk methods? for (int i = 0; i < builder.size; ++i) { builder.buffer.put(builder.offset + i, defaultBuffer.get(defaultOffset * 8 + i)); @@ -826,9 +851,10 @@ static Text.Builder getWritableTextPointer(int refOffset, // size is in bytes static Data.Builder initDataPointer(int refOffset, SegmentBuilder segment, + CapTableBuilder capTable, int size) { //# Allocate the space. - AllocateResult allocation = allocate(refOffset, segment, roundBytesUpToWords(size), + AllocateResult allocation = allocate(refOffset, segment, capTable, roundBytesUpToWords(size), WirePointer.LIST); //# Initialize the pointer. @@ -839,8 +865,9 @@ static Data.Builder initDataPointer(int refOffset, static Data.Builder setDataPointer(int refOffset, SegmentBuilder segment, + CapTableBuilder capTable, Data.Reader value) { - Data.Builder builder = initDataPointer(refOffset, segment, value.size); + Data.Builder builder = initDataPointer(refOffset, segment, capTable, value.size); // TODO is there a way to do this with bulk methods? for (int i = 0; i < builder.size; ++i) { @@ -851,6 +878,7 @@ static Data.Builder setDataPointer(int refOffset, static Data.Builder getWritableDataPointer(int refOffset, SegmentBuilder segment, + CapTableBuilder capTable, ByteBuffer defaultBuffer, int defaultOffset, int defaultSize) { @@ -860,7 +888,7 @@ static Data.Builder getWritableDataPointer(int refOffset, if (defaultBuffer == null) { return new Data.Builder(); } else { - Data.Builder builder = initDataPointer(refOffset, segment, defaultSize); + Data.Builder builder = initDataPointer(refOffset, segment, capTable, defaultSize); // TODO is there a way to do this with bulk methods? for (int i = 0; i < builder.size; ++i) { builder.buffer.put(builder.offset + i, defaultBuffer.get(defaultOffset * 8 + i)); @@ -887,6 +915,7 @@ static Data.Builder getWritableDataPointer(int refOffset, static T readStructPointer(StructReader.Factory factory, SegmentReader segment, + CapTableReader capTable, int refOffset, SegmentReader defaultSegment, int defaultOffset, @@ -918,6 +947,7 @@ static T readStructPointer(StructReader.Factory factory, resolved.segment.arena.checkReadLimit(StructPointer.wordSize(resolved.ref)); return factory.constructReader(resolved.segment, + capTable, resolved.ptr * Constants.BYTES_PER_WORD, (resolved.ptr + dataSizeWords), dataSizeWords * Constants.BITS_PER_WORD, @@ -926,11 +956,11 @@ static T readStructPointer(StructReader.Factory factory, } - static SegmentBuilder setStructPointer(SegmentBuilder segment, int refOffset, StructReader value) { + static SegmentBuilder setStructPointer(SegmentBuilder segment, CapTableBuilder capTable, int refOffset, StructReader value) { short dataSize = (short)roundBitsUpToWords(value.dataSize); int totalSize = dataSize + value.pointerCount * Constants.POINTER_SIZE_IN_WORDS; - AllocateResult allocation = allocate(refOffset, segment, totalSize, WirePointer.STRUCT); + AllocateResult allocation = allocate(refOffset, segment, capTable, totalSize, WirePointer.STRUCT); StructPointer.set(allocation.segment.buffer, allocation.refOffset, dataSize, value.pointerCount); @@ -943,25 +973,25 @@ static SegmentBuilder setStructPointer(SegmentBuilder segment, int refOffset, St int pointerSection = allocation.ptr + dataSize; for (int i = 0; i < value.pointerCount; ++i) { - copyPointer(allocation.segment, pointerSection + i, value.segment, value.pointers + i, + copyPointer(allocation.segment, capTable, pointerSection + i, value.segment, value.capTable, value.pointers + i, value.nestingLimit); } return allocation.segment; }; - static SegmentBuilder setListPointer(SegmentBuilder segment, int refOffset, ListReader value) { + static SegmentBuilder setListPointer(SegmentBuilder segment, CapTableBuilder capTable, int refOffset, ListReader value) { int totalSize = roundBitsUpToWords(value.elementCount * value.step); if (value.step <= Constants.BITS_PER_WORD) { //# List of non-structs. - AllocateResult allocation = allocate(refOffset, segment, totalSize, WirePointer.LIST); + AllocateResult allocation = allocate(refOffset, segment, capTable, totalSize, WirePointer.LIST); if (value.structPointerCount == 1) { //# List of pointers. ListPointer.set(allocation.segment.buffer, allocation.refOffset, ElementSize.POINTER, value.elementCount); for (int i = 0; i < value.elementCount; ++i) { - copyPointer(allocation.segment, allocation.ptr + i, - value.segment, value.ptr / Constants.BYTES_PER_WORD + i, value.nestingLimit); + copyPointer(allocation.segment, capTable,allocation.ptr + i, + value.segment, value.capTable, value.ptr / Constants.BYTES_PER_WORD + i, value.nestingLimit); } } else { //# List of data. @@ -984,7 +1014,7 @@ static SegmentBuilder setListPointer(SegmentBuilder segment, int refOffset, List return allocation.segment; } else { //# List of structs. - AllocateResult allocation = allocate(refOffset, segment, totalSize + Constants.POINTER_SIZE_IN_WORDS, WirePointer.LIST); + AllocateResult allocation = allocate(refOffset, segment, capTable, totalSize + Constants.POINTER_SIZE_IN_WORDS, WirePointer.LIST); ListPointer.setInlineComposite(allocation.segment.buffer, allocation.refOffset, totalSize); short dataSize = (short)roundBitsUpToWords(value.structDataSize); short pointerCount = value.structPointerCount; @@ -1005,7 +1035,7 @@ static SegmentBuilder setListPointer(SegmentBuilder segment, int refOffset, List srcOffset += dataSize; for (int j = 0; j < pointerCount; ++j) { - copyPointer(allocation.segment, dstOffset, value.segment, srcOffset, value.nestingLimit); + copyPointer(allocation.segment, capTable, dstOffset, value.segment, value.capTable, srcOffset, value.nestingLimit); dstOffset += Constants.POINTER_SIZE_IN_WORDS; srcOffset += Constants.POINTER_SIZE_IN_WORDS; } @@ -1031,8 +1061,8 @@ static void memcpy(ByteBuffer dstBuffer, int dstByteOffset, ByteBuffer srcBuffer dstDup.put(srcDup); } - static SegmentBuilder copyPointer(SegmentBuilder dstSegment, int dstOffset, - SegmentReader srcSegment, int srcOffset, int nestingLimit) { + static SegmentBuilder copyPointer(SegmentBuilder dstSegment, CapTableBuilder dstCapTable, int dstOffset, + SegmentReader srcSegment, CapTableReader srcCapTable, int srcOffset, int nestingLimit) { // Deep-copy the object pointed to by src into dst. It turns out we can't reuse // readStructPointer(), etc. because they do type checking whereas here we want to accept any // valid pointer. @@ -1053,7 +1083,7 @@ static SegmentBuilder copyPointer(SegmentBuilder dstSegment, int dstOffset, throw new DecodeException("Message is too deeply nested or contains cycles. See org.capnproto.ReaderOptions."); } resolved.segment.arena.checkReadLimit(StructPointer.wordSize(resolved.ref)); - return setStructPointer(dstSegment, dstOffset, + return setStructPointer(dstSegment, dstCapTable, dstOffset, new StructReader(resolved.segment, resolved.ptr * Constants.BYTES_PER_WORD, resolved.ptr + StructPointer.dataSize(resolved.ref), @@ -1088,7 +1118,7 @@ static SegmentBuilder copyPointer(SegmentBuilder dstSegment, int dstOffset, resolved.segment.arena.checkReadLimit(elementCount); } - return setListPointer(dstSegment, dstOffset, + return setListPointer(dstSegment, dstCapTable, dstOffset, new ListReader(resolved.segment, ptr * Constants.BYTES_PER_WORD, elementCount, @@ -1111,7 +1141,7 @@ static SegmentBuilder copyPointer(SegmentBuilder dstSegment, int dstOffset, resolved.segment.arena.checkReadLimit(elementCount); } - return setListPointer(dstSegment, dstOffset, + return setListPointer(dstSegment, dstCapTable, dstOffset, new ListReader(resolved.segment, resolved.ptr * Constants.BYTES_PER_WORD, elementCount, @@ -1132,6 +1162,7 @@ static SegmentBuilder copyPointer(SegmentBuilder dstSegment, int dstOffset, static T readListPointer(ListReader.Factory factory, SegmentReader segment, int refOffset, + CapTableReader capTable, SegmentReader defaultSegment, int defaultOffset, byte expectedElementSize, @@ -1316,16 +1347,19 @@ static void setCapabilityPointer(SegmentBuilder segment, CapTableBuilder capTabl long ref = segment.get(refOffset); if (!WirePointer.isNull(ref)) { - zeroObject(segment, refOffset); + zeroObject(segment, capTable, refOffset); } if (cap == null) { // TODO check zeroMemory behaviour zeroPointerAndFars(segment, refOffset); } - else { + else if (capTable != null) { WirePointer.setCap(segment.buffer, refOffset, capTable.injectCap(cap)); } + else { + assert false: "Cannot set capability pointer without capTable"; + } } static ClientHook readCapabilityPointer(SegmentReader segment, CapTableReader capTable, int refOffset, int maxValue) { @@ -1339,6 +1373,10 @@ static ClientHook readCapabilityPointer(SegmentReader segment, CapTableReader ca return Capability.newBrokenCap("Calling capability extracted from a non-capability pointer."); } + if (capTable == null) { + return Capability.newBrokenCap("Cannot read capability pointer without capTable."); + } + var cap = capTable.extractCap(WirePointer.upper32Bits(ref)); if (cap == null) { return Capability.newBrokenCap("Calling invalid capability pointer."); diff --git a/runtime/src/test/java/org/capnproto/LayoutTest.java b/runtime/src/test/java/org/capnproto/LayoutTest.java index 4ed6042c..d023abb2 100644 --- a/runtime/src/test/java/org/capnproto/LayoutTest.java +++ b/runtime/src/test/java/org/capnproto/LayoutTest.java @@ -25,7 +25,7 @@ public void testSimpleRawDataStruct() { ReaderArena arena = new ReaderArena(new ByteBuffer[]{ buffer }, 0x7fffffffffffffffL); - StructReader reader = WireHelpers.readStructPointer(new BareStructReader(), arena.tryGetSegment(0), 0, null, 0, 0x7fffffff); + StructReader reader = WireHelpers.readStructPointer(new BareStructReader(), arena.tryGetSegment(0), null,0, null, 0, 0x7fffffff); Assert.assertEquals(reader._getLongField(0), 0xefcdab8967452301L); Assert.assertEquals(reader._getLongField(1), 0L); diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index 2b00a390..6178dd96 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -22,7 +22,7 @@ static final class Client extends org.capnproto.Capability.Client { public Client(ClientHook hook) { super(hook); } - public Client(Capability.Client cap) { super(cap.getHook()); } + public Client(Capability.Client cap) { super(cap.hook); } public Client(Capability.Server server) { super(server); } @@ -85,7 +85,7 @@ static final class Client extends org.capnproto.Capability.Client { public Client(ClientHook hook) { super(hook); } - public Client(Capability.Client cap) { super(cap.getHook()); } + public Client(Capability.Client cap) { super(cap.hook); } public Client(Capability.Server server) { super(server); } } @@ -111,7 +111,8 @@ private DispatchCallResult dispatchCallInternal(short methodId, CallContext testMethod0(TestCap0.Server.TestMethod0Context ctx) { var params = ctx.getParams(); @@ -124,7 +125,11 @@ public CompletableFuture testMethod1(TestCap0.Server.TestMethod1Context ctx) var params = ctx.getParams(); var results = ctx.getResults(); var res0 = results.getResult0(); - res0.setAsCapability(testCap1); + res0.setAsCapability(testCap1a); + var res1 = results.getResult1(); + res1.setAsCapability(testCap1b); + var res2 = results.getResult2(); + res2.setAsCapability(testCap1b); return CompletableFuture.completedFuture(null); } } @@ -195,12 +200,19 @@ public void testReturnCap() throws ExecutionException, InterruptedException { var params = request.params(); var resultsPromise = request.send(); while (!resultsPromise.isDone()) { - CompletableFuture.anyOf(resultsPromise, server.runOnce()).join(); + CompletableFuture.anyOf(resultsPromise, server.runOnce(), client.runOnce()).join(); } Assert.assertTrue(resultsPromise.isDone()); var results = resultsPromise.get(); - var any = results.getResult0(); - var cap1 = any.getAsCapability(); + var cap0 = results.getResult0().getAsCapability(); + Assert.assertFalse(cap0.hook.isNull()); + Assert.assertFalse(cap0.hook.isError()); + var cap1 = results.getResult1().getAsCapability(); + Assert.assertFalse(cap1.hook.isNull()); + Assert.assertFalse(cap1.hook.isError()); + var cap2 = results.getResult2().getAsCapability(); + Assert.assertFalse(cap2.hook.isNull()); + Assert.assertFalse(cap2.hook.isError()); } @Test diff --git a/runtime/src/test/java/org/capnproto/demo/Demo.java b/runtime/src/test/java/org/capnproto/demo/Demo.java index 2b531ddc..2ae5ba25 100644 --- a/runtime/src/test/java/org/capnproto/demo/Demo.java +++ b/runtime/src/test/java/org/capnproto/demo/Demo.java @@ -166,7 +166,7 @@ public org.capnproto.AnyPointer.Reader getParam0() { public static class TestResults1 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)3); public static final class Factory extends org.capnproto.StructFactory { public Factory() { } @@ -206,6 +206,32 @@ public org.capnproto.AnyPointer.Builder initResult0(int size) { return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); } + public final boolean hasResult1() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.AnyPointer.Builder getResult1() { + return _getPointerField(org.capnproto.AnyPointer.factory, 1); + } + public org.capnproto.AnyPointer.Builder initResult1() { + return _initPointerField(org.capnproto.AnyPointer.factory, 1, 0); + } + public org.capnproto.AnyPointer.Builder initResult1(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 1, size); + } + + public final boolean hasResult2() { + return !_pointerFieldIsNull(2); + } + public org.capnproto.AnyPointer.Builder getResult2() { + return _getPointerField(org.capnproto.AnyPointer.factory, 2); + } + public org.capnproto.AnyPointer.Builder initResult2() { + return _initPointerField(org.capnproto.AnyPointer.factory, 2, 0); + } + public org.capnproto.AnyPointer.Builder initResult2(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 2, size); + } + } public static final class Reader extends org.capnproto.StructReader { @@ -219,6 +245,18 @@ public boolean hasResult0() { public org.capnproto.AnyPointer.Reader getResult0() { return _getPointerField(org.capnproto.AnyPointer.factory, 0); } + public boolean hasResult1() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.AnyPointer.Reader getResult1() { + return _getPointerField(org.capnproto.AnyPointer.factory, 1); + } + public boolean hasResult2() { + return !_pointerFieldIsNull(2); + } + public org.capnproto.AnyPointer.Reader getResult2() { + return _getPointerField(org.capnproto.AnyPointer.factory, 2); + } } } @@ -230,20 +268,25 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0012\u00f0\u0080\u00d1\u00ac\u00b4\u0001\u00b3" + - "\u0011\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u003a\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0032\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0065\u006d\u006f\u0070\u0061\u0072\u0061" + - "\u006d\u0073\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0065\u0073\u0074\u0050\u0061\u0072" + - "\u0061\u006d\u0073\u0030\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u0070\u0061\u0072" + + "\u0061\u006d\u0073\u002e\u0063\u0061\u0070\u006e" + + "\u0070\u003a\u0054\u0065\u0073\u0074\u0050\u0061" + + "\u0072\u0061\u006d\u0073\u0030\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -265,20 +308,25 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0081\u0028\u00b5\u0021\u0054\u002e\u00a4\u0096" + - "\u0011\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u003a\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00f2\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u003a\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0065\u006d\u006f\u0070\u0061\u0072\u0061" + - "\u006d\u0073\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0065\u0073\u0074\u0052\u0065\u0073" + - "\u0075\u006c\u0074\u0073\u0030\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u0070\u0061\u0072" + + "\u0061\u006d\u0073\u002e\u0063\u0061\u0070\u006e" + + "\u0070\u003a\u0054\u0065\u0073\u0074\u0052\u0065" + + "\u0073\u0075\u006c\u0074\u0073\u0030\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -300,20 +348,25 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0057\u0009\"\u00b6\u00a8\u0063\u0003\u00e1" + - "\u0011\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u003a\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0032\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0065\u006d\u006f\u0070\u0061\u0072\u0061" + - "\u006d\u0073\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0065\u0073\u0074\u0050\u0061\u0072" + - "\u0061\u006d\u0073\u0031\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u0070\u0061\u0072" + + "\u0061\u006d\u0073\u002e\u0063\u0061\u0070\u006e" + + "\u0070\u003a\u0054\u0065\u0073\u0074\u0050\u0061" + + "\u0072\u0061\u006d\u0073\u0031\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -335,29 +388,48 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u003e\u00db\u005d\u00d4\u00e4\u002e\u0085\u0099" + - "\u0011\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u003a\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00f2\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u003a\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0065\u006d\u006f\u0070\u0061\u0072\u0061" + - "\u006d\u0073\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0065\u0073\u0074\u0052\u0065\u0073" + - "\u0075\u006c\u0074\u0073\u0031\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u0070\u0061\u0072" + + "\u0061\u006d\u0073\u002e\u0063\u0061\u0070\u006e" + + "\u0070\u003a\u0054\u0065\u0073\u0074\u0052\u0065" + + "\u0073\u0075\u006c\u0074\u0073\u0031\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -365,6 +437,22 @@ public static final class Schemas { "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0031\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0032\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); } } diff --git a/runtime/src/test/java/org/capnproto/demo/demoparams.capnp b/runtime/src/test/java/org/capnproto/demo/demoparams.capnp index 5c2cae42..560cad41 100644 --- a/runtime/src/test/java/org/capnproto/demo/demoparams.capnp +++ b/runtime/src/test/java/org/capnproto/demo/demoparams.capnp @@ -18,6 +18,8 @@ struct TestParams1 { struct TestResults1 { result0 @0 :AnyPointer; + result1 @1 :AnyPointer; + result2 @2 :AnyPointer; } From 6bd1411c26aab25978058a4644ac96c8f2feb43f Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 2 Oct 2020 22:23:46 +0100 Subject: [PATCH 033/246] handleDisembargo. NB future evaluation order needs work --- .../src/main/java/org/capnproto/RpcState.java | 61 ++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 1214bc21..e56fde54 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -486,8 +486,67 @@ else if (imp.importClient != null) { } void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { - } + var ctx = disembargo.getContext(); + switch (ctx.which()) { + case SENDER_LOOPBACK: + var target = getMessageTarget(disembargo.getTarget()); + if (target == null) { + // Exception already reported. + return; + } + for (; ; ) { + var resolved = target.getResolved(); + if (resolved == null) { + break; + } + target = resolved; + } + + assert target.getBrand() == RpcState.this : "'Disembargo' of type 'senderLoopback' sent to an object that does not point back to the sender."; + if (target.getBrand() != this) { + return; + } + var embargoId = ctx.getSenderLoopback(); + + // TODO run this later... + if (isDisconnected()) { + return; + } + + var rpcTarget = (RpcClient) target; + var message = connection.newOutgoingMessage(1024); + var builder = message.getBody().initAs(RpcProtocol.Message.factory).initDisembargo(); + var redirect = rpcTarget.writeTarget(builder.initTarget()); + // Disembargoes should only be sent to capabilities that were previously the subject of + // a `Resolve` message. But `writeTarget` only ever returns non-null when called on + // a PromiseClient. The code which sends `Resolve` and `Return` should have replaced + // any promise with a direct node in order to solve the Tribble 4-way race condition. + // See the documentation of Disembargo in rpc.capnp for more. + if (redirect == null) { + assert false: "'Disembargo' of type 'senderLoopback' sent to an object that does not appear to have been the subject of a previous 'Resolve' message."; + return; + } + builder.getContext().setReceiverLoopback(embargoId); + message.send(); + break; + + case RECEIVER_LOOPBACK: + var embargo = embargos.find(ctx.getReceiverLoopback()); + if (embargo == null) { + assert false: "Invalid embargo ID in 'Disembargo.context.receiverLoopback'."; + return; + } + assert embargo.disembargo != null; + embargo.disembargo.complete(null); + embargos.erase(ctx.getReceiverLoopback(), embargo); + break; + + default: + assert false: "Unimplemented Disembargo type. " + ctx.which(); + return; + } + } private List writeDescriptors(ClientHook[] capTable, RpcProtocol.Payload.Builder payload, List fds) { if (capTable.length == 0) { return List.of(); From 734af7165995492b4e2788f9727cc4dc597e4b78 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 2 Oct 2020 22:46:29 +0100 Subject: [PATCH 034/246] handleFinish --- .../src/main/java/org/capnproto/RpcState.java | 56 ++++++++++++++++--- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index e56fde54..453be6ee 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -445,6 +445,30 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu } void handleFinish(RpcProtocol.Finish.Reader finish) { + List exportsToRelease = null; + var answer = answers.find(finish.getQuestionId()); + if (answer == null || !answer.active) { + assert false: "'Finish' for invalid question ID."; + return; + } + + if (finish.getReleaseResultCaps()) { + exportsToRelease = answer.resultExports; + } + answer.resultExports = null; + + var pipelineToRelease = answer.pipeline; + answer.pipeline = null; + + // If the call isn't actually done yet, cancel it. Otherwise, we can go ahead and erase the + // question from the table. + var ctx = answer.callContext; + if (ctx != null) { + ctx.requestCancel(); + } + else { + answers.erase(finish.getQuestionId()); + } } void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { @@ -1003,15 +1027,15 @@ public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { } RpcResponse consumeRedirectedResponse() { - assert this.redirectResults; + assert this.redirectResults; - if (this.response == null) { - getResults(); // force initialization of response - } - - return ((LocallyRedirectedRpcResponse)this.response); + if (this.response == null) { + getResults(); // force initialization of response } + return ((LocallyRedirectedRpcResponse) this.response); + } + void sendReturn() { assert !redirectResults; @@ -1029,7 +1053,7 @@ void sendReturn() { List exports; try { - exports = ((RpcServerResponseImpl)response).send(); + exports = ((RpcServerResponseImpl) response).send(); } catch (Throwable exc) { this.responseSent = false; @@ -1081,6 +1105,24 @@ void cleanupAnswerTable(List resultExports, boolean shouldFreePipeline) } } } + + public void requestCancel() { + // Hints that the caller wishes to cancel this call. At the next time when cancellation is + // deemed safe, the RpcCallContext shall send a canceled Return -- or if it never becomes + // safe, the RpcCallContext will send a normal return when the call completes. Either way + // the RpcCallContext is now responsible for cleaning up the entry in the answer table, since + // a Finish message was already received. + + boolean previouslyAllowedButNotRequested = (this.cancelAllowed && !this.cancelRequested); + this.cancelRequested = true; + + if (previouslyAllowedButNotRequested) { + // We just set CANCEL_REQUESTED, and CANCEL_ALLOWED was already set previously. Initiate + // the cancellation. + this.cancelled.complete(null); + } + // TODO do we care about cancelRequested if further completions are effectively ignored? + } } enum PipelineState { From 07dbf228f09936a550e1d5a9513133601ca980d4 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 2 Oct 2020 22:53:49 +0100 Subject: [PATCH 035/246] avoid repetition of getResultsBuilder call --- .../src/main/java/org/capnproto/RpcState.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 453be6ee..da61be95 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -991,17 +991,16 @@ public void releaseParams() { @Override public AnyPointer.Builder getResults() { - if (response != null) { - return response.getResultsBuilder(); - } + if (response == null) { - if (redirectResults || isDisconnected()) { - response = new LocallyRedirectedRpcResponse(); - } - else { - var message = connection.newOutgoingMessage(1024); - returnMessage = message.getBody().initAs(RpcProtocol.Message.factory).initReturn(); - response = new RpcServerResponseImpl(message, returnMessage.getResults()); + if (redirectResults || isDisconnected()) { + response = new LocallyRedirectedRpcResponse(); + } + else { + var message = connection.newOutgoingMessage(1024); + returnMessage = message.getBody().initAs(RpcProtocol.Message.factory).initReturn(); + response = new RpcServerResponseImpl(message, returnMessage.getResults()); + } } return response.getResultsBuilder(); From 81b151deb5c2b4f1fd46e5249928c27344279202 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 3 Oct 2020 19:48:02 +0100 Subject: [PATCH 036/246] oops, correct FromPointerBuilder default call --- runtime/src/main/java/org/capnproto/FromPointerBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/FromPointerBuilder.java b/runtime/src/main/java/org/capnproto/FromPointerBuilder.java index 1a2342af..ca6877e5 100644 --- a/runtime/src/main/java/org/capnproto/FromPointerBuilder.java +++ b/runtime/src/main/java/org/capnproto/FromPointerBuilder.java @@ -23,7 +23,7 @@ public interface FromPointerBuilder { default T fromPointerBuilder(SegmentBuilder segment, int pointer) { - return fromPointerBuilder(segment, pointer); + return fromPointerBuilder(segment, null, pointer); } T fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer); @@ -31,5 +31,6 @@ default T fromPointerBuilder(SegmentBuilder segment, int pointer) { default T initFromPointerBuilder(SegmentBuilder segment, int pointer, int elementCount) { return initFromPointerBuilder(segment, null, pointer, elementCount); } + T initFromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, int elementCount); } From be64ced181a4fbfbcf454a1d7da0408ef684de4e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 6 Oct 2020 17:42:05 +0100 Subject: [PATCH 037/246] demo schema with interfaces --- .../test/java/org/capnproto/demo/Demo.java | 1646 ++++++++++++- .../test/java/org/capnproto/demo/demo.capnp | 70 + .../java/org/capnproto/demo/demo.capnp.c++ | 1188 +++++++++ .../test/java/org/capnproto/demo/demo.capnp.h | 2155 +++++++++++++++++ 4 files changed, 4967 insertions(+), 92 deletions(-) create mode 100644 runtime/src/test/java/org/capnproto/demo/demo.capnp create mode 100644 runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ create mode 100644 runtime/src/test/java/org/capnproto/demo/demo.capnp.h diff --git a/runtime/src/test/java/org/capnproto/demo/Demo.java b/runtime/src/test/java/org/capnproto/demo/Demo.java index 2ae5ba25..46687de6 100644 --- a/runtime/src/test/java/org/capnproto/demo/Demo.java +++ b/runtime/src/test/java/org/capnproto/demo/Demo.java @@ -1,5 +1,5 @@ // Generated by Cap'n Proto compiler, DO NOT EDIT -// source: demoparams.capnp +// source: demo.capnp package org.capnproto.demo; @@ -262,100 +262,1324 @@ public org.capnproto.AnyPointer.Reader getResult2() { } + public static class Struct0 { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)6,(short)3); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Struct0.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean getF0() { + return _getBooleanField(0); + } + public final void setF0(boolean value) { + _setBooleanField(0, value); + } + + public final short getF1() { + return _getShortField(1); + } + public final void setF1(short value) { + _setShortField(1, value); + } + + public final short getF2() { + return _getShortField(2); + } + public final void setF2(short value) { + _setShortField(2, value); + } + + public final int getF3() { + return _getIntField(2); + } + public final void setF3(int value) { + _setIntField(2, value); + } + + public final int getF4() { + return _getIntField(3); + } + public final void setF4(int value) { + _setIntField(3, value); + } + + public final long getF5() { + return _getLongField(2); + } + public final void setF5(long value) { + _setLongField(2, value); + } + + public final long getF6() { + return _getLongField(3); + } + public final void setF6(long value) { + _setLongField(3, value); + } + + public final float getF7() { + return _getFloatField(8); + } + public final void setF7(float value) { + _setFloatField(8, value); + } + + public final double getF8() { + return _getDoubleField(5); + } + public final void setF8(double value) { + _setDoubleField(5, value); + } + + public final boolean hasF9() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getF9() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setF9(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setF9(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initF9(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + public final boolean hasF10() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.Data.Builder getF10() { + return _getPointerField(org.capnproto.Data.factory, 1, null, 0, 0); + } + public final void setF10(org.capnproto.Data.Reader value) { + _setPointerField(org.capnproto.Data.factory, 1, value); + } + public final void setF10(byte [] value) { + _setPointerField(org.capnproto.Data.factory, 1, new org.capnproto.Data.Reader(value)); + } + public final org.capnproto.Data.Builder initF10(int size) { + return _initPointerField(org.capnproto.Data.factory, 1, size); + } + public final boolean hasF11() { + return !_pointerFieldIsNull(2); + } + public org.capnproto.AnyPointer.Builder getF11() { + return _getPointerField(org.capnproto.AnyPointer.factory, 2); + } + public org.capnproto.AnyPointer.Builder initF11() { + return _initPointerField(org.capnproto.AnyPointer.factory, 2, 0); + } + public org.capnproto.AnyPointer.Builder initF11(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 2, size); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean getF0() { + return _getBooleanField(0); + } + + public final short getF1() { + return _getShortField(1); + } + + public final short getF2() { + return _getShortField(2); + } + + public final int getF3() { + return _getIntField(2); + } + + public final int getF4() { + return _getIntField(3); + } + + public final long getF5() { + return _getLongField(2); + } + + public final long getF6() { + return _getLongField(3); + } + + public final float getF7() { + return _getFloatField(8); + } + + public final double getF8() { + return _getDoubleField(5); + } + + public boolean hasF9() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getF9() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + public boolean hasF10() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.Data.Reader getF10() { + return _getPointerField(org.capnproto.Data.factory, 1, null, 0, 0); + } + + public boolean hasF11() { + return !_pointerFieldIsNull(2); + } + public org.capnproto.AnyPointer.Reader getF11() { + return _getPointerField(org.capnproto.AnyPointer.factory, 2); + } + } + + } + + + public static class Iface0 { + + public static class Client extends org.capnproto.Capability.Client { + public Client() {} + public Client(org.capnproto.ClientHook hook) { super(hook); } + public Client(org.capnproto.Capability.Client cap) { super(cap.getHook()); } + public Client(Server server) { super(server); } + public Client(java.util.concurrent.CompletableFuture promise) { + super(promise); + } + } + public static abstract class Server extends org.capnproto.Capability.Server { + protected org.capnproto.DispatchCallResult dispatchCall( + long interfaceId, short methodId, + org.capnproto.CallContext context) { + if (interfaceId == 0xac6d126c2fac16ebL) { + return dispatchCallInternal(methodId, context); + } + return org.capnproto.Capability.Server.result( + org.capnproto.Capability.Server.internalUnimplemented("Iface0", interfaceId)); + } + + protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { + switch (methodId) { + default: + return org.capnproto.Capability.Server.result( + org.capnproto.Capability.Server.internalUnimplemented("Iface0", 0xac6d126c2fac16ebL, methodId)); + } + } + + } + + + static Object brand() { return null; /*schema.defaultBrand;*/ } + + } + + public static class Struct2 { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)2); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Struct2.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasF0() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getF0() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initF0() { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initF0(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + public final boolean hasF1i() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.demo.Demo.Iface0.Client getF1i() { + return new org.capnproto.demo.Demo.Iface0.Client( + _getPointerField(org.capnproto.AnyPointer.factory, 1).getAsCap()); + } + public void setF1i(org.capnproto.demo.Demo.Iface0.Client value) { + _initPointerField(org.capnproto.AnyPointer.factory, 1, 0).setAsCap(value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasF0() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getF0() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public boolean hasF1i() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.demo.Demo.Iface0.Client getF1i() { + return new org.capnproto.demo.Demo.Iface0.Client(_getPointerField(org.capnproto.AnyPointer.factory, 1).getAsCap()); + } + } + + } + + + public static class Iface1 { + + public static class Client extends org.capnproto.Capability.Client { + public Client() {} + public Client(org.capnproto.ClientHook hook) { super(hook); } + public Client(org.capnproto.Capability.Client cap) { super(cap.getHook()); } + public Client(Server server) { super(server); } + public Client(java.util.concurrent.CompletableFuture promise) { + super(promise); + } + } + public static abstract class Server extends org.capnproto.Capability.Server { + protected org.capnproto.DispatchCallResult dispatchCall( + long interfaceId, short methodId, + org.capnproto.CallContext context) { + if (interfaceId == 0xd52dcf38c9f6f7c0L) { + return dispatchCallInternal(methodId, context); + } + return org.capnproto.Capability.Server.result( + org.capnproto.Capability.Server.internalUnimplemented("Iface1", interfaceId)); + } + + protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { + switch (methodId) { + case 0: + return org.capnproto.Capability.Server.result( + this.method0(org.capnproto.Capability.Server.typedContext( + org.capnproto.demo.Demo.Iface1.Method0Params.factory, + org.capnproto.demo.Demo.Iface1.Method0Results.factory, context))); + case 1: + return org.capnproto.Capability.Server.result( + this.method1(org.capnproto.Capability.Server.typedContext( + org.capnproto.demo.Demo.Iface1.Method1Params.factory, + org.capnproto.demo.Demo.Iface1.Method1Results.factory, context))); + default: + return org.capnproto.Capability.Server.result( + org.capnproto.Capability.Server.internalUnimplemented("Iface1", 0xd52dcf38c9f6f7c0L, methodId)); + } + } + + protected java.util.concurrent.CompletableFuture method0(org.capnproto.CallContext context) { + return org.capnproto.Capability.Server.internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method0", + 0xd52dcf38c9f6f7c0L, (short)0); + } + + protected java.util.concurrent.CompletableFuture method1(org.capnproto.CallContext context) { + return org.capnproto.Capability.Server.internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method1", + 0xd52dcf38c9f6f7c0L, (short)1); + } + + } + + public static class Struct1 { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)6,(short)3); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Iface1.Struct1.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean getF0() { + return _getBooleanField(0); + } + public final void setF0(boolean value) { + _setBooleanField(0, value); + } + + public final short getF1() { + return _getShortField(1); + } + public final void setF1(short value) { + _setShortField(1, value); + } + + public final short getF2() { + return _getShortField(2); + } + public final void setF2(short value) { + _setShortField(2, value); + } + + public final int getF3() { + return _getIntField(2); + } + public final void setF3(int value) { + _setIntField(2, value); + } + + public final int getF4() { + return _getIntField(3); + } + public final void setF4(int value) { + _setIntField(3, value); + } + + public final long getF5() { + return _getLongField(2); + } + public final void setF5(long value) { + _setLongField(2, value); + } + + public final long getF6() { + return _getLongField(3); + } + public final void setF6(long value) { + _setLongField(3, value); + } + + public final float getF7() { + return _getFloatField(8); + } + public final void setF7(float value) { + _setFloatField(8, value); + } + + public final double getF8() { + return _getDoubleField(5); + } + public final void setF8(double value) { + _setDoubleField(5, value); + } + + public final boolean hasF9() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getF9() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setF9(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setF9(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initF9(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + public final boolean hasF10() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.Data.Builder getF10() { + return _getPointerField(org.capnproto.Data.factory, 1, null, 0, 0); + } + public final void setF10(org.capnproto.Data.Reader value) { + _setPointerField(org.capnproto.Data.factory, 1, value); + } + public final void setF10(byte [] value) { + _setPointerField(org.capnproto.Data.factory, 1, new org.capnproto.Data.Reader(value)); + } + public final org.capnproto.Data.Builder initF10(int size) { + return _initPointerField(org.capnproto.Data.factory, 1, size); + } + public final boolean hasF11() { + return !_pointerFieldIsNull(2); + } + public org.capnproto.AnyPointer.Builder getF11() { + return _getPointerField(org.capnproto.AnyPointer.factory, 2); + } + public org.capnproto.AnyPointer.Builder initF11() { + return _initPointerField(org.capnproto.AnyPointer.factory, 2, 0); + } + public org.capnproto.AnyPointer.Builder initF11(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 2, size); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean getF0() { + return _getBooleanField(0); + } + + public final short getF1() { + return _getShortField(1); + } + + public final short getF2() { + return _getShortField(2); + } + + public final int getF3() { + return _getIntField(2); + } + + public final int getF4() { + return _getIntField(3); + } + + public final long getF5() { + return _getLongField(2); + } + + public final long getF6() { + return _getLongField(3); + } + + public final float getF7() { + return _getFloatField(8); + } + + public final double getF8() { + return _getDoubleField(5); + } + + public boolean hasF9() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getF9() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + public boolean hasF10() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.Data.Reader getF10() { + return _getPointerField(org.capnproto.Data.factory, 1, null, 0, 0); + } + + public boolean hasF11() { + return !_pointerFieldIsNull(2); + } + public org.capnproto.AnyPointer.Reader getF11() { + return _getPointerField(org.capnproto.AnyPointer.factory, 2); + } + } + + } + + + public static class Method0Params { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Iface1.Method0Params.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + } + + } + + + public static class Method0Results { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)2); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Iface1.Method0Results.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final org.capnproto.demo.Demo.Struct0.Builder getResult0() { + return _getPointerField(org.capnproto.demo.Demo.Struct0.factory, 0, null, 0); + } + public final void setResult0(org.capnproto.demo.Demo.Struct0.Reader value) { + _setPointerField(org.capnproto.demo.Demo.Struct0.factory,0, value); + } + public final org.capnproto.demo.Demo.Struct0.Builder initResult0() { + return _initPointerField(org.capnproto.demo.Demo.Struct0.factory,0, 0); + } + public final org.capnproto.demo.Demo.Iface1.Struct1.Builder getResult1() { + return _getPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory, 1, null, 0); + } + public final void setResult1(org.capnproto.demo.Demo.Iface1.Struct1.Reader value) { + _setPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory,1, value); + } + public final org.capnproto.demo.Demo.Iface1.Struct1.Builder initResult1() { + return _initPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory,1, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasResult0() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.demo.Demo.Struct0.Reader getResult0() { + return _getPointerField(org.capnproto.demo.Demo.Struct0.factory,0,null, 0); + } + + public boolean hasResult1() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.demo.Demo.Iface1.Struct1.Reader getResult1() { + return _getPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory,1,null, 0); + } + + } + + } + + + public static class Method1Params { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Iface1.Method1Params.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + } + + } + + + public static class Method1Results { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Iface1.Method1Results.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasResult0() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.demo.Demo.Iface0.Client getResult0() { + return new org.capnproto.demo.Demo.Iface0.Client( + _getPointerField(org.capnproto.AnyPointer.factory, 0).getAsCap()); + } + public void setResult0(org.capnproto.demo.Demo.Iface0.Client value) { + _initPointerField(org.capnproto.AnyPointer.factory, 0, 0).setAsCap(value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasResult0() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.demo.Demo.Iface0.Client getResult0() { + return new org.capnproto.demo.Demo.Iface0.Client(_getPointerField(org.capnproto.AnyPointer.factory, 0).getAsCap()); + } + } + + } + + + + static Object brand() { return null; /*schema.defaultBrand;*/ } + + } + public static final class Schemas { -public static final org.capnproto.SegmentReader b_b301b4acd180f012 = +public static final org.capnproto.SegmentReader b_91e1b138de965ab0 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00b0\u005a\u0096\u00de\u0038\u00b1\u00e1\u0091" + + "\u0034\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + + "\u0050\u0061\u0072\u0061\u006d\u0073\u0030\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0070\u0061\u0072\u0061\u006d\u0030\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_a77bdd3c3bd1dcbf = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00bf\u00dc\u00d1\u003b\u003c\u00dd\u007b\u00a7" + + "\u0034\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + + "\u0052\u0065\u0073\u0075\u006c\u0074\u0073\u0030" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_b20f33e412339049 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0049\u0090\u0033\u0012\u00e4\u0033\u000f\u00b2" + + "\u0034\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + + "\u0050\u0061\u0072\u0061\u006d\u0073\u0031\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0070\u0061\u0072\u0061\u006d\u0030\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_d1342392ab536963 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0063\u0069\u0053\u00ab\u0092\u0023\u0034\u00d1" + + "\u0034\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + + "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + + "\u0052\u0065\u0073\u0075\u006c\u0074\u0073\u0031" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0031\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0032\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_b1af51b6aef0e7bc = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00bc\u00e7\u00f0\u00ae\u00b6\u0051\u00af\u00b1" + + "\u0034\u0000\u0000\u0000\u0001\u0000\u0006\u0000" + + "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + + "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u00a7\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0053\u0074\u0072\u0075" + + "\u0063\u0074\u0030\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0041\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u003c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0048\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0044\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0050\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0058\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0055\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0050\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\\\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0059\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0054\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0060\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0007\u0000\u0000\u0000\u0008\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u005d\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0058\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0064\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\\\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0068\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0060\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u006c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\n\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u0001\u0000\u0000\"\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0070\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000b\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006d\u0001\u0000\u0000\"\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0068\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0074\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0066\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0032\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0033\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0034\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0035\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0036\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0037\u0000\u0000\u0000\u0000\u0000\u0000" + + "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0038\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0039\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0031\u0030\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0031\u0031\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_ac6d126c2fac16eb = org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0012\u00f0\u0080\u00d1\u00ac\u00b4\u0001\u00b3" + - "\u003a\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u00eb\u0016\u00ac\u002f\u006c\u0012\u006d\u00ac" + + "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0032\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u0070\u0061\u0072" + - "\u0061\u006d\u0073\u002e\u0063\u0061\u0070\u006e" + - "\u0070\u003a\u0054\u0065\u0073\u0074\u0050\u0061" + - "\u0072\u0061\u006d\u0073\u0030\u0000\u0000\u0000" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + + "\u0065\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); +public static final org.capnproto.SegmentReader b_a9395663e97ca3af = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00af\u00a3\u007c\u00e9\u0063\u0056\u0039\u00a9" + + "\u0034\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0053\u0074\u0072\u0075" + + "\u0063\u0074\u0032\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0030\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\"\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0066\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0031\u0069\u0000\u0000\u0000\u0000\u0000" + + "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00eb\u0016\u00ac\u002f\u006c\u0012\u006d\u00ac" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_96a42e5421b52881 = +public static final org.capnproto.SegmentReader b_d52dcf38c9f6f7c0 = org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0081\u0028\u00b5\u0021\u0054\u002e\u00a4\u0096" + - "\u003a\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u00c0\u00f7\u00f6\u00c9\u0038\u00cf\u002d\u00d5" + + "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u003a\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0039\u0000\u0000\u0000\u0087\u0000\u0000\u0000" + + "\u0089\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u0070\u0061\u0072" + - "\u0061\u006d\u0073\u002e\u0063\u0061\u0070\u006e" + - "\u0070\u003a\u0054\u0065\u0073\u0074\u0052\u0065" + - "\u0073\u0075\u006c\u0074\u0073\u0030\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + + "\u0065\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0038\u00dd\u00fd\u00fb\u0062\u00a8\u000c\u0080" + + "\u0001\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0053\u0074\u0072\u0075\u0063\u0074\u0031\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u00d5\u0004\u002e\u0063\u0018\u00ca\u0092\u008f" + + "\u008f\u0083\u0018\u0046\u00fe\u00c4\u0067\u0080" + + "\u0031\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d6\u005a\u00ae\u0003\u0007\u0092\u0089\u00f0" + + "\u0006\u00f5\u0011\u00c3\u00aa\u0015\u006d\u00c3" + + "\u0019\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_e10363a8b6220957 = + "\r\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u006d\u0065\u0074\u0068\u006f\u0064\u0030\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + + "\u006d\u0065\u0074\u0068\u006f\u0064\u0031\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); +public static final org.capnproto.SegmentReader b_800ca862fbfddd38 = org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0057\u0009\"\u00b6\u00a8\u0063\u0003\u00e1" + - "\u003a\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0038\u00dd\u00fd\u00fb\u0062\u00a8\u000c\u0080" + + "\u003b\u0000\u0000\u0000\u0001\u0000\u0006\u0000" + + "\u00c0\u00f7\u00f6\u00c9\u0038\u00cf\u002d\u00d5" + + "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0032\u0002\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u001a\u0002\u0000\u0000" + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u00a7\u0002\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + @@ -363,20 +1587,185 @@ public static final class Schemas { "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u0070\u0061\u0072" + - "\u0061\u006d\u0073\u002e\u0063\u0061\u0070\u006e" + - "\u0070\u003a\u0054\u0065\u0073\u0074\u0050\u0061" + - "\u0072\u0061\u006d\u0073\u0031\u0000\u0000\u0000" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + + "\u0065\u0031\u002e\u0053\u0074\u0072\u0075\u0063" + + "\u0074\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0030\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0041\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0030\u0000\u0000" + + "\u003c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0048\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0044\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0050\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0058\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0055\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0050\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\\\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0059\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0054\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0060\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0007\u0000\u0000\u0000\u0008\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u005d\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0058\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0064\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\\\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0068\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0060\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u006c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\n\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u0001\u0000\u0000\"\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0070\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000b\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006d\u0001\u0000\u0000\"\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0068\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0074\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0066\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0032\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0033\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0034\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0035\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0036\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0037\u0000\u0000\u0000\u0000\u0000\u0000" + + "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0038\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0039\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0031\u0030\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0031\u0031\u0000\u0000\u0000\u0000\u0000" + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -384,18 +1773,18 @@ public static final class Schemas { "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_99852ee4d45ddb3e = +public static final org.capnproto.SegmentReader b_8f92ca18632e04d5 = org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u003e\u00db\u005d\u00d4\u00e4\u002e\u0085\u0099" + - "\u003a\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u00c4\u0053\u0042\u00d6\u0097\u0077\u00b5\u0091" + - "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u00d5\u0004\u002e\u0063\u0018\u00ca\u0092\u008f" + + "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u003a\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + @@ -403,55 +1792,128 @@ public static final class Schemas { "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u0070\u0061\u0072" + - "\u0061\u006d\u0073\u002e\u0063\u0061\u0070\u006e" + - "\u0070\u003a\u0054\u0065\u0073\u0074\u0052\u0065" + - "\u0073\u0075\u006c\u0074\u0073\u0031\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + + "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + + "\u0064\u0030\u0024\u0050\u0061\u0072\u0061\u006d" + + "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_8067c4fe4618838f = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u008f\u0083\u0018\u0046\u00fe\u00c4\u0067\u0080" + + "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u005a\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + + "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + + "\u0064\u0030\u0024\u0052\u0065\u0073\u0075\u006c" + + "\u0074\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00bc\u00e7\u00f0\u00ae\u00b6\u0051\u00af\u00b1" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0031\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0038\u00dd\u00fd\u00fb\u0062\u00a8\u000c\u0080" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0031\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_f089920703ae5ad6 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00d6\u005a\u00ae\u0003\u0007\u0092\u0089\u00f0" + + "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0032\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + + "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + + "\u0064\u0031\u0024\u0050\u0061\u0072\u0061\u006d" + + "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_c36d15aac311f506 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0006\u00f5\u0011\u00c3\u00aa\u0015\u006d\u00c3" + + "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u005a\u0002\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + + "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + + "\u0064\u0031\u0024\u0052\u0065\u0073\u0075\u006c" + + "\u0074\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + + "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00eb\u0016\u00ac\u002f\u006c\u0012\u006d\u00ac" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); } diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp b/runtime/src/test/java/org/capnproto/demo/demo.capnp new file mode 100644 index 00000000..550f9c07 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp @@ -0,0 +1,70 @@ +@0xb6577a1582e84742; + +using Java = import "/capnp/java.capnp"; +$Java.package("org.capnproto.demo"); +$Java.outerClassname("Demo"); + +struct TestParams0 { + param0 @0 :Int32; +} + +struct TestResults0 { + result0 @0 :Int32; +} + +struct TestParams1 { + param0 @0 :AnyPointer; +} + +struct TestResults1 { + result0 @0 :AnyPointer; + result1 @1 :AnyPointer; + result2 @2 :AnyPointer; +} + +struct Struct0 { + f0 @0 :Bool; + f1 @1 :UInt16; + f2 @2 :Int16; + f3 @3 :UInt32; + f4 @4 :Int32; + f5 @5 :UInt64; + f6 @6 :Int64; + f7 @7 :Float32; + f8 @8 :Float64; + f9 @9 :Text; + f10 @10 :Data; + f11 @11 :AnyPointer; +} + +interface Iface0 { +} + +struct Struct2 { + f0 @0 :AnyPointer; + f1i @1 :Iface0; +} + +interface Iface1 { + + struct Struct1 { + f0 @0 :Bool; + f1 @1 :UInt16; + f2 @2 :Int16; + f3 @3 :UInt32; + f4 @4 :Int32; + f5 @5 :UInt64; + f6 @6 :Int64; + f7 @7 :Float32; + f8 @8 :Float64; + f9 @9 :Text; + f10 @10 :Data; + f11 @11 :AnyPointer; + } + + method0 @0 () -> (result0 :Struct0, result1 :Struct1); + method1 @1 () -> (result0: Iface0); + +} + + diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ new file mode 100644 index 00000000..5dd280d2 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ @@ -0,0 +1,1188 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: demo.capnp + +#include "demo.capnp.h" + +namespace capnp { +namespace schemas { +static const ::capnp::_::AlignedData<37> b_91e1b138de965ab0 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 176, 90, 150, 222, 56, 177, 225, 145, + 52, 0, 0, 0, 1, 0, 1, 0, + 66, 71, 232, 130, 21, 122, 87, 182, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 2, 0, 0, + 49, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 84, 101, 115, 116, + 80, 97, 114, 97, 109, 115, 48, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 1, 0, + 20, 0, 0, 0, 2, 0, 1, 0, + 112, 97, 114, 97, 109, 48, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_91e1b138de965ab0 = b_91e1b138de965ab0.words; +#if !CAPNP_LITE +static const uint16_t m_91e1b138de965ab0[] = {0}; +static const uint16_t i_91e1b138de965ab0[] = {0}; +const ::capnp::_::RawSchema s_91e1b138de965ab0 = { + 0x91e1b138de965ab0, b_91e1b138de965ab0.words, 37, nullptr, m_91e1b138de965ab0, + 0, 1, i_91e1b138de965ab0, nullptr, nullptr, { &s_91e1b138de965ab0, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<38> b_a77bdd3c3bd1dcbf = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 191, 220, 209, 59, 60, 221, 123, 167, + 52, 0, 0, 0, 1, 0, 1, 0, + 66, 71, 232, 130, 21, 122, 87, 182, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 10, 2, 0, 0, + 53, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 84, 101, 115, 116, + 82, 101, 115, 117, 108, 116, 115, 48, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 1, 0, + 20, 0, 0, 0, 2, 0, 1, 0, + 114, 101, 115, 117, 108, 116, 48, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a77bdd3c3bd1dcbf = b_a77bdd3c3bd1dcbf.words; +#if !CAPNP_LITE +static const uint16_t m_a77bdd3c3bd1dcbf[] = {0}; +static const uint16_t i_a77bdd3c3bd1dcbf[] = {0}; +const ::capnp::_::RawSchema s_a77bdd3c3bd1dcbf = { + 0xa77bdd3c3bd1dcbf, b_a77bdd3c3bd1dcbf.words, 38, nullptr, m_a77bdd3c3bd1dcbf, + 0, 1, i_a77bdd3c3bd1dcbf, nullptr, nullptr, { &s_a77bdd3c3bd1dcbf, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<37> b_b20f33e412339049 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 73, 144, 51, 18, 228, 51, 15, 178, + 52, 0, 0, 0, 1, 0, 0, 0, + 66, 71, 232, 130, 21, 122, 87, 182, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 2, 2, 0, 0, + 49, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 84, 101, 115, 116, + 80, 97, 114, 97, 109, 115, 49, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 1, 0, + 20, 0, 0, 0, 2, 0, 1, 0, + 112, 97, 114, 97, 109, 48, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b20f33e412339049 = b_b20f33e412339049.words; +#if !CAPNP_LITE +static const uint16_t m_b20f33e412339049[] = {0}; +static const uint16_t i_b20f33e412339049[] = {0}; +const ::capnp::_::RawSchema s_b20f33e412339049 = { + 0xb20f33e412339049, b_b20f33e412339049.words, 37, nullptr, m_b20f33e412339049, + 0, 1, i_b20f33e412339049, nullptr, nullptr, { &s_b20f33e412339049, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<68> b_d1342392ab536963 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 99, 105, 83, 171, 146, 35, 52, 209, + 52, 0, 0, 0, 1, 0, 0, 0, + 66, 71, 232, 130, 21, 122, 87, 182, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 10, 2, 0, 0, + 53, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 84, 101, 115, 116, + 82, 101, 115, 117, 108, 116, 115, 49, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 12, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 3, 0, 1, 0, + 76, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 3, 0, 1, 0, + 80, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 0, 0, 0, 3, 0, 1, 0, + 84, 0, 0, 0, 2, 0, 1, 0, + 114, 101, 115, 117, 108, 116, 48, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 115, 117, 108, 116, 49, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 115, 117, 108, 116, 50, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d1342392ab536963 = b_d1342392ab536963.words; +#if !CAPNP_LITE +static const uint16_t m_d1342392ab536963[] = {0, 1, 2}; +static const uint16_t i_d1342392ab536963[] = {0, 1, 2}; +const ::capnp::_::RawSchema s_d1342392ab536963 = { + 0xd1342392ab536963, b_d1342392ab536963.words, 68, nullptr, m_d1342392ab536963, + 0, 3, i_d1342392ab536963, nullptr, nullptr, { &s_d1342392ab536963, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<202> b_b1af51b6aef0e7bc = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 188, 231, 240, 174, 182, 81, 175, 177, + 52, 0, 0, 0, 1, 0, 6, 0, + 66, 71, 232, 130, 21, 122, 87, 182, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 226, 1, 0, 0, + 49, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 167, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 83, 116, 114, 117, + 99, 116, 48, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 48, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 1, 0, 0, 3, 0, 1, 0, + 72, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 1, 0, 0, 3, 0, 1, 0, + 76, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 1, 0, 0, 3, 0, 1, 0, + 80, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 1, 0, 0, 3, 0, 1, 0, + 84, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 1, 0, 0, 3, 0, 1, 0, + 88, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 1, 0, 0, 3, 0, 1, 0, + 92, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 1, 0, 0, 3, 0, 1, 0, + 96, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 1, 0, 0, 3, 0, 1, 0, + 100, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 1, 0, 0, 3, 0, 1, 0, + 104, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 1, 0, 0, 3, 0, 1, 0, + 108, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 1, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 1, 0, 0, 3, 0, 1, 0, + 112, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 1, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 1, 0, 0, 3, 0, 1, 0, + 116, 1, 0, 0, 2, 0, 1, 0, + 102, 48, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 49, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 50, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 51, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 52, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 53, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 54, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 55, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 56, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 57, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 49, 48, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 49, 49, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_b1af51b6aef0e7bc = b_b1af51b6aef0e7bc.words; +#if !CAPNP_LITE +static const uint16_t m_b1af51b6aef0e7bc[] = {0, 1, 10, 11, 2, 3, 4, 5, 6, 7, 8, 9}; +static const uint16_t i_b1af51b6aef0e7bc[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; +const ::capnp::_::RawSchema s_b1af51b6aef0e7bc = { + 0xb1af51b6aef0e7bc, b_b1af51b6aef0e7bc.words, 202, nullptr, m_b1af51b6aef0e7bc, + 0, 12, i_b1af51b6aef0e7bc, nullptr, nullptr, { &s_b1af51b6aef0e7bc, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<23> b_ac6d126c2fac16eb = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 235, 22, 172, 47, 108, 18, 109, 172, + 52, 0, 0, 0, 3, 0, 0, 0, + 66, 71, 232, 130, 21, 122, 87, 182, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 218, 1, 0, 0, + 49, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 7, 0, 0, 0, + 45, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 73, 102, 97, 99, + 101, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 3, 0, 5, 0, + 0, 0, 0, 0, 1, 0, 1, 0, } +}; +::capnp::word const* const bp_ac6d126c2fac16eb = b_ac6d126c2fac16eb.words; +#if !CAPNP_LITE +const ::capnp::_::RawSchema s_ac6d126c2fac16eb = { + 0xac6d126c2fac16eb, b_ac6d126c2fac16eb.words, 23, nullptr, nullptr, + 0, 0, nullptr, nullptr, nullptr, { &s_ac6d126c2fac16eb, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<52> b_a9395663e97ca3af = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 175, 163, 124, 233, 99, 86, 57, 169, + 52, 0, 0, 0, 1, 0, 0, 0, + 66, 71, 232, 130, 21, 122, 87, 182, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 226, 1, 0, 0, + 49, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 83, 116, 114, 117, + 99, 116, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 48, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 102, 48, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 49, 105, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 0, 0, 0, + 235, 22, 172, 47, 108, 18, 109, 172, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_a9395663e97ca3af = b_a9395663e97ca3af.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_a9395663e97ca3af[] = { + &s_ac6d126c2fac16eb, +}; +static const uint16_t m_a9395663e97ca3af[] = {0, 1}; +static const uint16_t i_a9395663e97ca3af[] = {0, 1}; +const ::capnp::_::RawSchema s_a9395663e97ca3af = { + 0xa9395663e97ca3af, b_a9395663e97ca3af.words, 52, d_a9395663e97ca3af, m_a9395663e97ca3af, + 1, 2, i_a9395663e97ca3af, nullptr, nullptr, { &s_a9395663e97ca3af, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<46> b_d52dcf38c9f6f7c0 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 192, 247, 246, 201, 56, 207, 45, 213, + 52, 0, 0, 0, 3, 0, 0, 0, + 66, 71, 232, 130, 21, 122, 87, 182, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 218, 1, 0, 0, + 49, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 0, 135, 0, 0, 0, + 137, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 73, 102, 97, 99, + 101, 49, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 1, 0, 1, 0, + 56, 221, 253, 251, 98, 168, 12, 128, + 1, 0, 0, 0, 66, 0, 0, 0, + 83, 116, 114, 117, 99, 116, 49, 0, + 8, 0, 0, 0, 3, 0, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 4, 46, 99, 24, 202, 146, 143, + 143, 131, 24, 70, 254, 196, 103, 128, + 49, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 214, 90, 174, 3, 7, 146, 137, 240, + 6, 245, 17, 195, 170, 21, 109, 195, + 25, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 7, 0, 0, 0, + 109, 101, 116, 104, 111, 100, 48, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 109, 101, 116, 104, 111, 100, 49, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 1, 0, 1, 0, } +}; +::capnp::word const* const bp_d52dcf38c9f6f7c0 = b_d52dcf38c9f6f7c0.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_d52dcf38c9f6f7c0[] = { + &s_8067c4fe4618838f, + &s_8f92ca18632e04d5, + &s_c36d15aac311f506, + &s_f089920703ae5ad6, +}; +static const uint16_t m_d52dcf38c9f6f7c0[] = {0, 1}; +const ::capnp::_::RawSchema s_d52dcf38c9f6f7c0 = { + 0xd52dcf38c9f6f7c0, b_d52dcf38c9f6f7c0.words, 46, d_d52dcf38c9f6f7c0, m_d52dcf38c9f6f7c0, + 4, 2, nullptr, nullptr, nullptr, { &s_d52dcf38c9f6f7c0, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<203> b_800ca862fbfddd38 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 56, 221, 253, 251, 98, 168, 12, 128, + 59, 0, 0, 0, 1, 0, 6, 0, + 192, 247, 246, 201, 56, 207, 45, 213, + 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 26, 2, 0, 0, + 53, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 167, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 73, 102, 97, 99, + 101, 49, 46, 83, 116, 114, 117, 99, + 116, 49, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 48, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 1, 0, 0, 3, 0, 1, 0, + 72, 1, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 69, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 1, 0, 0, 3, 0, 1, 0, + 76, 1, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 73, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 1, 0, 0, 3, 0, 1, 0, + 80, 1, 0, 0, 2, 0, 1, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 77, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 1, 0, 0, 3, 0, 1, 0, + 84, 1, 0, 0, 2, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 76, 1, 0, 0, 3, 0, 1, 0, + 88, 1, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 85, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 1, 0, 0, 3, 0, 1, 0, + 92, 1, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 89, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 1, 0, 0, 3, 0, 1, 0, + 96, 1, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 93, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 88, 1, 0, 0, 3, 0, 1, 0, + 100, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 1, 0, 0, 3, 0, 1, 0, + 104, 1, 0, 0, 2, 0, 1, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 101, 1, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 96, 1, 0, 0, 3, 0, 1, 0, + 108, 1, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 105, 1, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 100, 1, 0, 0, 3, 0, 1, 0, + 112, 1, 0, 0, 2, 0, 1, 0, + 11, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 109, 1, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 104, 1, 0, 0, 3, 0, 1, 0, + 116, 1, 0, 0, 2, 0, 1, 0, + 102, 48, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 49, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 50, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 51, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 52, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 53, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 54, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 55, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 56, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 57, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 49, 48, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 102, 49, 49, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_800ca862fbfddd38 = b_800ca862fbfddd38.words; +#if !CAPNP_LITE +static const uint16_t m_800ca862fbfddd38[] = {0, 1, 10, 11, 2, 3, 4, 5, 6, 7, 8, 9}; +static const uint16_t i_800ca862fbfddd38[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; +const ::capnp::_::RawSchema s_800ca862fbfddd38 = { + 0x800ca862fbfddd38, b_800ca862fbfddd38.words, 203, nullptr, m_800ca862fbfddd38, + 0, 12, i_800ca862fbfddd38, nullptr, nullptr, { &s_800ca862fbfddd38, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<22> b_8f92ca18632e04d5 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 213, 4, 46, 99, 24, 202, 146, 143, + 59, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 82, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 73, 102, 97, 99, + 101, 49, 46, 109, 101, 116, 104, 111, + 100, 48, 36, 80, 97, 114, 97, 109, + 115, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8f92ca18632e04d5 = b_8f92ca18632e04d5.words; +#if !CAPNP_LITE +const ::capnp::_::RawSchema s_8f92ca18632e04d5 = { + 0x8f92ca18632e04d5, b_8f92ca18632e04d5.words, 22, nullptr, nullptr, + 0, 0, nullptr, nullptr, nullptr, { &s_8f92ca18632e04d5, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<53> b_8067c4fe4618838f = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 143, 131, 24, 70, 254, 196, 103, 128, + 59, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 90, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 73, 102, 97, 99, + 101, 49, 46, 109, 101, 116, 104, 111, + 100, 48, 36, 82, 101, 115, 117, 108, + 116, 115, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 48, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, + 114, 101, 115, 117, 108, 116, 48, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 188, 231, 240, 174, 182, 81, 175, 177, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 101, 115, 117, 108, 116, 49, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 56, 221, 253, 251, 98, 168, 12, 128, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_8067c4fe4618838f = b_8067c4fe4618838f.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_8067c4fe4618838f[] = { + &s_800ca862fbfddd38, + &s_b1af51b6aef0e7bc, +}; +static const uint16_t m_8067c4fe4618838f[] = {0, 1}; +static const uint16_t i_8067c4fe4618838f[] = {0, 1}; +const ::capnp::_::RawSchema s_8067c4fe4618838f = { + 0x8067c4fe4618838f, b_8067c4fe4618838f.words, 53, d_8067c4fe4618838f, m_8067c4fe4618838f, + 2, 2, i_8067c4fe4618838f, nullptr, nullptr, { &s_8067c4fe4618838f, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<22> b_f089920703ae5ad6 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 214, 90, 174, 3, 7, 146, 137, 240, + 59, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 82, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 73, 102, 97, 99, + 101, 49, 46, 109, 101, 116, 104, 111, + 100, 49, 36, 80, 97, 114, 97, 109, + 115, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f089920703ae5ad6 = b_f089920703ae5ad6.words; +#if !CAPNP_LITE +const ::capnp::_::RawSchema s_f089920703ae5ad6 = { + 0xf089920703ae5ad6, b_f089920703ae5ad6.words, 22, nullptr, nullptr, + 0, 0, nullptr, nullptr, nullptr, { &s_f089920703ae5ad6, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<38> b_c36d15aac311f506 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 6, 245, 17, 195, 170, 21, 109, 195, + 59, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 90, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 73, 102, 97, 99, + 101, 49, 46, 109, 101, 116, 104, 111, + 100, 49, 36, 82, 101, 115, 117, 108, + 116, 115, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 3, 0, 1, 0, + 20, 0, 0, 0, 2, 0, 1, 0, + 114, 101, 115, 117, 108, 116, 48, 0, + 17, 0, 0, 0, 0, 0, 0, 0, + 235, 22, 172, 47, 108, 18, 109, 172, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c36d15aac311f506 = b_c36d15aac311f506.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_c36d15aac311f506[] = { + &s_ac6d126c2fac16eb, +}; +static const uint16_t m_c36d15aac311f506[] = {0}; +static const uint16_t i_c36d15aac311f506[] = {0}; +const ::capnp::_::RawSchema s_c36d15aac311f506 = { + 0xc36d15aac311f506, b_c36d15aac311f506.words, 38, d_c36d15aac311f506, m_c36d15aac311f506, + 1, 1, i_c36d15aac311f506, nullptr, nullptr, { &s_c36d15aac311f506, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +} // namespace schemas +} // namespace capnp + +// ======================================================================================= + + +// TestParams0 +constexpr uint16_t TestParams0::_capnpPrivate::dataWordSize; +constexpr uint16_t TestParams0::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind TestParams0::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* TestParams0::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// TestResults0 +constexpr uint16_t TestResults0::_capnpPrivate::dataWordSize; +constexpr uint16_t TestResults0::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind TestResults0::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* TestResults0::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// TestParams1 +constexpr uint16_t TestParams1::_capnpPrivate::dataWordSize; +constexpr uint16_t TestParams1::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind TestParams1::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* TestParams1::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// TestResults1 +constexpr uint16_t TestResults1::_capnpPrivate::dataWordSize; +constexpr uint16_t TestResults1::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind TestResults1::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* TestResults1::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Struct0 +constexpr uint16_t Struct0::_capnpPrivate::dataWordSize; +constexpr uint16_t Struct0::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Struct0::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Struct0::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +#if !CAPNP_LITE +::capnp::Capability::Server::DispatchCallResult Iface0::Server::dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (interfaceId) { + case 0xac6d126c2fac16ebull: + return dispatchCallInternal(methodId, context); + default: + return internalUnimplemented("runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", interfaceId); + } +} +::capnp::Capability::Server::DispatchCallResult Iface0::Server::dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (methodId) { + default: + (void)context; + return ::capnp::Capability::Server::internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", + 0xac6d126c2fac16ebull, methodId); + } +} +#endif // !CAPNP_LITE + +// Iface0 +#if !CAPNP_LITE +constexpr ::capnp::Kind Iface0::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Iface0::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Struct2 +constexpr uint16_t Struct2::_capnpPrivate::dataWordSize; +constexpr uint16_t Struct2::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Struct2::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Struct2::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +#if !CAPNP_LITE +::capnp::Request< ::Iface1::Method0Params, ::Iface1::Method0Results> +Iface1::Client::method0Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { + return newCall< ::Iface1::Method0Params, ::Iface1::Method0Results>( + 0xd52dcf38c9f6f7c0ull, 0, sizeHint); +} +::kj::Promise Iface1::Server::method0(Method0Context) { + return ::capnp::Capability::Server::internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method0", + 0xd52dcf38c9f6f7c0ull, 0); +} +::capnp::Request< ::Iface1::Method1Params, ::Iface1::Method1Results> +Iface1::Client::method1Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { + return newCall< ::Iface1::Method1Params, ::Iface1::Method1Results>( + 0xd52dcf38c9f6f7c0ull, 1, sizeHint); +} +::kj::Promise Iface1::Server::method1(Method1Context) { + return ::capnp::Capability::Server::internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method1", + 0xd52dcf38c9f6f7c0ull, 1); +} +::capnp::Capability::Server::DispatchCallResult Iface1::Server::dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (interfaceId) { + case 0xd52dcf38c9f6f7c0ull: + return dispatchCallInternal(methodId, context); + default: + return internalUnimplemented("runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", interfaceId); + } +} +::capnp::Capability::Server::DispatchCallResult Iface1::Server::dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (methodId) { + case 0: + return { + method0(::capnp::Capability::Server::internalGetTypedContext< + ::Iface1::Method0Params, ::Iface1::Method0Results>(context)), + false + }; + case 1: + return { + method1(::capnp::Capability::Server::internalGetTypedContext< + ::Iface1::Method1Params, ::Iface1::Method1Results>(context)), + false + }; + default: + (void)context; + return ::capnp::Capability::Server::internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", + 0xd52dcf38c9f6f7c0ull, methodId); + } +} +#endif // !CAPNP_LITE + +// Iface1 +#if !CAPNP_LITE +constexpr ::capnp::Kind Iface1::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Iface1::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Iface1::Struct1 +constexpr uint16_t Iface1::Struct1::_capnpPrivate::dataWordSize; +constexpr uint16_t Iface1::Struct1::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Iface1::Struct1::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Iface1::Struct1::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Iface1::Method0Params +constexpr uint16_t Iface1::Method0Params::_capnpPrivate::dataWordSize; +constexpr uint16_t Iface1::Method0Params::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Iface1::Method0Params::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Iface1::Method0Params::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Iface1::Method0Results +constexpr uint16_t Iface1::Method0Results::_capnpPrivate::dataWordSize; +constexpr uint16_t Iface1::Method0Results::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Iface1::Method0Results::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Iface1::Method0Results::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Iface1::Method1Params +constexpr uint16_t Iface1::Method1Params::_capnpPrivate::dataWordSize; +constexpr uint16_t Iface1::Method1Params::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Iface1::Method1Params::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Iface1::Method1Params::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Iface1::Method1Results +constexpr uint16_t Iface1::Method1Results::_capnpPrivate::dataWordSize; +constexpr uint16_t Iface1::Method1Results::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Iface1::Method1Results::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Iface1::Method1Results::_capnpPrivate::schema; +#endif // !CAPNP_LITE + + + diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp.h b/runtime/src/test/java/org/capnproto/demo/demo.capnp.h new file mode 100644 index 00000000..c547464d --- /dev/null +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.h @@ -0,0 +1,2155 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: demo.capnp + +#pragma once + +#include +#include +#if !CAPNP_LITE +#include +#endif // !CAPNP_LITE + +#if CAPNP_VERSION != 8000 +#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." +#endif + + +namespace capnp { +namespace schemas { + +CAPNP_DECLARE_SCHEMA(91e1b138de965ab0); +CAPNP_DECLARE_SCHEMA(a77bdd3c3bd1dcbf); +CAPNP_DECLARE_SCHEMA(b20f33e412339049); +CAPNP_DECLARE_SCHEMA(d1342392ab536963); +CAPNP_DECLARE_SCHEMA(b1af51b6aef0e7bc); +CAPNP_DECLARE_SCHEMA(ac6d126c2fac16eb); +CAPNP_DECLARE_SCHEMA(a9395663e97ca3af); +CAPNP_DECLARE_SCHEMA(d52dcf38c9f6f7c0); +CAPNP_DECLARE_SCHEMA(800ca862fbfddd38); +CAPNP_DECLARE_SCHEMA(8f92ca18632e04d5); +CAPNP_DECLARE_SCHEMA(8067c4fe4618838f); +CAPNP_DECLARE_SCHEMA(f089920703ae5ad6); +CAPNP_DECLARE_SCHEMA(c36d15aac311f506); + +} // namespace schemas +} // namespace capnp + + +struct TestParams0 { + TestParams0() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(91e1b138de965ab0, 1, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct TestResults0 { + TestResults0() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a77bdd3c3bd1dcbf, 1, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct TestParams1 { + TestParams1() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b20f33e412339049, 0, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct TestResults1 { + TestResults1() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d1342392ab536963, 0, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Struct0 { + Struct0() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(b1af51b6aef0e7bc, 6, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Iface0 { + Iface0() = delete; + +#if !CAPNP_LITE + class Client; + class Server; +#endif // !CAPNP_LITE + + + #if !CAPNP_LITE + struct _capnpPrivate { + CAPNP_DECLARE_INTERFACE_HEADER(ac6d126c2fac16eb) + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + }; + #endif // !CAPNP_LITE +}; + +struct Struct2 { + Struct2() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(a9395663e97ca3af, 0, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Iface1 { + Iface1() = delete; + +#if !CAPNP_LITE + class Client; + class Server; +#endif // !CAPNP_LITE + + struct Struct1; + struct Method0Params; + struct Method0Results; + struct Method1Params; + struct Method1Results; + + #if !CAPNP_LITE + struct _capnpPrivate { + CAPNP_DECLARE_INTERFACE_HEADER(d52dcf38c9f6f7c0) + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + }; + #endif // !CAPNP_LITE +}; + +struct Iface1::Struct1 { + Struct1() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(800ca862fbfddd38, 6, 3) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Iface1::Method0Params { + Method0Params() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8f92ca18632e04d5, 0, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Iface1::Method0Results { + Method0Results() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(8067c4fe4618838f, 0, 2) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Iface1::Method1Params { + Method1Params() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f089920703ae5ad6, 0, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Iface1::Method1Results { + Method1Results() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c36d15aac311f506, 0, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +// ======================================================================================= + +class TestParams0::Reader { +public: + typedef TestParams0 Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int32_t getParam0() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class TestParams0::Builder { +public: + typedef TestParams0 Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int32_t getParam0(); + inline void setParam0( ::int32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class TestParams0::Pipeline { +public: + typedef TestParams0 Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class TestResults0::Reader { +public: + typedef TestResults0 Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::int32_t getResult0() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class TestResults0::Builder { +public: + typedef TestResults0 Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline ::int32_t getResult0(); + inline void setResult0( ::int32_t value); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class TestResults0::Pipeline { +public: + typedef TestResults0 Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class TestParams1::Reader { +public: + typedef TestParams1 Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasParam0() const; + inline ::capnp::AnyPointer::Reader getParam0() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class TestParams1::Builder { +public: + typedef TestParams1 Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasParam0(); + inline ::capnp::AnyPointer::Builder getParam0(); + inline ::capnp::AnyPointer::Builder initParam0(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class TestParams1::Pipeline { +public: + typedef TestParams1 Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class TestResults1::Reader { +public: + typedef TestResults1 Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasResult0() const; + inline ::capnp::AnyPointer::Reader getResult0() const; + + inline bool hasResult1() const; + inline ::capnp::AnyPointer::Reader getResult1() const; + + inline bool hasResult2() const; + inline ::capnp::AnyPointer::Reader getResult2() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class TestResults1::Builder { +public: + typedef TestResults1 Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasResult0(); + inline ::capnp::AnyPointer::Builder getResult0(); + inline ::capnp::AnyPointer::Builder initResult0(); + + inline bool hasResult1(); + inline ::capnp::AnyPointer::Builder getResult1(); + inline ::capnp::AnyPointer::Builder initResult1(); + + inline bool hasResult2(); + inline ::capnp::AnyPointer::Builder getResult2(); + inline ::capnp::AnyPointer::Builder initResult2(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class TestResults1::Pipeline { +public: + typedef TestResults1 Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Struct0::Reader { +public: + typedef Struct0 Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getF0() const; + + inline ::uint16_t getF1() const; + + inline ::int16_t getF2() const; + + inline ::uint32_t getF3() const; + + inline ::int32_t getF4() const; + + inline ::uint64_t getF5() const; + + inline ::int64_t getF6() const; + + inline float getF7() const; + + inline double getF8() const; + + inline bool hasF9() const; + inline ::capnp::Text::Reader getF9() const; + + inline bool hasF10() const; + inline ::capnp::Data::Reader getF10() const; + + inline bool hasF11() const; + inline ::capnp::AnyPointer::Reader getF11() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Struct0::Builder { +public: + typedef Struct0 Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getF0(); + inline void setF0(bool value); + + inline ::uint16_t getF1(); + inline void setF1( ::uint16_t value); + + inline ::int16_t getF2(); + inline void setF2( ::int16_t value); + + inline ::uint32_t getF3(); + inline void setF3( ::uint32_t value); + + inline ::int32_t getF4(); + inline void setF4( ::int32_t value); + + inline ::uint64_t getF5(); + inline void setF5( ::uint64_t value); + + inline ::int64_t getF6(); + inline void setF6( ::int64_t value); + + inline float getF7(); + inline void setF7(float value); + + inline double getF8(); + inline void setF8(double value); + + inline bool hasF9(); + inline ::capnp::Text::Builder getF9(); + inline void setF9( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initF9(unsigned int size); + inline void adoptF9(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownF9(); + + inline bool hasF10(); + inline ::capnp::Data::Builder getF10(); + inline void setF10( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initF10(unsigned int size); + inline void adoptF10(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownF10(); + + inline bool hasF11(); + inline ::capnp::AnyPointer::Builder getF11(); + inline ::capnp::AnyPointer::Builder initF11(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Struct0::Pipeline { +public: + typedef Struct0 Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +#if !CAPNP_LITE +class Iface0::Client + : public virtual ::capnp::Capability::Client { +public: + typedef Iface0 Calls; + typedef Iface0 Reads; + + Client(decltype(nullptr)); + explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); + template ()>> + Client(::kj::Own<_t>&& server); + template ()>> + Client(::kj::Promise<_t>&& promise); + Client(::kj::Exception&& exception); + Client(Client&) = default; + Client(Client&&) = default; + Client& operator=(Client& other); + Client& operator=(Client&& other); + + +protected: + Client() = default; +}; + +class Iface0::Server + : public virtual ::capnp::Capability::Server { +public: + typedef Iface0 Serves; + + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) + override; + +protected: + + inline ::Iface0::Client thisCap() { + return ::capnp::Capability::Server::thisCap() + .template castAs< ::Iface0>(); + } + + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); +}; +#endif // !CAPNP_LITE + +class Struct2::Reader { +public: + typedef Struct2 Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasF0() const; + inline ::capnp::AnyPointer::Reader getF0() const; + + inline bool hasF1i() const; +#if !CAPNP_LITE + inline ::Iface0::Client getF1i() const; +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Struct2::Builder { +public: + typedef Struct2 Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasF0(); + inline ::capnp::AnyPointer::Builder getF0(); + inline ::capnp::AnyPointer::Builder initF0(); + + inline bool hasF1i(); +#if !CAPNP_LITE + inline ::Iface0::Client getF1i(); + inline void setF1i( ::Iface0::Client&& value); + inline void setF1i( ::Iface0::Client& value); + inline void adoptF1i(::capnp::Orphan< ::Iface0>&& value); + inline ::capnp::Orphan< ::Iface0> disownF1i(); +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Struct2::Pipeline { +public: + typedef Struct2 Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::Iface0::Client getF1i(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +#if !CAPNP_LITE +class Iface1::Client + : public virtual ::capnp::Capability::Client { +public: + typedef Iface1 Calls; + typedef Iface1 Reads; + + Client(decltype(nullptr)); + explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); + template ()>> + Client(::kj::Own<_t>&& server); + template ()>> + Client(::kj::Promise<_t>&& promise); + Client(::kj::Exception&& exception); + Client(Client&) = default; + Client(Client&&) = default; + Client& operator=(Client& other); + Client& operator=(Client&& other); + + ::capnp::Request< ::Iface1::Method0Params, ::Iface1::Method0Results> method0Request( + ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); + ::capnp::Request< ::Iface1::Method1Params, ::Iface1::Method1Results> method1Request( + ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); + +protected: + Client() = default; +}; + +class Iface1::Server + : public virtual ::capnp::Capability::Server { +public: + typedef Iface1 Serves; + + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) + override; + +protected: + typedef ::Iface1::Method0Params Method0Params; + typedef ::Iface1::Method0Results Method0Results; + typedef ::capnp::CallContext Method0Context; + virtual ::kj::Promise method0(Method0Context context); + typedef ::Iface1::Method1Params Method1Params; + typedef ::Iface1::Method1Results Method1Results; + typedef ::capnp::CallContext Method1Context; + virtual ::kj::Promise method1(Method1Context context); + + inline ::Iface1::Client thisCap() { + return ::capnp::Capability::Server::thisCap() + .template castAs< ::Iface1>(); + } + + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); +}; +#endif // !CAPNP_LITE + +class Iface1::Struct1::Reader { +public: + typedef Struct1 Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool getF0() const; + + inline ::uint16_t getF1() const; + + inline ::int16_t getF2() const; + + inline ::uint32_t getF3() const; + + inline ::int32_t getF4() const; + + inline ::uint64_t getF5() const; + + inline ::int64_t getF6() const; + + inline float getF7() const; + + inline double getF8() const; + + inline bool hasF9() const; + inline ::capnp::Text::Reader getF9() const; + + inline bool hasF10() const; + inline ::capnp::Data::Reader getF10() const; + + inline bool hasF11() const; + inline ::capnp::AnyPointer::Reader getF11() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Iface1::Struct1::Builder { +public: + typedef Struct1 Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool getF0(); + inline void setF0(bool value); + + inline ::uint16_t getF1(); + inline void setF1( ::uint16_t value); + + inline ::int16_t getF2(); + inline void setF2( ::int16_t value); + + inline ::uint32_t getF3(); + inline void setF3( ::uint32_t value); + + inline ::int32_t getF4(); + inline void setF4( ::int32_t value); + + inline ::uint64_t getF5(); + inline void setF5( ::uint64_t value); + + inline ::int64_t getF6(); + inline void setF6( ::int64_t value); + + inline float getF7(); + inline void setF7(float value); + + inline double getF8(); + inline void setF8(double value); + + inline bool hasF9(); + inline ::capnp::Text::Builder getF9(); + inline void setF9( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initF9(unsigned int size); + inline void adoptF9(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownF9(); + + inline bool hasF10(); + inline ::capnp::Data::Builder getF10(); + inline void setF10( ::capnp::Data::Reader value); + inline ::capnp::Data::Builder initF10(unsigned int size); + inline void adoptF10(::capnp::Orphan< ::capnp::Data>&& value); + inline ::capnp::Orphan< ::capnp::Data> disownF10(); + + inline bool hasF11(); + inline ::capnp::AnyPointer::Builder getF11(); + inline ::capnp::AnyPointer::Builder initF11(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Iface1::Struct1::Pipeline { +public: + typedef Struct1 Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Iface1::Method0Params::Reader { +public: + typedef Method0Params Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Iface1::Method0Params::Builder { +public: + typedef Method0Params Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Iface1::Method0Params::Pipeline { +public: + typedef Method0Params Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Iface1::Method0Results::Reader { +public: + typedef Method0Results Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasResult0() const; + inline ::Struct0::Reader getResult0() const; + + inline bool hasResult1() const; + inline ::Iface1::Struct1::Reader getResult1() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Iface1::Method0Results::Builder { +public: + typedef Method0Results Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasResult0(); + inline ::Struct0::Builder getResult0(); + inline void setResult0( ::Struct0::Reader value); + inline ::Struct0::Builder initResult0(); + inline void adoptResult0(::capnp::Orphan< ::Struct0>&& value); + inline ::capnp::Orphan< ::Struct0> disownResult0(); + + inline bool hasResult1(); + inline ::Iface1::Struct1::Builder getResult1(); + inline void setResult1( ::Iface1::Struct1::Reader value); + inline ::Iface1::Struct1::Builder initResult1(); + inline void adoptResult1(::capnp::Orphan< ::Iface1::Struct1>&& value); + inline ::capnp::Orphan< ::Iface1::Struct1> disownResult1(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Iface1::Method0Results::Pipeline { +public: + typedef Method0Results Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::Struct0::Pipeline getResult0(); + inline ::Iface1::Struct1::Pipeline getResult1(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Iface1::Method1Params::Reader { +public: + typedef Method1Params Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Iface1::Method1Params::Builder { +public: + typedef Method1Params Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Iface1::Method1Params::Pipeline { +public: + typedef Method1Params Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Iface1::Method1Results::Reader { +public: + typedef Method1Results Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasResult0() const; +#if !CAPNP_LITE + inline ::Iface0::Client getResult0() const; +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Iface1::Method1Results::Builder { +public: + typedef Method1Results Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasResult0(); +#if !CAPNP_LITE + inline ::Iface0::Client getResult0(); + inline void setResult0( ::Iface0::Client&& value); + inline void setResult0( ::Iface0::Client& value); + inline void adoptResult0(::capnp::Orphan< ::Iface0>&& value); + inline ::capnp::Orphan< ::Iface0> disownResult0(); +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Iface1::Method1Results::Pipeline { +public: + typedef Method1Results Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::Iface0::Client getResult0(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +// ======================================================================================= + +inline ::int32_t TestParams0::Reader::getParam0() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t TestParams0::Builder::getParam0() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void TestParams0::Builder::setParam0( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t TestResults0::Reader::getResult0() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::int32_t TestResults0::Builder::getResult0() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void TestResults0::Builder::setResult0( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline bool TestParams1::Reader::hasParam0() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool TestParams1::Builder::hasParam0() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::AnyPointer::Reader TestParams1::Reader::getParam0() const { + return ::capnp::AnyPointer::Reader(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder TestParams1::Builder::getParam0() { + return ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder TestParams1::Builder::initParam0() { + auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); + result.clear(); + return result; +} + +inline bool TestResults1::Reader::hasResult0() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool TestResults1::Builder::hasResult0() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::AnyPointer::Reader TestResults1::Reader::getResult0() const { + return ::capnp::AnyPointer::Reader(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder TestResults1::Builder::getResult0() { + return ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder TestResults1::Builder::initResult0() { + auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); + result.clear(); + return result; +} + +inline bool TestResults1::Reader::hasResult1() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool TestResults1::Builder::hasResult1() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::AnyPointer::Reader TestResults1::Reader::getResult1() const { + return ::capnp::AnyPointer::Reader(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder TestResults1::Builder::getResult1() { + return ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder TestResults1::Builder::initResult1() { + auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); + result.clear(); + return result; +} + +inline bool TestResults1::Reader::hasResult2() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool TestResults1::Builder::hasResult2() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::AnyPointer::Reader TestResults1::Reader::getResult2() const { + return ::capnp::AnyPointer::Reader(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder TestResults1::Builder::getResult2() { + return ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder TestResults1::Builder::initResult2() { + auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); + result.clear(); + return result; +} + +inline bool Struct0::Reader::getF0() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool Struct0::Builder::getF0() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void Struct0::Builder::setF0(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t Struct0::Reader::getF1() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t Struct0::Builder::getF1() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void Struct0::Builder::setF1( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int16_t Struct0::Reader::getF2() const { + return _reader.getDataField< ::int16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int16_t Struct0::Builder::getF2() { + return _builder.getDataField< ::int16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void Struct0::Builder::setF2( ::int16_t value) { + _builder.setDataField< ::int16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t Struct0::Reader::getF3() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t Struct0::Builder::getF3() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void Struct0::Builder::setF3( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t Struct0::Reader::getF4() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::int32_t Struct0::Builder::getF4() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void Struct0::Builder::setF4( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t Struct0::Reader::getF5() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t Struct0::Builder::getF5() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void Struct0::Builder::setF5( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t Struct0::Reader::getF6() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::int64_t Struct0::Builder::getF6() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void Struct0::Builder::setF6( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float Struct0::Reader::getF7() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float Struct0::Builder::getF7() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void Struct0::Builder::setF7(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline double Struct0::Reader::getF8() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline double Struct0::Builder::getF8() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void Struct0::Builder::setF8(double value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool Struct0::Reader::hasF9() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Struct0::Builder::hasF9() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader Struct0::Reader::getF9() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder Struct0::Builder::getF9() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Struct0::Builder::setF9( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder Struct0::Builder::initF9(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Struct0::Builder::adoptF9( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> Struct0::Builder::disownF9() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Struct0::Reader::hasF10() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool Struct0::Builder::hasF10() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader Struct0::Reader::getF10() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder Struct0::Builder::getF10() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void Struct0::Builder::setF10( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder Struct0::Builder::initF10(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void Struct0::Builder::adoptF10( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> Struct0::Builder::disownF10() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool Struct0::Reader::hasF11() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool Struct0::Builder::hasF11() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::AnyPointer::Reader Struct0::Reader::getF11() const { + return ::capnp::AnyPointer::Reader(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder Struct0::Builder::getF11() { + return ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder Struct0::Builder::initF11() { + auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); + result.clear(); + return result; +} + +#if !CAPNP_LITE +inline Iface0::Client::Client(decltype(nullptr)) + : ::capnp::Capability::Client(nullptr) {} +inline Iface0::Client::Client( + ::kj::Own< ::capnp::ClientHook>&& hook) + : ::capnp::Capability::Client(::kj::mv(hook)) {} +template +inline Iface0::Client::Client(::kj::Own<_t>&& server) + : ::capnp::Capability::Client(::kj::mv(server)) {} +template +inline Iface0::Client::Client(::kj::Promise<_t>&& promise) + : ::capnp::Capability::Client(::kj::mv(promise)) {} +inline Iface0::Client::Client(::kj::Exception&& exception) + : ::capnp::Capability::Client(::kj::mv(exception)) {} +inline ::Iface0::Client& Iface0::Client::operator=(Client& other) { + ::capnp::Capability::Client::operator=(other); + return *this; +} +inline ::Iface0::Client& Iface0::Client::operator=(Client&& other) { + ::capnp::Capability::Client::operator=(kj::mv(other)); + return *this; +} + +#endif // !CAPNP_LITE +inline bool Struct2::Reader::hasF0() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Struct2::Builder::hasF0() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::AnyPointer::Reader Struct2::Reader::getF0() const { + return ::capnp::AnyPointer::Reader(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder Struct2::Builder::getF0() { + return ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder Struct2::Builder::initF0() { + auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); + result.clear(); + return result; +} + +inline bool Struct2::Reader::hasF1i() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool Struct2::Builder::hasF1i() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +#if !CAPNP_LITE +inline ::Iface0::Client Struct2::Reader::getF1i() const { + return ::capnp::_::PointerHelpers< ::Iface0>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::Iface0::Client Struct2::Builder::getF1i() { + return ::capnp::_::PointerHelpers< ::Iface0>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::Iface0::Client Struct2::Pipeline::getF1i() { + return ::Iface0::Client(_typeless.getPointerField(1).asCap()); +} +inline void Struct2::Builder::setF1i( ::Iface0::Client&& cap) { + ::capnp::_::PointerHelpers< ::Iface0>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(cap)); +} +inline void Struct2::Builder::setF1i( ::Iface0::Client& cap) { + ::capnp::_::PointerHelpers< ::Iface0>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), cap); +} +inline void Struct2::Builder::adoptF1i( + ::capnp::Orphan< ::Iface0>&& value) { + ::capnp::_::PointerHelpers< ::Iface0>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::Iface0> Struct2::Builder::disownF1i() { + return ::capnp::_::PointerHelpers< ::Iface0>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#endif // !CAPNP_LITE + +#if !CAPNP_LITE +inline Iface1::Client::Client(decltype(nullptr)) + : ::capnp::Capability::Client(nullptr) {} +inline Iface1::Client::Client( + ::kj::Own< ::capnp::ClientHook>&& hook) + : ::capnp::Capability::Client(::kj::mv(hook)) {} +template +inline Iface1::Client::Client(::kj::Own<_t>&& server) + : ::capnp::Capability::Client(::kj::mv(server)) {} +template +inline Iface1::Client::Client(::kj::Promise<_t>&& promise) + : ::capnp::Capability::Client(::kj::mv(promise)) {} +inline Iface1::Client::Client(::kj::Exception&& exception) + : ::capnp::Capability::Client(::kj::mv(exception)) {} +inline ::Iface1::Client& Iface1::Client::operator=(Client& other) { + ::capnp::Capability::Client::operator=(other); + return *this; +} +inline ::Iface1::Client& Iface1::Client::operator=(Client&& other) { + ::capnp::Capability::Client::operator=(kj::mv(other)); + return *this; +} + +#endif // !CAPNP_LITE +inline bool Iface1::Struct1::Reader::getF0() const { + return _reader.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline bool Iface1::Struct1::Builder::getF0() { + return _builder.getDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void Iface1::Struct1::Builder::setF0(bool value) { + _builder.setDataField( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + +inline ::uint16_t Iface1::Struct1::Reader::getF1() const { + return _reader.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} + +inline ::uint16_t Iface1::Struct1::Builder::getF1() { + return _builder.getDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS); +} +inline void Iface1::Struct1::Builder::setF1( ::uint16_t value) { + _builder.setDataField< ::uint16_t>( + ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); +} + +inline ::int16_t Iface1::Struct1::Reader::getF2() const { + return _reader.getDataField< ::int16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::int16_t Iface1::Struct1::Builder::getF2() { + return _builder.getDataField< ::int16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void Iface1::Struct1::Builder::setF2( ::int16_t value) { + _builder.setDataField< ::int16_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::uint32_t Iface1::Struct1::Reader::getF3() const { + return _reader.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint32_t Iface1::Struct1::Builder::getF3() { + return _builder.getDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void Iface1::Struct1::Builder::setF3( ::uint32_t value) { + _builder.setDataField< ::uint32_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int32_t Iface1::Struct1::Reader::getF4() const { + return _reader.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::int32_t Iface1::Struct1::Builder::getF4() { + return _builder.getDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void Iface1::Struct1::Builder::setF4( ::int32_t value) { + _builder.setDataField< ::int32_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline ::uint64_t Iface1::Struct1::Reader::getF5() const { + return _reader.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} + +inline ::uint64_t Iface1::Struct1::Builder::getF5() { + return _builder.getDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS); +} +inline void Iface1::Struct1::Builder::setF5( ::uint64_t value) { + _builder.setDataField< ::uint64_t>( + ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); +} + +inline ::int64_t Iface1::Struct1::Reader::getF6() const { + return _reader.getDataField< ::int64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} + +inline ::int64_t Iface1::Struct1::Builder::getF6() { + return _builder.getDataField< ::int64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS); +} +inline void Iface1::Struct1::Builder::setF6( ::int64_t value) { + _builder.setDataField< ::int64_t>( + ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); +} + +inline float Iface1::Struct1::Reader::getF7() const { + return _reader.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} + +inline float Iface1::Struct1::Builder::getF7() { + return _builder.getDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS); +} +inline void Iface1::Struct1::Builder::setF7(float value) { + _builder.setDataField( + ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); +} + +inline double Iface1::Struct1::Reader::getF8() const { + return _reader.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} + +inline double Iface1::Struct1::Builder::getF8() { + return _builder.getDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS); +} +inline void Iface1::Struct1::Builder::setF8(double value) { + _builder.setDataField( + ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); +} + +inline bool Iface1::Struct1::Reader::hasF9() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Iface1::Struct1::Builder::hasF9() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader Iface1::Struct1::Reader::getF9() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder Iface1::Struct1::Builder::getF9() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Iface1::Struct1::Builder::setF9( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder Iface1::Struct1::Builder::initF9(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), size); +} +inline void Iface1::Struct1::Builder::adoptF9( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> Iface1::Struct1::Builder::disownF9() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Iface1::Struct1::Reader::hasF10() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool Iface1::Struct1::Builder::hasF10() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Data::Reader Iface1::Struct1::Reader::getF10() const { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::capnp::Data::Builder Iface1::Struct1::Builder::getF10() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void Iface1::Struct1::Builder::setF10( ::capnp::Data::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::capnp::Data::Builder Iface1::Struct1::Builder::initF10(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), size); +} +inline void Iface1::Struct1::Builder::adoptF10( + ::capnp::Orphan< ::capnp::Data>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Data> Iface1::Struct1::Builder::disownF10() { + return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool Iface1::Struct1::Reader::hasF11() const { + return !_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline bool Iface1::Struct1::Builder::hasF11() { + return !_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::AnyPointer::Reader Iface1::Struct1::Reader::getF11() const { + return ::capnp::AnyPointer::Reader(_reader.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder Iface1::Struct1::Builder::getF11() { + return ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); +} +inline ::capnp::AnyPointer::Builder Iface1::Struct1::Builder::initF11() { + auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( + ::capnp::bounded<2>() * ::capnp::POINTERS)); + result.clear(); + return result; +} + +inline bool Iface1::Method0Results::Reader::hasResult0() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Iface1::Method0Results::Builder::hasResult0() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::Struct0::Reader Iface1::Method0Results::Reader::getResult0() const { + return ::capnp::_::PointerHelpers< ::Struct0>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::Struct0::Builder Iface1::Method0Results::Builder::getResult0() { + return ::capnp::_::PointerHelpers< ::Struct0>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::Struct0::Pipeline Iface1::Method0Results::Pipeline::getResult0() { + return ::Struct0::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void Iface1::Method0Results::Builder::setResult0( ::Struct0::Reader value) { + ::capnp::_::PointerHelpers< ::Struct0>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::Struct0::Builder Iface1::Method0Results::Builder::initResult0() { + return ::capnp::_::PointerHelpers< ::Struct0>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Iface1::Method0Results::Builder::adoptResult0( + ::capnp::Orphan< ::Struct0>&& value) { + ::capnp::_::PointerHelpers< ::Struct0>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::Struct0> Iface1::Method0Results::Builder::disownResult0() { + return ::capnp::_::PointerHelpers< ::Struct0>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + +inline bool Iface1::Method0Results::Reader::hasResult1() const { + return !_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline bool Iface1::Method0Results::Builder::hasResult1() { + return !_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); +} +inline ::Iface1::Struct1::Reader Iface1::Method0Results::Reader::getResult1() const { + return ::capnp::_::PointerHelpers< ::Iface1::Struct1>::get(_reader.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline ::Iface1::Struct1::Builder Iface1::Method0Results::Builder::getResult1() { + return ::capnp::_::PointerHelpers< ::Iface1::Struct1>::get(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::Iface1::Struct1::Pipeline Iface1::Method0Results::Pipeline::getResult1() { + return ::Iface1::Struct1::Pipeline(_typeless.getPointerField(1)); +} +#endif // !CAPNP_LITE +inline void Iface1::Method0Results::Builder::setResult1( ::Iface1::Struct1::Reader value) { + ::capnp::_::PointerHelpers< ::Iface1::Struct1>::set(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), value); +} +inline ::Iface1::Struct1::Builder Iface1::Method0Results::Builder::initResult1() { + return ::capnp::_::PointerHelpers< ::Iface1::Struct1>::init(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} +inline void Iface1::Method0Results::Builder::adoptResult1( + ::capnp::Orphan< ::Iface1::Struct1>&& value) { + ::capnp::_::PointerHelpers< ::Iface1::Struct1>::adopt(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::Iface1::Struct1> Iface1::Method0Results::Builder::disownResult1() { + return ::capnp::_::PointerHelpers< ::Iface1::Struct1>::disown(_builder.getPointerField( + ::capnp::bounded<1>() * ::capnp::POINTERS)); +} + +inline bool Iface1::Method1Results::Reader::hasResult0() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Iface1::Method1Results::Builder::hasResult0() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +#if !CAPNP_LITE +inline ::Iface0::Client Iface1::Method1Results::Reader::getResult0() const { + return ::capnp::_::PointerHelpers< ::Iface0>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::Iface0::Client Iface1::Method1Results::Builder::getResult0() { + return ::capnp::_::PointerHelpers< ::Iface0>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::Iface0::Client Iface1::Method1Results::Pipeline::getResult0() { + return ::Iface0::Client(_typeless.getPointerField(0).asCap()); +} +inline void Iface1::Method1Results::Builder::setResult0( ::Iface0::Client&& cap) { + ::capnp::_::PointerHelpers< ::Iface0>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(cap)); +} +inline void Iface1::Method1Results::Builder::setResult0( ::Iface0::Client& cap) { + ::capnp::_::PointerHelpers< ::Iface0>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), cap); +} +inline void Iface1::Method1Results::Builder::adoptResult0( + ::capnp::Orphan< ::Iface0>&& value) { + ::capnp::_::PointerHelpers< ::Iface0>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::Iface0> Iface1::Method1Results::Builder::disownResult0() { + return ::capnp::_::PointerHelpers< ::Iface0>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#endif // !CAPNP_LITE + + From b94f2d6c8ce1b8c4b347805237452bf0560b0341 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 6 Oct 2020 17:44:54 +0100 Subject: [PATCH 038/246] prep for generated code --- .../main/java/org/capnproto/AnyPointer.java | 9 ++- .../java/org/capnproto/CapTableReader.java | 2 +- .../main/java/org/capnproto/Capability.java | 73 ++++++++----------- .../org/capnproto/DispatchCallResult.java | 26 +++++++ 4 files changed, 66 insertions(+), 44 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/DispatchCallResult.java diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 9e5d6c91..1fb76f65 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -69,7 +69,7 @@ public final T getAs(FromPointerReader factory) { return factory.fromPointerReader(this.segment, this.capTable, this.pointer, this.nestingLimit); } - public final Capability.Client getAsCapability() { + public final Capability.Client getAsCap() { return new Capability.Client( WireHelpers.readCapabilityPointer(this.segment, capTable, this.pointer, 0)); } @@ -129,7 +129,12 @@ public final void setAs(SetPointerBuilder factory, U reader) { factory.setPointerBuilder(this.segment, this.capTable, this.pointer, reader); } - public final void setAsCapability(Capability.Client cap) { + public final Capability.Client getAsCap() { + return new Capability.Client( + WireHelpers.readCapabilityPointer(this.segment, capTable, this.pointer, 0)); + } + + public final void setAsCap(Capability.Client cap) { WireHelpers.setCapabilityPointer(this.segment, capTable, this.pointer, cap.hook); } diff --git a/runtime/src/main/java/org/capnproto/CapTableReader.java b/runtime/src/main/java/org/capnproto/CapTableReader.java index 0b9ddd56..e8f5be5e 100644 --- a/runtime/src/main/java/org/capnproto/CapTableReader.java +++ b/runtime/src/main/java/org/capnproto/CapTableReader.java @@ -1,5 +1,5 @@ package org.capnproto; -interface CapTableReader { +public interface CapTableReader { ClientHook extractCap(int index); } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 7762809c..3087bda8 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -4,11 +4,11 @@ public final class Capability { - static abstract class BuilderContext { + public static abstract class BuilderContext { CapTableBuilder capTable; } - static class ReaderContext { + public static class ReaderContext { CapTableReader capTable; } @@ -36,6 +36,10 @@ public Client(Throwable exc) { this(newBrokenCap(exc)); } + public ClientHook getHook() { + return this.hook; + } + private static ClientHook makeLocalClient(Server server) { return server.makeLocalClient(); } @@ -127,12 +131,12 @@ CompletableFuture callInternal(long interfaceId, short methodId, CallContextH interfaceId, methodId, new CallContext<>(AnyPointer.factory, AnyPointer.factory, context)); - if (result.streaming) { + if (result.isStreaming()) { // TODO streaming return null; } else { - return result.promise; + return result.getPromise(); } } @@ -147,34 +151,6 @@ void startResolveTask() { } } - public static final class DispatchCallResult { - private final CompletableFuture promise; - private final boolean streaming; - - public DispatchCallResult(CompletableFuture promise) { - this.promise = promise; - this.streaming = false; - } - - DispatchCallResult(Throwable exc) { - this.promise = CompletableFuture.failedFuture(exc); - this.streaming = false; - } - - DispatchCallResult(CompletableFuture promise, boolean isStreaming) { - this.promise = promise; - this.streaming = isStreaming; - } - - public CompletableFuture getPromise() { - return promise; - } - - public boolean isStreaming() { - return streaming; - } - } - public CompletableFuture shortenPath() { return null; } @@ -183,28 +159,43 @@ protected Client thisCap() { return new Client(this.hook); } - protected final CallContext internalGetTypedContext( + protected static CallContext typedContext( FromPointerReader paramsFactory, FromPointerBuilder resultsFactory, CallContext typeless) { return new CallContext<>(paramsFactory, resultsFactory, typeless.hook); } - public abstract DispatchCallResult dispatchCall(long interfaceId, short methodId, - CallContext context); + protected abstract DispatchCallResult dispatchCall( + long interfaceId, short methodId, + CallContext context); + + protected static DispatchCallResult streamResult(CompletableFuture result) { + // For streaming calls, we need to add an evalNow() here so that exceptions thrown + // directly from the call can propagate to later calls. If we don't capture the + // exception properly then the caller will never find out that this is a streaming + // call (indicated by the boolean in the return value) so won't know to propagate + // the exception. + // TODO the above comment... + return new DispatchCallResult(result, true); + } + + protected static DispatchCallResult result(CompletableFuture result) { + return new DispatchCallResult(result, false); + } - protected DispatchCallResult internalUnimplemented(String actualInterfaceName, long requestedTypeId) { - return new DispatchCallResult(RpcException.unimplemented( + protected static CompletableFuture internalUnimplemented(String actualInterfaceName, long requestedTypeId) { + return CompletableFuture.failedFuture(RpcException.unimplemented( "Method not implemented. " + actualInterfaceName + " " + requestedTypeId)); } - protected DispatchCallResult internalUnimplemented(String interfaceName, long typeId, short methodId) { - return new DispatchCallResult(RpcException.unimplemented( + protected static CompletableFuture internalUnimplemented(String interfaceName, long typeId, short methodId) { + return CompletableFuture.failedFuture(RpcException.unimplemented( "Method not implemented. " + interfaceName + " " + typeId + " " + methodId)); } - protected DispatchCallResult internalUnimplemented(String interfaceName, String methodName, long typeId, short methodId) { - return new DispatchCallResult(RpcException.unimplemented( + protected static CompletableFuture internalUnimplemented(String interfaceName, String methodName, long typeId, short methodId) { + return CompletableFuture.failedFuture(RpcException.unimplemented( "Method not implemented. " + interfaceName + " " + typeId + " " + methodName + " " + methodId)); } } diff --git a/runtime/src/main/java/org/capnproto/DispatchCallResult.java b/runtime/src/main/java/org/capnproto/DispatchCallResult.java new file mode 100644 index 00000000..de3fb4d3 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/DispatchCallResult.java @@ -0,0 +1,26 @@ +package org.capnproto; + +import java.util.concurrent.CompletableFuture; + +public final class DispatchCallResult { + + private final CompletableFuture promise; + private final boolean streaming; + + public DispatchCallResult(CompletableFuture promise, boolean isStreaming) { + this.promise = promise; + this.streaming = isStreaming; + } + + public DispatchCallResult(Throwable exc) { + this(CompletableFuture.failedFuture(exc), false); + } + + public CompletableFuture getPromise() { + return promise; + } + + public boolean isStreaming() { + return streaming; + } +} From 3b0e3f37a0d67ed2a4dbbe9eca76580d8a60755e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 6 Oct 2020 18:26:50 +0100 Subject: [PATCH 039/246] generate (non-generic) interfaces and capability accessors --- compiler/src/main/cpp/capnpc-java.c++ | 192 +++++++++++++++++++++++++- 1 file changed, 189 insertions(+), 3 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 86d558be..e1ea8d08 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -199,6 +199,10 @@ private: bool hasInterfaces = false; kj::StringTree javaFullName(Schema schema) { + return javaFullName(schema, nullptr); + } + + kj::StringTree javaFullName(Schema schema, kj::Maybe method) { auto node = schema.getProto(); if (node.getScopeId() == 0) { usedImports.insert(node.getId()); @@ -1022,8 +1026,41 @@ private: }; } else if (kind == FieldKind::INTERFACE) { - KJ_FAIL_REQUIRE("interfaces unimplemented"); + auto factoryArg = makeFactoryArg(schema::Type::ANY_POINTER); + auto capType = typeName(field.getType(), kj::str("Client")).flatten(); + + return FieldText { + kj::strTree( + kj::mv(unionDiscrim.readerIsDef), + spaces(indent), " public boolean has", titleCase, "() {\n", + unionDiscrim.has, + spaces(indent), " return !_pointerFieldIsNull(", offset, ");\n", + spaces(indent), " }\n", + + spaces(indent), " public ", capType, " get", titleCase, "() {\n", + unionDiscrim.check, + spaces(indent), " return new ", capType, "(_getPointerField(", factoryArg, ", ", offset, ").getAsCap());\n", + spaces(indent), " }\n"), + + kj::strTree( + kj::mv(unionDiscrim.builderIsDef), + spaces(indent), " public final boolean has", titleCase, "() {\n", + spaces(indent), " return !_pointerFieldIsNull(", offset, ");\n", + spaces(indent), " }\n", + + spaces(indent), " public ", capType, " get", titleCase, "() {\n", + unionDiscrim.check, + spaces(indent), " return new ", capType, "(\n", + spaces(indent), " _getPointerField(", factoryArg, ", ", offset, ").getAsCap());\n", + spaces(indent), " }\n", + + spaces(indent), " public void set", titleCase, "(", capType, " value) {\n", + unionDiscrim.set, + spaces(indent), " _initPointerField(", factoryArg, ", ", offset, ", 0).setAsCap(value);\n", + spaces(indent), " }\n", + "\n") + }; } else if (kind == FieldKind::ANY_POINTER) { auto factoryArg = makeFactoryArg(field.getType()); @@ -1535,7 +1572,130 @@ private: kj::strTree() }; } + // ----------------------------------------------------------------- + struct InterfaceText { + kj::StringTree outerTypeDef; + kj::StringTree clientServerDefs; + }; + + InterfaceText makeInterfaceText(kj::StringPtr scope, kj::StringPtr name, InterfaceSchema schema, + kj::Array nestedTypeDecls, int indent) { + auto fullName = kj::str(scope, name); + auto methods = KJ_MAP(m, schema.getMethods()) { + return makeMethodText(fullName, m); + }; + + auto proto = schema.getProto(); + auto hexId = kj::hex(proto.getId()); + + auto typeName = javaFullName(schema); + + return InterfaceText { + kj::strTree( + spaces(indent), "public static class ", name, "{\n", + spaces(indent), "\n", + spaces(indent), " public static class Client extends org.capnproto.Capability.Client {\n", + spaces(indent), " public Client() {}\n", + spaces(indent), " public Client(org.capnproto.ClientHook hook) { super(hook); }\n", + spaces(indent), " public Client(org.capnproto.Capability.Client cap) { super(cap.getHook()); }\n", + spaces(indent), " public Client(Server server) { super(server); }\n", + spaces(indent), " public Client(java.util.concurrent.CompletableFuture promise) {\n", + spaces(indent), " super(promise);\n", + spaces(indent), " }\n", + spaces(indent), " }\n", + spaces(indent), " public static abstract class Server extends org.capnproto.Capability.Server {\n", + spaces(indent), " protected org.capnproto.DispatchCallResult dispatchCall(\n", + spaces(indent), " long interfaceId, short methodId,\n", + spaces(indent), " org.capnproto.CallContext context) {\n", + spaces(indent), " if (interfaceId == 0x", hexId, "L) {\n", + spaces(indent), " return dispatchCallInternal(methodId, context);\n", + spaces(indent), " }\n", + spaces(indent), " return org.capnproto.Capability.Server.result(\n", + spaces(indent), " org.capnproto.Capability.Server.internalUnimplemented(\"", name, "\", interfaceId));\n", + spaces(indent), " }\n", + spaces(indent), "\n", + spaces(indent), " protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) {\n", + spaces(indent), " switch (methodId) {\n", + KJ_MAP(m, methods) { return kj::mv(m.dispatchCase); }, + spaces(indent), " default:\n", + spaces(indent), " return org.capnproto.Capability.Server.result(\n", + spaces(indent), " org.capnproto.Capability.Server.internalUnimplemented(\"", name, "\", 0x", hexId, "L, methodId));\n", + spaces(indent), " }\n", + spaces(indent), " }\n\n", + KJ_MAP(m, methods) { return kj::mv(m.sourceDefs); }, + spaces(indent), " }\n", + spaces(indent), "\n", + KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, + spaces(indent), "\n", + spaces(indent), "}\n", + spaces(indent), "\n") + }; + } + + // ----------------------------------------------------------------- + + struct MethodText { + kj::StringTree sourceDefs; + kj::StringTree dispatchCase; + }; + + MethodText makeMethodText(kj::StringPtr interfaceName, InterfaceSchema::Method method) { + auto proto = method.getProto(); + auto name = proto.getName(); + auto titleCase = toTitleCase(name); + auto paramSchema = method.getParamType(); + auto resultSchema = method.getResultType(); + auto identifierName = safeIdentifier(name); + + auto paramProto = paramSchema.getProto(); + auto resultProto = resultSchema.getProto(); + + bool isStreaming = method.isStreaming(); + + auto interfaceTypeName = javaFullName(method.getContainingInterface()); + + kj::String paramType = (paramProto.getScopeId() == 0) + ? kj::str(interfaceTypeName, "Params") + : kj::str(javaFullName(paramSchema, method)); + + kj::String resultType = (resultProto.getScopeId() == 0) + ? kj::str(interfaceTypeName, "Results") + : kj::str(javaFullName(resultSchema, method)); + + auto interfaceProto = method.getContainingInterface().getProto(); + uint64_t interfaceId = interfaceProto.getId(); + auto interfaceIdHex = kj::hex(interfaceId); + uint16_t methodId = method.getIndex(); + + auto requestMethodImpl = kj::strTree( + isStreaming ? kj::strTree("org.capnproto.StreamingRequest<", paramType, ">") + : kj::strTree("org.capnproto.Request<", paramType, ", ", resultType, ">"), + name, "Request() {\n", + isStreaming + ? kj::strTree(" return newStreamingCall<", paramType, ">(\n") + : kj::strTree(" return newCall<", paramType, ", ", resultType, ">(\n"), + " 0x", interfaceIdHex, "L, ", methodId, ");\n" + "}\n"); + + return MethodText { + + kj::strTree( + " protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.CallContext<", titleCase, "Params.Reader, ", titleCase, "Results.Builder> context) {\n" + " return org.capnproto.Capability.Server.internalUnimplemented(\n" + " \"", interfaceProto.getDisplayName(), "\", \"", name, "\",\n" + " 0x", interfaceIdHex, "L, (short)", methodId, ");\n" + " }\n\n"), + + kj::strTree( + " case ", methodId, ":\n", + " return org.capnproto.Capability.Server.", + isStreaming ? "streamResult" : "result", "(\n", + " this.", identifierName, "(org.capnproto.Capability.Server.typedContext(\n" + " ", paramType, ".factory,\n", + " ", resultType, ".factory, context)));\n") + }; + } // ----------------------------------------------------------------- @@ -1668,7 +1828,24 @@ private: } } } else if (proto.isInterface()) { - KJ_FAIL_REQUIRE("interfaces not implemented"); + for (auto method: proto.getInterface().getMethods()) { + { + Schema params = schemaLoader.getUnbound(method.getParamStructType()); + auto paramsProto = schemaLoader.getUnbound(method.getParamStructType()).getProto(); + if (paramsProto.getScopeId() == 0) { + nestedTexts.add(makeNodeText(subScope, + toTitleCase(kj::str(method.getName(), "Params")), params, indent + 1)); + } + } + { + Schema results = schemaLoader.getUnbound(method.getResultStructType()); + auto resultsProto = schemaLoader.getUnbound(method.getResultStructType()).getProto(); + if (resultsProto.getScopeId() == 0) { + nestedTexts.add(makeNodeText(subScope, + toTitleCase(kj::str(method.getName(), "Results")), results, indent + 1)); + } + } + } } // Convert the encoded schema to a literal byte array. @@ -1834,7 +2011,16 @@ private: case schema::Node::INTERFACE: { hasInterfaces = true; - KJ_FAIL_REQUIRE("unimplemented"); + auto interfaceText = + makeInterfaceText(scope, name, schema.asInterface(), kj::mv(nestedTypeDecls), indent); + + return NodeTextNoSchema { + kj::mv(interfaceText.outerTypeDef), + kj::mv(interfaceText.clientServerDefs), + kj::strTree(), + kj::strTree(), + kj::strTree() + }; } case schema::Node::CONST: { From 218529deae2855da37beb9151d9962d376188b8d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 7 Oct 2020 17:31:44 +0100 Subject: [PATCH 040/246] add client factory for AnyPointer accessor --- compiler/src/main/cpp/capnpc-java.c++ | 83 ++- .../main/java/org/capnproto/AnyPointer.java | 5 - .../main/java/org/capnproto/Capability.java | 24 + .../main/java/org/capnproto/WireHelpers.java | 2 +- .../main/java/org/capnproto/WirePointer.java | 2 +- .../test/java/org/capnproto/TwoPartyTest.java | 78 +- .../test/java/org/capnproto/demo/Demo.java | 702 ++---------------- .../test/java/org/capnproto/demo/demo.capnp | 24 +- .../java/org/capnproto/demo/demo.capnp.c++ | 371 +-------- .../test/java/org/capnproto/demo/demo.capnp.h | 540 +------------- 10 files changed, 228 insertions(+), 1603 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index e1ea8d08..4a4691c6 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -1027,8 +1027,8 @@ private: } else if (kind == FieldKind::INTERFACE) { - auto factoryArg = makeFactoryArg(schema::Type::ANY_POINTER); - auto capType = typeName(field.getType(), kj::str("Client")).flatten(); + auto factoryArg = kj::str(typeName(field.getType()), ".factory"); + auto capType = kj::str(typeName(field.getType()), ".Client"); return FieldText { kj::strTree( @@ -1040,7 +1040,7 @@ private: spaces(indent), " public ", capType, " get", titleCase, "() {\n", unionDiscrim.check, - spaces(indent), " return new ", capType, "(_getPointerField(", factoryArg, ", ", offset, ").getAsCap());\n", + spaces(indent), " return _getPointerField(", factoryArg, ", ", offset, ");\n", spaces(indent), " }\n"), kj::strTree( @@ -1051,13 +1051,12 @@ private: spaces(indent), " public ", capType, " get", titleCase, "() {\n", unionDiscrim.check, - spaces(indent), " return new ", capType, "(\n", - spaces(indent), " _getPointerField(", factoryArg, ", ", offset, ").getAsCap());\n", + spaces(indent), " return _getPointerField(", factoryArg, ", ", offset, ");\n", spaces(indent), " }\n", spaces(indent), " public void set", titleCase, "(", capType, " value) {\n", unionDiscrim.set, - spaces(indent), " _initPointerField(", factoryArg, ", ", offset, ", 0).setAsCap(value);\n", + spaces(indent), " _initPointerField(", factoryArg, ", ", offset, ", 0);\n", spaces(indent), " }\n", "\n") }; @@ -1593,8 +1592,13 @@ private: return InterfaceText { kj::strTree( - spaces(indent), "public static class ", name, "{\n", - spaces(indent), "\n", + spaces(indent), "public static class ", name, " {\n", + spaces(indent), " public static final class Factory extends org.capnproto.Capability.Factory {\n", + spaces(indent), " public final Client newClient(org.capnproto.ClientHook hook) {\n", + spaces(indent), " return new Client(hook);\n", + spaces(indent), " }\n", + spaces(indent), " }\n", + spaces(indent), " public static final Factory factory = new Factory();\n", spaces(indent), " public static class Client extends org.capnproto.Capability.Client {\n", spaces(indent), " public Client() {}\n", spaces(indent), " public Client(org.capnproto.ClientHook hook) { super(hook); }\n", @@ -1653,15 +1657,62 @@ private: bool isStreaming = method.isStreaming(); + auto implicitParamsReader = proto.getImplicitParameters(); + auto interfaceTypeName = javaFullName(method.getContainingInterface()); + kj::String paramType; + kj::String genericParamType; + + if (paramProto.getScopeId() == 0) { + paramType = kj::str(interfaceTypeName); + if (implicitParamsReader.size() == 0) { + paramType = kj::str(titleCase, "Params"); + genericParamType = kj::str(paramType); + } else { + KJ_FAIL_REQUIRE("Generic interfaces not supported"); + //genericParamType = paramType; + //genericParamType.addMemberTemplate(kj::str(titleCase, "Params"), nullptr); + //paramType.addMemberTemplate(kj::str(titleCase, "Params"), + // kj::heapArray(implicitParams.asPtr())); + } + } else { + paramType = kj::str(javaFullName(paramSchema, method)); + genericParamType = kj::str(javaFullName(paramSchema, nullptr)); + } + + kj::String resultType; + kj::String genericResultType; + if (isStreaming) { + // We don't use resultType or genericResultType in this case. We want to avoid computing them + // at all so that we don't end up marking stream.capnp.h in usedImports. + } else if (resultProto.getScopeId() == 0) { + resultType = kj::str(interfaceTypeName); + if (implicitParamsReader.size() == 0) { + resultType = kj::str(titleCase, "Results"); + genericResultType = kj::str(resultType); + } else { + KJ_FAIL_REQUIRE("Generic interfaces not supported"); + //genericResultType = resultType; + //genericResultType.addMemberTemplate(kj::str(titleCase, "Results"), nullptr); + //resultType.addMemberTemplate(kj::str(titleCase, "Results"), + // kj::heapArray(implicitParams.asPtr())); + } + } else { + resultType = kj::str(javaFullName(resultSchema, method)); + genericResultType = kj::str(javaFullName(resultSchema, nullptr)); + } - kj::String paramType = (paramProto.getScopeId() == 0) - ? kj::str(interfaceTypeName, "Params") - : kj::str(javaFullName(paramSchema, method)); + kj::String shortParamType = paramProto.getScopeId() == 0 ? + kj::str(titleCase, "Params") : kj::str(genericParamType); + kj::String shortResultType = resultProto.getScopeId() == 0 || isStreaming ? + kj::str(titleCase, "Results") : kj::str(genericResultType); - kj::String resultType = (resultProto.getScopeId() == 0) - ? kj::str(interfaceTypeName, "Results") - : kj::str(javaFullName(resultSchema, method)); + if (paramProto.getScopeId() == 0) { + paramType = kj::str(javaFullName(paramSchema, method)); + } + if (resultProto.getScopeId() == 0) { + paramType = kj::str(javaFullName(resultSchema, method)); + } auto interfaceProto = method.getContainingInterface().getProto(); uint64_t interfaceId = interfaceProto.getId(); @@ -1692,8 +1743,8 @@ private: " return org.capnproto.Capability.Server.", isStreaming ? "streamResult" : "result", "(\n", " this.", identifierName, "(org.capnproto.Capability.Server.typedContext(\n" - " ", paramType, ".factory,\n", - " ", resultType, ".factory, context)));\n") + " ", genericParamType, ".factory,\n", + " ", genericResultType, ".factory, context)));\n") }; } diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 1fb76f65..feb304e7 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -69,11 +69,6 @@ public final T getAs(FromPointerReader factory) { return factory.fromPointerReader(this.segment, this.capTable, this.pointer, this.nestingLimit); } - public final Capability.Client getAsCap() { - return new Capability.Client( - WireHelpers.readCapabilityPointer(this.segment, capTable, this.pointer, 0)); - } - public final ClientHook getPipelinedCap(PipelineOp[] ops) { for (var op: ops) { switch (op.type) { diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 3087bda8..ad75eb79 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -12,6 +12,30 @@ public static class ReaderContext { CapTableReader capTable; } + public static abstract class Factory + implements FromPointerReader, + FromPointerBuilder { + @Override + public T fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { + var hook = WireHelpers.readCapabilityPointer(segment, capTable, pointer, 0); + return newClient(hook); + } + + @Override + public T fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { + var hook = WireHelpers.readCapabilityPointer(segment, capTable, pointer, 0); + return newClient(hook); + } + + @Override + public T initFromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, int elementCount) { + var hook = WireHelpers.readCapabilityPointer(segment, capTable, pointer, 0); + return newClient(hook); + } + + public abstract T newClient(ClientHook hook); + } + public static class Client { final ClientHook hook; diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index f96ca2c7..83302122 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -1355,7 +1355,7 @@ static void setCapabilityPointer(SegmentBuilder segment, CapTableBuilder capTabl zeroPointerAndFars(segment, refOffset); } else if (capTable != null) { - WirePointer.setCap(segment.buffer, refOffset, capTable.injectCap(cap)); + WirePointer.setCapability(segment.buffer, refOffset, capTable.injectCap(cap)); } else { assert false: "Cannot set capability pointer without capTable"; diff --git a/runtime/src/main/java/org/capnproto/WirePointer.java b/runtime/src/main/java/org/capnproto/WirePointer.java index 167b649d..4d9b547d 100644 --- a/runtime/src/main/java/org/capnproto/WirePointer.java +++ b/runtime/src/main/java/org/capnproto/WirePointer.java @@ -91,7 +91,7 @@ public static boolean isCapability(long wirePointer) { return offsetAndKind(wirePointer) == OTHER; } - public static void setCap(ByteBuffer buffer, int offset, int cap) { + public static void setCapability(ByteBuffer buffer, int offset, int cap) { setOffsetAndKind(buffer, offset, OTHER); buffer.putInt(offset*8 + 4, cap); } diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index 6178dd96..a946e43d 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -1,20 +1,17 @@ package org.capnproto; import org.capnproto.demo.Demo; +import org.capnproto.demo.DemoFoo; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import java.io.IOException; import java.nio.channels.AsynchronousServerSocketChannel; import java.nio.channels.AsynchronousSocketChannel; -import java.nio.channels.CompletionHandler; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -import static org.junit.Assert.*; - class TestCap0 { static final class Client extends org.capnproto.Capability.Client { @@ -35,44 +32,31 @@ public org.capnproto.Request } } - static abstract class Server extends org.capnproto.Capability.Server { - - public class TestMethod0Context extends CallContext { - public TestMethod0Context(CallContextHook hook) { - super(Demo.TestParams0.factory, Demo.TestResults0.factory, hook); - } - } - - public class TestMethod1Context extends CallContext { - public TestMethod1Context(CallContextHook hook) { - super(Demo.TestParams1.factory, Demo.TestResults1.factory, hook); - } - } - + public static class Server extends Capability.Server { @Override public DispatchCallResult dispatchCall(long interfaceId, short methodId, CallContext context) { if (interfaceId == 0xa65f4a3d7f622e6bL) { return dispatchCallInternal(methodId, context); } - return internalUnimplemented(Demo.class.getName(), interfaceId); + return result(internalUnimplemented(Demo.class.getName(), interfaceId)); } - private DispatchCallResult dispatchCallInternal(short methodId, CallContext ctx) { + DispatchCallResult dispatchCallInternal(short methodId, CallContext ctx) { switch (methodId) { case 0: - return new DispatchCallResult(testMethod0(new TestMethod0Context(ctx.getHook()))); + return result(testMethod0(typedContext(Demo.TestParams0.factory, Demo.TestResults0.factory, ctx))); case 1: - return new DispatchCallResult(testMethod1(new TestMethod1Context(ctx.getHook()))); + return result(testMethod1(typedContext(Demo.TestParams1.factory, Demo.TestResults1.factory, ctx))); default: - return internalUnimplemented(Demo.class.getName(), 0xa27d3c231c7b9202L, methodId); + return result(internalUnimplemented(Demo.class.getName(), 0xa27d3c231c7b9202L, methodId)); } } - public CompletableFuture testMethod0(TestMethod0Context ctx) { + public CompletableFuture testMethod0(CallContext ctx) { return CompletableFuture.failedFuture(RpcException.unimplemented("testMethod0")); } - public CompletableFuture testMethod1(TestMethod1Context ctx) { + public CompletableFuture testMethod1(CallContext ctx) { return CompletableFuture.failedFuture(RpcException.unimplemented("testMethod1")); } } @@ -97,13 +81,13 @@ public DispatchCallResult dispatchCall(long interfaceId, short methodId, CallCon if (interfaceId == 0x81da3f8f6079c216L) { return dispatchCallInternal(methodId, context); } - return internalUnimplemented(Demo.class.getName(), interfaceId); + return result(internalUnimplemented(Demo.class.getName(), interfaceId)); } private DispatchCallResult dispatchCallInternal(short methodId, CallContext ctx) { switch (methodId) { default: - return internalUnimplemented(Demo.class.getName(), 0x81da3f8f6079c216L, methodId); + return result(internalUnimplemented(Demo.class.getName(), 0x81da3f8f6079c216L, methodId)); } } } @@ -114,22 +98,22 @@ class TestCap0Impl extends TestCap0.Server { final TestCap1.Client testCap1a = new TestCap1.Client(new TestCap1Impl()); final TestCap1.Client testCap1b = new TestCap1.Client(new TestCap1Impl()); - public CompletableFuture testMethod0(TestCap0.Server.TestMethod0Context ctx) { + public CompletableFuture testMethod0(CallContext ctx) { var params = ctx.getParams(); var results = ctx.getResults(); results.setResult0(params.getParam0()); return CompletableFuture.completedFuture(null); } - public CompletableFuture testMethod1(TestCap0.Server.TestMethod1Context ctx) { + public CompletableFuture testMethod1(CallContext ctx) { var params = ctx.getParams(); var results = ctx.getResults(); var res0 = results.getResult0(); - res0.setAsCapability(testCap1a); + res0.setAsCap(testCap1a); var res1 = results.getResult1(); - res1.setAsCapability(testCap1b); + res1.setAsCap(testCap1b); var res2 = results.getResult2(); - res2.setAsCapability(testCap1b); + res2.setAsCap(testCap1b); return CompletableFuture.completedFuture(null); } } @@ -204,15 +188,16 @@ public void testReturnCap() throws ExecutionException, InterruptedException { } Assert.assertTrue(resultsPromise.isDone()); var results = resultsPromise.get(); - var cap0 = results.getResult0().getAsCapability(); - Assert.assertFalse(cap0.hook.isNull()); - Assert.assertFalse(cap0.hook.isError()); - var cap1 = results.getResult1().getAsCapability(); - Assert.assertFalse(cap1.hook.isNull()); - Assert.assertFalse(cap1.hook.isError()); - var cap2 = results.getResult2().getAsCapability(); - Assert.assertFalse(cap2.hook.isNull()); - Assert.assertFalse(cap2.hook.isError()); + var cap0 = results.getResult0(); + Assert.assertFalse(cap0.isNull()); + var cap1 = results.getResult1(); + Assert.assertFalse(cap1.isNull()); + var cap2 = results.getResult2(); + Assert.assertFalse(cap2.isNull()); + + var cap3 = results.getResult2().getAs(Demo.Iface0.factory); + Assert.assertFalse(cap2.isNull()); + //Assert.assertFalse(cap2.hook.isError()); } @Test @@ -225,4 +210,15 @@ public void testLocalServer() throws ExecutionException, InterruptedException { var results = request.send().get(); Assert.assertEquals(params.getParam0(), results.getResult0()); } + + @Test + public void testGenericServer() throws ExecutionException, InterruptedException { + var demo = new TestCap0Impl(); + var client = new TestCap0.Client(demo); + var request = client.testMethod0Request(); + var params = request.params(); + params.setParam0(4321); + var results = request.send().get(); + Assert.assertEquals(params.getParam0(), results.getResult0()); + } } \ No newline at end of file diff --git a/runtime/src/test/java/org/capnproto/demo/Demo.java b/runtime/src/test/java/org/capnproto/demo/Demo.java index 46687de6..820e36ed 100644 --- a/runtime/src/test/java/org/capnproto/demo/Demo.java +++ b/runtime/src/test/java/org/capnproto/demo/Demo.java @@ -263,7 +263,7 @@ public org.capnproto.AnyPointer.Reader getResult2() { public static class Struct0 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)6,(short)3); + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); public static final class Factory extends org.capnproto.StructFactory { public Factory() { } @@ -297,105 +297,6 @@ public final void setF0(boolean value) { _setBooleanField(0, value); } - public final short getF1() { - return _getShortField(1); - } - public final void setF1(short value) { - _setShortField(1, value); - } - - public final short getF2() { - return _getShortField(2); - } - public final void setF2(short value) { - _setShortField(2, value); - } - - public final int getF3() { - return _getIntField(2); - } - public final void setF3(int value) { - _setIntField(2, value); - } - - public final int getF4() { - return _getIntField(3); - } - public final void setF4(int value) { - _setIntField(3, value); - } - - public final long getF5() { - return _getLongField(2); - } - public final void setF5(long value) { - _setLongField(2, value); - } - - public final long getF6() { - return _getLongField(3); - } - public final void setF6(long value) { - _setLongField(3, value); - } - - public final float getF7() { - return _getFloatField(8); - } - public final void setF7(float value) { - _setFloatField(8, value); - } - - public final double getF8() { - return _getDoubleField(5); - } - public final void setF8(double value) { - _setDoubleField(5, value); - } - - public final boolean hasF9() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getF9() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setF9(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setF9(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initF9(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - public final boolean hasF10() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.Data.Builder getF10() { - return _getPointerField(org.capnproto.Data.factory, 1, null, 0, 0); - } - public final void setF10(org.capnproto.Data.Reader value) { - _setPointerField(org.capnproto.Data.factory, 1, value); - } - public final void setF10(byte [] value) { - _setPointerField(org.capnproto.Data.factory, 1, new org.capnproto.Data.Reader(value)); - } - public final org.capnproto.Data.Builder initF10(int size) { - return _initPointerField(org.capnproto.Data.factory, 1, size); - } - public final boolean hasF11() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.AnyPointer.Builder getF11() { - return _getPointerField(org.capnproto.AnyPointer.factory, 2); - } - public org.capnproto.AnyPointer.Builder initF11() { - return _initPointerField(org.capnproto.AnyPointer.factory, 2, 0); - } - public org.capnproto.AnyPointer.Builder initF11(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 2, size); - } - } public static final class Reader extends org.capnproto.StructReader { @@ -407,65 +308,18 @@ public final boolean getF0() { return _getBooleanField(0); } - public final short getF1() { - return _getShortField(1); - } - - public final short getF2() { - return _getShortField(2); - } - - public final int getF3() { - return _getIntField(2); - } - - public final int getF4() { - return _getIntField(3); - } - - public final long getF5() { - return _getLongField(2); - } - - public final long getF6() { - return _getLongField(3); - } - - public final float getF7() { - return _getFloatField(8); - } - - public final double getF8() { - return _getDoubleField(5); - } - - public boolean hasF9() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getF9() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - public boolean hasF10() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.Data.Reader getF10() { - return _getPointerField(org.capnproto.Data.factory, 1, null, 0, 0); - } - - public boolean hasF11() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.AnyPointer.Reader getF11() { - return _getPointerField(org.capnproto.AnyPointer.factory, 2); - } } } public static class Iface0 { - + public static final class Factory extends org.capnproto.Capability.Factory { + public final Client newClient(org.capnproto.ClientHook hook) { + return new Client(hook); + } + } + public static final Factory factory = new Factory(); public static class Client extends org.capnproto.Capability.Client { public Client() {} public Client(org.capnproto.ClientHook hook) { super(hook); } @@ -486,7 +340,7 @@ protected org.capnproto.DispatchCallResult dispatchCall( org.capnproto.Capability.Server.internalUnimplemented("Iface0", interfaceId)); } - protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { + protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { switch (methodId) { default: return org.capnproto.Capability.Server.result( @@ -497,8 +351,6 @@ protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, } - static Object brand() { return null; /*schema.defaultBrand;*/ } - } public static class Struct2 { @@ -546,11 +398,10 @@ public final boolean hasF1i() { return !_pointerFieldIsNull(1); } public org.capnproto.demo.Demo.Iface0.Client getF1i() { - return new org.capnproto.demo.Demo.Iface0.Client( - _getPointerField(org.capnproto.AnyPointer.factory, 1).getAsCap()); + return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 1); } public void setF1i(org.capnproto.demo.Demo.Iface0.Client value) { - _initPointerField(org.capnproto.AnyPointer.factory, 1, 0).setAsCap(value); + _initPointerField(org.capnproto.demo.Demo.Iface0.factory, 1, 0); } } @@ -570,7 +421,7 @@ public boolean hasF1i() { return !_pointerFieldIsNull(1); } public org.capnproto.demo.Demo.Iface0.Client getF1i() { - return new org.capnproto.demo.Demo.Iface0.Client(_getPointerField(org.capnproto.AnyPointer.factory, 1).getAsCap()); + return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 1); } } @@ -578,7 +429,12 @@ public org.capnproto.demo.Demo.Iface0.Client getF1i() { public static class Iface1 { - + public static final class Factory extends org.capnproto.Capability.Factory { + public final Client newClient(org.capnproto.ClientHook hook) { + return new Client(hook); + } + } + public static final Factory factory = new Factory(); public static class Client extends org.capnproto.Capability.Client { public Client() {} public Client(org.capnproto.ClientHook hook) { super(hook); } @@ -599,18 +455,18 @@ protected org.capnproto.DispatchCallResult dispatchCall( org.capnproto.Capability.Server.internalUnimplemented("Iface1", interfaceId)); } - protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { + protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { switch (methodId) { case 0: return org.capnproto.Capability.Server.result( this.method0(org.capnproto.Capability.Server.typedContext( - org.capnproto.demo.Demo.Iface1.Method0Params.factory, - org.capnproto.demo.Demo.Iface1.Method0Results.factory, context))); + Method0Params.factory, + Method0Results.factory, context))); case 1: return org.capnproto.Capability.Server.result( this.method1(org.capnproto.Capability.Server.typedContext( - org.capnproto.demo.Demo.Iface1.Method1Params.factory, - org.capnproto.demo.Demo.Iface1.Method1Results.factory, context))); + Method1Params.factory, + Method1Results.factory, context))); default: return org.capnproto.Capability.Server.result( org.capnproto.Capability.Server.internalUnimplemented("Iface1", 0xd52dcf38c9f6f7c0L, methodId)); @@ -632,7 +488,7 @@ protected java.util.concurrent.CompletableFuture method1(org.capnproto.CallCo } public static class Struct1 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)6,(short)3); + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); public static final class Factory extends org.capnproto.StructFactory { public Factory() { } @@ -666,103 +522,17 @@ public final void setF0(boolean value) { _setBooleanField(0, value); } - public final short getF1() { - return _getShortField(1); - } - public final void setF1(short value) { - _setShortField(1, value); - } - - public final short getF2() { - return _getShortField(2); - } - public final void setF2(short value) { - _setShortField(2, value); - } - - public final int getF3() { - return _getIntField(2); - } - public final void setF3(int value) { - _setIntField(2, value); - } - - public final int getF4() { - return _getIntField(3); - } - public final void setF4(int value) { - _setIntField(3, value); - } - - public final long getF5() { - return _getLongField(2); - } - public final void setF5(long value) { - _setLongField(2, value); - } - - public final long getF6() { - return _getLongField(3); - } - public final void setF6(long value) { - _setLongField(3, value); - } - - public final float getF7() { - return _getFloatField(8); - } - public final void setF7(float value) { - _setFloatField(8, value); - } - - public final double getF8() { - return _getDoubleField(5); - } - public final void setF8(double value) { - _setDoubleField(5, value); - } - - public final boolean hasF9() { + public final boolean hasF1() { return !_pointerFieldIsNull(0); } - public final org.capnproto.Text.Builder getF9() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setF9(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setF9(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initF9(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); + public org.capnproto.AnyPointer.Builder getF1() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); } - public final boolean hasF10() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.Data.Builder getF10() { - return _getPointerField(org.capnproto.Data.factory, 1, null, 0, 0); - } - public final void setF10(org.capnproto.Data.Reader value) { - _setPointerField(org.capnproto.Data.factory, 1, value); - } - public final void setF10(byte [] value) { - _setPointerField(org.capnproto.Data.factory, 1, new org.capnproto.Data.Reader(value)); - } - public final org.capnproto.Data.Builder initF10(int size) { - return _initPointerField(org.capnproto.Data.factory, 1, size); + public org.capnproto.AnyPointer.Builder initF1() { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); } - public final boolean hasF11() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.AnyPointer.Builder getF11() { - return _getPointerField(org.capnproto.AnyPointer.factory, 2); - } - public org.capnproto.AnyPointer.Builder initF11() { - return _initPointerField(org.capnproto.AnyPointer.factory, 2, 0); - } - public org.capnproto.AnyPointer.Builder initF11(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 2, size); + public org.capnproto.AnyPointer.Builder initF1(int size) { + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); } } @@ -776,57 +546,11 @@ public final boolean getF0() { return _getBooleanField(0); } - public final short getF1() { - return _getShortField(1); - } - - public final short getF2() { - return _getShortField(2); - } - - public final int getF3() { - return _getIntField(2); - } - - public final int getF4() { - return _getIntField(3); - } - - public final long getF5() { - return _getLongField(2); - } - - public final long getF6() { - return _getLongField(3); - } - - public final float getF7() { - return _getFloatField(8); - } - - public final double getF8() { - return _getDoubleField(5); - } - - public boolean hasF9() { + public boolean hasF1() { return !_pointerFieldIsNull(0); } - public org.capnproto.Text.Reader getF9() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - public boolean hasF10() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.Data.Reader getF10() { - return _getPointerField(org.capnproto.Data.factory, 1, null, 0, 0); - } - - public boolean hasF11() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.AnyPointer.Reader getF11() { - return _getPointerField(org.capnproto.AnyPointer.factory, 2); + public org.capnproto.AnyPointer.Reader getF1() { + return _getPointerField(org.capnproto.AnyPointer.factory, 0); } } @@ -1017,11 +741,10 @@ public final boolean hasResult0() { return !_pointerFieldIsNull(0); } public org.capnproto.demo.Demo.Iface0.Client getResult0() { - return new org.capnproto.demo.Demo.Iface0.Client( - _getPointerField(org.capnproto.AnyPointer.factory, 0).getAsCap()); + return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 0); } public void setResult0(org.capnproto.demo.Demo.Iface0.Client value) { - _initPointerField(org.capnproto.AnyPointer.factory, 0, 0).setAsCap(value); + _initPointerField(org.capnproto.demo.Demo.Iface0.factory, 0, 0); } } @@ -1035,7 +758,7 @@ public boolean hasResult0() { return !_pointerFieldIsNull(0); } public org.capnproto.demo.Demo.Iface0.Client getResult0() { - return new org.capnproto.demo.Demo.Iface0.Client(_getPointerField(org.capnproto.AnyPointer.factory, 0).getAsCap()); + return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 0); } } @@ -1043,8 +766,6 @@ public org.capnproto.demo.Demo.Iface0.Client getResult0() { - static Object brand() { return null; /*schema.defaultBrand;*/ } - } @@ -1241,14 +962,14 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u00bc\u00e7\u00f0\u00ae\u00b6\u0051\u00af\u00b1" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0006\u0000" + + "\u0034\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u00a7\u0002\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + @@ -1260,91 +981,14 @@ public static final class Schemas { "\u0070\u006e\u0070\u003a\u0053\u0074\u0072\u0075" + "\u0063\u0074\u0030\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0041\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0048\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0050\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0058\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0055\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0050\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\\\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0059\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0054\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0060\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0007\u0000\u0000\u0000\u0008\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u005d\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0058\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0064\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\\\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0068\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0060\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u006c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\n\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u0001\u0000\u0000\"\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0070\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000b\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006d\u0001\u0000\u0000\"\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0068\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0074\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + "\u0066\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -1352,94 +996,6 @@ public static final class Schemas { "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0032\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0033\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0034\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0035\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0036\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0037\u0000\u0000\u0000\u0000\u0000\u0000" + - "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0038\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0039\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0031\u0030\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0031\u0031\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); public static final org.capnproto.SegmentReader b_ac6d126c2fac16eb = org.capnproto.GeneratedClassSupport.decodeRawBytes( @@ -1572,14 +1128,14 @@ public static final class Schemas { org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + "\u0038\u00dd\u00fd\u00fb\u0062\u00a8\u000c\u0080" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0006\u0000" + + "\u003b\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + "\u00c0\u00f7\u00f6\u00c9\u0038\u00cf\u002d\u00d5" + - "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0015\u0000\u0000\u0000\u001a\u0002\u0000\u0000" + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u00a7\u0002\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + @@ -1592,91 +1148,21 @@ public static final class Schemas { "\u0065\u0031\u002e\u0053\u0074\u0072\u0075\u0063" + "\u0074\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0041\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0048\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0050\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0058\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0055\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0050\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\\\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0059\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0054\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0060\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0007\u0000\u0000\u0000\u0008\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u005d\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0058\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0064\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\\\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0068\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0060\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u006c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\n\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u0001\u0000\u0000\"\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0070\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000b\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006d\u0001\u0000\u0000\"\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0068\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0074\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + "\u0066\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + @@ -1686,86 +1172,6 @@ public static final class Schemas { "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0066\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0032\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0033\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0034\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0035\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0036\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0037\u0000\u0000\u0000\u0000\u0000\u0000" + - "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0038\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0039\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0031\u0030\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0031\u0031\u0000\u0000\u0000\u0000\u0000" + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp b/runtime/src/test/java/org/capnproto/demo/demo.capnp index 550f9c07..a9676ede 100644 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp @@ -24,17 +24,6 @@ struct TestResults1 { struct Struct0 { f0 @0 :Bool; - f1 @1 :UInt16; - f2 @2 :Int16; - f3 @3 :UInt32; - f4 @4 :Int32; - f5 @5 :UInt64; - f6 @6 :Int64; - f7 @7 :Float32; - f8 @8 :Float64; - f9 @9 :Text; - f10 @10 :Data; - f11 @11 :AnyPointer; } interface Iface0 { @@ -49,22 +38,11 @@ interface Iface1 { struct Struct1 { f0 @0 :Bool; - f1 @1 :UInt16; - f2 @2 :Int16; - f3 @3 :UInt32; - f4 @4 :Int32; - f5 @5 :UInt64; - f6 @6 :Int64; - f7 @7 :Float32; - f8 @8 :Float64; - f9 @9 :Text; - f10 @10 :Data; - f11 @11 :AnyPointer; + f1 @1 :AnyPointer; } method0 @0 () -> (result0 :Struct0, result1 :Struct1); method1 @1 () -> (result0: Iface0); - } diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ index 5dd280d2..db120da0 100644 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ @@ -229,17 +229,17 @@ const ::capnp::_::RawSchema s_d1342392ab536963 = { 0, 3, i_d1342392ab536963, nullptr, nullptr, { &s_d1342392ab536963, nullptr, nullptr, 0, 0, nullptr } }; #endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<202> b_b1af51b6aef0e7bc = { +static const ::capnp::_::AlignedData<37> b_b1af51b6aef0e7bc = { { 0, 0, 0, 0, 5, 0, 6, 0, 188, 231, 240, 174, 182, 81, 175, 177, - 52, 0, 0, 0, 1, 0, 6, 0, + 52, 0, 0, 0, 1, 0, 1, 0, 66, 71, 232, 130, 21, 122, 87, 182, - 3, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 226, 1, 0, 0, 49, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 167, 2, 0, 0, + 45, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 117, 110, 116, 105, 109, 101, 47, @@ -251,195 +251,30 @@ static const ::capnp::_::AlignedData<202> b_b1af51b6aef0e7bc = { 112, 110, 112, 58, 83, 116, 114, 117, 99, 116, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, - 48, 0, 0, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 65, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 60, 1, 0, 0, 3, 0, 1, 0, - 72, 1, 0, 0, 2, 0, 1, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 69, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 64, 1, 0, 0, 3, 0, 1, 0, - 76, 1, 0, 0, 2, 0, 1, 0, - 2, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 73, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 68, 1, 0, 0, 3, 0, 1, 0, - 80, 1, 0, 0, 2, 0, 1, 0, - 3, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 77, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 72, 1, 0, 0, 3, 0, 1, 0, - 84, 1, 0, 0, 2, 0, 1, 0, - 4, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 1, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 81, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 76, 1, 0, 0, 3, 0, 1, 0, - 88, 1, 0, 0, 2, 0, 1, 0, - 5, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 85, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 80, 1, 0, 0, 3, 0, 1, 0, - 92, 1, 0, 0, 2, 0, 1, 0, - 6, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 1, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 89, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 84, 1, 0, 0, 3, 0, 1, 0, - 96, 1, 0, 0, 2, 0, 1, 0, - 7, 0, 0, 0, 8, 0, 0, 0, - 0, 0, 1, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 93, 1, 0, 0, 26, 0, 0, 0, + 13, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 88, 1, 0, 0, 3, 0, 1, 0, - 100, 1, 0, 0, 2, 0, 1, 0, - 8, 0, 0, 0, 5, 0, 0, 0, - 0, 0, 1, 0, 8, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 97, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 92, 1, 0, 0, 3, 0, 1, 0, - 104, 1, 0, 0, 2, 0, 1, 0, - 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 101, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 96, 1, 0, 0, 3, 0, 1, 0, - 108, 1, 0, 0, 2, 0, 1, 0, - 10, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 10, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 105, 1, 0, 0, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 100, 1, 0, 0, 3, 0, 1, 0, - 112, 1, 0, 0, 2, 0, 1, 0, - 11, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 109, 1, 0, 0, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 104, 1, 0, 0, 3, 0, 1, 0, - 116, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 1, 0, + 20, 0, 0, 0, 2, 0, 1, 0, 102, 48, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 49, 0, 0, 0, 0, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 50, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 51, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 52, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 53, 0, 0, 0, 0, 0, 0, - 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 54, 0, 0, 0, 0, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 55, 0, 0, 0, 0, 0, 0, - 10, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 10, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 56, 0, 0, 0, 0, 0, 0, - 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 57, 0, 0, 0, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 49, 48, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 49, 49, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, } }; ::capnp::word const* const bp_b1af51b6aef0e7bc = b_b1af51b6aef0e7bc.words; #if !CAPNP_LITE -static const uint16_t m_b1af51b6aef0e7bc[] = {0, 1, 10, 11, 2, 3, 4, 5, 6, 7, 8, 9}; -static const uint16_t i_b1af51b6aef0e7bc[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; +static const uint16_t m_b1af51b6aef0e7bc[] = {0}; +static const uint16_t i_b1af51b6aef0e7bc[] = {0}; const ::capnp::_::RawSchema s_b1af51b6aef0e7bc = { - 0xb1af51b6aef0e7bc, b_b1af51b6aef0e7bc.words, 202, nullptr, m_b1af51b6aef0e7bc, - 0, 12, i_b1af51b6aef0e7bc, nullptr, nullptr, { &s_b1af51b6aef0e7bc, nullptr, nullptr, 0, 0, nullptr } + 0xb1af51b6aef0e7bc, b_b1af51b6aef0e7bc.words, 37, nullptr, m_b1af51b6aef0e7bc, + 0, 1, i_b1af51b6aef0e7bc, nullptr, nullptr, { &s_b1af51b6aef0e7bc, nullptr, nullptr, 0, 0, nullptr } }; #endif // !CAPNP_LITE static const ::capnp::_::AlignedData<23> b_ac6d126c2fac16eb = { @@ -602,17 +437,17 @@ const ::capnp::_::RawSchema s_d52dcf38c9f6f7c0 = { 4, 2, nullptr, nullptr, nullptr, { &s_d52dcf38c9f6f7c0, nullptr, nullptr, 0, 0, nullptr } }; #endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<203> b_800ca862fbfddd38 = { +static const ::capnp::_::AlignedData<53> b_800ca862fbfddd38 = { { 0, 0, 0, 0, 5, 0, 6, 0, 56, 221, 253, 251, 98, 168, 12, 128, - 59, 0, 0, 0, 1, 0, 6, 0, + 59, 0, 0, 0, 1, 0, 1, 0, 192, 247, 246, 201, 56, 207, 45, 213, - 3, 0, 7, 0, 0, 0, 0, 0, + 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 26, 2, 0, 0, 53, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 49, 0, 0, 0, 167, 2, 0, 0, + 49, 0, 0, 0, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 117, 110, 116, 105, 109, 101, 47, @@ -625,91 +460,21 @@ static const ::capnp::_::AlignedData<203> b_800ca862fbfddd38 = { 101, 49, 46, 83, 116, 114, 117, 99, 116, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, - 48, 0, 0, 0, 3, 0, 4, 0, + 8, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 65, 1, 0, 0, 26, 0, 0, 0, + 41, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 60, 1, 0, 0, 3, 0, 1, 0, - 72, 1, 0, 0, 2, 0, 1, 0, - 1, 0, 0, 0, 1, 0, 0, 0, + 36, 0, 0, 0, 3, 0, 1, 0, + 48, 0, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 69, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 64, 1, 0, 0, 3, 0, 1, 0, - 76, 1, 0, 0, 2, 0, 1, 0, - 2, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 73, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 68, 1, 0, 0, 3, 0, 1, 0, - 80, 1, 0, 0, 2, 0, 1, 0, - 3, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 77, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 72, 1, 0, 0, 3, 0, 1, 0, - 84, 1, 0, 0, 2, 0, 1, 0, - 4, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 1, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 81, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 76, 1, 0, 0, 3, 0, 1, 0, - 88, 1, 0, 0, 2, 0, 1, 0, - 5, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 85, 1, 0, 0, 26, 0, 0, 0, + 45, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 80, 1, 0, 0, 3, 0, 1, 0, - 92, 1, 0, 0, 2, 0, 1, 0, - 6, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 1, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 89, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 84, 1, 0, 0, 3, 0, 1, 0, - 96, 1, 0, 0, 2, 0, 1, 0, - 7, 0, 0, 0, 8, 0, 0, 0, - 0, 0, 1, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 93, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 88, 1, 0, 0, 3, 0, 1, 0, - 100, 1, 0, 0, 2, 0, 1, 0, - 8, 0, 0, 0, 5, 0, 0, 0, - 0, 0, 1, 0, 8, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 97, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 92, 1, 0, 0, 3, 0, 1, 0, - 104, 1, 0, 0, 2, 0, 1, 0, - 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 101, 1, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 96, 1, 0, 0, 3, 0, 1, 0, - 108, 1, 0, 0, 2, 0, 1, 0, - 10, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 10, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 105, 1, 0, 0, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 100, 1, 0, 0, 3, 0, 1, 0, - 112, 1, 0, 0, 2, 0, 1, 0, - 11, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 109, 1, 0, 0, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 104, 1, 0, 0, 3, 0, 1, 0, - 116, 1, 0, 0, 2, 0, 1, 0, + 40, 0, 0, 0, 3, 0, 1, 0, + 52, 0, 0, 0, 2, 0, 1, 0, 102, 48, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -719,86 +484,6 @@ static const ::capnp::_::AlignedData<203> b_800ca862fbfddd38 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 49, 0, 0, 0, 0, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 50, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 51, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 52, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 53, 0, 0, 0, 0, 0, 0, - 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 54, 0, 0, 0, 0, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 55, 0, 0, 0, 0, 0, 0, - 10, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 10, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 56, 0, 0, 0, 0, 0, 0, - 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 57, 0, 0, 0, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 49, 48, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 49, 49, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -809,11 +494,11 @@ static const ::capnp::_::AlignedData<203> b_800ca862fbfddd38 = { }; ::capnp::word const* const bp_800ca862fbfddd38 = b_800ca862fbfddd38.words; #if !CAPNP_LITE -static const uint16_t m_800ca862fbfddd38[] = {0, 1, 10, 11, 2, 3, 4, 5, 6, 7, 8, 9}; -static const uint16_t i_800ca862fbfddd38[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; +static const uint16_t m_800ca862fbfddd38[] = {0, 1}; +static const uint16_t i_800ca862fbfddd38[] = {0, 1}; const ::capnp::_::RawSchema s_800ca862fbfddd38 = { - 0x800ca862fbfddd38, b_800ca862fbfddd38.words, 203, nullptr, m_800ca862fbfddd38, - 0, 12, i_800ca862fbfddd38, nullptr, nullptr, { &s_800ca862fbfddd38, nullptr, nullptr, 0, 0, nullptr } + 0x800ca862fbfddd38, b_800ca862fbfddd38.words, 53, nullptr, m_800ca862fbfddd38, + 0, 2, i_800ca862fbfddd38, nullptr, nullptr, { &s_800ca862fbfddd38, nullptr, nullptr, 0, 0, nullptr } }; #endif // !CAPNP_LITE static const ::capnp::_::AlignedData<22> b_8f92ca18632e04d5 = { diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp.h b/runtime/src/test/java/org/capnproto/demo/demo.capnp.h index c547464d..a5953344 100644 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp.h +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.h @@ -103,7 +103,7 @@ struct Struct0 { class Pipeline; struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(b1af51b6aef0e7bc, 6, 3) + CAPNP_DECLARE_STRUCT_HEADER(b1af51b6aef0e7bc, 1, 0) #if !CAPNP_LITE static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } #endif // !CAPNP_LITE @@ -172,7 +172,7 @@ struct Iface1::Struct1 { class Pipeline; struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(800ca862fbfddd38, 6, 3) + CAPNP_DECLARE_STRUCT_HEADER(800ca862fbfddd38, 1, 1) #if !CAPNP_LITE static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } #endif // !CAPNP_LITE @@ -582,31 +582,6 @@ class Struct0::Reader { inline bool getF0() const; - inline ::uint16_t getF1() const; - - inline ::int16_t getF2() const; - - inline ::uint32_t getF3() const; - - inline ::int32_t getF4() const; - - inline ::uint64_t getF5() const; - - inline ::int64_t getF6() const; - - inline float getF7() const; - - inline double getF8() const; - - inline bool hasF9() const; - inline ::capnp::Text::Reader getF9() const; - - inline bool hasF10() const; - inline ::capnp::Data::Reader getF10() const; - - inline bool hasF11() const; - inline ::capnp::AnyPointer::Reader getF11() const; - private: ::capnp::_::StructReader _reader; template @@ -638,48 +613,6 @@ class Struct0::Builder { inline bool getF0(); inline void setF0(bool value); - inline ::uint16_t getF1(); - inline void setF1( ::uint16_t value); - - inline ::int16_t getF2(); - inline void setF2( ::int16_t value); - - inline ::uint32_t getF3(); - inline void setF3( ::uint32_t value); - - inline ::int32_t getF4(); - inline void setF4( ::int32_t value); - - inline ::uint64_t getF5(); - inline void setF5( ::uint64_t value); - - inline ::int64_t getF6(); - inline void setF6( ::int64_t value); - - inline float getF7(); - inline void setF7(float value); - - inline double getF8(); - inline void setF8(double value); - - inline bool hasF9(); - inline ::capnp::Text::Builder getF9(); - inline void setF9( ::capnp::Text::Reader value); - inline ::capnp::Text::Builder initF9(unsigned int size); - inline void adoptF9(::capnp::Orphan< ::capnp::Text>&& value); - inline ::capnp::Orphan< ::capnp::Text> disownF9(); - - inline bool hasF10(); - inline ::capnp::Data::Builder getF10(); - inline void setF10( ::capnp::Data::Reader value); - inline ::capnp::Data::Builder initF10(unsigned int size); - inline void adoptF10(::capnp::Orphan< ::capnp::Data>&& value); - inline ::capnp::Orphan< ::capnp::Data> disownF10(); - - inline bool hasF11(); - inline ::capnp::AnyPointer::Builder getF11(); - inline ::capnp::AnyPointer::Builder initF11(); - private: ::capnp::_::StructBuilder _builder; template @@ -924,30 +857,8 @@ class Iface1::Struct1::Reader { inline bool getF0() const; - inline ::uint16_t getF1() const; - - inline ::int16_t getF2() const; - - inline ::uint32_t getF3() const; - - inline ::int32_t getF4() const; - - inline ::uint64_t getF5() const; - - inline ::int64_t getF6() const; - - inline float getF7() const; - - inline double getF8() const; - - inline bool hasF9() const; - inline ::capnp::Text::Reader getF9() const; - - inline bool hasF10() const; - inline ::capnp::Data::Reader getF10() const; - - inline bool hasF11() const; - inline ::capnp::AnyPointer::Reader getF11() const; + inline bool hasF1() const; + inline ::capnp::AnyPointer::Reader getF1() const; private: ::capnp::_::StructReader _reader; @@ -980,47 +891,9 @@ class Iface1::Struct1::Builder { inline bool getF0(); inline void setF0(bool value); - inline ::uint16_t getF1(); - inline void setF1( ::uint16_t value); - - inline ::int16_t getF2(); - inline void setF2( ::int16_t value); - - inline ::uint32_t getF3(); - inline void setF3( ::uint32_t value); - - inline ::int32_t getF4(); - inline void setF4( ::int32_t value); - - inline ::uint64_t getF5(); - inline void setF5( ::uint64_t value); - - inline ::int64_t getF6(); - inline void setF6( ::int64_t value); - - inline float getF7(); - inline void setF7(float value); - - inline double getF8(); - inline void setF8(double value); - - inline bool hasF9(); - inline ::capnp::Text::Builder getF9(); - inline void setF9( ::capnp::Text::Reader value); - inline ::capnp::Text::Builder initF9(unsigned int size); - inline void adoptF9(::capnp::Orphan< ::capnp::Text>&& value); - inline ::capnp::Orphan< ::capnp::Text> disownF9(); - - inline bool hasF10(); - inline ::capnp::Data::Builder getF10(); - inline void setF10( ::capnp::Data::Reader value); - inline ::capnp::Data::Builder initF10(unsigned int size); - inline void adoptF10(::capnp::Orphan< ::capnp::Data>&& value); - inline ::capnp::Orphan< ::capnp::Data> disownF10(); - - inline bool hasF11(); - inline ::capnp::AnyPointer::Builder getF11(); - inline ::capnp::AnyPointer::Builder initF11(); + inline bool hasF1(); + inline ::capnp::AnyPointer::Builder getF1(); + inline ::capnp::AnyPointer::Builder initF1(); private: ::capnp::_::StructBuilder _builder; @@ -1505,209 +1378,6 @@ inline void Struct0::Builder::setF0(bool value) { ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); } -inline ::uint16_t Struct0::Reader::getF1() const { - return _reader.getDataField< ::uint16_t>( - ::capnp::bounded<1>() * ::capnp::ELEMENTS); -} - -inline ::uint16_t Struct0::Builder::getF1() { - return _builder.getDataField< ::uint16_t>( - ::capnp::bounded<1>() * ::capnp::ELEMENTS); -} -inline void Struct0::Builder::setF1( ::uint16_t value) { - _builder.setDataField< ::uint16_t>( - ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); -} - -inline ::int16_t Struct0::Reader::getF2() const { - return _reader.getDataField< ::int16_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} - -inline ::int16_t Struct0::Builder::getF2() { - return _builder.getDataField< ::int16_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} -inline void Struct0::Builder::setF2( ::int16_t value) { - _builder.setDataField< ::int16_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); -} - -inline ::uint32_t Struct0::Reader::getF3() const { - return _reader.getDataField< ::uint32_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} - -inline ::uint32_t Struct0::Builder::getF3() { - return _builder.getDataField< ::uint32_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} -inline void Struct0::Builder::setF3( ::uint32_t value) { - _builder.setDataField< ::uint32_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); -} - -inline ::int32_t Struct0::Reader::getF4() const { - return _reader.getDataField< ::int32_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS); -} - -inline ::int32_t Struct0::Builder::getF4() { - return _builder.getDataField< ::int32_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS); -} -inline void Struct0::Builder::setF4( ::int32_t value) { - _builder.setDataField< ::int32_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); -} - -inline ::uint64_t Struct0::Reader::getF5() const { - return _reader.getDataField< ::uint64_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} - -inline ::uint64_t Struct0::Builder::getF5() { - return _builder.getDataField< ::uint64_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} -inline void Struct0::Builder::setF5( ::uint64_t value) { - _builder.setDataField< ::uint64_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); -} - -inline ::int64_t Struct0::Reader::getF6() const { - return _reader.getDataField< ::int64_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS); -} - -inline ::int64_t Struct0::Builder::getF6() { - return _builder.getDataField< ::int64_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS); -} -inline void Struct0::Builder::setF6( ::int64_t value) { - _builder.setDataField< ::int64_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); -} - -inline float Struct0::Reader::getF7() const { - return _reader.getDataField( - ::capnp::bounded<8>() * ::capnp::ELEMENTS); -} - -inline float Struct0::Builder::getF7() { - return _builder.getDataField( - ::capnp::bounded<8>() * ::capnp::ELEMENTS); -} -inline void Struct0::Builder::setF7(float value) { - _builder.setDataField( - ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); -} - -inline double Struct0::Reader::getF8() const { - return _reader.getDataField( - ::capnp::bounded<5>() * ::capnp::ELEMENTS); -} - -inline double Struct0::Builder::getF8() { - return _builder.getDataField( - ::capnp::bounded<5>() * ::capnp::ELEMENTS); -} -inline void Struct0::Builder::setF8(double value) { - _builder.setDataField( - ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); -} - -inline bool Struct0::Reader::hasF9() const { - return !_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline bool Struct0::Builder::hasF9() { - return !_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline ::capnp::Text::Reader Struct0::Reader::getF9() const { - return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::capnp::Text::Builder Struct0::Builder::getF9() { - return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline void Struct0::Builder::setF9( ::capnp::Text::Reader value) { - ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS), value); -} -inline ::capnp::Text::Builder Struct0::Builder::initF9(unsigned int size) { - return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS), size); -} -inline void Struct0::Builder::adoptF9( - ::capnp::Orphan< ::capnp::Text>&& value) { - ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); -} -inline ::capnp::Orphan< ::capnp::Text> Struct0::Builder::disownF9() { - return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} - -inline bool Struct0::Reader::hasF10() const { - return !_reader.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); -} -inline bool Struct0::Builder::hasF10() { - return !_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); -} -inline ::capnp::Data::Reader Struct0::Reader::getF10() const { - return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -inline ::capnp::Data::Builder Struct0::Builder::getF10() { - return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -inline void Struct0::Builder::setF10( ::capnp::Data::Reader value) { - ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS), value); -} -inline ::capnp::Data::Builder Struct0::Builder::initF10(unsigned int size) { - return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS), size); -} -inline void Struct0::Builder::adoptF10( - ::capnp::Orphan< ::capnp::Data>&& value) { - ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); -} -inline ::capnp::Orphan< ::capnp::Data> Struct0::Builder::disownF10() { - return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} - -inline bool Struct0::Reader::hasF11() const { - return !_reader.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); -} -inline bool Struct0::Builder::hasF11() { - return !_builder.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); -} -inline ::capnp::AnyPointer::Reader Struct0::Reader::getF11() const { - return ::capnp::AnyPointer::Reader(_reader.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder Struct0::Builder::getF11() { - return ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder Struct0::Builder::initF11() { - auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS)); - result.clear(); - return result; -} - #if !CAPNP_LITE inline Iface0::Client::Client(decltype(nullptr)) : ::capnp::Capability::Client(nullptr) {} @@ -1832,205 +1502,25 @@ inline void Iface1::Struct1::Builder::setF0(bool value) { ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); } -inline ::uint16_t Iface1::Struct1::Reader::getF1() const { - return _reader.getDataField< ::uint16_t>( - ::capnp::bounded<1>() * ::capnp::ELEMENTS); -} - -inline ::uint16_t Iface1::Struct1::Builder::getF1() { - return _builder.getDataField< ::uint16_t>( - ::capnp::bounded<1>() * ::capnp::ELEMENTS); -} -inline void Iface1::Struct1::Builder::setF1( ::uint16_t value) { - _builder.setDataField< ::uint16_t>( - ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); -} - -inline ::int16_t Iface1::Struct1::Reader::getF2() const { - return _reader.getDataField< ::int16_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} - -inline ::int16_t Iface1::Struct1::Builder::getF2() { - return _builder.getDataField< ::int16_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} -inline void Iface1::Struct1::Builder::setF2( ::int16_t value) { - _builder.setDataField< ::int16_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); -} - -inline ::uint32_t Iface1::Struct1::Reader::getF3() const { - return _reader.getDataField< ::uint32_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} - -inline ::uint32_t Iface1::Struct1::Builder::getF3() { - return _builder.getDataField< ::uint32_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} -inline void Iface1::Struct1::Builder::setF3( ::uint32_t value) { - _builder.setDataField< ::uint32_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); -} - -inline ::int32_t Iface1::Struct1::Reader::getF4() const { - return _reader.getDataField< ::int32_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS); -} - -inline ::int32_t Iface1::Struct1::Builder::getF4() { - return _builder.getDataField< ::int32_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS); -} -inline void Iface1::Struct1::Builder::setF4( ::int32_t value) { - _builder.setDataField< ::int32_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); -} - -inline ::uint64_t Iface1::Struct1::Reader::getF5() const { - return _reader.getDataField< ::uint64_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} - -inline ::uint64_t Iface1::Struct1::Builder::getF5() { - return _builder.getDataField< ::uint64_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS); -} -inline void Iface1::Struct1::Builder::setF5( ::uint64_t value) { - _builder.setDataField< ::uint64_t>( - ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); -} - -inline ::int64_t Iface1::Struct1::Reader::getF6() const { - return _reader.getDataField< ::int64_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS); -} - -inline ::int64_t Iface1::Struct1::Builder::getF6() { - return _builder.getDataField< ::int64_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS); -} -inline void Iface1::Struct1::Builder::setF6( ::int64_t value) { - _builder.setDataField< ::int64_t>( - ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); -} - -inline float Iface1::Struct1::Reader::getF7() const { - return _reader.getDataField( - ::capnp::bounded<8>() * ::capnp::ELEMENTS); -} - -inline float Iface1::Struct1::Builder::getF7() { - return _builder.getDataField( - ::capnp::bounded<8>() * ::capnp::ELEMENTS); -} -inline void Iface1::Struct1::Builder::setF7(float value) { - _builder.setDataField( - ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); -} - -inline double Iface1::Struct1::Reader::getF8() const { - return _reader.getDataField( - ::capnp::bounded<5>() * ::capnp::ELEMENTS); -} - -inline double Iface1::Struct1::Builder::getF8() { - return _builder.getDataField( - ::capnp::bounded<5>() * ::capnp::ELEMENTS); -} -inline void Iface1::Struct1::Builder::setF8(double value) { - _builder.setDataField( - ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); -} - -inline bool Iface1::Struct1::Reader::hasF9() const { +inline bool Iface1::Struct1::Reader::hasF1() const { return !_reader.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); } -inline bool Iface1::Struct1::Builder::hasF9() { +inline bool Iface1::Struct1::Builder::hasF1() { return !_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); } -inline ::capnp::Text::Reader Iface1::Struct1::Reader::getF9() const { - return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::capnp::Text::Builder Iface1::Struct1::Builder::getF9() { - return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline void Iface1::Struct1::Builder::setF9( ::capnp::Text::Reader value) { - ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS), value); -} -inline ::capnp::Text::Builder Iface1::Struct1::Builder::initF9(unsigned int size) { - return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS), size); -} -inline void Iface1::Struct1::Builder::adoptF9( - ::capnp::Orphan< ::capnp::Text>&& value) { - ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); -} -inline ::capnp::Orphan< ::capnp::Text> Iface1::Struct1::Builder::disownF9() { - return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} - -inline bool Iface1::Struct1::Reader::hasF10() const { - return !_reader.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); -} -inline bool Iface1::Struct1::Builder::hasF10() { - return !_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); -} -inline ::capnp::Data::Reader Iface1::Struct1::Reader::getF10() const { - return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_reader.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -inline ::capnp::Data::Builder Iface1::Struct1::Builder::getF10() { - return ::capnp::_::PointerHelpers< ::capnp::Data>::get(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -inline void Iface1::Struct1::Builder::setF10( ::capnp::Data::Reader value) { - ::capnp::_::PointerHelpers< ::capnp::Data>::set(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS), value); -} -inline ::capnp::Data::Builder Iface1::Struct1::Builder::initF10(unsigned int size) { - return ::capnp::_::PointerHelpers< ::capnp::Data>::init(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS), size); -} -inline void Iface1::Struct1::Builder::adoptF10( - ::capnp::Orphan< ::capnp::Data>&& value) { - ::capnp::_::PointerHelpers< ::capnp::Data>::adopt(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); -} -inline ::capnp::Orphan< ::capnp::Data> Iface1::Struct1::Builder::disownF10() { - return ::capnp::_::PointerHelpers< ::capnp::Data>::disown(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} - -inline bool Iface1::Struct1::Reader::hasF11() const { - return !_reader.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); -} -inline bool Iface1::Struct1::Builder::hasF11() { - return !_builder.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); -} -inline ::capnp::AnyPointer::Reader Iface1::Struct1::Reader::getF11() const { +inline ::capnp::AnyPointer::Reader Iface1::Struct1::Reader::getF1() const { return ::capnp::AnyPointer::Reader(_reader.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS)); + ::capnp::bounded<0>() * ::capnp::POINTERS)); } -inline ::capnp::AnyPointer::Builder Iface1::Struct1::Builder::getF11() { +inline ::capnp::AnyPointer::Builder Iface1::Struct1::Builder::getF1() { return ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS)); + ::capnp::bounded<0>() * ::capnp::POINTERS)); } -inline ::capnp::AnyPointer::Builder Iface1::Struct1::Builder::initF11() { +inline ::capnp::AnyPointer::Builder Iface1::Struct1::Builder::initF1() { auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS)); + ::capnp::bounded<0>() * ::capnp::POINTERS)); result.clear(); return result; } From 59977b53fe450a35408a339eb2bc2fc44f22a1f6 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 8 Oct 2020 14:17:02 +0100 Subject: [PATCH 041/246] generate client methods and add streaming --- compiler/src/main/cpp/capnpc-java.c++ | 75 +++-- .../main/java/org/capnproto/CallContext.java | 2 +- .../main/java/org/capnproto/Capability.java | 27 +- .../java/org/capnproto/RemotePromise.java | 5 + .../src/main/java/org/capnproto/Request.java | 11 +- .../main/java/org/capnproto/RequestHook.java | 3 + .../org/capnproto/StreamingCallContext.java | 13 + .../java/org/capnproto/StreamingRequest.java | 25 ++ .../test/java/org/capnproto/TwoPartyTest.java | 9 +- .../test/java/org/capnproto/demo/Demo.java | 270 ++++++++++++++++- .../test/java/org/capnproto/demo/demo.capnp | 4 +- .../java/org/capnproto/demo/demo.capnp.c++ | 190 +++++++++++- .../test/java/org/capnproto/demo/demo.capnp.h | 275 ++++++++++++++++++ 13 files changed, 847 insertions(+), 62 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/StreamingCallContext.java create mode 100644 runtime/src/main/java/org/capnproto/StreamingRequest.java diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 4a4691c6..3c3b39dd 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -1607,6 +1607,8 @@ private: spaces(indent), " public Client(java.util.concurrent.CompletableFuture promise) {\n", spaces(indent), " super(promise);\n", spaces(indent), " }\n", + spaces(indent), "\n", + KJ_MAP(m, methods) { return kj::mv(m.clientDefs); }, spaces(indent), " }\n", spaces(indent), " public static abstract class Server extends org.capnproto.Capability.Server {\n", spaces(indent), " protected org.capnproto.DispatchCallResult dispatchCall(\n", @@ -1627,7 +1629,7 @@ private: spaces(indent), " org.capnproto.Capability.Server.internalUnimplemented(\"", name, "\", 0x", hexId, "L, methodId));\n", spaces(indent), " }\n", spaces(indent), " }\n\n", - KJ_MAP(m, methods) { return kj::mv(m.sourceDefs); }, + KJ_MAP(m, methods) { return kj::mv(m.serverDefs); }, spaces(indent), " }\n", spaces(indent), "\n", KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, @@ -1640,17 +1642,18 @@ private: // ----------------------------------------------------------------- struct MethodText { - kj::StringTree sourceDefs; + kj::StringTree clientDefs; + kj::StringTree serverDefs; kj::StringTree dispatchCase; }; MethodText makeMethodText(kj::StringPtr interfaceName, InterfaceSchema::Method method) { auto proto = method.getProto(); - auto name = proto.getName(); - auto titleCase = toTitleCase(name); + auto methodName = proto.getName(); + auto titleCase = toTitleCase(methodName); auto paramSchema = method.getParamType(); auto resultSchema = method.getResultType(); - auto identifierName = safeIdentifier(name); + auto identifierName = safeIdentifier(methodName); auto paramProto = paramSchema.getProto(); auto resultProto = resultSchema.getProto(); @@ -1710,42 +1713,62 @@ private: if (paramProto.getScopeId() == 0) { paramType = kj::str(javaFullName(paramSchema, method)); } + if (resultProto.getScopeId() == 0) { paramType = kj::str(javaFullName(resultSchema, method)); } + kj::String paramFactory = kj::str(shortParamType, ".factory"); + kj::String resultFactory = kj::str(shortResultType, ".factory"); + auto interfaceProto = method.getContainingInterface().getProto(); uint64_t interfaceId = interfaceProto.getId(); auto interfaceIdHex = kj::hex(interfaceId); uint16_t methodId = method.getIndex(); - auto requestMethodImpl = kj::strTree( - isStreaming ? kj::strTree("org.capnproto.StreamingRequest<", paramType, ">") - : kj::strTree("org.capnproto.Request<", paramType, ", ", resultType, ">"), - name, "Request() {\n", - isStreaming - ? kj::strTree(" return newStreamingCall<", paramType, ">(\n") - : kj::strTree(" return newCall<", paramType, ", ", resultType, ">(\n"), - " 0x", interfaceIdHex, "L, ", methodId, ");\n" - "}\n"); + if (isStreaming) { + return MethodText { + kj::strTree( + " public org.capnproto.StreamingRequest<", shortParamType, ".Builder> ", methodName, "Request() {\n", + " return newStreamingCall(", paramFactory, ", 0x", interfaceIdHex, "L, (short)", methodId, ");\n" + " }\n"), - return MethodText { + kj::strTree( + " protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.StreamingCallContext<", shortParamType, ".Reader> context) {\n" + " return org.capnproto.Capability.Server.internalUnimplemented(\n" + " \"", interfaceProto.getDisplayName(), "\", \"", methodName, "\",\n" + " 0x", interfaceIdHex, "L, (short)", methodId, ");\n" + " }\n\n"), - kj::strTree( - " protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.CallContext<", titleCase, "Params.Reader, ", titleCase, "Results.Builder> context) {\n" - " return org.capnproto.Capability.Server.internalUnimplemented(\n" - " \"", interfaceProto.getDisplayName(), "\", \"", name, "\",\n" + kj::strTree( + " case ", methodId, ":\n", + " return org.capnproto.Capability.Server.streamResult(\n", + " this.", identifierName, "(org.capnproto.Capability.Server.internalGetTypedStreamingContext(\n" + " ", paramFactory, ", context)));\n") + }; + + } else { + return MethodText { + + kj::strTree( + " public org.capnproto.Request<", shortParamType, ".Builder, ", shortResultType, ".Reader> ", methodName, "Request() {\n", + " return newCall(", paramFactory, ", ", resultFactory, ", 0x", interfaceIdHex, "L, (short)", methodId, ");\n" + " }\n"), + + kj::strTree( + " protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.CallContext<", shortParamType, ".Reader, ", shortResultType, ".Builder> context) {\n" + " return org.capnproto.Capability.Server.internalUnimplemented(\n" + " \"", interfaceProto.getDisplayName(), "\", \"", methodName, "\",\n" " 0x", interfaceIdHex, "L, (short)", methodId, ");\n" " }\n\n"), - kj::strTree( + kj::strTree( " case ", methodId, ":\n", - " return org.capnproto.Capability.Server.", - isStreaming ? "streamResult" : "result", "(\n", - " this.", identifierName, "(org.capnproto.Capability.Server.typedContext(\n" - " ", genericParamType, ".factory,\n", - " ", genericResultType, ".factory, context)));\n") - }; + " return org.capnproto.Capability.Server.result (\n", + " this.", identifierName, "(org.capnproto.Capability.Server.internalGetTypedContext(\n" + " ", paramFactory, ", ", resultFactory, ", context)));\n") + }; + } } // ----------------------------------------------------------------- diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java index 49279f03..8a73e975 100644 --- a/runtime/src/main/java/org/capnproto/CallContext.java +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -4,9 +4,9 @@ public class CallContext { - final CallContextHook hook; private final FromPointerReader params; private final FromPointerBuilder results; + final CallContextHook hook; public CallContext(FromPointerReader params, FromPointerBuilder results, diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index ad75eb79..277e5fa7 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -79,10 +79,16 @@ Request typelessRequest( } protected Request newCall(FromPointerBuilder builder, - FromPointerReader reader, - long interfaceId, short methodId) { + FromPointerReader reader, + long interfaceId, short methodId) { var request = hook.newCall(interfaceId, methodId); - return new Request (builder, reader, request.params, request.hook); + return new Request<> (builder, reader, request.params, request.hook); + } + + protected StreamingRequest newStreamingCall(FromPointerBuilder builder, + long interfaceId, short methodId) { + var request = hook.newCall(interfaceId, methodId); + return new StreamingRequest<> (builder, request.params, request.hook); } } @@ -183,13 +189,19 @@ protected Client thisCap() { return new Client(this.hook); } - protected static CallContext typedContext( + protected static CallContext internalGetTypedContext( FromPointerReader paramsFactory, FromPointerBuilder resultsFactory, CallContext typeless) { return new CallContext<>(paramsFactory, resultsFactory, typeless.hook); } + protected static StreamingCallContext internalGetTypedStreamingContext( + FromPointerReader paramsFactory, + CallContext typeless) { + return new StreamingCallContext<>(paramsFactory, typeless.hook); + } + protected abstract DispatchCallResult dispatchCall( long interfaceId, short methodId, CallContext context); @@ -258,6 +270,13 @@ public RemotePromise send() { return new RemotePromise(promise, promiseAndPipeline.pipeline); } + @Override + public CompletableFuture sendStreaming() { + // We don't do any special handling of streaming in RequestHook for local requests, because + // there is no latency to compensate for between the client and server in this case. + return send().ignoreResult(); + } + @Override public Object getBrand() { return null; diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index 9664942c..a9acd6ee 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -16,6 +16,11 @@ public CompletableFuture getResponse() { return response; } + public CompletableFuture ignoreResult() { + return this.response.thenCompose( + result -> CompletableFuture.completedFuture(null)); + } + public PipelineHook getHook() { return pipeline; } diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index 38c931ce..dd6d580e 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -25,9 +25,8 @@ Params params() { CompletableFuture send() { var typelessPromise = hook.send(); hook = null; // prevent reuse - return typelessPromise.getResponse().thenApply(response -> { - return response.getAs(resultsReader); - }); + return typelessPromise.getResponse().thenApply( + response -> response.getAs(resultsReader)); } static Request newBrokenRequest(Throwable exc) { @@ -39,6 +38,11 @@ public RemotePromise send() { return new RemotePromise<>(CompletableFuture.failedFuture(exc), null); } + @Override + public CompletableFuture sendStreaming() { + return CompletableFuture.failedFuture(exc); + } + @Override public Object getBrand() { return null; @@ -59,4 +63,3 @@ static Request fromTypeless(FromPointerBuilde return new Request<>(params, results, typeless.params(), typeless.hook); } } - diff --git a/runtime/src/main/java/org/capnproto/RequestHook.java b/runtime/src/main/java/org/capnproto/RequestHook.java index 290aecee..1ba5df74 100644 --- a/runtime/src/main/java/org/capnproto/RequestHook.java +++ b/runtime/src/main/java/org/capnproto/RequestHook.java @@ -1,6 +1,9 @@ package org.capnproto; +import java.util.concurrent.CompletableFuture; + interface RequestHook { RemotePromise send(); + CompletableFuture sendStreaming(); Object getBrand(); } diff --git a/runtime/src/main/java/org/capnproto/StreamingCallContext.java b/runtime/src/main/java/org/capnproto/StreamingCallContext.java new file mode 100644 index 00000000..750d8dc3 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/StreamingCallContext.java @@ -0,0 +1,13 @@ +package org.capnproto; + +public class StreamingCallContext { + + private final FromPointerReader params; + final CallContextHook hook; + + public StreamingCallContext(FromPointerReader params, + CallContextHook hook) { + this.params = params; + this.hook = hook; + } +} diff --git a/runtime/src/main/java/org/capnproto/StreamingRequest.java b/runtime/src/main/java/org/capnproto/StreamingRequest.java new file mode 100644 index 00000000..81943cee --- /dev/null +++ b/runtime/src/main/java/org/capnproto/StreamingRequest.java @@ -0,0 +1,25 @@ +package org.capnproto; + + +import java.util.concurrent.CompletableFuture; + +public class StreamingRequest { + + private final FromPointerBuilder paramsBuilder; + AnyPointer.Builder params; + RequestHook hook; + + StreamingRequest(FromPointerBuilder paramsBuilder, + AnyPointer.Builder params, RequestHook hook) { + this.paramsBuilder = paramsBuilder; + this.params = params; + this.hook = hook; + } + + CompletableFuture send() { + var promise = hook.sendStreaming(); + hook = null; // prevent reuse + return promise; + } +} + diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index a946e43d..56b01b6f 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -1,7 +1,6 @@ package org.capnproto; import org.capnproto.demo.Demo; -import org.capnproto.demo.DemoFoo; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -44,9 +43,9 @@ public DispatchCallResult dispatchCall(long interfaceId, short methodId, CallCon DispatchCallResult dispatchCallInternal(short methodId, CallContext ctx) { switch (methodId) { case 0: - return result(testMethod0(typedContext(Demo.TestParams0.factory, Demo.TestResults0.factory, ctx))); + return result(testMethod0(internalGetTypedContext(Demo.TestParams0.factory, Demo.TestResults0.factory, ctx))); case 1: - return result(testMethod1(typedContext(Demo.TestParams1.factory, Demo.TestResults1.factory, ctx))); + return result(testMethod1(internalGetTypedContext(Demo.TestParams1.factory, Demo.TestResults1.factory, ctx))); default: return result(internalUnimplemented(Demo.class.getName(), 0xa27d3c231c7b9202L, methodId)); } @@ -194,10 +193,6 @@ public void testReturnCap() throws ExecutionException, InterruptedException { Assert.assertFalse(cap1.isNull()); var cap2 = results.getResult2(); Assert.assertFalse(cap2.isNull()); - - var cap3 = results.getResult2().getAs(Demo.Iface0.factory); - Assert.assertFalse(cap2.isNull()); - //Assert.assertFalse(cap2.hook.isError()); } @Test diff --git a/runtime/src/test/java/org/capnproto/demo/Demo.java b/runtime/src/test/java/org/capnproto/demo/Demo.java index 820e36ed..1f70ba4f 100644 --- a/runtime/src/test/java/org/capnproto/demo/Demo.java +++ b/runtime/src/test/java/org/capnproto/demo/Demo.java @@ -328,6 +328,13 @@ public Client() {} public Client(java.util.concurrent.CompletableFuture promise) { super(promise); } + + public org.capnproto.Request method0Request() { + return newCall(Method0Params.factory, Method0Results.factory, 0xac6d126c2fac16ebL, (short)0); + } + public org.capnproto.StreamingRequest method1Request() { + return newStreamingCall(Method1Params.factory, 0xac6d126c2fac16ebL, (short)1); + } } public static abstract class Server extends org.capnproto.Capability.Server { protected org.capnproto.DispatchCallResult dispatchCall( @@ -342,14 +349,154 @@ protected org.capnproto.DispatchCallResult dispatchCall( protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { switch (methodId) { + case 0: + return org.capnproto.Capability.Server.result ( + this.method0(org.capnproto.Capability.Server.internalGetTypedContext( + Method0Params.factory, Method0Results.factory, context))); + case 1: + return org.capnproto.Capability.Server.streamResult( + this.method1(org.capnproto.Capability.Server.internalGetTypedStreamingContext( + Method1Params.factory, context))); default: return org.capnproto.Capability.Server.result( org.capnproto.Capability.Server.internalUnimplemented("Iface0", 0xac6d126c2fac16ebL, methodId)); } } + protected java.util.concurrent.CompletableFuture method0(org.capnproto.CallContext context) { + return org.capnproto.Capability.Server.internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method0", + 0xac6d126c2fac16ebL, (short)0); + } + + protected java.util.concurrent.CompletableFuture method1(org.capnproto.StreamingCallContext context) { + return org.capnproto.Capability.Server.internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method1", + 0xac6d126c2fac16ebL, (short)1); + } + } + public static class Method0Params { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Iface0.Method0Params.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + } + + } + + + public static class Method0Results { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Iface0.Method0Results.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + } + + } + + + public static class Method1Params { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Iface0.Method1Params.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + } + + } + + } @@ -443,6 +590,13 @@ public Client() {} public Client(java.util.concurrent.CompletableFuture promise) { super(promise); } + + public org.capnproto.Request method0Request() { + return newCall(Method0Params.factory, Method0Results.factory, 0xd52dcf38c9f6f7c0L, (short)0); + } + public org.capnproto.Request method1Request() { + return newCall(Method1Params.factory, Method1Results.factory, 0xd52dcf38c9f6f7c0L, (short)1); + } } public static abstract class Server extends org.capnproto.Capability.Server { protected org.capnproto.DispatchCallResult dispatchCall( @@ -458,15 +612,13 @@ protected org.capnproto.DispatchCallResult dispatchCall( protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { switch (methodId) { case 0: - return org.capnproto.Capability.Server.result( - this.method0(org.capnproto.Capability.Server.typedContext( - Method0Params.factory, - Method0Results.factory, context))); + return org.capnproto.Capability.Server.result ( + this.method0(org.capnproto.Capability.Server.internalGetTypedContext( + Method0Params.factory, Method0Results.factory, context))); case 1: - return org.capnproto.Capability.Server.result( - this.method1(org.capnproto.Capability.Server.typedContext( - Method1Params.factory, - Method1Results.factory, context))); + return org.capnproto.Capability.Server.result ( + this.method1(org.capnproto.Capability.Server.internalGetTypedContext( + Method1Params.factory, Method1Results.factory, context))); default: return org.capnproto.Capability.Server.result( org.capnproto.Capability.Server.internalUnimplemented("Iface1", 0xd52dcf38c9f6f7c0L, methodId)); @@ -474,13 +626,13 @@ protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, } protected java.util.concurrent.CompletableFuture method0(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( + return org.capnproto.Capability.Server.internalUnimplemented( "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method0", 0xd52dcf38c9f6f7c0L, (short)0); } protected java.util.concurrent.CompletableFuture method1(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( + return org.capnproto.Capability.Server.internalUnimplemented( "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method1", 0xd52dcf38c9f6f7c0L, (short)1); } @@ -1008,8 +1160,8 @@ public static final class Schemas { "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0087\u0000\u0000\u0000" + + "\u007d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + @@ -1020,8 +1172,100 @@ public static final class Schemas { "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + "\u0065\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004b\u0029\u0076\u00aa\u00ed\u0077\u008d\u00bc" + + "\u003e\u0067\u0084\u00a6\u004a\u00e2\u0044\u00f7" + + "\u0031\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u00f3\u0034\u00d2\u0078\u005b\u00c2\u00c8" + + "\u006e\u00b1\u00c0\u0077\u0033\u009a\u005f\u0099" + + "\u0019\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u006d\u0065\u0074\u0068\u006f\u0064\u0030\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + + "\u006d\u0065\u0074\u0068\u006f\u0064\u0031\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); +public static final org.capnproto.SegmentReader b_bc8d77edaa76294b = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u004b\u0029\u0076\u00aa\u00ed\u0077\u008d\u00bc" + + "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + + "\u0065\u0030\u002e\u006d\u0065\u0074\u0068\u006f" + + "\u0064\u0030\u0024\u0050\u0061\u0072\u0061\u006d" + + "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_f744e24aa684673e = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u003e\u0067\u0084\u00a6\u004a\u00e2\u0044\u00f7" + + "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u005a\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + + "\u0065\u0030\u002e\u006d\u0065\u0074\u0068\u006f" + + "\u0064\u0030\u0024\u0052\u0065\u0073\u0075\u006c" + + "\u0074\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_c8c25b78d234f324 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0024\u00f3\u0034\u00d2\u0078\u005b\u00c2\u00c8" + + "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + + "\u0065\u0030\u002e\u006d\u0065\u0074\u0068\u006f" + + "\u0064\u0031\u0024\u0050\u0061\u0072\u0061\u006d" + + "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); public static final org.capnproto.SegmentReader b_a9395663e97ca3af = org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp b/runtime/src/test/java/org/capnproto/demo/demo.capnp index a9676ede..0b67c3e0 100644 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp @@ -27,6 +27,8 @@ struct Struct0 { } interface Iface0 { + method0 @0 (); + method1 @1 () -> stream; } struct Struct2 { @@ -37,7 +39,7 @@ struct Struct2 { interface Iface1 { struct Struct1 { - f0 @0 :Bool; + f0 @0 :Bool; f1 @1 :AnyPointer; } diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ index db120da0..53d50f4a 100644 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ @@ -277,7 +277,7 @@ const ::capnp::_::RawSchema s_b1af51b6aef0e7bc = { 0, 1, i_b1af51b6aef0e7bc, nullptr, nullptr, { &s_b1af51b6aef0e7bc, nullptr, nullptr, 0, 0, nullptr } }; #endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<23> b_ac6d126c2fac16eb = { +static const ::capnp::_::AlignedData<43> b_ac6d126c2fac16eb = { { 0, 0, 0, 0, 5, 0, 6, 0, 235, 22, 172, 47, 108, 18, 109, 172, 52, 0, 0, 0, 3, 0, 0, 0, @@ -287,8 +287,8 @@ static const ::capnp::_::AlignedData<23> b_ac6d126c2fac16eb = { 21, 0, 0, 0, 218, 1, 0, 0, 49, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 7, 0, 0, 0, - 45, 0, 0, 0, 7, 0, 0, 0, + 45, 0, 0, 0, 135, 0, 0, 0, + 125, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 117, 110, 116, 105, 109, 101, 47, 115, 114, 99, 47, 116, 101, 115, 116, @@ -299,14 +299,134 @@ static const ::capnp::_::AlignedData<23> b_ac6d126c2fac16eb = { 112, 110, 112, 58, 73, 102, 97, 99, 101, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 3, 0, 5, 0, + 8, 0, 0, 0, 3, 0, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 75, 41, 118, 170, 237, 119, 141, 188, + 62, 103, 132, 166, 74, 226, 68, 247, + 49, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 36, 243, 52, 210, 120, 91, 194, 200, + 110, 177, 192, 119, 51, 154, 95, 153, + 25, 0, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 7, 0, 0, 0, + 109, 101, 116, 104, 111, 100, 48, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 109, 101, 116, 104, 111, 100, 49, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, } }; ::capnp::word const* const bp_ac6d126c2fac16eb = b_ac6d126c2fac16eb.words; #if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_ac6d126c2fac16eb[] = { + &s_995f9a3377c0b16e, + &s_bc8d77edaa76294b, + &s_c8c25b78d234f324, + &s_f744e24aa684673e, +}; +static const uint16_t m_ac6d126c2fac16eb[] = {0, 1}; const ::capnp::_::RawSchema s_ac6d126c2fac16eb = { - 0xac6d126c2fac16eb, b_ac6d126c2fac16eb.words, 23, nullptr, nullptr, - 0, 0, nullptr, nullptr, nullptr, { &s_ac6d126c2fac16eb, nullptr, nullptr, 0, 0, nullptr } + 0xac6d126c2fac16eb, b_ac6d126c2fac16eb.words, 43, d_ac6d126c2fac16eb, m_ac6d126c2fac16eb, + 4, 2, nullptr, nullptr, nullptr, { &s_ac6d126c2fac16eb, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<22> b_bc8d77edaa76294b = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 75, 41, 118, 170, 237, 119, 141, 188, + 59, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 82, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 73, 102, 97, 99, + 101, 48, 46, 109, 101, 116, 104, 111, + 100, 48, 36, 80, 97, 114, 97, 109, + 115, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_bc8d77edaa76294b = b_bc8d77edaa76294b.words; +#if !CAPNP_LITE +const ::capnp::_::RawSchema s_bc8d77edaa76294b = { + 0xbc8d77edaa76294b, b_bc8d77edaa76294b.words, 22, nullptr, nullptr, + 0, 0, nullptr, nullptr, nullptr, { &s_bc8d77edaa76294b, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<22> b_f744e24aa684673e = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 62, 103, 132, 166, 74, 226, 68, 247, + 59, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 90, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 73, 102, 97, 99, + 101, 48, 46, 109, 101, 116, 104, 111, + 100, 48, 36, 82, 101, 115, 117, 108, + 116, 115, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_f744e24aa684673e = b_f744e24aa684673e.words; +#if !CAPNP_LITE +const ::capnp::_::RawSchema s_f744e24aa684673e = { + 0xf744e24aa684673e, b_f744e24aa684673e.words, 22, nullptr, nullptr, + 0, 0, nullptr, nullptr, nullptr, { &s_f744e24aa684673e, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<22> b_c8c25b78d234f324 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 36, 243, 52, 210, 120, 91, 194, 200, + 59, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 82, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 73, 102, 97, 99, + 101, 48, 46, 109, 101, 116, 104, 111, + 100, 49, 36, 80, 97, 114, 97, 109, + 115, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_c8c25b78d234f324 = b_c8c25b78d234f324.words; +#if !CAPNP_LITE +const ::capnp::_::RawSchema s_c8c25b78d234f324 = { + 0xc8c25b78d234f324, b_c8c25b78d234f324.words, 22, nullptr, nullptr, + 0, 0, nullptr, nullptr, nullptr, { &s_c8c25b78d234f324, nullptr, nullptr, 0, 0, nullptr } }; #endif // !CAPNP_LITE static const ::capnp::_::AlignedData<52> b_a9395663e97ca3af = { @@ -730,6 +850,26 @@ constexpr ::capnp::_::RawSchema const* Struct0::_capnpPrivate::schema; #endif // !CAPNP_LITE #if !CAPNP_LITE +::capnp::Request< ::Iface0::Method0Params, ::Iface0::Method0Results> +Iface0::Client::method0Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { + return newCall< ::Iface0::Method0Params, ::Iface0::Method0Results>( + 0xac6d126c2fac16ebull, 0, sizeHint); +} +::kj::Promise Iface0::Server::method0(Method0Context) { + return ::capnp::Capability::Server::internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method0", + 0xac6d126c2fac16ebull, 0); +} +::capnp::StreamingRequest< ::Iface0::Method1Params> +Iface0::Client::method1Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { + return newStreamingCall< ::Iface0::Method1Params>( + 0xac6d126c2fac16ebull, 1, sizeHint); +} +::kj::Promise Iface0::Server::method1(Method1Context) { + return ::capnp::Capability::Server::internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method1", + 0xac6d126c2fac16ebull, 1); +} ::capnp::Capability::Server::DispatchCallResult Iface0::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { @@ -744,6 +884,20 @@ constexpr ::capnp::_::RawSchema const* Struct0::_capnpPrivate::schema; uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { + case 0: + return { + method0(::capnp::Capability::Server::internalGetTypedContext< + ::Iface0::Method0Params, ::Iface0::Method0Results>(context)), + false + }; + case 1: + return { + kj::evalNow([&]() { + return method1(::capnp::Capability::Server::internalGetTypedStreamingContext< + ::Iface0::Method1Params>(context)); + }), + true + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -759,6 +913,30 @@ constexpr ::capnp::Kind Iface0::_capnpPrivate::kind; constexpr ::capnp::_::RawSchema const* Iface0::_capnpPrivate::schema; #endif // !CAPNP_LITE +// Iface0::Method0Params +constexpr uint16_t Iface0::Method0Params::_capnpPrivate::dataWordSize; +constexpr uint16_t Iface0::Method0Params::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Iface0::Method0Params::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Iface0::Method0Params::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Iface0::Method0Results +constexpr uint16_t Iface0::Method0Results::_capnpPrivate::dataWordSize; +constexpr uint16_t Iface0::Method0Results::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Iface0::Method0Results::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Iface0::Method0Results::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +// Iface0::Method1Params +constexpr uint16_t Iface0::Method1Params::_capnpPrivate::dataWordSize; +constexpr uint16_t Iface0::Method1Params::_capnpPrivate::pointerCount; +#if !CAPNP_LITE +constexpr ::capnp::Kind Iface0::Method1Params::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* Iface0::Method1Params::_capnpPrivate::schema; +#endif // !CAPNP_LITE + // Struct2 constexpr uint16_t Struct2::_capnpPrivate::dataWordSize; constexpr uint16_t Struct2::_capnpPrivate::pointerCount; diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp.h b/runtime/src/test/java/org/capnproto/demo/demo.capnp.h index a5953344..f98b0922 100644 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp.h +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.h @@ -23,6 +23,9 @@ CAPNP_DECLARE_SCHEMA(b20f33e412339049); CAPNP_DECLARE_SCHEMA(d1342392ab536963); CAPNP_DECLARE_SCHEMA(b1af51b6aef0e7bc); CAPNP_DECLARE_SCHEMA(ac6d126c2fac16eb); +CAPNP_DECLARE_SCHEMA(bc8d77edaa76294b); +CAPNP_DECLARE_SCHEMA(f744e24aa684673e); +CAPNP_DECLARE_SCHEMA(c8c25b78d234f324); CAPNP_DECLARE_SCHEMA(a9395663e97ca3af); CAPNP_DECLARE_SCHEMA(d52dcf38c9f6f7c0); CAPNP_DECLARE_SCHEMA(800ca862fbfddd38); @@ -118,6 +121,9 @@ struct Iface0 { class Server; #endif // !CAPNP_LITE + struct Method0Params; + struct Method0Results; + struct Method1Params; #if !CAPNP_LITE struct _capnpPrivate { @@ -127,6 +133,51 @@ struct Iface0 { #endif // !CAPNP_LITE }; +struct Iface0::Method0Params { + Method0Params() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(bc8d77edaa76294b, 0, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Iface0::Method0Results { + Method0Results() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(f744e24aa684673e, 0, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + +struct Iface0::Method1Params { + Method1Params() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(c8c25b78d234f324, 0, 0) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + struct Struct2 { Struct2() = delete; @@ -658,6 +709,10 @@ class Iface0::Client Client& operator=(Client& other); Client& operator=(Client&& other); + ::capnp::Request< ::Iface0::Method0Params, ::Iface0::Method0Results> method0Request( + ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); + ::capnp::StreamingRequest< ::Iface0::Method1Params> method1Request( + ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); protected: Client() = default; @@ -674,6 +729,13 @@ class Iface0::Server override; protected: + typedef ::Iface0::Method0Params Method0Params; + typedef ::Iface0::Method0Results Method0Results; + typedef ::capnp::CallContext Method0Context; + virtual ::kj::Promise method0(Method0Context context); + typedef ::Iface0::Method1Params Method1Params; + typedef ::capnp::StreamingCallContext Method1Context; + virtual ::kj::Promise method1(Method1Context context); inline ::Iface0::Client thisCap() { return ::capnp::Capability::Server::thisCap() @@ -686,6 +748,219 @@ class Iface0::Server }; #endif // !CAPNP_LITE +class Iface0::Method0Params::Reader { +public: + typedef Method0Params Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Iface0::Method0Params::Builder { +public: + typedef Method0Params Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Iface0::Method0Params::Pipeline { +public: + typedef Method0Params Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Iface0::Method0Results::Reader { +public: + typedef Method0Results Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Iface0::Method0Results::Builder { +public: + typedef Method0Results Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Iface0::Method0Results::Pipeline { +public: + typedef Method0Results Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + +class Iface0::Method1Params::Reader { +public: + typedef Method1Params Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class Iface0::Method1Params::Builder { +public: + typedef Method1Params Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class Iface0::Method1Params::Pipeline { +public: + typedef Method1Params Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + class Struct2::Reader { public: typedef Struct2 Reads; From 2ffdecbe41ebaa221b6152b96760d25eba0156b8 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 8 Oct 2020 15:35:15 +0100 Subject: [PATCH 042/246] Make Response typed --- runtime/src/main/java/org/capnproto/Capability.java | 7 +++++-- .../src/main/java/org/capnproto/RemotePromise.java | 7 ++++--- runtime/src/main/java/org/capnproto/Request.java | 12 +++++++++--- runtime/src/main/java/org/capnproto/RequestHook.java | 2 +- runtime/src/main/java/org/capnproto/Response.java | 10 +++++++--- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 277e5fa7..f711e837 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -306,7 +306,7 @@ static class LocalCallContext implements CallContextHook { final CompletableFuture cancelAllowed; MessageBuilder request; - Response response; + Response response; AnyPointer.Builder responseBuilder; ClientHook clientRef; @@ -333,7 +333,10 @@ public AnyPointer.Builder getResults() { if (this.response == null) { var localResponse = new LocalResponse(); this.responseBuilder = localResponse.message.getRoot(AnyPointer.factory); - this.response = new Response(this.responseBuilder.asReader(), localResponse); + this.response = new Response<>( + AnyPointer.factory, + this.responseBuilder.asReader(), + localResponse); } return this.responseBuilder; } diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index a9acd6ee..ab278bca 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -4,15 +4,16 @@ class RemotePromise { - final CompletableFuture response; + final CompletableFuture> response; final PipelineHook pipeline; - RemotePromise(CompletableFuture response, PipelineHook pipeline) { + RemotePromise(CompletableFuture> response, + PipelineHook pipeline) { this.response = response; this.pipeline = pipeline; } - public CompletableFuture getResponse() { + public CompletableFuture> getResponse() { return response; } diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index dd6d580e..6573f7be 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -22,11 +22,17 @@ Params params() { return params.getAs(paramsBuilder); } - CompletableFuture send() { + RemotePromise send() { var typelessPromise = hook.send(); hook = null; // prevent reuse - return typelessPromise.getResponse().thenApply( - response -> response.getAs(resultsReader)); + var typedPromise = typelessPromise.getResponse().thenApply(response -> { + return new Response( + resultsReader, + response.get(), + response.hook); + }); + + return new RemotePromise(typedPromise, typelessPromise.pipeline); } static Request newBrokenRequest(Throwable exc) { diff --git a/runtime/src/main/java/org/capnproto/RequestHook.java b/runtime/src/main/java/org/capnproto/RequestHook.java index 1ba5df74..58133263 100644 --- a/runtime/src/main/java/org/capnproto/RequestHook.java +++ b/runtime/src/main/java/org/capnproto/RequestHook.java @@ -2,7 +2,7 @@ import java.util.concurrent.CompletableFuture; -interface RequestHook { +public interface RequestHook { RemotePromise send(); CompletableFuture sendStreaming(); Object getBrand(); diff --git a/runtime/src/main/java/org/capnproto/Response.java b/runtime/src/main/java/org/capnproto/Response.java index 8c188dac..ee6c0386 100644 --- a/runtime/src/main/java/org/capnproto/Response.java +++ b/runtime/src/main/java/org/capnproto/Response.java @@ -1,16 +1,20 @@ package org.capnproto; -class Response { +class Response { + final FromPointerReader factory; final ResponseHook hook; final AnyPointer.Reader results; - public Response(AnyPointer.Reader reader, ResponseHook hook) { + public Response(FromPointerReader factory, + AnyPointer.Reader reader, + ResponseHook hook) { + this.factory = factory; this.hook = hook; this.results = reader; } - public final T getAs(FromPointerReader factory) { + public final Results get() { return this.results.getAs(factory); } } \ No newline at end of file From 1abc975b8bc115243069fa3b9c469248a6630cd1 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 8 Oct 2020 15:36:40 +0100 Subject: [PATCH 043/246] defer disembargo --- .../src/main/java/org/capnproto/RpcState.java | 68 +++++++++++++------ 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index da61be95..b76cb412 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -1,8 +1,11 @@ package org.capnproto; import java.util.*; +import java.util.concurrent.Callable; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; +import java.util.concurrent.FutureTask; +import java.util.function.Function; final class RpcState { @@ -117,6 +120,18 @@ final boolean isConnected() { return !isDisconnected(); } + // Run func() before the next IO event. + private CompletableFuture evalLast(Callable func) { + return this.messageReady.thenCompose(x -> { + try { + return CompletableFuture.completedFuture(func.call()); + } + catch (java.lang.Exception exc) { + return CompletableFuture.failedFuture(exc); + } + }); + } + ClientHook restore() { var question = questions.next(); question.isAwaitingReturn = true; @@ -276,7 +291,7 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo var payload = ret.initResults(); var content = payload.getContent().imbue(capTable); - content.setAsCapability(bootstrapInterface); + content.setAsCap(bootstrapInterface); var capTableArray = capTable.getTable(); assert capTableArray.length != 0; @@ -531,28 +546,31 @@ void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { return; } - var embargoId = ctx.getSenderLoopback(); + final var embargoId = ctx.getSenderLoopback(); + final var rpcTarget = (RpcClient) target; - // TODO run this later... - if (isDisconnected()) { - return; - } + Callable sendDisembargo = () -> { + if (isDisconnected()) { + return null; + } - var rpcTarget = (RpcClient) target; - var message = connection.newOutgoingMessage(1024); - var builder = message.getBody().initAs(RpcProtocol.Message.factory).initDisembargo(); - var redirect = rpcTarget.writeTarget(builder.initTarget()); - // Disembargoes should only be sent to capabilities that were previously the subject of - // a `Resolve` message. But `writeTarget` only ever returns non-null when called on - // a PromiseClient. The code which sends `Resolve` and `Return` should have replaced - // any promise with a direct node in order to solve the Tribble 4-way race condition. - // See the documentation of Disembargo in rpc.capnp for more. - if (redirect == null) { - assert false: "'Disembargo' of type 'senderLoopback' sent to an object that does not appear to have been the subject of a previous 'Resolve' message."; - return; - } - builder.getContext().setReceiverLoopback(embargoId); - message.send(); + var message = connection.newOutgoingMessage(1024); + var builder = message.getBody().initAs(RpcProtocol.Message.factory).initDisembargo(); + var redirect = rpcTarget.writeTarget(builder.initTarget()); + // Disembargoes should only be sent to capabilities that were previously the subject of + // a `Resolve` message. But `writeTarget` only ever returns non-null when called on + // a PromiseClient. The code which sends `Resolve` and `Return` should have replaced + // any promise with a direct node in order to solve the Tribble 4-way race condition. + // See the documentation of Disembargo in rpc.capnp for more. + if (redirect == null) { + assert false : "'Disembargo' of type 'senderLoopback' sent to an object that does not appear to have been the subject of a previous 'Resolve' message."; + return null; + } + builder.getContext().setReceiverLoopback(embargoId); + message.send(); + return null; + }; + evalLast(sendDisembargo); break; case RECEIVER_LOOPBACK: @@ -1274,12 +1292,18 @@ public RemotePromise send() { var appPromise = question.response.thenApply(response -> { var results = response.getResults(); - return new Response(results, response); + return new Response<>(AnyPointer.factory, results, response); }); return new RemotePromise<>(appPromise, pipeline); } + @Override + public CompletableFuture sendStreaming() { + // TODO falling back to regular send for now... + return send().ignoreResult(); + } + Question sendInternal(boolean isTailCall) { // TODO refactor var fds = List.of(); From 606dd26d48b33ebb6a6934c6ca16127041f2e5db Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 8 Oct 2020 17:18:54 +0100 Subject: [PATCH 044/246] generate pipelines, add AnyPointer.Pipeline --- compiler/src/main/cpp/capnpc-java.c++ | 36 ++++-- .../main/java/org/capnproto/AnyPointer.java | 42 +++++++ .../main/java/org/capnproto/Capability.java | 2 +- .../java/org/capnproto/RemotePromise.java | 1 + .../src/main/java/org/capnproto/Request.java | 2 +- .../src/main/java/org/capnproto/Response.java | 2 +- .../test/java/org/capnproto/TwoPartyTest.java | 69 +++++++--- .../test/java/org/capnproto/demo/Demo.java | 118 ++++++++++++++++++ 8 files changed, 247 insertions(+), 25 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 3c3b39dd..996e2f1c 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -711,6 +711,7 @@ private: struct FieldText { kj::StringTree readerMethodDecls; kj::StringTree builderMethodDecls; + kj::StringTree pipelineMethodDecls; }; enum class FieldKind { @@ -869,7 +870,10 @@ private: " return new ", scope, titleCase, ".Builder(segment, data, pointers, dataSize, pointerCount);\n", spaces(indent), " }\n", - "\n") + "\n"), + + // TODO pipelineMethodDecls + kj::strTree() }; } } @@ -1028,7 +1032,7 @@ private: } else if (kind == FieldKind::INTERFACE) { auto factoryArg = kj::str(typeName(field.getType()), ".factory"); - auto capType = kj::str(typeName(field.getType()), ".Client"); + auto clientType = kj::str(typeName(field.getType()), ".Client"); return FieldText { kj::strTree( @@ -1038,7 +1042,7 @@ private: spaces(indent), " return !_pointerFieldIsNull(", offset, ");\n", spaces(indent), " }\n", - spaces(indent), " public ", capType, " get", titleCase, "() {\n", + spaces(indent), " public ", clientType, " get", titleCase, "() {\n", unionDiscrim.check, spaces(indent), " return _getPointerField(", factoryArg, ", ", offset, ");\n", spaces(indent), " }\n"), @@ -1049,17 +1053,23 @@ private: spaces(indent), " return !_pointerFieldIsNull(", offset, ");\n", spaces(indent), " }\n", - spaces(indent), " public ", capType, " get", titleCase, "() {\n", + spaces(indent), " public ", clientType, " get", titleCase, "() {\n", unionDiscrim.check, spaces(indent), " return _getPointerField(", factoryArg, ", ", offset, ");\n", spaces(indent), " }\n", - spaces(indent), " public void set", titleCase, "(", capType, " value) {\n", + spaces(indent), " public void set", titleCase, "(", clientType, " value) {\n", unionDiscrim.set, spaces(indent), " _initPointerField(", factoryArg, ", ", offset, ", 0);\n", spaces(indent), " }\n", - "\n") - }; + "\n"), + + kj::strTree( + spaces(indent), " public ", clientType, " get", titleCase, "() {\n", + spaces(indent), " return new ", clientType, "(typeless.getPointerField((short)", offset, ").asCap());\n", + spaces(indent), " }\n" + ) + }; } else if (kind == FieldKind::ANY_POINTER) { auto factoryArg = makeFactoryArg(field.getType()); @@ -1563,7 +1573,16 @@ private: spaces(indent), " _NOT_IN_SCHEMA,\n", spaces(indent), " }\n"), KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, - spaces(indent), "}\n" + + spaces(indent), " public static class Pipeline {\n", + spaces(indent), " private org.capnproto.AnyPointer.Pipeline typeless;\n\n", + spaces(indent), " public Pipeline() {}\n", + spaces(indent), " public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) {\n", + spaces(indent), " this.typeless = typeless;\n", + spaces(indent), " }\n", + KJ_MAP(f, fieldTexts) { return kj::mv(f.pipelineMethodDecls); }, + spaces(indent), " }\n", + spaces(indent), "}\n", "\n", "\n"), @@ -1571,6 +1590,7 @@ private: kj::strTree() }; } + // ----------------------------------------------------------------- struct InterfaceText { diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index feb304e7..2f452851 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -143,4 +143,46 @@ public final void clear() { } } + public static final class Pipeline { + private PipelineHook hook; + private final PipelineOp[] ops; + + Pipeline() { + this.hook = null; + this.ops = new PipelineOp[0]; + } + + Pipeline(PipelineHook hook) { + this.hook = hook; + this.ops = new PipelineOp[0]; + } + + Pipeline(PipelineHook hook, PipelineOp[] ops) { + this.hook = hook; + this.ops = ops; + } + + Pipeline noop() { + return new Pipeline(this.hook, this.ops.clone()); + } + + public ClientHook asCap() { + return this.hook.getPipelinedCap(this.ops); + } + + PipelineHook releasePipelineHook() { + var tmp = this.hook; + this.hook = null; + return tmp; + } + + public Pipeline getPointerField(short pointerIndex) { + var newOps = new PipelineOp[this.ops.length+1]; + for (int ii = 0; ii < this.ops.length; ++ii) { + newOps[ii] = this.ops[ii]; + } + newOps[this.ops.length] = PipelineOp.PointerField(pointerIndex); + return new Pipeline(this.hook, newOps); + } + } } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index f711e837..c270d371 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -267,7 +267,7 @@ public RemotePromise send() { return context.response; }); - return new RemotePromise(promise, promiseAndPipeline.pipeline); + return new RemotePromise<>(promise, promiseAndPipeline.pipeline); } @Override diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index ab278bca..ae4ad2e7 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -13,6 +13,7 @@ class RemotePromise { this.pipeline = pipeline; } + public CompletableFuture> getResponse() { return response; } diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index 6573f7be..020eb018 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -28,7 +28,7 @@ RemotePromise send() { var typedPromise = typelessPromise.getResponse().thenApply(response -> { return new Response( resultsReader, - response.get(), + response.getResults(), response.hook); }); diff --git a/runtime/src/main/java/org/capnproto/Response.java b/runtime/src/main/java/org/capnproto/Response.java index ee6c0386..c89e97fd 100644 --- a/runtime/src/main/java/org/capnproto/Response.java +++ b/runtime/src/main/java/org/capnproto/Response.java @@ -14,7 +14,7 @@ public Response(FromPointerReader factory, this.results = reader; } - public final Results get() { + public final Results getResults() { return this.results.getAs(factory); } } \ No newline at end of file diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index 56b01b6f..d2806bed 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -120,6 +120,32 @@ public CompletableFuture testMethod1(CallContext method0(CallContext context) { + System.out.println("Called Iface0.method0"); + return CompletableFuture.completedFuture(null); + } + + @Override + protected CompletableFuture method1(StreamingCallContext context) { + return super.method1(context); + } +} +class Iface1Impl extends Demo.Iface1.Server { + @Override + protected CompletableFuture method0(CallContext context) { + return super.method0(context); + } + + @Override + protected CompletableFuture method1(CallContext context) { + context.getResults().setResult0(new Demo.Iface0.Client(new Iface0Impl())); + System.out.println("Called Iface0.method0"); + return CompletableFuture.completedFuture(null); + } +} + public class TwoPartyTest { AsynchronousServerSocketChannel serverSocket; @@ -163,13 +189,13 @@ public void testBasic() throws ExecutionException, InterruptedException { var request = demoClient.testMethod0Request(); var params = request.params(); params.setParam0(4321); - var resultsPromise = request.send(); - while (!resultsPromise.isDone()) { - CompletableFuture.anyOf(resultsPromise, server.runOnce()).join(); + var promise = request.send(); + while (!promise.response.isDone()) { + CompletableFuture.anyOf(promise.response, server.runOnce()).join(); } - Assert.assertTrue(resultsPromise.isDone()); - var results = resultsPromise.get(); - Assert.assertEquals(params.getParam0(), results.getResult0()); + Assert.assertTrue(promise.response.isDone()); + var response = promise.response.get(); + Assert.assertEquals(params.getParam0(), response.getResults().getResult0()); } @Test @@ -181,12 +207,14 @@ public void testReturnCap() throws ExecutionException, InterruptedException { var demoClient = new TestCap0.Client(this.client.bootstrap()); var request = demoClient.testMethod1Request(); var params = request.params(); - var resultsPromise = request.send(); - while (!resultsPromise.isDone()) { - CompletableFuture.anyOf(resultsPromise, server.runOnce(), client.runOnce()).join(); + var promise = request.send(); + while (!promise.response.isDone()) { + CompletableFuture.anyOf(promise.response, server.runOnce(), client.runOnce()).join(); } - Assert.assertTrue(resultsPromise.isDone()); - var results = resultsPromise.get(); + Assert.assertTrue(promise.response.isDone()); + + var response = promise.response.get(); + var results = response.getResults(); var cap0 = results.getResult0(); Assert.assertFalse(cap0.isNull()); var cap1 = results.getResult1(); @@ -202,7 +230,10 @@ public void testLocalServer() throws ExecutionException, InterruptedException { var request = client.testMethod0Request(); var params = request.params(); params.setParam0(4321); - var results = request.send().get(); + var promise = request.send(); + var future = promise.getResponse(); + var response = future.get(); + var results = response.getResults(); Assert.assertEquals(params.getParam0(), results.getResult0()); } @@ -212,8 +243,18 @@ public void testGenericServer() throws ExecutionException, InterruptedException var client = new TestCap0.Client(demo); var request = client.testMethod0Request(); var params = request.params(); - params.setParam0(4321); - var results = request.send().get(); + var promise = request.send(); + var future = promise.getResponse(); + var response = future.get(); + var results = response.getResults(); Assert.assertEquals(params.getParam0(), results.getResult0()); } + + @Test + public void testTwoStagePipeline() { + var iface1Client = new Demo.Iface1.Client(new Iface1Impl()); + var request = iface1Client.method1Request(); + var response = request.send(); + + } } \ No newline at end of file diff --git a/runtime/src/test/java/org/capnproto/demo/Demo.java b/runtime/src/test/java/org/capnproto/demo/Demo.java index 1f70ba4f..a84b8f54 100644 --- a/runtime/src/test/java/org/capnproto/demo/Demo.java +++ b/runtime/src/test/java/org/capnproto/demo/Demo.java @@ -52,6 +52,14 @@ public final int getParam0() { } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -103,6 +111,14 @@ public final int getResult0() { } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -162,6 +178,14 @@ public org.capnproto.AnyPointer.Reader getParam0() { } } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -259,6 +283,14 @@ public org.capnproto.AnyPointer.Reader getResult2() { } } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -310,6 +342,14 @@ public final boolean getF0() { } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -414,6 +454,14 @@ public static final class Reader extends org.capnproto.StructReader { } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -454,6 +502,14 @@ public static final class Reader extends org.capnproto.StructReader { } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -494,6 +550,14 @@ public static final class Reader extends org.capnproto.StructReader { } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -572,6 +636,17 @@ public org.capnproto.demo.Demo.Iface0.Client getF1i() { } } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + public org.capnproto.demo.Demo.Iface0.Client getF1i() { + return new org.capnproto.demo.Demo.Iface0.Client(typeless.getPointerField((short)1).asCap()); + } + } } @@ -706,6 +781,14 @@ public org.capnproto.AnyPointer.Reader getF1() { } } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -746,6 +829,14 @@ public static final class Reader extends org.capnproto.StructReader { } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -818,6 +909,14 @@ public org.capnproto.demo.Demo.Iface1.Struct1.Reader getResult1() { } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -858,6 +957,14 @@ public static final class Reader extends org.capnproto.StructReader { } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + } } @@ -914,6 +1021,17 @@ public org.capnproto.demo.Demo.Iface0.Client getResult0() { } } + public static class Pipeline { + private org.capnproto.AnyPointer.Pipeline typeless; + + public Pipeline() {} + public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { + this.typeless = typeless; + } + public org.capnproto.demo.Demo.Iface0.Client getResult0() { + return new org.capnproto.demo.Demo.Iface0.Client(typeless.getPointerField((short)0).asCap()); + } + } } From c2f64ba31716f45dad04abc3a1dab696d194486c Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 13 Oct 2020 17:13:30 +0100 Subject: [PATCH 045/246] Add local cap table to message builder. --- .../main/java/org/capnproto/BuilderArena.java | 40 +++++++++++++++++++ .../java/org/capnproto/MessageBuilder.java | 4 +- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/BuilderArena.java b/runtime/src/main/java/org/capnproto/BuilderArena.java index 37dc7748..4e6f8a6b 100644 --- a/runtime/src/main/java/org/capnproto/BuilderArena.java +++ b/runtime/src/main/java/org/capnproto/BuilderArena.java @@ -24,6 +24,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.ArrayList; +import java.util.List; public final class BuilderArena implements Arena { public enum AllocationStrategy { @@ -38,6 +39,35 @@ public enum AllocationStrategy { public final ArrayList segments; private Allocator allocator; + private CapTableBuilder localCapTable = new CapTableBuilder() { + + List capTable = new ArrayList<>(); + + @Override + public int injectCap(ClientHook cap) { + int result = this.capTable.size(); + capTable.add(cap); + return result; + } + + @Override + public void dropCap(int index) { + if (index < this.capTable.size()) { + assert false : "Invalid capability descriptor in message."; + return; + } + this.capTable.set(index, null); + + } + + @Override + public ClientHook extractCap(int index) { + return index < this.capTable.size() + ? this.capTable.get(index) + : null; + } + }; + public BuilderArena(int firstSegmentSizeWords, AllocationStrategy allocationStrategy) { this.segments = new ArrayList(); { @@ -64,6 +94,16 @@ public BuilderArena(Allocator allocator, ByteBuffer firstSegment) { this.allocator = allocator; } + CapTableBuilder getLocalCapTable() { + return this.localCapTable; + } + + CapTableBuilder releaseLocalCapTable() { + var tmp = this.localCapTable; + this.localCapTable = null; + return tmp; + } + @Override public final SegmentReader tryGetSegment(int id) { return this.segments.get(id); diff --git a/runtime/src/main/java/org/capnproto/MessageBuilder.java b/runtime/src/main/java/org/capnproto/MessageBuilder.java index 40d714d3..98a55606 100644 --- a/runtime/src/main/java/org/capnproto/MessageBuilder.java +++ b/runtime/src/main/java/org/capnproto/MessageBuilder.java @@ -85,9 +85,9 @@ private AnyPointer.Builder getRootInternal() { if (location != 0) { throw new RuntimeException("First allocated word of new segment was not at offset 0"); } - return new AnyPointer.Builder(rootSegment, location); + return new AnyPointer.Builder(rootSegment, this.arena.getLocalCapTable(), location); } else { - return new AnyPointer.Builder(rootSegment, 0); + return new AnyPointer.Builder(rootSegment, this.arena.getLocalCapTable(), 0); } } From dea4d2d3c018a43b4799b349b95b75fa3e4fdae8 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 13 Oct 2020 17:19:24 +0100 Subject: [PATCH 046/246] implement bulk of pipelining logic --- compiler/src/main/cpp/capnpc-java.c++ | 40 +- .../main/java/org/capnproto/AnyPointer.java | 64 +-- .../main/java/org/capnproto/CallContext.java | 4 +- .../main/java/org/capnproto/Capability.java | 86 ++-- .../main/java/org/capnproto/ClientHook.java | 11 +- .../capnproto/CompletableFutureWrapper.java | 18 + .../src/main/java/org/capnproto/Pipeline.java | 41 ++ .../java/org/capnproto/PipelineFactory.java | 5 + .../main/java/org/capnproto/PipelineHook.java | 2 +- .../main/java/org/capnproto/PipelineOp.java | 4 +- .../main/java/org/capnproto/QueuedClient.java | 29 +- .../java/org/capnproto/QueuedPipeline.java | 10 +- .../java/org/capnproto/RemotePromise.java | 37 +- .../src/main/java/org/capnproto/Request.java | 52 +- .../main/java/org/capnproto/RequestHook.java | 4 +- .../src/main/java/org/capnproto/Response.java | 29 +- .../main/java/org/capnproto/ResponseHook.java | 2 +- .../src/main/java/org/capnproto/RpcState.java | 43 +- .../java/org/capnproto/StreamingRequest.java | 3 +- .../main/java/org/capnproto/StructReader.java | 15 +- .../main/java/org/capnproto/VatNetwork.java | 3 - .../main/java/org/capnproto/WireHelpers.java | 45 +- .../test/java/org/capnproto/TwoPartyTest.java | 213 +++----- .../test/java/org/capnproto/demo/Demo.java | 462 +++++++++++++----- .../test/java/org/capnproto/demo/demo.capnp | 9 + .../java/org/capnproto/demo/demo.capnp.c++ | 185 +++++++ .../test/java/org/capnproto/demo/demo.capnp.h | 186 +++++++ 27 files changed, 1094 insertions(+), 508 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java create mode 100644 runtime/src/main/java/org/capnproto/Pipeline.java create mode 100644 runtime/src/main/java/org/capnproto/PipelineFactory.java diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 996e2f1c..23c0654e 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -1060,13 +1060,13 @@ private: spaces(indent), " public void set", titleCase, "(", clientType, " value) {\n", unionDiscrim.set, - spaces(indent), " _initPointerField(", factoryArg, ", ", offset, ", 0);\n", + spaces(indent), " _setPointerField(", factoryArg, ", ", offset, ", value);\n", spaces(indent), " }\n", "\n"), kj::strTree( spaces(indent), " public ", clientType, " get", titleCase, "() {\n", - spaces(indent), " return new ", clientType, "(typeless.getPointerField((short)", offset, ").asCap());\n", + spaces(indent), " return new ", clientType, "(this.getPointerField((short)", offset, ").asCap());\n", spaces(indent), " }\n" ) }; @@ -1451,8 +1451,9 @@ private: " new org.capnproto.StructSize((short)", structNode.getDataWordCount(), ",(short)", structNode.getPointerCount(), ");\n"), - spaces(indent), " public static final class Factory", factoryTypeParams, - " extends org.capnproto.StructFactory {\n", + spaces(indent), " public static final class Factory", factoryTypeParams, "\n", + spaces(indent), " extends org.capnproto.StructFactory\n", + spaces(indent), " implements org.capnproto.PipelineFactory {\n", factoryMembers.flatten(), spaces(indent), " public Factory(", factoryArgs.flatten(), @@ -1487,6 +1488,9 @@ private: (hasTypeParams ? kj::strTree("this") : kj::strTree()), ");\n", spaces(indent), " }\n", + spaces(indent), " public Pipeline newPipeline(org.capnproto.RemotePromise promise) {\n", + spaces(indent), " return new Pipeline(promise);\n", + spaces(indent), " }\n", spaces(indent), " }\n", (hasTypeParams ? @@ -1574,16 +1578,13 @@ private: spaces(indent), " }\n"), KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, - spaces(indent), " public static class Pipeline {\n", - spaces(indent), " private org.capnproto.AnyPointer.Pipeline typeless;\n\n", - spaces(indent), " public Pipeline() {}\n", - spaces(indent), " public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) {\n", - spaces(indent), " this.typeless = typeless;\n", + spaces(indent), " public static class Pipeline extends org.capnproto.Pipeline {\n", + spaces(indent), " public Pipeline(org.capnproto.RemotePromise remotePromise) {\n", + spaces(indent), " super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise));\n", spaces(indent), " }\n", KJ_MAP(f, fieldTexts) { return kj::mv(f.pipelineMethodDecls); }, spaces(indent), " }\n", spaces(indent), "}\n", - "\n", "\n"), kj::strTree(), @@ -1618,18 +1619,21 @@ private: spaces(indent), " return new Client(hook);\n", spaces(indent), " }\n", spaces(indent), " }\n", + "\n", spaces(indent), " public static final Factory factory = new Factory();\n", + "\n", spaces(indent), " public static class Client extends org.capnproto.Capability.Client {\n", spaces(indent), " public Client() {}\n", spaces(indent), " public Client(org.capnproto.ClientHook hook) { super(hook); }\n", - spaces(indent), " public Client(org.capnproto.Capability.Client cap) { super(cap.getHook()); }\n", + spaces(indent), " public Client(org.capnproto.Capability.Client cap) { super(cap); }\n", spaces(indent), " public Client(Server server) { super(server); }\n", - spaces(indent), " public Client(java.util.concurrent.CompletableFuture promise) {\n", + spaces(indent), " public Client(java.util.concurrent.CompletionStage promise) {\n", spaces(indent), " super(promise);\n", spaces(indent), " }\n", - spaces(indent), "\n", + "\n", KJ_MAP(m, methods) { return kj::mv(m.clientDefs); }, spaces(indent), " }\n", + "\n", spaces(indent), " public static abstract class Server extends org.capnproto.Capability.Server {\n", spaces(indent), " protected org.capnproto.DispatchCallResult dispatchCall(\n", spaces(indent), " long interfaceId, short methodId,\n", @@ -1640,7 +1644,7 @@ private: spaces(indent), " return org.capnproto.Capability.Server.result(\n", spaces(indent), " org.capnproto.Capability.Server.internalUnimplemented(\"", name, "\", interfaceId));\n", spaces(indent), " }\n", - spaces(indent), "\n", + "\n", spaces(indent), " protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) {\n", spaces(indent), " switch (methodId) {\n", KJ_MAP(m, methods) { return kj::mv(m.dispatchCase); }, @@ -1653,9 +1657,9 @@ private: spaces(indent), " }\n", spaces(indent), "\n", KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, - spaces(indent), "\n", + "\n", spaces(indent), "}\n", - spaces(indent), "\n") + "\n") }; } @@ -1771,8 +1775,8 @@ private: return MethodText { kj::strTree( - " public org.capnproto.Request<", shortParamType, ".Builder, ", shortResultType, ".Reader> ", methodName, "Request() {\n", - " return newCall(", paramFactory, ", ", resultFactory, ", 0x", interfaceIdHex, "L, (short)", methodId, ");\n" + " public org.capnproto.Request<", shortParamType, ".Builder, ", shortResultType, ".Pipeline> ", methodName, "Request() {\n", + " return newCall(", paramFactory, ", ", shortResultType, ".factory, 0x", interfaceIdHex, "L, (short)", methodId, ");\n" " }\n"), kj::strTree( diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 2f452851..3dfc6cdd 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -22,7 +22,9 @@ package org.capnproto; public final class AnyPointer { - public static final class Factory implements PointerFactory { + public static final class Factory + implements PointerFactory, + PipelineFactory { public final Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { return new Reader(segment, capTable, pointer, nestingLimit); } @@ -34,6 +36,9 @@ public final Builder initFromPointerBuilder(SegmentBuilder segment, CapTableBuil result.clear(); return result; } + public Pipeline newPipeline(RemotePromise promise) { + return new AnyPointer.Pipeline(promise); + } } public static final Factory factory = new Factory(); @@ -70,18 +75,21 @@ public final T getAs(FromPointerReader factory) { } public final ClientHook getPipelinedCap(PipelineOp[] ops) { + AnyPointer.Reader any = this; + for (var op: ops) { switch (op.type) { case NOOP: break; case GET_POINTER_FIELD: var index = op.pointerIndex; + var reader = WireHelpers.readStructPointer(any.segment, any.capTable, any.pointer, null, 0, any.nestingLimit); // TODO getpointerfield + any = reader._getPointerField(AnyPointer.factory, op.pointerIndex); break; } } - // TODO implement getPipelinedCap - return null; + return WireHelpers.readCapabilityPointer(any.segment, any.capTable, any.pointer, 0); } } @@ -124,12 +132,13 @@ public final void setAs(SetPointerBuilder factory, U reader) { factory.setPointerBuilder(this.segment, this.capTable, this.pointer, reader); } - public final Capability.Client getAsCap() { + /* + final Capability.Client getAsCap() { return new Capability.Client( WireHelpers.readCapabilityPointer(this.segment, capTable, this.pointer, 0)); } - - public final void setAsCap(Capability.Client cap) { +*/ + final void setAsCap(Capability.Client cap) { WireHelpers.setCapabilityPointer(this.segment, capTable, this.pointer, cap.hook); } @@ -143,46 +152,15 @@ public final void clear() { } } - public static final class Pipeline { - private PipelineHook hook; - private final PipelineOp[] ops; - - Pipeline() { - this.hook = null; - this.ops = new PipelineOp[0]; - } - - Pipeline(PipelineHook hook) { - this.hook = hook; - this.ops = new PipelineOp[0]; - } - - Pipeline(PipelineHook hook, PipelineOp[] ops) { - this.hook = hook; - this.ops = ops; - } - - Pipeline noop() { - return new Pipeline(this.hook, this.ops.clone()); - } + public static final class Pipeline + extends org.capnproto.Pipeline { - public ClientHook asCap() { - return this.hook.getPipelinedCap(this.ops); + public Pipeline(RemotePromise promise) { + super(promise); } - PipelineHook releasePipelineHook() { - var tmp = this.hook; - this.hook = null; - return tmp; - } - - public Pipeline getPointerField(short pointerIndex) { - var newOps = new PipelineOp[this.ops.length+1]; - for (int ii = 0; ii < this.ops.length; ++ii) { - newOps[ii] = this.ops[ii]; - } - newOps[this.ops.length] = PipelineOp.PointerField(pointerIndex); - return new Pipeline(this.hook, newOps); + public Pipeline(RemotePromise promise, PipelineOp[] ops) { + super(promise, ops); } } } diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java index 8a73e975..ebcd6946 100644 --- a/runtime/src/main/java/org/capnproto/CallContext.java +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -32,8 +32,8 @@ public final Results initResults() { return this.hook.getResults().initAs(results); } - public final CompletableFuture tailCall(Request tailRequest) { - return hook.tailCall(tailRequest.hook); + public final CompletableFuture tailCall(Request tailRequest) { + return hook.tailCall(tailRequest.getHook()); } public final void allowCancellation() { diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index c270d371..262cc83e 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -1,6 +1,7 @@ package org.capnproto; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; public final class Capability { @@ -12,28 +13,35 @@ public static class ReaderContext { CapTableReader capTable; } - public static abstract class Factory + public static abstract class Factory implements FromPointerReader, - FromPointerBuilder { + FromPointerBuilder, + SetPointerBuilder { + + public abstract T newClient(ClientHook hook); + @Override public T fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { - var hook = WireHelpers.readCapabilityPointer(segment, capTable, pointer, 0); - return newClient(hook); + return newClient( + WireHelpers.readCapabilityPointer(segment, capTable, pointer, 0)); } @Override public T fromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer) { - var hook = WireHelpers.readCapabilityPointer(segment, capTable, pointer, 0); - return newClient(hook); - } + return newClient( + WireHelpers.readCapabilityPointer(segment, capTable, pointer, 0)); + } @Override public T initFromPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, int elementCount) { - var hook = WireHelpers.readCapabilityPointer(segment, capTable, pointer, 0); - return newClient(hook); + return newClient( + WireHelpers.readCapabilityPointer(segment, capTable, pointer, 0)); } - public abstract T newClient(ClientHook hook); + @Override + public void setPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, T value) { + WireHelpers.setCapabilityPointer(segment, capTable, pointer, value.getHook()); + } } public static class Client { @@ -44,6 +52,10 @@ public Client() { this.hook = null; } + public Client(Client other) { + this.hook = other.hook; + } + public Client(ClientHook hook) { this.hook = hook; } @@ -52,15 +64,16 @@ public Client(Server server) { this(makeLocalClient(server)); } - public Client(CompletableFuture promise) { - this(Capability.newLocalPromiseClient(promise)); + public Client(CompletionStage promise) { + this(Capability.newLocalPromiseClient( + promise.thenApply(client -> client.getHook()))); } public Client(Throwable exc) { this(newBrokenCap(exc)); } - public ClientHook getHook() { + ClientHook getHook() { return this.hook; } @@ -68,27 +81,20 @@ private static ClientHook makeLocalClient(Server server) { return server.makeLocalClient(); } - CompletableFuture whenResolved() { - return hook.whenResolved(); - } - - Request typelessRequest( - long interfaceId, - short methodId) { - return hook.newCall(interfaceId, methodId); + CompletionStage whenResolved() { + return this.hook.whenResolved(); } - protected Request newCall(FromPointerBuilder builder, - FromPointerReader reader, + protected Request newCall(FromPointerBuilder

paramsFactory, + PipelineFactory pipelineFactory, long interfaceId, short methodId) { - var request = hook.newCall(interfaceId, methodId); - return new Request<> (builder, reader, request.params, request.hook); + return Request.fromTypeless(paramsFactory, pipelineFactory, hook.newCall(interfaceId, methodId)); } - protected StreamingRequest newStreamingCall(FromPointerBuilder builder, + protected StreamingRequest newStreamingCall(FromPointerBuilder paramsBuilder, long interfaceId, short methodId) { var request = hook.newCall(interfaceId, methodId); - return new StreamingRequest<> (builder, request.params, request.hook); + return new StreamingRequest<> (paramsBuilder, request.params, request.hook); } } @@ -114,10 +120,10 @@ private final class LocalClient implements ClientHook { } @Override - public Request newCall(long interfaceId, short methodId) { + public Request newCall(long interfaceId, short methodId) { var hook = new LocalRequest(interfaceId, methodId, this); var root = hook.message.getRoot(AnyPointer.factory); - return new Request<>(AnyPointer.factory, AnyPointer.factory, root, hook); + return new Request<>(root, AnyPointer.factory, hook); } @Override @@ -236,11 +242,11 @@ protected static CompletableFuture internalUnimplemented(String interfaceName } } - public static ClientHook newLocalPromiseClient(CompletableFuture promise) { + public static ClientHook newLocalPromiseClient(CompletionStage promise) { return new QueuedClient(promise); } - public static PipelineHook newLocalPromisePipeline(CompletableFuture promise) { + public static PipelineHook newLocalPromisePipeline(CompletionStage promise) { return new QueuedPipeline(promise); } @@ -267,6 +273,7 @@ public RemotePromise send() { return context.response; }); + assert promiseAndPipeline.pipeline != null; return new RemotePromise<>(promise, promiseAndPipeline.pipeline); } @@ -274,7 +281,7 @@ public RemotePromise send() { public CompletableFuture sendStreaming() { // We don't do any special handling of streaming in RequestHook for local requests, because // there is no latency to compensate for between the client and server in this case. - return send().ignoreResult(); + return send(); } @Override @@ -333,10 +340,7 @@ public AnyPointer.Builder getResults() { if (this.response == null) { var localResponse = new LocalResponse(); this.responseBuilder = localResponse.message.getRoot(AnyPointer.factory); - this.response = new Response<>( - AnyPointer.factory, - this.responseBuilder.asReader(), - localResponse); + this.response = new Response<>(this.responseBuilder.asReader(), localResponse); } return this.responseBuilder; } @@ -384,7 +388,7 @@ static private ClientHook newBrokenClient(String reason, boolean resolved, Objec static private ClientHook newBrokenClient(Throwable exc, boolean resolved, Object brand) { return new ClientHook() { @Override - public Request newCall(long interfaceId, short methodId) { + public Request newCall(long interfaceId, short methodId) { return Request.newBrokenRequest(exc); } @@ -394,12 +398,8 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } @Override - public CompletableFuture whenMoreResolved() { - if (resolved) { - return null; - } else { - return CompletableFuture.failedFuture(exc); - } + public CompletionStage whenMoreResolved() { + return resolved ? null : CompletableFuture.failedFuture(exc); } @Override diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index 9dc49aed..55b12a91 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -1,13 +1,14 @@ package org.capnproto; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; public interface ClientHook { Object NULL_CAPABILITY_BRAND = new Object(); Object BROKEN_CAPABILITY_BRAND = new Object(); - Request newCall(long interfaceId, short methodId); + Request newCall(long interfaceId, short methodId); VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context); @@ -15,7 +16,7 @@ default ClientHook getResolved() { return null; } - default CompletableFuture whenMoreResolved() { + default CompletionStage whenMoreResolved() { return null; } @@ -23,7 +24,7 @@ default Object getBrand() { return NULL_CAPABILITY_BRAND; } - default CompletableFuture whenResolved() { + default CompletionStage whenResolved() { var promise = whenMoreResolved(); return promise != null ? promise.thenCompose(ClientHook::whenResolved) @@ -43,10 +44,10 @@ default Integer getFd() { } final class VoidPromiseAndPipeline { - public final CompletableFuture promise; + public final CompletionStage promise; public final PipelineHook pipeline; - VoidPromiseAndPipeline(CompletableFuture promise, PipelineHook pipeline) { + VoidPromiseAndPipeline(CompletionStage promise, PipelineHook pipeline) { this.promise = promise; this.pipeline = pipeline; } diff --git a/runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java b/runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java new file mode 100644 index 00000000..09401ae2 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java @@ -0,0 +1,18 @@ +package org.capnproto; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; + +public class CompletableFutureWrapper extends CompletableFuture { + + public CompletableFutureWrapper(CompletionStage other) { + other.toCompletableFuture().whenComplete((value, exc) -> { + if (exc == null) { + this.complete(value); + } + else { + this.completeExceptionally(exc); + } + }); + } +} \ No newline at end of file diff --git a/runtime/src/main/java/org/capnproto/Pipeline.java b/runtime/src/main/java/org/capnproto/Pipeline.java new file mode 100644 index 00000000..0d06cfc5 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/Pipeline.java @@ -0,0 +1,41 @@ +package org.capnproto; + +public class Pipeline + extends RemotePromise { + + protected final PipelineOp[] ops; + protected PipelineHook hook; + + public Pipeline(RemotePromise remotePromise) { + this(remotePromise, new PipelineOp[0]); + } + + public Pipeline(RemotePromise remotePromise, PipelineOp[] ops) { + super(remotePromise.response, remotePromise.hook); + this.ops = ops; + this.hook = remotePromise.hook; + } + + public PipelineHook getHook() { + return hook; + } + + Pipeline noop() { + return new Pipeline<>(this, this.ops.clone()); + } + + public ClientHook asCap() { + return this.hook.getPipelinedCap(this.ops); + } + + public Pipeline getPointerField(short pointerIndex) { + var newOps = new PipelineOp[this.ops.length+1]; + for (int ii = 0; ii < this.ops.length; ++ii) { + newOps[ii] = this.ops[ii]; + } + newOps[this.ops.length] = PipelineOp.PointerField(pointerIndex); + return new Pipeline<>(this, newOps); + } +} + + diff --git a/runtime/src/main/java/org/capnproto/PipelineFactory.java b/runtime/src/main/java/org/capnproto/PipelineFactory.java new file mode 100644 index 00000000..fb817ec2 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/PipelineFactory.java @@ -0,0 +1,5 @@ +package org.capnproto; + +public interface PipelineFactory { + Pipeline newPipeline(RemotePromise promise); +} diff --git a/runtime/src/main/java/org/capnproto/PipelineHook.java b/runtime/src/main/java/org/capnproto/PipelineHook.java index f926c542..8d12f227 100644 --- a/runtime/src/main/java/org/capnproto/PipelineHook.java +++ b/runtime/src/main/java/org/capnproto/PipelineHook.java @@ -1,6 +1,6 @@ package org.capnproto; -interface PipelineHook { +public interface PipelineHook { ClientHook getPipelinedCap(PipelineOp[] ops); diff --git a/runtime/src/main/java/org/capnproto/PipelineOp.java b/runtime/src/main/java/org/capnproto/PipelineOp.java index 067954f1..e316068c 100644 --- a/runtime/src/main/java/org/capnproto/PipelineOp.java +++ b/runtime/src/main/java/org/capnproto/PipelineOp.java @@ -2,6 +2,8 @@ final class PipelineOp { + // TODO just use array of Short? + enum Type { NOOP, GET_POINTER_FIELD @@ -44,7 +46,7 @@ static PipelineOp[] ToPipelineOps(RpcProtocol.PromisedAnswer.Reader reader) { var transform = transforms.get(ii); switch (transform.which()) { case NOOP: - ops[ii] = Noop(); + ops[ii] = Noop(); // TODO null? break; case GET_POINTER_FIELD: ops[ii] = PointerField(transform.getGetPointerField()); diff --git a/runtime/src/main/java/org/capnproto/QueuedClient.java b/runtime/src/main/java/org/capnproto/QueuedClient.java index 64171f12..752dde37 100644 --- a/runtime/src/main/java/org/capnproto/QueuedClient.java +++ b/runtime/src/main/java/org/capnproto/QueuedClient.java @@ -1,20 +1,20 @@ package org.capnproto; -import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; class QueuedClient implements ClientHook { - final CompletableFuture promise; - final CompletableFuture promiseForCallForwarding; - final CompletableFuture promiseForClientResolution; - final CompletableFuture setResolutionOp; + final CompletionStage promise; + final CompletionStage promiseForCallForwarding; + final CompletionStage promiseForClientResolution; + final CompletionStage setResolutionOp; ClientHook redirect; - QueuedClient(CompletableFuture promise) { + QueuedClient(CompletionStage promise) { // TODO revisit futures - this.promise = promise.copy(); - this.promiseForCallForwarding = promise.copy(); - this.promiseForClientResolution = promise.copy(); + this.promise = promise.toCompletableFuture().copy(); + this.promiseForCallForwarding = promise.toCompletableFuture().copy(); + this.promiseForClientResolution = promise.toCompletableFuture().copy(); this.setResolutionOp = promise.thenAccept(inner -> { this.redirect = inner; }).exceptionally(exc -> { @@ -24,15 +24,18 @@ class QueuedClient implements ClientHook { } @Override - public Request newCall(long interfaceId, short methodId) { + public Request newCall(long interfaceId, short methodId) { var hook = new Capability.LocalRequest(interfaceId, methodId, this); var root = hook.message.getRoot(AnyPointer.factory); - return new Request<>(AnyPointer.factory, AnyPointer.factory, root, hook); + return new Request<>(root, AnyPointer.factory, hook); } @Override public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { - return null; + var callResultPromise = this.promiseForCallForwarding.thenApply(client -> client.call(interfaceId, methodId, ctx)); + var pipelinePromise = callResultPromise.thenApply(callResult -> callResult.pipeline); + var pipeline = new QueuedPipeline(pipelinePromise); + return new VoidPromiseAndPipeline(callResultPromise, pipeline); } @Override @@ -41,7 +44,7 @@ public ClientHook getResolved() { } @Override - public CompletableFuture whenMoreResolved() { + public CompletionStage whenMoreResolved() { return promiseForClientResolution; } } diff --git a/runtime/src/main/java/org/capnproto/QueuedPipeline.java b/runtime/src/main/java/org/capnproto/QueuedPipeline.java index 8256563e..27508f5a 100644 --- a/runtime/src/main/java/org/capnproto/QueuedPipeline.java +++ b/runtime/src/main/java/org/capnproto/QueuedPipeline.java @@ -1,15 +1,15 @@ package org.capnproto; -import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; final class QueuedPipeline implements PipelineHook { - final CompletableFuture promise; - final CompletableFuture selfResolutionOp; + final CompletionStage promise; + final CompletionStage selfResolutionOp; PipelineHook redirect; - public QueuedPipeline(CompletableFuture promiseParam) { - this.promise = promiseParam.copy(); + public QueuedPipeline(CompletionStage promiseParam) { + this.promise = promiseParam; this.selfResolutionOp = promise.handle((pipeline, exc) -> { this.redirect = exc == null ? pipeline diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index ae4ad2e7..15500043 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -1,29 +1,26 @@ package org.capnproto; -import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; -class RemotePromise { +public class RemotePromise + extends CompletableFutureWrapper { - final CompletableFuture> response; - final PipelineHook pipeline; + final CompletionStage> response; + final PipelineHook hook; - RemotePromise(CompletableFuture> response, - PipelineHook pipeline) { - this.response = response; - this.pipeline = pipeline; + RemotePromise(CompletionStage> promise, + PipelineHook hook) { + super(promise.thenApply(response -> response.getResults())); + this.response = promise; + this.hook = hook; } - - public CompletableFuture> getResponse() { - return response; - } - - public CompletableFuture ignoreResult() { - return this.response.thenCompose( - result -> CompletableFuture.completedFuture(null)); - } - - public PipelineHook getHook() { - return pipeline; + public static RemotePromise fromTypeless( + FromPointerReader resultsFactory, + RemotePromise typeless) { + var promise = typeless.response.thenApply( + response -> Response.fromTypeless(resultsFactory, response)); + return new RemotePromise<>(promise, typeless.hook); } } + diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index 020eb018..b5ac341c 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -4,38 +4,33 @@ public class Request { - AnyPointer.Builder params; - private final FromPointerBuilder paramsBuilder; - private final FromPointerReader resultsReader; + Params params; + PipelineFactory pipelineFactory; RequestHook hook; - Request(FromPointerBuilder paramsBuilder, - FromPointerReader resultsReader, - AnyPointer.Builder params, RequestHook hook) { - this.paramsBuilder = paramsBuilder; - this.resultsReader = resultsReader; + public Request(Params params, + PipelineFactory pipelineFactory, + RequestHook hook) { this.params = params; + this.pipelineFactory = pipelineFactory; this.hook = hook; } - Params params() { - return params.getAs(paramsBuilder); + public Params getParams() { + return params; } - RemotePromise send() { - var typelessPromise = hook.send(); - hook = null; // prevent reuse - var typedPromise = typelessPromise.getResponse().thenApply(response -> { - return new Response( - resultsReader, - response.getResults(), - response.hook); - }); + public RequestHook getHook() { + return this.hook; + } - return new RemotePromise(typedPromise, typelessPromise.pipeline); + public Results send() { + var typelessPromise = this.hook.send(); + this.hook = null; // prevent reuse + return pipelineFactory.newPipeline(typelessPromise); } - static Request newBrokenRequest(Throwable exc) { + static Request newBrokenRequest(Throwable exc) { final MessageBuilder message = new MessageBuilder(); var hook = new RequestHook() { @@ -56,16 +51,13 @@ public Object getBrand() { }; var root = message.getRoot(AnyPointer.factory); - return new Request(null, null, root, hook); - } - - static Request newTypelessRequest(AnyPointer.Builder root, RequestHook hook) { - return new Request<>(AnyPointer.factory, AnyPointer.factory, root, hook); + return new Request(null, null, hook); } - static Request fromTypeless(FromPointerBuilder params, - FromPointerReader results, - Request typeless) { - return new Request<>(params, results, typeless.params(), typeless.hook); + static Request fromTypeless( + FromPointerBuilder

paramsFactory, + PipelineFactory pipelineFactory, + Request typeless) { + return new Request<>(typeless.params.getAs(paramsFactory), pipelineFactory, typeless.hook); } } diff --git a/runtime/src/main/java/org/capnproto/RequestHook.java b/runtime/src/main/java/org/capnproto/RequestHook.java index 58133263..8bdf9c46 100644 --- a/runtime/src/main/java/org/capnproto/RequestHook.java +++ b/runtime/src/main/java/org/capnproto/RequestHook.java @@ -1,9 +1,9 @@ package org.capnproto; -import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; public interface RequestHook { RemotePromise send(); - CompletableFuture sendStreaming(); + CompletionStage sendStreaming(); Object getBrand(); } diff --git a/runtime/src/main/java/org/capnproto/Response.java b/runtime/src/main/java/org/capnproto/Response.java index c89e97fd..90cc483a 100644 --- a/runtime/src/main/java/org/capnproto/Response.java +++ b/runtime/src/main/java/org/capnproto/Response.java @@ -1,20 +1,27 @@ package org.capnproto; -class Response { +public class Response { - final FromPointerReader factory; - final ResponseHook hook; - final AnyPointer.Reader results; + private Results results; + private ResponseHook hook; - public Response(FromPointerReader factory, - AnyPointer.Reader reader, + public Response(Results results, ResponseHook hook) { - this.factory = factory; + this.results = results; this.hook = hook; - this.results = reader; } - public final Results getResults() { - return this.results.getAs(factory); + public Results getResults() { + return this.results; } -} \ No newline at end of file + + public ResponseHook getHook() { + return this.hook; + } + + static Response fromTypeless(FromPointerReader resultsFactory, + Response typeless) { + return new Response<>(typeless.getResults().getAs(resultsFactory), typeless.hook); + + } +} diff --git a/runtime/src/main/java/org/capnproto/ResponseHook.java b/runtime/src/main/java/org/capnproto/ResponseHook.java index 7111d11d..24384ead 100644 --- a/runtime/src/main/java/org/capnproto/ResponseHook.java +++ b/runtime/src/main/java/org/capnproto/ResponseHook.java @@ -1,4 +1,4 @@ package org.capnproto; -interface ResponseHook { +public interface ResponseHook { } diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index b76cb412..537ef678 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -4,13 +4,12 @@ import java.util.concurrent.Callable; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; -import java.util.concurrent.FutureTask; -import java.util.function.Function; final class RpcState { static final class Question { final int id; + CompletableFuture response = new CompletableFuture<>(); List paramExports; boolean isAwaitingReturn = false; boolean isTailCall = false; @@ -20,10 +19,8 @@ static final class Question { this.id = id; } - CompletableFuture response = new CompletableFuture<>(); - void reject(Throwable exc) { - response.completeExceptionally(exc); + this.response.completeExceptionally(exc); } void answer(RpcResponse response) { @@ -34,7 +31,7 @@ void answer(RpcResponse response) { static final class Answer { boolean active = false; PipelineHook pipeline; - CompletableFuture redirectedResults; + CompletionStage redirectedResults; RpcCallContext callContext; List resultExports; } @@ -239,21 +236,19 @@ void handleUnimplemented(RpcProtocol.Message.Reader message) { case CAP: var cap = resolve.getCap(); switch (cap.which()) { - case NONE: - break; case SENDER_HOSTED: releaseExport(cap.getSenderHosted(), 1); break; case SENDER_PROMISE: releaseExport(cap.getSenderPromise(), 1); break; - case RECEIVER_ANSWER: - break; - case RECEIVER_HOSTED: - break; case THIRD_PARTY_HOSTED: releaseExport(cap.getThirdPartyHosted().getVineId(), 1); break; + case NONE: + case RECEIVER_ANSWER: + case RECEIVER_HOSTED: + break; } break; case EXCEPTION: @@ -278,7 +273,7 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo var answerId = bootstrap.getQuestionId(); var answer = answers.put(answerId); if (answer.active) { - // questionId already in use + assert false: "questionId is already in use: " + answerId; return; } answer.active = true; @@ -449,7 +444,7 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu if (answer.redirectedResults == null) { return; } - question.response = answer.redirectedResults; + question.response = answer.redirectedResults.toCompletableFuture(); answer.redirectedResults = null; break; default: @@ -1214,7 +1209,7 @@ public ClientHook getInnermostClient() { } @Override - public Request newCall(long interfaceId, short methodId) { + public Request newCall(long interfaceId, short methodId) { return newCallNoIntercept(interfaceId, methodId); } @@ -1235,7 +1230,7 @@ public final Object getBrand() { return RpcState.this; } - private Request newCallNoIntercept(long interfaceId, short methodId) { + private Request newCallNoIntercept(long interfaceId, short methodId) { if (isDisconnected()) { return Request.newBrokenRequest(disconnected); } @@ -1245,7 +1240,7 @@ private Request newCallNoIntercept(long i callBuilder.setInterfaceId(interfaceId); callBuilder.setMethodId(methodId); var root = request.getRoot(); - return Request.newTypelessRequest(root, request); + return new Request<>(root, AnyPointer.factory, request); } } @@ -1290,18 +1285,16 @@ public RemotePromise send() { // The pipeline must get notified of resolution before the app does to maintain ordering. var pipeline = new RpcPipeline(question, question.response); - var appPromise = question.response.thenApply(response -> { - var results = response.getResults(); - return new Response<>(AnyPointer.factory, results, response); + var appPromise = question.response.thenApply(hook -> { + return new Response<>(hook.getResults(), hook); }); - return new RemotePromise<>(appPromise, pipeline); } @Override - public CompletableFuture sendStreaming() { + public CompletionStage sendStreaming() { // TODO falling back to regular send for now... - return send().ignoreResult(); + return send(); } Question sendInternal(boolean isTailCall) { @@ -1407,7 +1400,7 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } @Override - public CompletableFuture whenMoreResolved() { + public CompletionStage whenMoreResolved() { return null; } } @@ -1556,7 +1549,7 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } @Override - public CompletableFuture whenMoreResolved() { + public CompletionStage whenMoreResolved() { return null; } diff --git a/runtime/src/main/java/org/capnproto/StreamingRequest.java b/runtime/src/main/java/org/capnproto/StreamingRequest.java index 81943cee..a66182b0 100644 --- a/runtime/src/main/java/org/capnproto/StreamingRequest.java +++ b/runtime/src/main/java/org/capnproto/StreamingRequest.java @@ -2,6 +2,7 @@ import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; public class StreamingRequest { @@ -16,7 +17,7 @@ public class StreamingRequest { this.hook = hook; } - CompletableFuture send() { + CompletionStage send() { var promise = hook.sendStreaming(); hook = null; // prevent reuse return promise; diff --git a/runtime/src/main/java/org/capnproto/StructReader.java b/runtime/src/main/java/org/capnproto/StructReader.java index 9f1b5573..4d8083f3 100644 --- a/runtime/src/main/java/org/capnproto/StructReader.java +++ b/runtime/src/main/java/org/capnproto/StructReader.java @@ -64,10 +64,17 @@ public StructReader(SegmentReader segment, int data, this.nestingLimit = nestingLimit; } - final StructReader imbue(CapTableReader capTable) { - var result = new StructReader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - result.capTable = capTable; - return result; + public StructReader(SegmentReader segment, CapTableReader capTable, + int data, + int pointers, int dataSize, short pointerCount, + int nestingLimit) { + this.segment = segment; + this.data = data; + this.pointers = pointers; + this.dataSize = dataSize; + this.pointerCount = pointerCount; + this.nestingLimit = nestingLimit; + this.capTable = capTable; } protected final boolean _getBooleanField(int offset) { diff --git a/runtime/src/main/java/org/capnproto/VatNetwork.java b/runtime/src/main/java/org/capnproto/VatNetwork.java index 96c2cf11..42921504 100644 --- a/runtime/src/main/java/org/capnproto/VatNetwork.java +++ b/runtime/src/main/java/org/capnproto/VatNetwork.java @@ -1,14 +1,11 @@ package org.capnproto; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; public interface VatNetwork { interface Connection { - OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize); - CompletableFuture receiveIncomingMessage(); } diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 83302122..5cd6311f 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -956,6 +956,48 @@ static T readStructPointer(StructReader.Factory factory, } + static StructReader readStructPointer(SegmentReader segment, + CapTableReader capTable, + int refOffset, + SegmentReader defaultSegment, + int defaultOffset, + int nestingLimit) { + long ref = segment.get(refOffset); + if (WirePointer.isNull(ref)) { + if (defaultSegment == null) { + return new StructReader(SegmentReader.EMPTY, 0, 0, 0, (short) 0, 0x7fffffff); + } else { + segment = defaultSegment; + refOffset = defaultOffset; + ref = segment.get(refOffset); + } + } + + if (nestingLimit <= 0) { + throw new DecodeException("Message is too deeply nested or contains cycles."); + } + + int refTarget = WirePointer.target(refOffset, ref); + FollowFarsResult resolved = followFars(ref, refTarget, segment); + + int dataSizeWords = StructPointer.dataSize(resolved.ref); + + if (WirePointer.kind(resolved.ref) != WirePointer.STRUCT) { + throw new DecodeException("Message contains non-struct pointer where struct pointer was expected."); + } + + resolved.segment.arena.checkReadLimit(StructPointer.wordSize(resolved.ref)); + + return new StructReader(resolved.segment, + capTable, + resolved.ptr * Constants.BYTES_PER_WORD, + (resolved.ptr + dataSizeWords), + dataSizeWords * Constants.BITS_PER_WORD, + StructPointer.ptrCount(resolved.ref), + nestingLimit - 1); + + } + static SegmentBuilder setStructPointer(SegmentBuilder segment, CapTableBuilder capTable, int refOffset, StructReader value) { short dataSize = (short)roundBitsUpToWords(value.dataSize); int totalSize = dataSize + value.pointerCount * Constants.POINTER_SIZE_IN_WORDS; @@ -1377,7 +1419,8 @@ static ClientHook readCapabilityPointer(SegmentReader segment, CapTableReader ca return Capability.newBrokenCap("Cannot read capability pointer without capTable."); } - var cap = capTable.extractCap(WirePointer.upper32Bits(ref)); + int index = WirePointer.upper32Bits(ref); + var cap = capTable.extractCap(index); if (cap == null) { return Capability.newBrokenCap("Calling invalid capability pointer."); } diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index d2806bed..0e0e4d5e 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -11,91 +11,10 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -class TestCap0 { +class TestCap0Impl extends Demo.TestCap0.Server { - static final class Client extends org.capnproto.Capability.Client { - public Client() { super(); } - - public Client(ClientHook hook) { super(hook); } - - public Client(Capability.Client cap) { super(cap.hook); } - - public Client(Capability.Server server) { super(server); } - - public org.capnproto.Request testMethod0Request() { - return newCall(Demo.TestParams0.factory, Demo.TestResults0.factory, 0xa65f4a3d7f622e6bL, (short) 0); - } - - public org.capnproto.Request testMethod1Request() { - return newCall(Demo.TestParams1.factory, Demo.TestResults1.factory, 0xa65f4a3d7f622e6bL, (short) 1); - } - } - - public static class Server extends Capability.Server { - @Override - public DispatchCallResult dispatchCall(long interfaceId, short methodId, CallContext context) { - if (interfaceId == 0xa65f4a3d7f622e6bL) { - return dispatchCallInternal(methodId, context); - } - return result(internalUnimplemented(Demo.class.getName(), interfaceId)); - } - - DispatchCallResult dispatchCallInternal(short methodId, CallContext ctx) { - switch (methodId) { - case 0: - return result(testMethod0(internalGetTypedContext(Demo.TestParams0.factory, Demo.TestResults0.factory, ctx))); - case 1: - return result(testMethod1(internalGetTypedContext(Demo.TestParams1.factory, Demo.TestResults1.factory, ctx))); - default: - return result(internalUnimplemented(Demo.class.getName(), 0xa27d3c231c7b9202L, methodId)); - } - } - - public CompletableFuture testMethod0(CallContext ctx) { - return CompletableFuture.failedFuture(RpcException.unimplemented("testMethod0")); - } - - public CompletableFuture testMethod1(CallContext ctx) { - return CompletableFuture.failedFuture(RpcException.unimplemented("testMethod1")); - } - } -} - -class TestCap1 { - - static final class Client extends org.capnproto.Capability.Client { - public Client() { super(); } - - public Client(ClientHook hook) { super(hook); } - - public Client(Capability.Client cap) { super(cap.hook); } - - public Client(Capability.Server server) { super(server); } - } - - static abstract class Server extends org.capnproto.Capability.Server { - - @Override - public DispatchCallResult dispatchCall(long interfaceId, short methodId, CallContext context) { - if (interfaceId == 0x81da3f8f6079c216L) { - return dispatchCallInternal(methodId, context); - } - return result(internalUnimplemented(Demo.class.getName(), interfaceId)); - } - - private DispatchCallResult dispatchCallInternal(short methodId, CallContext ctx) { - switch (methodId) { - default: - return result(internalUnimplemented(Demo.class.getName(), 0x81da3f8f6079c216L, methodId)); - } - } - } -} - -class TestCap0Impl extends TestCap0.Server { - - final TestCap1.Client testCap1a = new TestCap1.Client(new TestCap1Impl()); - final TestCap1.Client testCap1b = new TestCap1.Client(new TestCap1Impl()); + final Demo.TestCap1.Client testCap1a = new Demo.TestCap1.Client(new TestCap1Impl()); + final Demo.TestCap1.Client testCap1b = new Demo.TestCap1.Client(new TestCap1Impl()); public CompletableFuture testMethod0(CallContext ctx) { var params = ctx.getParams(); @@ -108,42 +27,16 @@ public CompletableFuture testMethod1(CallContext method0(CallContext context) { - System.out.println("Called Iface0.method0"); - return CompletableFuture.completedFuture(null); - } - - @Override - protected CompletableFuture method1(StreamingCallContext context) { - return super.method1(context); - } -} -class Iface1Impl extends Demo.Iface1.Server { - @Override - protected CompletableFuture method0(CallContext context) { - return super.method0(context); - } - - @Override - protected CompletableFuture method1(CallContext context) { - context.getResults().setResult0(new Demo.Iface0.Client(new Iface0Impl())); - System.out.println("Called Iface0.method0"); - return CompletableFuture.completedFuture(null); - } +class TestCap1Impl extends Demo.TestCap1.Server { } public class TwoPartyTest { @@ -172,49 +65,47 @@ public void tearDown() throws Exception { @Test public void testNullCap() { - var server = new TwoPartyServer(new Capability.Client()); server.listen(serverSocket); var cap = this.client.bootstrap(); - var resolved = cap.whenResolved(); + var resolved = cap.whenResolved().toCompletableFuture(); resolved.join(); } @Test public void testBasic() throws ExecutionException, InterruptedException { var capServer = new TestCap0Impl(); - var server = new TwoPartyServer(new TestCap0.Client(capServer)); + var server = new TwoPartyServer(new Demo.TestCap0.Client(capServer)); server.listen(serverSocket); - var demoClient = new TestCap0.Client(this.client.bootstrap()); + var demoClient = new Demo.TestCap0.Client(this.client.bootstrap()); var request = demoClient.testMethod0Request(); - var params = request.params(); + var params = request.getParams(); params.setParam0(4321); - var promise = request.send(); - while (!promise.response.isDone()) { - CompletableFuture.anyOf(promise.response, server.runOnce()).join(); + var response = request.send(); + while (!response.isDone()) { + CompletableFuture.anyOf(response, server.runOnce()).join(); } - Assert.assertTrue(promise.response.isDone()); - var response = promise.response.get(); - Assert.assertEquals(params.getParam0(), response.getResults().getResult0()); + Assert.assertTrue(response.isDone()); + var results = response.get(); + Assert.assertEquals(params.getParam0(), results.getResult0()); } @Test public void testReturnCap() throws ExecutionException, InterruptedException { - // send a capabilty back from the server to the client + // send a capability back from the server to the client var capServer = new TestCap0Impl(); - var server = new TwoPartyServer(new TestCap0.Client(capServer)); + var server = new TwoPartyServer(new Demo.TestCap0.Client(capServer)); server.listen(serverSocket); - var demoClient = new TestCap0.Client(this.client.bootstrap()); + var demoClient = new Demo.TestCap0.Client(this.client.bootstrap()); var request = demoClient.testMethod1Request(); - var params = request.params(); - var promise = request.send(); - while (!promise.response.isDone()) { - CompletableFuture.anyOf(promise.response, server.runOnce(), client.runOnce()).join(); + var params = request.getParams(); + var response = request.send(); + while (!response.isDone()) { + CompletableFuture.anyOf(response, server.runOnce()).join(); } - Assert.assertTrue(promise.response.isDone()); + Assert.assertTrue(response.isDone()); - var response = promise.response.get(); - var results = response.getResults(); + var results = response.get(); var cap0 = results.getResult0(); Assert.assertFalse(cap0.isNull()); var cap1 = results.getResult1(); @@ -226,35 +117,55 @@ public void testReturnCap() throws ExecutionException, InterruptedException { @Test public void testLocalServer() throws ExecutionException, InterruptedException { var demo = new TestCap0Impl(); - var client = new TestCap0.Client(demo); + var client = new Demo.TestCap0.Client(demo); var request = client.testMethod0Request(); - var params = request.params(); + var params = request.getParams(); params.setParam0(4321); - var promise = request.send(); - var future = promise.getResponse(); - var response = future.get(); - var results = response.getResults(); + var response = request.send(); + var results = response.get(); Assert.assertEquals(params.getParam0(), results.getResult0()); } @Test public void testGenericServer() throws ExecutionException, InterruptedException { var demo = new TestCap0Impl(); - var client = new TestCap0.Client(demo); + var client = new Demo.TestCap0.Client(demo); var request = client.testMethod0Request(); - var params = request.params(); - var promise = request.send(); - var future = promise.getResponse(); - var response = future.get(); - var results = response.getResults(); + var params = request.getParams(); + var response = request.send(); + var results = response.get(); Assert.assertEquals(params.getParam0(), results.getResult0()); } @Test - public void testTwoStagePipeline() { - var iface1Client = new Demo.Iface1.Client(new Iface1Impl()); - var request = iface1Client.method1Request(); - var response = request.send(); + public void testLocalTwoStagePipeline() { + + var server0 = new Demo.Iface0.Server() { + boolean method0called = false; + @Override + protected CompletableFuture method0(CallContext ctx) { + method0called = true; + return CompletableFuture.completedFuture(null); + } + }; + + var server1 = new Demo.Iface1.Server() { + @Override + protected CompletableFuture method1(CallContext ctx) { + ctx.getResults().setResult0(new Demo.Iface0.Client(server0)); + return CompletableFuture.completedFuture(null); + } + }; + + var iface1Client = new Demo.Iface1.Client(server1); + var request1 = iface1Client.method1Request(); + var response = request1.send(); + var iface0 = response.getResult0(); + var request0 = iface0.method0Request(); + var response0 = request0.send(); + response0.join(); + Assert.assertTrue(!response0.isCompletedExceptionally()); + Assert.assertTrue(server0.method0called); } } \ No newline at end of file diff --git a/runtime/src/test/java/org/capnproto/demo/Demo.java b/runtime/src/test/java/org/capnproto/demo/Demo.java index a84b8f54..c77cf167 100644 --- a/runtime/src/test/java/org/capnproto/demo/Demo.java +++ b/runtime/src/test/java/org/capnproto/demo/Demo.java @@ -6,7 +6,9 @@ public final class Demo { public static class TestParams0 { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -21,6 +23,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -52,20 +57,18 @@ public final int getParam0() { } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - public static class TestResults0 { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -80,6 +83,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -111,20 +117,18 @@ public final int getResult0() { } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - public static class TestParams1 { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -139,6 +143,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -178,20 +185,18 @@ public org.capnproto.AnyPointer.Reader getParam0() { } } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - public static class TestResults1 { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)3); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -206,6 +211,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -283,20 +291,18 @@ public org.capnproto.AnyPointer.Reader getResult2() { } } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - public static class Struct0 { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -311,6 +317,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -342,40 +351,39 @@ public final boolean getF0() { } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - public static class Iface0 { public static final class Factory extends org.capnproto.Capability.Factory { public final Client newClient(org.capnproto.ClientHook hook) { return new Client(hook); } } + public static final Factory factory = new Factory(); + public static class Client extends org.capnproto.Capability.Client { public Client() {} public Client(org.capnproto.ClientHook hook) { super(hook); } - public Client(org.capnproto.Capability.Client cap) { super(cap.getHook()); } + public Client(org.capnproto.Capability.Client cap) { super(cap); } public Client(Server server) { super(server); } - public Client(java.util.concurrent.CompletableFuture promise) { + public Client(java.util.concurrent.CompletionStage promise) { super(promise); } - - public org.capnproto.Request method0Request() { + + public org.capnproto.Request method0Request() { return newCall(Method0Params.factory, Method0Results.factory, 0xac6d126c2fac16ebL, (short)0); } public org.capnproto.StreamingRequest method1Request() { return newStreamingCall(Method1Params.factory, 0xac6d126c2fac16ebL, (short)1); } } + public static abstract class Server extends org.capnproto.Capability.Server { protected org.capnproto.DispatchCallResult dispatchCall( long interfaceId, short methodId, @@ -386,7 +394,7 @@ protected org.capnproto.DispatchCallResult dispatchCall( return org.capnproto.Capability.Server.result( org.capnproto.Capability.Server.internalUnimplemented("Iface0", interfaceId)); } - + protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { switch (methodId) { case 0: @@ -419,7 +427,9 @@ protected java.util.concurrent.CompletableFuture method1(org.capnproto.Stream public static class Method0Params { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -434,6 +444,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -454,20 +467,18 @@ public static final class Reader extends org.capnproto.StructReader { } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - public static class Method0Results { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -482,6 +493,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -502,20 +516,18 @@ public static final class Reader extends org.capnproto.StructReader { } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - public static class Method1Params { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -530,6 +542,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -550,23 +565,21 @@ public static final class Reader extends org.capnproto.StructReader { } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - } - + public static class Struct2 { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)2); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -581,6 +594,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -612,7 +628,7 @@ public org.capnproto.demo.Demo.Iface0.Client getF1i() { return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 1); } public void setF1i(org.capnproto.demo.Demo.Iface0.Client value) { - _initPointerField(org.capnproto.demo.Demo.Iface0.factory, 1, 0); + _setPointerField(org.capnproto.demo.Demo.Iface0.factory, 1, value); } } @@ -636,43 +652,156 @@ public org.capnproto.demo.Demo.Iface0.Client getF1i() { } } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } public org.capnproto.demo.Demo.Iface0.Client getF1i() { - return new org.capnproto.demo.Demo.Iface0.Client(typeless.getPointerField((short)1).asCap()); + return new org.capnproto.demo.Demo.Iface0.Client(this.getPointerField((short)1).asCap()); } } } + public static class TestCap0 { + public static final class Factory extends org.capnproto.Capability.Factory { + public final Client newClient(org.capnproto.ClientHook hook) { + return new Client(hook); + } + } - public static class Iface1 { + public static final Factory factory = new Factory(); + + public static class Client extends org.capnproto.Capability.Client { + public Client() {} + public Client(org.capnproto.ClientHook hook) { super(hook); } + public Client(org.capnproto.Capability.Client cap) { super(cap); } + public Client(Server server) { super(server); } + public Client(java.util.concurrent.CompletionStage promise) { + super(promise); + } + + public org.capnproto.Request testMethod0Request() { + return newCall(org.capnproto.demo.Demo.TestParams0.factory, org.capnproto.demo.Demo.TestResults0.factory, 0x9c0c5ee4bb0cc725L, (short)0); + } + public org.capnproto.Request testMethod1Request() { + return newCall(org.capnproto.demo.Demo.TestParams1.factory, org.capnproto.demo.Demo.TestResults1.factory, 0x9c0c5ee4bb0cc725L, (short)1); + } + } + + public static abstract class Server extends org.capnproto.Capability.Server { + protected org.capnproto.DispatchCallResult dispatchCall( + long interfaceId, short methodId, + org.capnproto.CallContext context) { + if (interfaceId == 0x9c0c5ee4bb0cc725L) { + return dispatchCallInternal(methodId, context); + } + return org.capnproto.Capability.Server.result( + org.capnproto.Capability.Server.internalUnimplemented("TestCap0", interfaceId)); + } + + protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { + switch (methodId) { + case 0: + return org.capnproto.Capability.Server.result ( + this.testMethod0(org.capnproto.Capability.Server.internalGetTypedContext( + org.capnproto.demo.Demo.TestParams0.factory, org.capnproto.demo.Demo.TestResults0.factory, context))); + case 1: + return org.capnproto.Capability.Server.result ( + this.testMethod1(org.capnproto.Capability.Server.internalGetTypedContext( + org.capnproto.demo.Demo.TestParams1.factory, org.capnproto.demo.Demo.TestResults1.factory, context))); + default: + return org.capnproto.Capability.Server.result( + org.capnproto.Capability.Server.internalUnimplemented("TestCap0", 0x9c0c5ee4bb0cc725L, methodId)); + } + } + + protected java.util.concurrent.CompletableFuture testMethod0(org.capnproto.CallContext context) { + return org.capnproto.Capability.Server.internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod0", + 0x9c0c5ee4bb0cc725L, (short)0); + } + + protected java.util.concurrent.CompletableFuture testMethod1(org.capnproto.CallContext context) { + return org.capnproto.Capability.Server.internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod1", + 0x9c0c5ee4bb0cc725L, (short)1); + } + + } + + + } + + public static class TestCap1 { public static final class Factory extends org.capnproto.Capability.Factory { public final Client newClient(org.capnproto.ClientHook hook) { return new Client(hook); } } + public static final Factory factory = new Factory(); + public static class Client extends org.capnproto.Capability.Client { public Client() {} public Client(org.capnproto.ClientHook hook) { super(hook); } - public Client(org.capnproto.Capability.Client cap) { super(cap.getHook()); } + public Client(org.capnproto.Capability.Client cap) { super(cap); } public Client(Server server) { super(server); } - public Client(java.util.concurrent.CompletableFuture promise) { + public Client(java.util.concurrent.CompletionStage promise) { super(promise); } + + } + + public static abstract class Server extends org.capnproto.Capability.Server { + protected org.capnproto.DispatchCallResult dispatchCall( + long interfaceId, short methodId, + org.capnproto.CallContext context) { + if (interfaceId == 0xd88e8bb64ed6f7b1L) { + return dispatchCallInternal(methodId, context); + } + return org.capnproto.Capability.Server.result( + org.capnproto.Capability.Server.internalUnimplemented("TestCap1", interfaceId)); + } + + protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { + switch (methodId) { + default: + return org.capnproto.Capability.Server.result( + org.capnproto.Capability.Server.internalUnimplemented("TestCap1", 0xd88e8bb64ed6f7b1L, methodId)); + } + } + + } - public org.capnproto.Request method0Request() { + + } + + public static class Iface1 { + public static final class Factory extends org.capnproto.Capability.Factory { + public final Client newClient(org.capnproto.ClientHook hook) { + return new Client(hook); + } + } + + public static final Factory factory = new Factory(); + + public static class Client extends org.capnproto.Capability.Client { + public Client() {} + public Client(org.capnproto.ClientHook hook) { super(hook); } + public Client(org.capnproto.Capability.Client cap) { super(cap); } + public Client(Server server) { super(server); } + public Client(java.util.concurrent.CompletionStage promise) { + super(promise); + } + + public org.capnproto.Request method0Request() { return newCall(Method0Params.factory, Method0Results.factory, 0xd52dcf38c9f6f7c0L, (short)0); } - public org.capnproto.Request method1Request() { + public org.capnproto.Request method1Request() { return newCall(Method1Params.factory, Method1Results.factory, 0xd52dcf38c9f6f7c0L, (short)1); } } + public static abstract class Server extends org.capnproto.Capability.Server { protected org.capnproto.DispatchCallResult dispatchCall( long interfaceId, short methodId, @@ -683,7 +812,7 @@ protected org.capnproto.DispatchCallResult dispatchCall( return org.capnproto.Capability.Server.result( org.capnproto.Capability.Server.internalUnimplemented("Iface1", interfaceId)); } - + protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { switch (methodId) { case 0: @@ -716,7 +845,9 @@ protected java.util.concurrent.CompletableFuture method1(org.capnproto.CallCo public static class Struct1 { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -731,6 +862,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -781,20 +915,18 @@ public org.capnproto.AnyPointer.Reader getF1() { } } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - public static class Method0Params { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -809,6 +941,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -829,20 +964,18 @@ public static final class Reader extends org.capnproto.StructReader { } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - public static class Method0Results { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)2); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -857,6 +990,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -909,20 +1045,18 @@ public org.capnproto.demo.Demo.Iface1.Struct1.Reader getResult1() { } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - public static class Method1Params { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -937,6 +1071,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -957,20 +1094,18 @@ public static final class Reader extends org.capnproto.StructReader { } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } } } - public static class Method1Results { public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); - public static final class Factory extends org.capnproto.StructFactory { + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { public Factory() { } public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -985,6 +1120,9 @@ public final org.capnproto.StructSize structSize() { public final Reader asReader(Builder builder) { return builder.asReader(); } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } } public static final Factory factory = new Factory(); public static final org.capnproto.StructList.Factory listFactory = @@ -1003,7 +1141,7 @@ public org.capnproto.demo.Demo.Iface0.Client getResult0() { return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 0); } public void setResult0(org.capnproto.demo.Demo.Iface0.Client value) { - _initPointerField(org.capnproto.demo.Demo.Iface0.factory, 0, 0); + _setPointerField(org.capnproto.demo.Demo.Iface0.factory, 0, value); } } @@ -1021,23 +1159,19 @@ public org.capnproto.demo.Demo.Iface0.Client getResult0() { } } - public static class Pipeline { - private org.capnproto.AnyPointer.Pipeline typeless; - - public Pipeline() {} - public Pipeline(org.capnproto.AnyPointer.Pipeline typeless) { - this.typeless = typeless; + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); } public org.capnproto.demo.Demo.Iface0.Client getResult0() { - return new org.capnproto.demo.Demo.Iface0.Client(typeless.getPointerField((short)0).asCap()); + return new org.capnproto.demo.Demo.Iface0.Client(this.getPointerField((short)0).asCap()); } } } - } - + public static final class Schemas { public static final org.capnproto.SegmentReader b_91e1b138de965ab0 = @@ -1438,6 +1572,78 @@ public static final class Schemas { "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_9c0c5ee4bb0cc725 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0025\u00c7\u000c\u00bb\u00e4\u005e\u000c\u009c" + + "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0087\u0000\u0000\u0000" + + "\u0085\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + + "\u0043\u0061\u0070\u0030\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b0\u005a\u0096\u00de\u0038\u00b1\u00e1\u0091" + + "\u00bf\u00dc\u00d1\u003b\u003c\u00dd\u007b\u00a7" + + "\u0031\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0090\u0033\u0012\u00e4\u0033\u000f\u00b2" + + "\u0063\u0069\u0053\u00ab\u0092\u0023\u0034\u00d1" + + "\u001d\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0074\u0065\u0073\u0074\u004d\u0065\u0074\u0068" + + "\u006f\u0064\u0030\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + + "\u0074\u0065\u0073\u0074\u004d\u0065\u0074\u0068" + + "\u006f\u0064\u0031\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); +public static final org.capnproto.SegmentReader b_d88e8bb64ed6f7b1 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00b1\u00f7\u00d6\u004e\u00b6\u008b\u008e\u00d8" + + "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + + "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + + "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + + "\u0043\u0061\u0070\u0031\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); public static final org.capnproto.SegmentReader b_d52dcf38c9f6f7c0 = org.capnproto.GeneratedClassSupport.decodeRawBytes( "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp b/runtime/src/test/java/org/capnproto/demo/demo.capnp index 0b67c3e0..efdbc9ee 100644 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp @@ -36,6 +36,15 @@ struct Struct2 { f1i @1 :Iface0; } +interface TestCap0 { + testMethod0 @0 TestParams0 -> TestResults0; + testMethod1 @1 TestParams1 -> TestResults1; +} + +interface TestCap1 { +} + + interface Iface1 { struct Struct1 { diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ index 53d50f4a..121e736c 100644 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ @@ -495,6 +495,99 @@ const ::capnp::_::RawSchema s_a9395663e97ca3af = { 1, 2, i_a9395663e97ca3af, nullptr, nullptr, { &s_a9395663e97ca3af, nullptr, nullptr, 0, 0, nullptr } }; #endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<45> b_9c0c5ee4bb0cc725 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 37, 199, 12, 187, 228, 94, 12, 156, + 52, 0, 0, 0, 3, 0, 0, 0, + 66, 71, 232, 130, 21, 122, 87, 182, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 234, 1, 0, 0, + 49, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 135, 0, 0, 0, + 133, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 84, 101, 115, 116, + 67, 97, 112, 48, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 3, 0, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 176, 90, 150, 222, 56, 177, 225, 145, + 191, 220, 209, 59, 60, 221, 123, 167, + 49, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 7, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 73, 144, 51, 18, 228, 51, 15, 178, + 99, 105, 83, 171, 146, 35, 52, 209, + 29, 0, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 7, 0, 0, 0, + 116, 101, 115, 116, 77, 101, 116, 104, + 111, 100, 48, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 116, 101, 115, 116, 77, 101, 116, 104, + 111, 100, 49, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 1, 0, 1, 0, } +}; +::capnp::word const* const bp_9c0c5ee4bb0cc725 = b_9c0c5ee4bb0cc725.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_9c0c5ee4bb0cc725[] = { + &s_91e1b138de965ab0, + &s_a77bdd3c3bd1dcbf, + &s_b20f33e412339049, + &s_d1342392ab536963, +}; +static const uint16_t m_9c0c5ee4bb0cc725[] = {0, 1}; +const ::capnp::_::RawSchema s_9c0c5ee4bb0cc725 = { + 0x9c0c5ee4bb0cc725, b_9c0c5ee4bb0cc725.words, 45, d_9c0c5ee4bb0cc725, m_9c0c5ee4bb0cc725, + 4, 2, nullptr, nullptr, nullptr, { &s_9c0c5ee4bb0cc725, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<23> b_d88e8bb64ed6f7b1 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 177, 247, 214, 78, 182, 139, 142, 216, + 52, 0, 0, 0, 3, 0, 0, 0, + 66, 71, 232, 130, 21, 122, 87, 182, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 234, 1, 0, 0, + 49, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 7, 0, 0, 0, + 45, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 114, 117, 110, 116, 105, 109, 101, 47, + 115, 114, 99, 47, 116, 101, 115, 116, + 47, 106, 97, 118, 97, 47, 111, 114, + 103, 47, 99, 97, 112, 110, 112, 114, + 111, 116, 111, 47, 100, 101, 109, 111, + 47, 100, 101, 109, 111, 46, 99, 97, + 112, 110, 112, 58, 84, 101, 115, 116, + 67, 97, 112, 49, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 3, 0, 5, 0, + 0, 0, 0, 0, 1, 0, 1, 0, } +}; +::capnp::word const* const bp_d88e8bb64ed6f7b1 = b_d88e8bb64ed6f7b1.words; +#if !CAPNP_LITE +const ::capnp::_::RawSchema s_d88e8bb64ed6f7b1 = { + 0xd88e8bb64ed6f7b1, b_d88e8bb64ed6f7b1.words, 23, nullptr, nullptr, + 0, 0, nullptr, nullptr, nullptr, { &s_d88e8bb64ed6f7b1, nullptr, nullptr, 0, 0, nullptr } +}; +#endif // !CAPNP_LITE static const ::capnp::_::AlignedData<46> b_d52dcf38c9f6f7c0 = { { 0, 0, 0, 0, 5, 0, 6, 0, 192, 247, 246, 201, 56, 207, 45, 213, @@ -945,6 +1038,98 @@ constexpr ::capnp::Kind Struct2::_capnpPrivate::kind; constexpr ::capnp::_::RawSchema const* Struct2::_capnpPrivate::schema; #endif // !CAPNP_LITE +#if !CAPNP_LITE +::capnp::Request< ::TestParams0, ::TestResults0> +TestCap0::Client::testMethod0Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { + return newCall< ::TestParams0, ::TestResults0>( + 0x9c0c5ee4bb0cc725ull, 0, sizeHint); +} +::kj::Promise TestCap0::Server::testMethod0(TestMethod0Context) { + return ::capnp::Capability::Server::internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod0", + 0x9c0c5ee4bb0cc725ull, 0); +} +::capnp::Request< ::TestParams1, ::TestResults1> +TestCap0::Client::testMethod1Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { + return newCall< ::TestParams1, ::TestResults1>( + 0x9c0c5ee4bb0cc725ull, 1, sizeHint); +} +::kj::Promise TestCap0::Server::testMethod1(TestMethod1Context) { + return ::capnp::Capability::Server::internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod1", + 0x9c0c5ee4bb0cc725ull, 1); +} +::capnp::Capability::Server::DispatchCallResult TestCap0::Server::dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (interfaceId) { + case 0x9c0c5ee4bb0cc725ull: + return dispatchCallInternal(methodId, context); + default: + return internalUnimplemented("runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", interfaceId); + } +} +::capnp::Capability::Server::DispatchCallResult TestCap0::Server::dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (methodId) { + case 0: + return { + testMethod0(::capnp::Capability::Server::internalGetTypedContext< + ::TestParams0, ::TestResults0>(context)), + false + }; + case 1: + return { + testMethod1(::capnp::Capability::Server::internalGetTypedContext< + ::TestParams1, ::TestResults1>(context)), + false + }; + default: + (void)context; + return ::capnp::Capability::Server::internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", + 0x9c0c5ee4bb0cc725ull, methodId); + } +} +#endif // !CAPNP_LITE + +// TestCap0 +#if !CAPNP_LITE +constexpr ::capnp::Kind TestCap0::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* TestCap0::_capnpPrivate::schema; +#endif // !CAPNP_LITE + +#if !CAPNP_LITE +::capnp::Capability::Server::DispatchCallResult TestCap1::Server::dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (interfaceId) { + case 0xd88e8bb64ed6f7b1ull: + return dispatchCallInternal(methodId, context); + default: + return internalUnimplemented("runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap1", interfaceId); + } +} +::capnp::Capability::Server::DispatchCallResult TestCap1::Server::dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { + switch (methodId) { + default: + (void)context; + return ::capnp::Capability::Server::internalUnimplemented( + "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap1", + 0xd88e8bb64ed6f7b1ull, methodId); + } +} +#endif // !CAPNP_LITE + +// TestCap1 +#if !CAPNP_LITE +constexpr ::capnp::Kind TestCap1::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* TestCap1::_capnpPrivate::schema; +#endif // !CAPNP_LITE + #if !CAPNP_LITE ::capnp::Request< ::Iface1::Method0Params, ::Iface1::Method0Results> Iface1::Client::method0Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp.h b/runtime/src/test/java/org/capnproto/demo/demo.capnp.h index f98b0922..bdcd8bc5 100644 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp.h +++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.h @@ -27,6 +27,8 @@ CAPNP_DECLARE_SCHEMA(bc8d77edaa76294b); CAPNP_DECLARE_SCHEMA(f744e24aa684673e); CAPNP_DECLARE_SCHEMA(c8c25b78d234f324); CAPNP_DECLARE_SCHEMA(a9395663e97ca3af); +CAPNP_DECLARE_SCHEMA(9c0c5ee4bb0cc725); +CAPNP_DECLARE_SCHEMA(d88e8bb64ed6f7b1); CAPNP_DECLARE_SCHEMA(d52dcf38c9f6f7c0); CAPNP_DECLARE_SCHEMA(800ca862fbfddd38); CAPNP_DECLARE_SCHEMA(8f92ca18632e04d5); @@ -193,6 +195,40 @@ struct Struct2 { }; }; +struct TestCap0 { + TestCap0() = delete; + +#if !CAPNP_LITE + class Client; + class Server; +#endif // !CAPNP_LITE + + + #if !CAPNP_LITE + struct _capnpPrivate { + CAPNP_DECLARE_INTERFACE_HEADER(9c0c5ee4bb0cc725) + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + }; + #endif // !CAPNP_LITE +}; + +struct TestCap1 { + TestCap1() = delete; + +#if !CAPNP_LITE + class Client; + class Server; +#endif // !CAPNP_LITE + + + #if !CAPNP_LITE + struct _capnpPrivate { + CAPNP_DECLARE_INTERFACE_HEADER(d88e8bb64ed6f7b1) + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + }; + #endif // !CAPNP_LITE +}; + struct Iface1 { Iface1() = delete; @@ -1054,6 +1090,108 @@ class Struct2::Pipeline { }; #endif // !CAPNP_LITE +#if !CAPNP_LITE +class TestCap0::Client + : public virtual ::capnp::Capability::Client { +public: + typedef TestCap0 Calls; + typedef TestCap0 Reads; + + Client(decltype(nullptr)); + explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); + template ()>> + Client(::kj::Own<_t>&& server); + template ()>> + Client(::kj::Promise<_t>&& promise); + Client(::kj::Exception&& exception); + Client(Client&) = default; + Client(Client&&) = default; + Client& operator=(Client& other); + Client& operator=(Client&& other); + + ::capnp::Request< ::TestParams0, ::TestResults0> testMethod0Request( + ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); + ::capnp::Request< ::TestParams1, ::TestResults1> testMethod1Request( + ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); + +protected: + Client() = default; +}; + +class TestCap0::Server + : public virtual ::capnp::Capability::Server { +public: + typedef TestCap0 Serves; + + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) + override; + +protected: + typedef ::capnp::CallContext< ::TestParams0, ::TestResults0> TestMethod0Context; + virtual ::kj::Promise testMethod0(TestMethod0Context context); + typedef ::capnp::CallContext< ::TestParams1, ::TestResults1> TestMethod1Context; + virtual ::kj::Promise testMethod1(TestMethod1Context context); + + inline ::TestCap0::Client thisCap() { + return ::capnp::Capability::Server::thisCap() + .template castAs< ::TestCap0>(); + } + + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); +}; +#endif // !CAPNP_LITE + +#if !CAPNP_LITE +class TestCap1::Client + : public virtual ::capnp::Capability::Client { +public: + typedef TestCap1 Calls; + typedef TestCap1 Reads; + + Client(decltype(nullptr)); + explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); + template ()>> + Client(::kj::Own<_t>&& server); + template ()>> + Client(::kj::Promise<_t>&& promise); + Client(::kj::Exception&& exception); + Client(Client&) = default; + Client(Client&&) = default; + Client& operator=(Client& other); + Client& operator=(Client&& other); + + +protected: + Client() = default; +}; + +class TestCap1::Server + : public virtual ::capnp::Capability::Server { +public: + typedef TestCap1 Serves; + + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) + override; + +protected: + + inline ::TestCap1::Client thisCap() { + return ::capnp::Capability::Server::thisCap() + .template castAs< ::TestCap1>(); + } + + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, + ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); +}; +#endif // !CAPNP_LITE + #if !CAPNP_LITE class Iface1::Client : public virtual ::capnp::Capability::Client { @@ -1739,6 +1877,54 @@ inline ::capnp::Orphan< ::Iface0> Struct2::Builder::disownF1i() { } #endif // !CAPNP_LITE +#if !CAPNP_LITE +inline TestCap0::Client::Client(decltype(nullptr)) + : ::capnp::Capability::Client(nullptr) {} +inline TestCap0::Client::Client( + ::kj::Own< ::capnp::ClientHook>&& hook) + : ::capnp::Capability::Client(::kj::mv(hook)) {} +template +inline TestCap0::Client::Client(::kj::Own<_t>&& server) + : ::capnp::Capability::Client(::kj::mv(server)) {} +template +inline TestCap0::Client::Client(::kj::Promise<_t>&& promise) + : ::capnp::Capability::Client(::kj::mv(promise)) {} +inline TestCap0::Client::Client(::kj::Exception&& exception) + : ::capnp::Capability::Client(::kj::mv(exception)) {} +inline ::TestCap0::Client& TestCap0::Client::operator=(Client& other) { + ::capnp::Capability::Client::operator=(other); + return *this; +} +inline ::TestCap0::Client& TestCap0::Client::operator=(Client&& other) { + ::capnp::Capability::Client::operator=(kj::mv(other)); + return *this; +} + +#endif // !CAPNP_LITE +#if !CAPNP_LITE +inline TestCap1::Client::Client(decltype(nullptr)) + : ::capnp::Capability::Client(nullptr) {} +inline TestCap1::Client::Client( + ::kj::Own< ::capnp::ClientHook>&& hook) + : ::capnp::Capability::Client(::kj::mv(hook)) {} +template +inline TestCap1::Client::Client(::kj::Own<_t>&& server) + : ::capnp::Capability::Client(::kj::mv(server)) {} +template +inline TestCap1::Client::Client(::kj::Promise<_t>&& promise) + : ::capnp::Capability::Client(::kj::mv(promise)) {} +inline TestCap1::Client::Client(::kj::Exception&& exception) + : ::capnp::Capability::Client(::kj::mv(exception)) {} +inline ::TestCap1::Client& TestCap1::Client::operator=(Client& other) { + ::capnp::Capability::Client::operator=(other); + return *this; +} +inline ::TestCap1::Client& TestCap1::Client::operator=(Client&& other) { + ::capnp::Capability::Client::operator=(kj::mv(other)); + return *this; +} + +#endif // !CAPNP_LITE #if !CAPNP_LITE inline Iface1::Client::Client(decltype(nullptr)) : ::capnp::Capability::Client(nullptr) {} From 61c98ac26619855179086a20fcc68681270d1f89 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 13 Oct 2020 17:43:23 +0100 Subject: [PATCH 047/246] avoid duplicating conditions in asserts --- .../src/main/java/org/capnproto/RpcState.java | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 537ef678..1227434c 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -270,7 +270,7 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo return; } - var answerId = bootstrap.getQuestionId(); + final var answerId = bootstrap.getQuestionId(); var answer = answers.put(answerId); if (answer.active) { assert false: "questionId is already in use: " + answerId; @@ -339,8 +339,8 @@ void handleCall(IncomingRpcMessage message, RpcProtocol.Call.Reader call) { { var answer = answers.put(answerId); - assert !answer.active : "questionId is already in use"; if (answer.active) { + assert false: "questionId is already in use"; return; } @@ -381,13 +381,13 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu var exportsToRelease = new ArrayList(); var question = questions.find(callReturn.getAnswerId()); - assert question != null : "Invalid question ID in Return message."; if (question == null) { + assert false: "Invalid question ID in Return message."; return; } - assert question.isAwaitingReturn: "Duplicate Return"; if (!question.isAwaitingReturn) { + assert false: "Duplicate Return"; return; } @@ -397,8 +397,8 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu question.paramExports = List.of(); } - assert !callReturn.isTakeFromOtherQuestion(): "Not implemented"; if (callReturn.isTakeFromOtherQuestion()) { + assert false: "Not implemented"; // TODO process isTakeFromOtherQuestion... return; } @@ -414,19 +414,22 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu var response = new RpcResponseImpl(question, message, capTable, payload.getContent()); question.answer(response); break; + case EXCEPTION: - assert !question.isTailCall : "Tail call `Return` must set `resultsSentElsewhere`, not `exception`."; if (question.isTailCall) { + assert false: "Tail call `Return` must set `resultsSentElsewhere`, not `exception`."; return; } question.reject(RpcException.toException(callReturn.getException())); break; + case CANCELED: assert false : "Return message falsely claims call was canceled."; break; + case RESULTS_SENT_ELSEWHERE: - assert question.isTailCall : "`Return` had `resultsSentElsewhere` but this was not a tail call."; if (!question.isTailCall) { + assert false: "`Return` had `resultsSentElsewhere` but this was not a tail call."; return; } // Tail calls are fulfilled with a null pointer. @@ -436,22 +439,22 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu case TAKE_FROM_OTHER_QUESTION: var other = callReturn.getTakeFromOtherQuestion(); var answer = answers.find(other); - assert answer != null : "`Return.takeFromOtherQuestion` had invalid answer ID."; if (answer == null) { + assert false: "`Return.takeFromOtherQuestion` had invalid answer ID."; return; } - assert answer.redirectedResults != null : "`Return.takeFromOtherQuestion` referenced a call that did not use `sendResultsTo.yourself`."; if (answer.redirectedResults == null) { + assert false: "`Return.takeFromOtherQuestion` referenced a call that did not use `sendResultsTo.yourself`."; return; } question.response = answer.redirectedResults.toCompletableFuture(); answer.redirectedResults = null; break; + default: assert false : "Unknown 'Return' type."; return; } - } void handleFinish(RpcProtocol.Finish.Reader finish) { @@ -536,8 +539,8 @@ void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { target = resolved; } - assert target.getBrand() == RpcState.this : "'Disembargo' of type 'senderLoopback' sent to an object that does not point back to the sender."; if (target.getBrand() != this) { + assert false: "'Disembargo' of type 'senderLoopback' sent to an object that does not point back to the sender."; return; } @@ -710,14 +713,16 @@ CompletionStage resolveExportedPromise(int exportId, CompletionStage Date: Wed, 14 Oct 2020 15:54:21 +0100 Subject: [PATCH 048/246] simplify server runOnce --- runtime/src/main/java/org/capnproto/TwoPartyClient.java | 2 +- runtime/src/main/java/org/capnproto/TwoPartyServer.java | 2 +- runtime/src/test/java/org/capnproto/TwoPartyTest.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/TwoPartyClient.java b/runtime/src/main/java/org/capnproto/TwoPartyClient.java index 474dd86e..ee3a89cf 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyClient.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyClient.java @@ -32,7 +32,7 @@ public Capability.Client bootstrap() { return rpcSystem.bootstrap(vatId.asReader()); } - public synchronized CompletableFuture runOnce() { + public CompletableFuture runOnce() { return this.rpcSystem.runOnce(); } } diff --git a/runtime/src/main/java/org/capnproto/TwoPartyServer.java b/runtime/src/main/java/org/capnproto/TwoPartyServer.java index 8a27315c..f34d261a 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyServer.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyServer.java @@ -55,7 +55,7 @@ public void failed(Throwable exc, Object attachment) { } public synchronized CompletableFuture runOnce() { - var done = new CompletableFuture(); + var done = new CompletableFuture<>(); for (var conn: connections) { done = CompletableFuture.anyOf(done, conn.runOnce()); } diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index 0e0e4d5e..7ffe2169 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -83,7 +83,7 @@ public void testBasic() throws ExecutionException, InterruptedException { params.setParam0(4321); var response = request.send(); while (!response.isDone()) { - CompletableFuture.anyOf(response, server.runOnce()).join(); + CompletableFuture.anyOf(response, this.client.runOnce(), server.runOnce()).join(); } Assert.assertTrue(response.isDone()); var results = response.get(); @@ -101,7 +101,7 @@ public void testReturnCap() throws ExecutionException, InterruptedException { var params = request.getParams(); var response = request.send(); while (!response.isDone()) { - CompletableFuture.anyOf(response, server.runOnce()).join(); + CompletableFuture.anyOf(response, this.client.runOnce(), server.runOnce()).join(); } Assert.assertTrue(response.isDone()); From c49221c2e9a2fc5a37d7ad7cd71046c6a94071df Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 14 Oct 2020 15:54:44 +0100 Subject: [PATCH 049/246] add cleanup to questions and imports --- .../src/main/java/org/capnproto/RpcState.java | 89 +++++++++++++------ 1 file changed, 64 insertions(+), 25 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 1227434c..c2da6a1b 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -7,7 +7,7 @@ final class RpcState { - static final class Question { + final class Question { final int id; CompletableFuture response = new CompletableFuture<>(); List paramExports; @@ -21,10 +21,29 @@ static final class Question { void reject(Throwable exc) { this.response.completeExceptionally(exc); + this.finish(); } void answer(RpcResponse response) { this.response.complete(response); + this.finish(); + } + + void finish() { + assert questions.find(this.id) != null : "Question ID no longer on table?"; + if (isConnected() && !this.skipFinish) { + var message = connection.newOutgoingMessage(1024); + var builder = message.getBody().getAs(RpcProtocol.Message.factory).initFinish(); + builder.setQuestionId(this.id); + builder.setReleaseResultCaps(this.isAwaitingReturn); + message.send(); + } + + // Check if the question has returned and, if so, remove it from the table. + // Remove question ID from the table. Must do this *after* sending `Finish` to ensure that + // the ID is not re-allocated before the `Finish` message can be sent. + assert !this.isAwaitingReturn; + questions.erase(id, this); } } @@ -411,7 +430,9 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu } var payload = callReturn.getResults(); var capTable = receiveCaps(payload.getCapTable(), message.getAttachedFds()); - var response = new RpcResponseImpl(question, message, capTable, payload.getContent()); + // TODO question, message unused in RpcResponseImpl + // var response = new RpcResponseImpl(question, message, capTable, payload.getContent()); + var response = new RpcResponseImpl(capTable, payload.getContent()); question.answer(response); break; @@ -587,6 +608,7 @@ void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { return; } } + private List writeDescriptors(ClientHook[] capTable, RpcProtocol.Payload.Builder payload, List fds) { if (capTable.length == 0) { return List.of(); @@ -900,16 +922,17 @@ interface RpcServerResponse { } static class RpcResponseImpl implements RpcResponse { - private final Question question; - private final IncomingRpcMessage message; + // TODO unused? + // private final Question question; + // private final IncomingRpcMessage message; private final AnyPointer.Reader results; - RpcResponseImpl(Question question, - IncomingRpcMessage message, + RpcResponseImpl(/*Question question, + IncomingRpcMessage message,*/ List capTable, AnyPointer.Reader results) { - this.question = question; - this.message = message; + // this.question = question; + // this.message = message; this.results = results.imbue(new ReaderCapabilityTable(capTable)); } @@ -1048,7 +1071,7 @@ public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { return null; } - RpcResponse consumeRedirectedResponse() { + private RpcResponse consumeRedirectedResponse() { assert this.redirectResults; if (this.response == null) { @@ -1058,11 +1081,11 @@ RpcResponse consumeRedirectedResponse() { return ((LocallyRedirectedRpcResponse) this.response); } - void sendReturn() { + private void sendReturn() { assert !redirectResults; if (!this.cancelRequested && isDisconnected()) { - assert false: "Cancellation should have been requested on disconnect."; + assert false : "Cancellation should have been requested on disconnect."; return; } @@ -1073,17 +1096,20 @@ void sendReturn() { this.returnMessage.setAnswerId(this.answerId); this.returnMessage.setReleaseParamCaps(false); - List exports; + List exports = List.of(); try { exports = ((RpcServerResponseImpl) response).send(); - } - catch (Throwable exc) { + } catch (Throwable exc) { this.responseSent = false; sendErrorReturn(exc); } + + // If no caps in the results, the pipeline is irrelevant. + boolean shouldFreePipeline = exports.isEmpty(); + cleanupAnswerTable(exports, shouldFreePipeline); } - void sendErrorReturn(Throwable exc) { + private void sendErrorReturn(Throwable exc) { assert !redirectResults; if (!isFirstResponder()) { @@ -1099,10 +1125,10 @@ void sendErrorReturn(Throwable exc) { message.send(); } - cleanupAnswerTable(null, false); + cleanupAnswerTable(List.of(), false); } - boolean isFirstResponder() { + private boolean isFirstResponder() { if (this.responseSent) { return false; } @@ -1110,7 +1136,7 @@ boolean isFirstResponder() { return true; } - void cleanupAnswerTable(List resultExports, boolean shouldFreePipeline) { + private void cleanupAnswerTable(List resultExports, boolean shouldFreePipeline) { if (this.cancelRequested) { assert resultExports.size() == 0; answers.erase(this.answerId); @@ -1151,7 +1177,7 @@ enum PipelineState { WAITING, RESOLVED, BROKEN } - class RpcPipeline implements PipelineHook { + private class RpcPipeline implements PipelineHook { private final Question question; private PipelineState state = PipelineState.WAITING; @@ -1188,7 +1214,7 @@ class RpcPipeline implements PipelineHook { @Override public ClientHook getPipelinedCap(PipelineOp[] ops) { // TODO avoid conversion to/from ArrayList? - var key = new ArrayList<>(Arrays.asList(ops)); + var key = new ArrayList<>(Arrays.asList(ops)); var hook = this.clientMap.computeIfAbsent(key, k -> { switch (state) { case WAITING: @@ -1269,10 +1295,11 @@ class RpcRequest implements RequestHook { this.paramsBuilder = callBuilder.getParams().getContent().imbue(this.capTable); } - AnyPointer.Builder getRoot() { + private AnyPointer.Builder getRoot() { return this.paramsBuilder; } - RpcProtocol.Call.Builder getCall() { + + private RpcProtocol.Call.Builder getCall() { return this.callBuilder; } @@ -1353,7 +1380,7 @@ TailInfo tailSend() { } } - class ImportClient extends RpcClient { + private class ImportClient extends RpcClient { final int importId; int remoteRefCount = 0; @@ -1374,8 +1401,8 @@ void setFdIfMissing(Integer fd) { } } - public void dispose() { - // TODO manage destruction... + public void remove() { + // Remove self from the import table. var imp = imports.find(importId); if (imp != null) { if (imp.importClient == this) { @@ -1383,6 +1410,7 @@ public void dispose() { } } + // Send a message releasing our remote references. if (remoteRefCount > 0 && !isDisconnected()) { var message = connection.newOutgoingMessage(1024); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initRelease(); @@ -1541,6 +1569,17 @@ public ClientHook getInnermostClient() { public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { return null; } + + public void remove() { + if (this.importId != null) { + // This object represents an import promise. Clean that up. + var imp = imports.find(this.importId); + if (imp.appClient != null && imp.appClient == this) { + imp.appClient = null; + imp.importClient.remove(); + } + } + } } class PipelineClient extends RpcClient { From caec63d68c7f22fe6089228d6aef52b06c5e9496 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 14 Oct 2020 16:42:43 +0100 Subject: [PATCH 050/246] fix rpcsystem generic params, and hide various fields --- .../main/java/org/capnproto/CallContext.java | 2 +- .../java/org/capnproto/CallContextHook.java | 2 +- .../src/main/java/org/capnproto/RpcState.java | 49 ++++++++++--------- .../main/java/org/capnproto/RpcSystem.java | 8 +-- .../java/org/capnproto/TwoPartyRpcSystem.java | 2 +- 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java index ebcd6946..a4805997 100644 --- a/runtime/src/main/java/org/capnproto/CallContext.java +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -32,7 +32,7 @@ public final Results initResults() { return this.hook.getResults().initAs(results); } - public final CompletableFuture tailCall(Request tailRequest) { + public final CompletableFuture tailCall(Request tailRequest) { return hook.tailCall(tailRequest.getHook()); } diff --git a/runtime/src/main/java/org/capnproto/CallContextHook.java b/runtime/src/main/java/org/capnproto/CallContextHook.java index c5aa043f..71ebcdb6 100644 --- a/runtime/src/main/java/org/capnproto/CallContextHook.java +++ b/runtime/src/main/java/org/capnproto/CallContextHook.java @@ -9,7 +9,7 @@ public interface CallContextHook { AnyPointer.Builder getResults(); - CompletableFuture tailCall(RequestHook request); + CompletableFuture tailCall(RequestHook request); void allowCancellation(); diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index c2da6a1b..5b098fdd 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -7,6 +7,7 @@ final class RpcState { + final class Question { final int id; CompletableFuture response = new CompletableFuture<>(); @@ -976,7 +977,7 @@ List send() { } } - private static class LocallyRedirectedRpcResponse implements RpcServerResponse, RpcResponse { + private static final class LocallyRedirectedRpcResponse implements RpcServerResponse, RpcResponse { private final MessageBuilder message = new MessageBuilder(); @@ -991,30 +992,30 @@ public AnyPointer.Reader getResults() { } } - class RpcCallContext implements CallContextHook { + private final class RpcCallContext implements CallContextHook { - final int answerId; - final long interfaceId; - final short methodId; + private final int answerId; + private final long interfaceId; + private final short methodId; // request - IncomingRpcMessage request; - final AnyPointer.Reader params; + private IncomingRpcMessage request; + private final AnyPointer.Reader params; // response - RpcServerResponse response; - RpcProtocol.Return.Builder returnMessage; - boolean redirectResults = false; - boolean responseSent = false; + private RpcServerResponse response; + private RpcProtocol.Return.Builder returnMessage; + private boolean redirectResults = false; + private boolean responseSent = false; - boolean cancelRequested = false; - boolean cancelAllowed = false; + private boolean cancelRequested = false; + private boolean cancelAllowed = false; - final CompletableFuture cancelled; + private final CompletableFuture whenCancelled; RpcCallContext(int answerId, IncomingRpcMessage request, List capTable, AnyPointer.Reader params, boolean redirectResults, - CompletableFuture cancelled, + CompletableFuture whenCancelled, long interfaceId, short methodId) { this.answerId = answerId; this.interfaceId = interfaceId; @@ -1022,7 +1023,7 @@ class RpcCallContext implements CallContextHook { this.request = request; this.params = params.imbue(new ReaderCapabilityTable(capTable)); this.redirectResults = redirectResults; - this.cancelled = cancelled; + this.whenCancelled = whenCancelled; } @Override @@ -1037,23 +1038,23 @@ public void releaseParams() { @Override public AnyPointer.Builder getResults() { - if (response == null) { + if (this.response == null) { - if (redirectResults || isDisconnected()) { - response = new LocallyRedirectedRpcResponse(); + if (this.redirectResults || isDisconnected()) { + this.response = new LocallyRedirectedRpcResponse(); } else { var message = connection.newOutgoingMessage(1024); - returnMessage = message.getBody().initAs(RpcProtocol.Message.factory).initReturn(); - response = new RpcServerResponseImpl(message, returnMessage.getResults()); + this.returnMessage = message.getBody().initAs(RpcProtocol.Message.factory).initReturn(); + this.response = new RpcServerResponseImpl(message, returnMessage.getResults()); } } - return response.getResultsBuilder(); + return this.response.getResultsBuilder(); } @Override - public CompletableFuture tailCall(RequestHook request) { + public CompletableFuture tailCall(RequestHook request) { return null; } @@ -1167,7 +1168,7 @@ public void requestCancel() { if (previouslyAllowedButNotRequested) { // We just set CANCEL_REQUESTED, and CANCEL_ALLOWED was already set previously. Initiate // the cancellation. - this.cancelled.complete(null); + this.whenCancelled.complete(null); } // TODO do we care about cancelRequested if further completions are effectively ignored? } diff --git a/runtime/src/main/java/org/capnproto/RpcSystem.java b/runtime/src/main/java/org/capnproto/RpcSystem.java index d6bb2907..69624d93 100644 --- a/runtime/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime/src/main/java/org/capnproto/RpcSystem.java @@ -4,14 +4,14 @@ import java.util.Map; import java.util.concurrent.CompletableFuture; -public abstract class RpcSystem { +public abstract class RpcSystem { - final Network network; + final VatNetwork network; final Capability.Client bootstrapInterface; final Map connections = new HashMap<>(); CompletableFuture acceptCompleted = CompletableFuture.completedFuture(null); - public RpcSystem(Network network, Capability.Client bootstrapInterface) { + public RpcSystem(VatNetwork network, Capability.Client bootstrapInterface) { this.network = network; this.bootstrapInterface = bootstrapInterface; } @@ -36,7 +36,7 @@ public final CompletableFuture runOnce() { CompletableFuture acceptLoop() { if (this.acceptCompleted.isDone()) { - CompletableFuture accepted = this.network.baseAccept(); + var accepted = this.network.baseAccept(); this.acceptCompleted = accepted.thenAccept(this::accept); } return this.acceptCompleted; diff --git a/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java b/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java index d7996b1c..c99092a9 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java @@ -1,7 +1,7 @@ package org.capnproto; public class TwoPartyRpcSystem - extends RpcSystem { + extends RpcSystem { public TwoPartyRpcSystem(TwoPartyVatNetwork network, Capability.Client bootstrapInterface) { super(network, bootstrapInterface); From 7134461e7d6997f4bf849dcdca86f851e1411904 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 15 Oct 2020 17:41:12 +0100 Subject: [PATCH 051/246] use weak refs to cleanup import table --- .../main/java/org/capnproto/ImportTable.java | 4 +- .../src/main/java/org/capnproto/RpcState.java | 236 ++++++++++-------- 2 files changed, 133 insertions(+), 107 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/ImportTable.java b/runtime/src/main/java/org/capnproto/ImportTable.java index b15d2ea1..69050607 100644 --- a/runtime/src/main/java/org/capnproto/ImportTable.java +++ b/runtime/src/main/java/org/capnproto/ImportTable.java @@ -8,10 +8,10 @@ abstract class ImportTable implements Iterable { private final HashMap slots = new HashMap<>(); - protected abstract T newImportable(); + protected abstract T newImportable(int id); public T put(int id) { - return slots.computeIfAbsent(id, key -> newImportable()); + return this.slots.computeIfAbsent(id, key -> newImportable(id)); } public T find(int id) { diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 5b098fdd..92cad37f 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -1,5 +1,7 @@ package org.capnproto; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; import java.util.*; import java.util.concurrent.Callable; import java.util.concurrent.CompletableFuture; @@ -7,7 +9,6 @@ final class RpcState { - final class Question { final int id; CompletableFuture response = new CompletableFuture<>(); @@ -49,29 +50,61 @@ void finish() { } static final class Answer { + final int answerId; boolean active = false; PipelineHook pipeline; CompletionStage redirectedResults; RpcCallContext callContext; List resultExports; + + Answer(int answerId) { + this.answerId = answerId; + } } static final class Export { - final int id; + final int exportId; int refcount; ClientHook clientHook; CompletionStage resolveOp; - Export(int id) { - this.id = id; + Export(int exportId) { + this.exportId = exportId; } } - static final class Import { - ImportClient importClient; - RpcClient appClient; + final class Import { + final int importId; + ImportRef importClient; + int remoteRefCount; + WeakReference appClient; CompletableFuture promise; // If non-null, the import is a promise. + + Import(int importId) { + this.importId = importId; + } + + void addRemoteRef() { + this.remoteRefCount++; + } + + public void dispose() { + // Remove self from the import table. + var imp = imports.find(importId); + if (imp == this) { + imports.erase(importId, imp); + } + + // Send a message releasing our remote references. + if (remoteRefCount > 0 && !isDisconnected()) { + var message = connection.newOutgoingMessage(1024); + var builder = message.getBody().initAs(RpcProtocol.Message.factory).initRelease(); + builder.setId(importId); + builder.setReferenceCount(remoteRefCount); + message.send(); + } + } } final static class Embargo { @@ -97,21 +130,21 @@ Question newExportable(int id) { } }; - private final ImportTable answers = new ImportTable() { + private final ImportTable answers = new ImportTable<>() { @Override - protected Answer newImportable() { - return new Answer(); + protected Answer newImportable(int answerId) { + return new Answer(answerId); } }; - private final ImportTable imports = new ImportTable() { + private final ImportTable imports = new ImportTable<>() { @Override - protected Import newImportable() { - return new Import(); + protected Import newImportable(int importId) { + return new Import(importId); } }; - private final ExportTable embargos = new ExportTable() { + private final ExportTable embargos = new ExportTable<>() { @Override Embargo newExportable(int id) { return new Embargo(id); @@ -163,6 +196,7 @@ ClientHook restore() { // run message loop once final CompletableFuture runOnce() { + this.cleanupImports(); if (isDisconnected()) { return CompletableFuture.failedFuture(disconnected); @@ -189,6 +223,8 @@ final CompletableFuture runOnce() { // run message loop until promise is completed public final CompletableFuture messageLoop(CompletableFuture done) { + this.cleanupImports(); + if (done.isDone()) { return done; } @@ -237,6 +273,9 @@ synchronized void handleMessage(IncomingRpcMessage message) throws RpcException case DISEMBARGO: handleDisembargo(reader.getDisembargo()); break; + case RELEASE: + handleRelease(reader.getRelease()); + break; default: if (!isDisconnected()) { // boomin' back atcha @@ -432,8 +471,7 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu var payload = callReturn.getResults(); var capTable = receiveCaps(payload.getCapTable(), message.getAttachedFds()); // TODO question, message unused in RpcResponseImpl - // var response = new RpcResponseImpl(question, message, capTable, payload.getContent()); - var response = new RpcResponseImpl(capTable, payload.getContent()); + var response = new RpcResponseImpl(question, message, capTable, payload.getContent()); question.answer(response); break; @@ -508,40 +546,32 @@ void handleFinish(RpcProtocol.Finish.Reader finish) { void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { - ClientHook replacement = null; - Throwable exc = null; + var imp = imports.find(resolve.getPromiseId()); + if (imp == null) { + return; + } + + if (imp.importClient != null) { + // It appears this is a valid entry on the import table, but was not expected to be a + // promise. + assert false: "Import already resolved."; + } switch (resolve.which()) { case CAP: - replacement = receiveCap(resolve.getCap(), message.getAttachedFds()); + imp.promise.complete(receiveCap(resolve.getCap(), message.getAttachedFds())); break; case EXCEPTION: - exc = new RuntimeException(resolve.getException().getReason().toString()); + imp.promise.completeExceptionally(RpcException.toException(resolve.getException())); break; default: assert false; return; } + } - var imp = imports.find(resolve.getPromiseId()); - if (imp == null) { - return; - } - - var fulfiller = imp.promise; - if (fulfiller != null) { - if (exc != null) { - fulfiller.completeExceptionally(exc); - } - else { - fulfiller.complete(replacement); - } - } - else if (imp.importClient != null) { - // It appears this is a valid entry on the import table, but was not expected to be a - // promise. - assert false; - } + private void handleRelease(RpcProtocol.Release.Reader release) { + releaseExport(release.getId(), release.getReferenceCount()); } void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { @@ -669,13 +699,13 @@ private Integer writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builde var wrapped = inner.whenMoreResolved(); if (wrapped != null) { // This is a promise. Arrange for the `Resolve` message to be sent later. - export.resolveOp = resolveExportedPromise(export.id, wrapped); - descriptor.setSenderPromise(export.id); + export.resolveOp = resolveExportedPromise(export.exportId, wrapped); + descriptor.setSenderPromise(export.exportId); } else { - descriptor.setSenderHosted(export.id); + descriptor.setSenderHosted(export.exportId); } - return export.id; + return export.exportId; } CompletionStage resolveExportedPromise(int exportId, CompletionStage promise) { @@ -741,8 +771,8 @@ void releaseExport(int exportId, int refcount) { return; } - if (export.refcount <= refcount) { - assert false: "Over-reducing export refcount"; + if (export.refcount < refcount) { + assert false: "Over-reducing export refcount. exported=" + export.refcount + ", requested=" + refcount; return; } @@ -828,27 +858,35 @@ private ClientHook importCap(int importId, boolean isPromise, Integer fd) { // Receive a new import. var imp = imports.put(importId); - - if (imp.importClient == null) { - imp.importClient = new ImportClient(importId, fd); + ImportClient importClient = null; + if (imp.importClient != null) { + importClient = imp.importClient.get(); + } + if (importClient == null) { + importClient = new ImportClient(imp, fd); + imp.importClient = new ImportRef(importId, importClient); } else { - imp.importClient.setFdIfMissing(fd); + importClient.setFdIfMissing(fd); } - imp.importClient.addRemoteRef(); + + imp.addRemoteRef(); if (!isPromise) { - imp.appClient = imp.importClient; - return imp.importClient; + imp.appClient = new WeakReference<>(importClient); + return importClient; } if (imp.appClient != null) { - return imp.appClient; + var tmp = imp.appClient.get(); + if (tmp != null) { + return tmp; + } } - imp.promise = new CompletableFuture(); - var result = new PromiseClient(imp.importClient, imp.promise, importId); - imp.appClient = result; + imp.promise = new CompletableFuture<>(); + var result = new PromiseClient(importClient, imp.promise, importId); + imp.appClient = new WeakReference<>(result); return result; } @@ -923,17 +961,16 @@ interface RpcServerResponse { } static class RpcResponseImpl implements RpcResponse { - // TODO unused? - // private final Question question; - // private final IncomingRpcMessage message; + private final Question question; + private final IncomingRpcMessage message; private final AnyPointer.Reader results; - RpcResponseImpl(/*Question question, - IncomingRpcMessage message,*/ + RpcResponseImpl(Question question, + IncomingRpcMessage message, List capTable, AnyPointer.Reader results) { - // this.question = question; - // this.message = message; + this.question = question; + this.message = message; this.results = results.imbue(new ReaderCapabilityTable(capTable)); } @@ -1381,19 +1418,26 @@ TailInfo tailSend() { } } - private class ImportClient extends RpcClient { + private ReferenceQueue importRefs = new ReferenceQueue<>(); + + private class ImportRef extends WeakReference { final int importId; - int remoteRefCount = 0; - Integer fd; - ImportClient(int importId, Integer fd) { + ImportRef(int importId, ImportClient hook) { + super(hook, importRefs); this.importId = importId; - this.fd = fd; } + } - void addRemoteRef() { - this.remoteRefCount++; + private class ImportClient extends RpcClient { + + final Import imp; + Integer fd; + + ImportClient(Import imp, Integer fd) { + this.imp = imp; + this.fd = fd; } void setFdIfMissing(Integer fd) { @@ -1402,34 +1446,15 @@ void setFdIfMissing(Integer fd) { } } - public void remove() { - // Remove self from the import table. - var imp = imports.find(importId); - if (imp != null) { - if (imp.importClient == this) { - imports.erase(importId, imp); - } - } - - // Send a message releasing our remote references. - if (remoteRefCount > 0 && !isDisconnected()) { - var message = connection.newOutgoingMessage(1024); - var builder = message.getBody().initAs(RpcProtocol.Message.factory).initRelease(); - builder.setId(importId); - builder.setReferenceCount(remoteRefCount); - message.send(); - } - } - @Override public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { - descriptor.setReceiverHosted(importId); + descriptor.setReceiverHosted(this.imp.importId); return null; } @Override public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { - target.setImportedCap(importId); + target.setImportedCap(this.imp.importId); return null; } @@ -1444,6 +1469,20 @@ public CompletionStage whenMoreResolved() { } } + private void cleanupImports() { + while (true) { + var ref = (ImportRef) this.importRefs.poll(); + if (ref == null) { + return; + } + var imp = this.imports.find(ref.importId); + assert imp != null; + if (imp != null) { + imp.dispose(); + } + } + } + enum ResolutionType { UNRESOLVED, REMOTE, @@ -1464,9 +1503,7 @@ public PromiseClient(RpcClient initial, Integer importId) { this.cap = initial; this.importId = importId; - this.promise = eventual.thenApply(resolution -> { - return resolve(resolution); - }); + this.promise = eventual.thenApply(resolution -> resolve(resolution)); } public boolean isResolved() { @@ -1570,17 +1607,6 @@ public ClientHook getInnermostClient() { public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { return null; } - - public void remove() { - if (this.importId != null) { - // This object represents an import promise. Clean that up. - var imp = imports.find(this.importId); - if (imp.appClient != null && imp.appClient == this) { - imp.appClient = null; - imp.importClient.remove(); - } - } - } } class PipelineClient extends RpcClient { From 730ca1abf560e1493a58cfd7248a821788adf879 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 20 Oct 2020 21:42:20 +0100 Subject: [PATCH 052/246] question cleanup --- compiler/src/main/cpp/capnpc-java.c++ | 4 +- .../java/org/capnproto/CallContextHook.java | 6 +- .../main/java/org/capnproto/Capability.java | 119 +- .../main/java/org/capnproto/ClientHook.java | 4 +- .../org/capnproto/DispatchCallResult.java | 8 +- .../main/java/org/capnproto/ExportTable.java | 6 +- .../main/java/org/capnproto/QueuedClient.java | 50 - .../java/org/capnproto/QueuedPipeline.java | 28 - .../main/java/org/capnproto/RpcDumper.java | 103 + .../main/java/org/capnproto/RpcException.java | 7 +- .../src/main/java/org/capnproto/RpcState.java | 569 +- .../main/java/org/capnproto/RpcSystem.java | 42 +- .../src/main/java/org/capnproto/Schema.java | 7916 +++++++++++++++++ .../main/java/org/capnproto/Serialize.java | 2 +- .../java/org/capnproto/TwoPartyClient.java | 14 +- .../java/org/capnproto/TwoPartyRpcSystem.java | 4 + .../java/org/capnproto/TwoPartyServer.java | 107 +- .../org/capnproto/TwoPartyVatNetwork.java | 59 +- .../main/java/org/capnproto/VatNetwork.java | 2 + .../src/main/java/org/capnproto/schema.capnp | 533 ++ .../org/capnproto/LocalCapabilityTest.java | 66 + .../test/java/org/capnproto/RpcStateTest.java | 16 +- .../test/java/org/capnproto/TwoPartyTest.java | 166 +- .../test/java/org/capnproto/demo/Demo.java | 12 +- 24 files changed, 9437 insertions(+), 406 deletions(-) delete mode 100644 runtime/src/main/java/org/capnproto/QueuedClient.java delete mode 100644 runtime/src/main/java/org/capnproto/QueuedPipeline.java create mode 100644 runtime/src/main/java/org/capnproto/RpcDumper.java create mode 100644 runtime/src/main/java/org/capnproto/Schema.java create mode 100644 runtime/src/main/java/org/capnproto/schema.capnp create mode 100644 runtime/src/test/java/org/capnproto/LocalCapabilityTest.java diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 23c0654e..5943aacd 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -1758,7 +1758,7 @@ private: " }\n"), kj::strTree( - " protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.StreamingCallContext<", shortParamType, ".Reader> context) {\n" + " protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.StreamingCallContext<", shortParamType, ".Reader> context) {\n" " return org.capnproto.Capability.Server.internalUnimplemented(\n" " \"", interfaceProto.getDisplayName(), "\", \"", methodName, "\",\n" " 0x", interfaceIdHex, "L, (short)", methodId, ");\n" @@ -1780,7 +1780,7 @@ private: " }\n"), kj::strTree( - " protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.CallContext<", shortParamType, ".Reader, ", shortResultType, ".Builder> context) {\n" + " protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.CallContext<", shortParamType, ".Reader, ", shortResultType, ".Builder> context) {\n" " return org.capnproto.Capability.Server.internalUnimplemented(\n" " \"", interfaceProto.getDisplayName(), "\", \"", methodName, "\",\n" " 0x", interfaceIdHex, "L, (short)", methodId, ");\n" diff --git a/runtime/src/main/java/org/capnproto/CallContextHook.java b/runtime/src/main/java/org/capnproto/CallContextHook.java index 71ebcdb6..08f85c93 100644 --- a/runtime/src/main/java/org/capnproto/CallContextHook.java +++ b/runtime/src/main/java/org/capnproto/CallContextHook.java @@ -7,7 +7,11 @@ public interface CallContextHook { void releaseParams(); - AnyPointer.Builder getResults(); + default AnyPointer.Builder getResults() { + return getResults(0); + } + + AnyPointer.Builder getResults(int sizeHint); CompletableFuture tailCall(RequestHook request); diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 262cc83e..8dfed406 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -162,7 +162,7 @@ public Object getBrand() { return BRAND; } - CompletableFuture callInternal(long interfaceId, short methodId, CallContextHook context) { + CompletableFuture callInternal(long interfaceId, short methodId, CallContextHook context) { var result = dispatchCall( interfaceId, methodId, @@ -212,7 +212,7 @@ protected abstract DispatchCallResult dispatchCall( long interfaceId, short methodId, CallContext context); - protected static DispatchCallResult streamResult(CompletableFuture result) { + protected static DispatchCallResult streamResult(CompletableFuture result) { // For streaming calls, we need to add an evalNow() here so that exceptions thrown // directly from the call can propagate to later calls. If we don't capture the // exception properly then the caller will never find out that this is a streaming @@ -222,35 +222,35 @@ protected static DispatchCallResult streamResult(CompletableFuture result) { return new DispatchCallResult(result, true); } - protected static DispatchCallResult result(CompletableFuture result) { + protected static DispatchCallResult result(CompletableFuture result) { return new DispatchCallResult(result, false); } - protected static CompletableFuture internalUnimplemented(String actualInterfaceName, long requestedTypeId) { + protected static CompletableFuture internalUnimplemented(String actualInterfaceName, long requestedTypeId) { return CompletableFuture.failedFuture(RpcException.unimplemented( "Method not implemented. " + actualInterfaceName + " " + requestedTypeId)); } - protected static CompletableFuture internalUnimplemented(String interfaceName, long typeId, short methodId) { + protected static CompletableFuture internalUnimplemented(String interfaceName, long typeId, short methodId) { return CompletableFuture.failedFuture(RpcException.unimplemented( "Method not implemented. " + interfaceName + " " + typeId + " " + methodId)); } - protected static CompletableFuture internalUnimplemented(String interfaceName, String methodName, long typeId, short methodId) { + protected static CompletableFuture internalUnimplemented(String interfaceName, String methodName, long typeId, short methodId) { return CompletableFuture.failedFuture(RpcException.unimplemented( "Method not implemented. " + interfaceName + " " + typeId + " " + methodName + " " + methodId)); } } public static ClientHook newLocalPromiseClient(CompletionStage promise) { - return new QueuedClient(promise); + return new QueuedClient(promise.toCompletableFuture()); } public static PipelineHook newLocalPromisePipeline(CompletionStage promise) { - return new QueuedPipeline(promise); + return new QueuedPipeline(promise.toCompletableFuture()); } - static class LocalRequest implements RequestHook { + private static class LocalRequest implements RequestHook { final MessageBuilder message = new MessageBuilder(); final long interfaceId; @@ -290,11 +290,11 @@ public Object getBrand() { } } - static final class LocalPipeline implements PipelineHook { - final CallContextHook context; - final AnyPointer.Reader results; + private static final class LocalPipeline implements PipelineHook { + private final CallContextHook context; + private final AnyPointer.Reader results; - public LocalPipeline(CallContextHook context) { + LocalPipeline(CallContextHook context) { this.context = context; this.results = context.getResults().asReader(); } @@ -305,11 +305,16 @@ public final ClientHook getPipelinedCap(PipelineOp[] ops) { } } - static class LocalResponse implements ResponseHook { - final MessageBuilder message = new MessageBuilder(); + private static final class LocalResponse implements ResponseHook { + + final MessageBuilder message; + + LocalResponse(int sizeHint) { + this.message = new MessageBuilder(sizeHint); + } } - static class LocalCallContext implements CallContextHook { + private static class LocalCallContext implements CallContextHook { final CompletableFuture cancelAllowed; MessageBuilder request; @@ -336,9 +341,9 @@ public void releaseParams() { } @Override - public AnyPointer.Builder getResults() { + public AnyPointer.Builder getResults(int sizeHint) { if (this.response == null) { - var localResponse = new LocalResponse(); + var localResponse = new LocalResponse(sizeHint); this.responseBuilder = localResponse.message.getRoot(AnyPointer.factory); this.response = new Response<>(this.responseBuilder.asReader(), localResponse); } @@ -409,4 +414,82 @@ public Object getBrand() { }; } + // Call queues + // + // These classes handle pipelining in the case where calls need to be queued in-memory until some + // local operation completes. + + // A PipelineHook which simply queues calls while waiting for a PipelineHook to which to forward them. + private static final class QueuedPipeline implements PipelineHook { + + private final CompletableFuture promise; + private final CompletionStage selfResolutionOp; + PipelineHook redirect; + + QueuedPipeline(CompletableFuture promiseParam) { + this.promise = promiseParam; + this.selfResolutionOp = promise.handle((pipeline, exc) -> { + this.redirect = exc == null + ? pipeline + : PipelineHook.newBrokenPipeline(exc); + return null; + }); + } + + @Override + public final ClientHook getPipelinedCap(PipelineOp[] ops) { + return redirect != null + ? redirect.getPipelinedCap(ops) + : new QueuedClient(this.promise.thenApply( + pipeline -> pipeline.getPipelinedCap(ops))); + } + } + + // A ClientHook which simply queues calls while waiting for a ClientHook to which to forward them. + private static class QueuedClient implements ClientHook { + + private final CompletableFuture promise; + private final CompletableFuture promiseForCallForwarding; + private final CompletableFuture promiseForClientResolution; + private final CompletableFuture setResolutionOp; + private ClientHook redirect; + + QueuedClient(CompletableFuture promise) { + // TODO revisit futures + this.promise = promise; + this.promiseForCallForwarding = promise.toCompletableFuture().copy(); + this.promiseForClientResolution = promise.toCompletableFuture().copy(); + this.setResolutionOp = promise.thenAccept(inner -> { + this.redirect = inner; + }).exceptionally(exc -> { + this.redirect = newBrokenCap(exc); + return null; + }); + } + + @Override + public Request newCall(long interfaceId, short methodId) { + var hook = new LocalRequest(interfaceId, methodId, this); + var root = hook.message.getRoot(AnyPointer.factory); + return new Request<>(root, AnyPointer.factory, hook); + } + + @Override + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { + var callResultPromise = this.promiseForCallForwarding.thenApply(client -> client.call(interfaceId, methodId, ctx)); + var pipelinePromise = callResultPromise.thenApply(callResult -> callResult.pipeline); + var pipeline = new QueuedPipeline(pipelinePromise); + return new VoidPromiseAndPipeline(callResultPromise.thenAccept(x -> {}), pipeline); + } + + @Override + public ClientHook getResolved() { + return redirect; + } + + @Override + public CompletionStage whenMoreResolved() { + return promiseForClientResolution.copy(); + } + } } diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index 55b12a91..b5dc6130 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -44,10 +44,10 @@ default Integer getFd() { } final class VoidPromiseAndPipeline { - public final CompletionStage promise; + public final CompletionStage promise; public final PipelineHook pipeline; - VoidPromiseAndPipeline(CompletionStage promise, PipelineHook pipeline) { + VoidPromiseAndPipeline(CompletionStage promise, PipelineHook pipeline) { this.promise = promise; this.pipeline = pipeline; } diff --git a/runtime/src/main/java/org/capnproto/DispatchCallResult.java b/runtime/src/main/java/org/capnproto/DispatchCallResult.java index de3fb4d3..536a2a07 100644 --- a/runtime/src/main/java/org/capnproto/DispatchCallResult.java +++ b/runtime/src/main/java/org/capnproto/DispatchCallResult.java @@ -4,10 +4,10 @@ public final class DispatchCallResult { - private final CompletableFuture promise; + private final CompletableFuture promise; private final boolean streaming; - public DispatchCallResult(CompletableFuture promise, boolean isStreaming) { + public DispatchCallResult(CompletableFuture promise, boolean isStreaming) { this.promise = promise; this.streaming = isStreaming; } @@ -16,8 +16,8 @@ public DispatchCallResult(Throwable exc) { this(CompletableFuture.failedFuture(exc), false); } - public CompletableFuture getPromise() { - return promise; + public CompletableFuture getPromise() { + return promise.copy(); } public boolean isStreaming() { diff --git a/runtime/src/main/java/org/capnproto/ExportTable.java b/runtime/src/main/java/org/capnproto/ExportTable.java index f91a7e0b..dcd7730d 100644 --- a/runtime/src/main/java/org/capnproto/ExportTable.java +++ b/runtime/src/main/java/org/capnproto/ExportTable.java @@ -8,9 +8,9 @@ abstract class ExportTable implements Iterable { - final HashMap slots = new HashMap<>(); - final Queue freeIds = new PriorityQueue<>(); - int max = 0; + private final HashMap slots = new HashMap<>(); + private final Queue freeIds = new PriorityQueue<>(); + private int max = 0; abstract T newExportable(int id); diff --git a/runtime/src/main/java/org/capnproto/QueuedClient.java b/runtime/src/main/java/org/capnproto/QueuedClient.java deleted file mode 100644 index 752dde37..00000000 --- a/runtime/src/main/java/org/capnproto/QueuedClient.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.capnproto; - -import java.util.concurrent.CompletionStage; - -class QueuedClient implements ClientHook { - - final CompletionStage promise; - final CompletionStage promiseForCallForwarding; - final CompletionStage promiseForClientResolution; - final CompletionStage setResolutionOp; - ClientHook redirect; - - QueuedClient(CompletionStage promise) { - // TODO revisit futures - this.promise = promise.toCompletableFuture().copy(); - this.promiseForCallForwarding = promise.toCompletableFuture().copy(); - this.promiseForClientResolution = promise.toCompletableFuture().copy(); - this.setResolutionOp = promise.thenAccept(inner -> { - this.redirect = inner; - }).exceptionally(exc -> { - this.redirect = Capability.newBrokenCap(exc); - return null; - }); - } - - @Override - public Request newCall(long interfaceId, short methodId) { - var hook = new Capability.LocalRequest(interfaceId, methodId, this); - var root = hook.message.getRoot(AnyPointer.factory); - return new Request<>(root, AnyPointer.factory, hook); - } - - @Override - public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { - var callResultPromise = this.promiseForCallForwarding.thenApply(client -> client.call(interfaceId, methodId, ctx)); - var pipelinePromise = callResultPromise.thenApply(callResult -> callResult.pipeline); - var pipeline = new QueuedPipeline(pipelinePromise); - return new VoidPromiseAndPipeline(callResultPromise, pipeline); - } - - @Override - public ClientHook getResolved() { - return redirect; - } - - @Override - public CompletionStage whenMoreResolved() { - return promiseForClientResolution; - } -} diff --git a/runtime/src/main/java/org/capnproto/QueuedPipeline.java b/runtime/src/main/java/org/capnproto/QueuedPipeline.java deleted file mode 100644 index 27508f5a..00000000 --- a/runtime/src/main/java/org/capnproto/QueuedPipeline.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.capnproto; - -import java.util.concurrent.CompletionStage; - -final class QueuedPipeline implements PipelineHook { - - final CompletionStage promise; - final CompletionStage selfResolutionOp; - PipelineHook redirect; - - public QueuedPipeline(CompletionStage promiseParam) { - this.promise = promiseParam; - this.selfResolutionOp = promise.handle((pipeline, exc) -> { - this.redirect = exc == null - ? pipeline - : PipelineHook.newBrokenPipeline(exc); - return null; - }); - } - - @Override - public final ClientHook getPipelinedCap(PipelineOp[] ops) { - return redirect != null - ? redirect.getPipelinedCap(ops) - : new QueuedClient(this.promise.thenApply( - pipeline -> pipeline.getPipelinedCap(ops))); - } -} diff --git a/runtime/src/main/java/org/capnproto/RpcDumper.java b/runtime/src/main/java/org/capnproto/RpcDumper.java new file mode 100644 index 00000000..0a2f902c --- /dev/null +++ b/runtime/src/main/java/org/capnproto/RpcDumper.java @@ -0,0 +1,103 @@ +package org.capnproto; + +import java.util.HashMap; +import java.util.Map; + +public class RpcDumper { + + private final Map schemas = new HashMap<>(); + private final Map clientReturnTypes = new HashMap<>(); + private final Map serverReturnTypes = new HashMap<>(); + + void addSchema(long schemaId, Schema.Node.Reader node) { + this.schemas.put(schemaId, node); + } + + private void setReturnType(RpcTwoPartyProtocol.Side side, int schemaId, long schema) { + switch (side) { + case CLIENT: + clientReturnTypes.put(schemaId, schema); + break; + case SERVER: + serverReturnTypes.put(schemaId, schema); + default: + break; + } + } + + private Long getReturnType(RpcTwoPartyProtocol.Side side, int schemaId) { + switch (side) { + case CLIENT: + return clientReturnTypes.get(schemaId); + case SERVER: + return serverReturnTypes.get(schemaId); + default: + break; + } + return -1L; + } + + String dump(RpcProtocol.Message.Reader message, RpcTwoPartyProtocol.Side sender) { + switch (message.which()) { + case CALL: { + var call = message.getCall(); + var iface = call.getInterfaceId(); + var schema = this.schemas.get(iface); + if (schema == null || !schema.isInterface()) { + break; + } + + var interfaceSchema = schema.getInterface(); + + var methods = interfaceSchema.getMethods(); + if (call.getMethodId() >= methods.size()) { + break; + } + + var method = methods.get(call.getMethodId()); + var interfaceName = schema.getDisplayName().toString(); + var paramType = method.getParamStructType(); + var resultType = method.getResultStructType(); + + if (call.getSendResultsTo().isCaller()) { + var questionId = call.getQuestionId(); + setReturnType(sender, call.getQuestionId(), resultType); + } + + var payload = call.getParams(); + var params = payload.getContent(); + var sendResultsTo = call.getSendResultsTo(); + + return sender.name() + "(" + call.getQuestionId() + "): call " + + call.getTarget() + " <- " + interfaceName + "." + + method.getName().toString() + " " + params + " caps:[" + + payload.getCapTable() + "]" + (sendResultsTo.isCaller() ? "" : (" sendResultsTo:" + sendResultsTo)); + } + + case RETURN: { + var ret = message.getReturn(); + var returnType = getReturnType( + sender == RpcTwoPartyProtocol.Side.CLIENT + ? RpcTwoPartyProtocol.Side.SERVER + : RpcTwoPartyProtocol.Side.CLIENT, + ret.getAnswerId()); + if (ret.which() != RpcProtocol.Return.Which.RESULTS) { + break; + } + var payload = ret.getResults(); + return sender.name() + "(" + ret.getAnswerId() + "): return " + payload + + " caps:[" + payload.getCapTable() + "]"; + } + + case BOOTSTRAP: { + var restore = message.getBootstrap(); + setReturnType(sender, restore.getQuestionId(), 0); + return sender.name() + "(" + restore.getQuestionId() + "): bootstrap " + + restore.getDeprecatedObjectId(); + } + default: + break; + } + return ""; + } +} diff --git a/runtime/src/main/java/org/capnproto/RpcException.java b/runtime/src/main/java/org/capnproto/RpcException.java index a3202be0..cccc689b 100644 --- a/runtime/src/main/java/org/capnproto/RpcException.java +++ b/runtime/src/main/java/org/capnproto/RpcException.java @@ -5,7 +5,8 @@ public final class RpcException extends java.lang.Exception { public enum Type { UNKNOWN, UNIMPLEMENTED, - FAILED + FAILED, + DISCONNECTED } private Type type; @@ -27,6 +28,10 @@ public static RpcException failed(String message) { return new RpcException(Type.FAILED, message); } + public static RpcException disconnected(String message) { + return new RpcException(Type.DISCONNECTED, message); + } + static void fromException(Throwable exc, RpcProtocol.Exception.Builder builder) { builder.setReason(exc.getMessage()); builder.setType(RpcProtocol.Exception.Type.FAILED); diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 92cad37f..ff9844e4 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -1,40 +1,50 @@ package org.capnproto; +import java.io.IOException; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.*; import java.util.concurrent.Callable; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; +import java.util.function.Consumer; final class RpcState { - final class Question { + private static int messageSizeHint() { + return 1 + RpcProtocol.Message.factory.structSize().total(); + } + + private static int MESSAGE_TARGET_SIZE_HINT + = RpcProtocol.MessageTarget.factory.structSize().total() + + RpcProtocol.PromisedAnswer.factory.structSize().total() + + 16; + + private static int CAP_DESCRIPTOR_SIZE_HINT + = RpcProtocol.CapDescriptor.factory.structSize().total() + + RpcProtocol.PromisedAnswer.factory.structSize().total(); + + private final class QuestionDisposer { + final int id; - CompletableFuture response = new CompletableFuture<>(); - List paramExports; - boolean isAwaitingReturn = false; - boolean isTailCall = false; - boolean skipFinish = false; + boolean skipFinish; + boolean isAwaitingReturn; - Question(int id) { + QuestionDisposer(int id) { this.id = id; } - void reject(Throwable exc) { - this.response.completeExceptionally(exc); - this.finish(); - } - - void answer(RpcResponse response) { - this.response.complete(response); - this.finish(); - } + void dispose() { + var ref = questions.find(this.id); + if (ref != null) { + assert false: "Question ID no longer on table?"; + return; + } - void finish() { - assert questions.find(this.id) != null : "Question ID no longer on table?"; if (isConnected() && !this.skipFinish) { - var message = connection.newOutgoingMessage(1024); + var sizeHint = messageSizeHint() + + RpcProtocol.Finish.factory.structSize().total(); + var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().getAs(RpcProtocol.Message.factory).initFinish(); builder.setQuestionId(this.id); builder.setReleaseResultCaps(this.isAwaitingReturn); @@ -45,7 +55,104 @@ void finish() { // Remove question ID from the table. Must do this *after* sending `Finish` to ensure that // the ID is not re-allocated before the `Finish` message can be sent. assert !this.isAwaitingReturn; - questions.erase(id, this); + questions.erase(id); + } + } + + private final class QuestionRef extends WeakReference { + + private final QuestionDisposer disposer; + + QuestionRef(Question question) { + super(question, questionRefQueue); + this.disposer = question.disposer; + } + + void dispose() { + this.disposer.dispose(); + } + } + + private final class Question { + + CompletableFuture response = new CompletableFuture<>(); + int[] paramExports = new int[0]; + private final QuestionDisposer disposer; + boolean isTailCall = false; + + Question(int id) { + this.disposer = new QuestionDisposer(id); + } + + public int getId() { + return this.disposer.id; + } + + public void setAwaitingReturn(boolean value) { + this.disposer.isAwaitingReturn = value; + } + + void reject(Throwable exc) { + this.response.completeExceptionally(exc); + } + + void answer(RpcResponse response) { + this.response.complete(response); + } + + public boolean isAwaitingReturn() { + return this.disposer.isAwaitingReturn; + } + + public void setSkipFinish(boolean value) { + this.disposer.skipFinish = value; + } + } + + class QuestionExportTable implements Iterable { + private final HashMap> slots = new HashMap<>(); + private final Queue freeIds = new PriorityQueue<>(); + private int max = 0; + + public Question find(int id) { + var ref = this.slots.get(id); + return ref == null ? null : ref.get(); + } + + public Question erase(int id) { + var value = this.slots.get(id); + if (value != null) { + freeIds.add(id); + this.slots.remove(id); + return value.get(); + } else { + return null; + } + } + + public Question next() { + int id = freeIds.isEmpty() ? max++ : freeIds.remove(); + var value = new Question(id); + var prev = slots.put(id, new QuestionRef(value)); + assert prev == null; + return value; + } + + @Override + public Iterator iterator() { + return this.slots.values() + .stream() + .map(ref -> ref.get()) + .filter(question -> question != null) + .iterator(); + } + + @Override + public void forEach(Consumer action) { + var iter = this.iterator(); + while (iter.hasNext()) { + action.accept(iter.next()); + } } } @@ -55,7 +162,7 @@ static final class Answer { PipelineHook pipeline; CompletionStage redirectedResults; RpcCallContext callContext; - List resultExports; + int[] resultExports; Answer(int answerId) { this.answerId = answerId; @@ -123,12 +230,20 @@ Export newExportable(int id) { } }; - private final ExportTable questions = new ExportTable() { + /* + private final ExportTable questions = new ExportTable<>() { @Override - Question newExportable(int id) { - return new Question(id); + QuestionRef newExportable(int id) { + return new QuestionRef(new Question(id)); } }; +*/ + private final QuestionExportTable questions = new QuestionExportTable(); /*{ + @Override + Question newExportable(int id) { + return new Question(id); + } +*/ private final ImportTable answers = new ImportTable<>() { @Override @@ -151,15 +266,117 @@ Embargo newExportable(int id) { } }; - private final HashMap exportsByCap = new HashMap<>(); - private final VatNetwork.Connection connection; + private final Map exportsByCap = new HashMap<>(); private final Capability.Client bootstrapInterface; + private final VatNetwork.Connection connection; + private final CompletableFuture onDisconnect; private Throwable disconnected = null; - private CompletableFuture messageReady = CompletableFuture.completedFuture(null); - - RpcState(VatNetwork.Connection connection, Capability.Client bootstrapInterface) { - this.connection = connection; + private CompletableFuture messageReady = CompletableFuture.completedFuture(null); + private final String name; + private final CompletableFuture messageLoop; + private final ReferenceQueue questionRefQueue = new ReferenceQueue<>(); + + RpcState( Capability.Client bootstrapInterface, + VatNetwork.Connection connection, + CompletableFuture onDisconnect) { this.bootstrapInterface = bootstrapInterface; + this.connection = connection; + this.onDisconnect = onDisconnect; + this.messageLoop = this.doMessageLoop(); + + if (this.connection instanceof TwoPartyVatNetwork) { + this.name = ((TwoPartyVatNetwork)this.connection).getSide().toString(); + } + else { + this.name = this.toString(); + } + } + + public CompletableFuture getMessageLoop() { + return this.messageLoop; + } + + CompletableFuture disconnect(Throwable exc) { + if (isDisconnected()) { + return CompletableFuture.failedFuture(this.disconnected); + } + + var networkExc = RpcException.disconnected(exc.getMessage()); + + // All current questions complete with exceptions. + for (var question: questions) { + question.reject(networkExc); + } + + List pipelinesToRelease = new ArrayList<>(); + List clientsToRelease = new ArrayList<>(); + List> tailCallsToRelease = new ArrayList<>(); + List> resolveOpsToRelease = new ArrayList<>(); + + for (var answer : answers) { + if (answer.pipeline != null) { + pipelinesToRelease.add(answer.pipeline); + answer.pipeline = null; + } + + if (answer.redirectedResults != null) { + tailCallsToRelease.add(answer.redirectedResults); + answer.redirectedResults = null; + } + + if (answer.callContext != null) { + answer.callContext.requestCancel(); + } + } + + for (var export : exports) { + clientsToRelease.add(export.clientHook); + resolveOpsToRelease.add(export.resolveOp); + export.clientHook = null; + export.resolveOp = null; + export.refcount = 0; + } + + for (var imp : imports) { + if (imp.promise != null) { + imp.promise.completeExceptionally(networkExc); + } + } + + for (var embargo : embargos) { + if (embargo.disembargo != null) { + embargo.disembargo.completeExceptionally(networkExc); + } + } + + try { + var message = this.connection.newOutgoingMessage(1024); + RpcException.fromException(exc, message.getBody().getAs(RpcProtocol.Message.factory).initAbort()); + message.send(); + } + catch (Exception abortFailed) { + // no-op + } + + var onShutdown = this.connection.shutdown().handle((x, ioExc) -> { + if (ioExc == null) { + return CompletableFuture.completedFuture(null); + } + + // TODO IOException? + assert !(ioExc instanceof IOException); + + if (ioExc instanceof RpcException) { + var rpcExc = (RpcException)exc; + if (rpcExc.getType() == RpcException.Type.DISCONNECTED) { + return CompletableFuture.completedFuture(null); + } + } + return CompletableFuture.failedFuture(ioExc); + }); + + this.disconnected = networkExc; + return onShutdown.thenCompose(x -> CompletableFuture.failedFuture(networkExc)); } final boolean isDisconnected() { @@ -171,83 +388,52 @@ final boolean isConnected() { } // Run func() before the next IO event. - private CompletableFuture evalLast(Callable func) { - return this.messageReady.thenCompose(x -> { + private void evalLast(Callable func) { + this.messageReady = this.messageReady.thenCompose(x -> { try { - return CompletableFuture.completedFuture(func.call()); + func.call(); } catch (java.lang.Exception exc) { return CompletableFuture.failedFuture(exc); } + return CompletableFuture.completedFuture(null); }); } ClientHook restore() { var question = questions.next(); - question.isAwaitingReturn = true; - question.paramExports = List.of(); + question.setAwaitingReturn(true); var message = connection.newOutgoingMessage(64); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initBootstrap(); - builder.setQuestionId(question.id); + builder.setQuestionId(question.getId()); message.send(); var pipeline = new RpcPipeline(question); return pipeline.getPipelinedCap(new PipelineOp[0]); } - // run message loop once - final CompletableFuture runOnce() { + private final CompletableFuture doMessageLoop() { this.cleanupImports(); + this.cleanupQuestions(); if (isDisconnected()) { - return CompletableFuture.failedFuture(disconnected); - } - - if (!messageReady.isDone()) { - return messageReady; - } - - messageReady = connection.receiveIncomingMessage().thenAccept(message -> { - try { - handleMessage(message); - } - catch (Exception exc) { - this.disconnected = exc; - } - }).exceptionally(exc -> { - this.disconnected = exc; - return null; - }); - - return messageReady; - } - - // run message loop until promise is completed - public final CompletableFuture messageLoop(CompletableFuture done) { - this.cleanupImports(); - - if (done.isDone()) { - return done; - } - - if (isDisconnected()) { - done.completeExceptionally(disconnected); - return done; + return CompletableFuture.failedFuture(this.disconnected); } return connection.receiveIncomingMessage().thenCompose(message -> { try { handleMessage(message); + } catch (Throwable rpcExc) { + // either we received an Abort message from peer + // or internal RpcState is bad. + return this.disconnect(rpcExc); } - catch (Exception exc) { - done.completeExceptionally(exc); - } - return messageLoop(done); - }); + return this.doMessageLoop(); + + }).exceptionallyCompose(exc -> this.disconnect(exc)); } synchronized void handleMessage(IncomingRpcMessage message) throws RpcException { var reader = message.getBody().getAs(RpcProtocol.Message.factory); - System.out.println(reader.which()); switch (reader.which()) { case UNIMPLEMENTED: handleUnimplemented(reader.getUnimplemented()); @@ -437,7 +623,6 @@ private ClientHook.VoidPromiseAndPipeline startCall(long interfaceId, short meth } void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callReturn) { - var exportsToRelease = new ArrayList(); var question = questions.find(callReturn.getAnswerId()); if (question == null) { @@ -445,29 +630,35 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu return; } - if (!question.isAwaitingReturn) { + if (!question.isAwaitingReturn()) { assert false: "Duplicate Return"; return; } + question.setAwaitingReturn(false); - question.isAwaitingReturn = false; + var exportsToRelease = new int[0]; if (callReturn.getReleaseParamCaps()) { - exportsToRelease.addAll(question.paramExports); - question.paramExports = List.of(); + exportsToRelease = question.paramExports; + question.paramExports = new int[0]; } if (callReturn.isTakeFromOtherQuestion()) { - assert false: "Not implemented"; - // TODO process isTakeFromOtherQuestion... + var answer = this.answers.find(callReturn.getTakeFromOtherQuestion()); + if (answer != null) { + answer.redirectedResults = null; + } + //this.questions.erase(callReturn.getAnswerId()); + this.releaseExports(exportsToRelease); return; } switch (callReturn.which()) { case RESULTS: if (question.isTailCall) { - // TODO resultsSentElsewhere - return; + assert false: "Tail call `Return` must set `resultsSentElsewhere`, not `results`."; + break; } + var payload = callReturn.getResults(); var capTable = receiveCaps(payload.getCapTable(), message.getAttachedFds()); // TODO question, message unused in RpcResponseImpl @@ -478,7 +669,7 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu case EXCEPTION: if (question.isTailCall) { assert false: "Tail call `Return` must set `resultsSentElsewhere`, not `exception`."; - return; + break; } question.reject(RpcException.toException(callReturn.getException())); break; @@ -490,7 +681,7 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu case RESULTS_SENT_ELSEWHERE: if (!question.isTailCall) { assert false: "`Return` had `resultsSentElsewhere` but this was not a tail call."; - return; + break; } // Tail calls are fulfilled with a null pointer. question.answer(() -> null); @@ -501,11 +692,11 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu var answer = answers.find(other); if (answer == null) { assert false: "`Return.takeFromOtherQuestion` had invalid answer ID."; - return; + break; } if (answer.redirectedResults == null) { assert false: "`Return.takeFromOtherQuestion` referenced a call that did not use `sendResultsTo.yourself`."; - return; + break; } question.response = answer.redirectedResults.toCompletableFuture(); answer.redirectedResults = null; @@ -513,24 +704,24 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu default: assert false : "Unknown 'Return' type."; - return; + break; } + + this.releaseExports(exportsToRelease); } void handleFinish(RpcProtocol.Finish.Reader finish) { - List exportsToRelease = null; var answer = answers.find(finish.getQuestionId()); if (answer == null || !answer.active) { assert false: "'Finish' for invalid question ID."; return; } - if (finish.getReleaseResultCaps()) { - exportsToRelease = answer.resultExports; - } - answer.resultExports = null; + var exportsToRelease = finish.getReleaseResultCaps() + ? answer.resultExports + : null; - var pipelineToRelease = answer.pipeline; + answer.resultExports = null; answer.pipeline = null; // If the call isn't actually done yet, cancel it. Otherwise, we can go ahead and erase the @@ -540,13 +731,15 @@ void handleFinish(RpcProtocol.Finish.Reader finish) { ctx.requestCancel(); } else { - answers.erase(finish.getQuestionId()); + var questionId = finish.getQuestionId(); + answers.erase(questionId); } + + this.releaseExports(exportsToRelease); } void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { - - var imp = imports.find(resolve.getPromiseId()); + var imp = this.imports.find(resolve.getPromiseId()); if (imp == null) { return; } @@ -559,10 +752,12 @@ void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolv switch (resolve.which()) { case CAP: - imp.promise.complete(receiveCap(resolve.getCap(), message.getAttachedFds())); + var cap = receiveCap(resolve.getCap(), message.getAttachedFds()); + imp.promise.complete(cap); break; case EXCEPTION: - imp.promise.completeExceptionally(RpcException.toException(resolve.getException())); + var exc = RpcException.toException(resolve.getException()); + imp.promise.completeExceptionally(exc); break; default: assert false; @@ -571,7 +766,7 @@ void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolv } private void handleRelease(RpcProtocol.Release.Reader release) { - releaseExport(release.getId(), release.getReferenceCount()); + this.releaseExport(release.getId(), release.getReferenceCount()); } void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { @@ -640,9 +835,9 @@ void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { } } - private List writeDescriptors(ClientHook[] capTable, RpcProtocol.Payload.Builder payload, List fds) { + private int[] writeDescriptors(ClientHook[] capTable, RpcProtocol.Payload.Builder payload, List fds) { if (capTable.length == 0) { - return List.of(); + return new int[0]; } var capTableBuilder = payload.initCapTable(capTable.length); @@ -655,14 +850,15 @@ private List writeDescriptors(ClientHook[] capTable, RpcProtocol.Payloa } var exportId = writeDescriptor(cap, capTableBuilder.get(ii), fds); - if (exportId != null) { - exports.add(exportId); - } + exports.add(exportId); } - return exports; + + return exports.stream() + .mapToInt(Integer::intValue) + .toArray(); } - private Integer writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builder descriptor, List fds) { + private int writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builder descriptor, List fds) { ClientHook inner = cap; for (;;) { var resolved = inner.getResolved(); @@ -709,7 +905,6 @@ private Integer writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builde } CompletionStage resolveExportedPromise(int exportId, CompletionStage promise) { - return promise.thenCompose(resolution -> { if (isDisconnected()) { return CompletableFuture.completedFuture(null); @@ -764,6 +959,12 @@ CompletionStage resolveExportedPromise(int exportId, CompletionStage send() { + int[] send() { var capTable = this.capTable.getTable(); var fds = List.of(); var exports = writeDescriptors(capTable, payload, fds); @@ -1014,18 +1216,20 @@ List send() { } } - private static final class LocallyRedirectedRpcResponse implements RpcServerResponse, RpcResponse { + private static final class LocallyRedirectedRpcResponse + implements RpcServerResponse, + RpcResponse { private final MessageBuilder message = new MessageBuilder(); @Override public AnyPointer.Builder getResultsBuilder() { - return message.getRoot(AnyPointer.factory); + return this.message.getRoot(AnyPointer.factory); } @Override public AnyPointer.Reader getResults() { - return getResultsBuilder().asReader(); + return this.getResultsBuilder().asReader(); } } @@ -1044,6 +1248,7 @@ private final class RpcCallContext implements CallContextHook { private RpcProtocol.Return.Builder returnMessage; private boolean redirectResults = false; private boolean responseSent = false; + private CompletableFuture tailCallPipelineFuture; private boolean cancelRequested = false; private boolean cancelAllowed = false; @@ -1074,14 +1279,17 @@ public void releaseParams() { } @Override - public AnyPointer.Builder getResults() { + public AnyPointer.Builder getResults(int sizeHint) { if (this.response == null) { if (this.redirectResults || isDisconnected()) { this.response = new LocallyRedirectedRpcResponse(); } else { - var message = connection.newOutgoingMessage(1024); + sizeHint += messageSizeHint() + + RpcProtocol.Payload.factory.structSize().total() + + RpcProtocol.Return.factory.structSize().total(); + var message = connection.newOutgoingMessage(sizeHint); this.returnMessage = message.getBody().initAs(RpcProtocol.Message.factory).initReturn(); this.response = new RpcServerResponseImpl(message, returnMessage.getResults()); } @@ -1091,8 +1299,12 @@ public AnyPointer.Builder getResults() { } @Override - public CompletableFuture tailCall(RequestHook request) { - return null; + public CompletableFuture tailCall(RequestHook request) { + var result = this.directTailCall(request); + if (this.tailCallPipelineFuture != null) { + this.tailCallPipelineFuture.complete(result.pipeline); + } + return result.promise.toCompletableFuture().copy(); } @Override @@ -1134,7 +1346,7 @@ private void sendReturn() { this.returnMessage.setAnswerId(this.answerId); this.returnMessage.setReleaseParamCaps(false); - List exports = List.of(); + var exports = new int[0]; try { exports = ((RpcServerResponseImpl) response).send(); } catch (Throwable exc) { @@ -1143,7 +1355,7 @@ private void sendReturn() { } // If no caps in the results, the pipeline is irrelevant. - boolean shouldFreePipeline = exports.isEmpty(); + boolean shouldFreePipeline = exports.length == 0; cleanupAnswerTable(exports, shouldFreePipeline); } @@ -1163,7 +1375,7 @@ private void sendErrorReturn(Throwable exc) { message.send(); } - cleanupAnswerTable(List.of(), false); + cleanupAnswerTable(new int[0], false); } private boolean isFirstResponder() { @@ -1174,9 +1386,9 @@ private boolean isFirstResponder() { return true; } - private void cleanupAnswerTable(List resultExports, boolean shouldFreePipeline) { + private void cleanupAnswerTable(int[] resultExports, boolean shouldFreePipeline) { if (this.cancelRequested) { - assert resultExports.size() == 0; + assert resultExports.length == 0; answers.erase(this.answerId); return; } @@ -1186,7 +1398,7 @@ private void cleanupAnswerTable(List resultExports, boolean shouldFreeP answer.resultExports = resultExports; if (shouldFreePipeline) { - assert resultExports.size() == 0; + assert resultExports.length == 0; answer.pipeline = null; } } @@ -1320,15 +1532,22 @@ private Request newCallNoIntercept(long class RpcRequest implements RequestHook { - final RpcClient target; - final OutgoingRpcMessage message; - final BuilderCapabilityTable capTable = new BuilderCapabilityTable(); - final RpcProtocol.Call.Builder callBuilder; - final AnyPointer.Builder paramsBuilder; + private final RpcClient target; + private final OutgoingRpcMessage message; + private final BuilderCapabilityTable capTable = new BuilderCapabilityTable(); + private final RpcProtocol.Call.Builder callBuilder; + private final AnyPointer.Builder paramsBuilder; RpcRequest(RpcClient target) { + this(target, 0); + } + + RpcRequest(RpcClient target, int sizeHint) { this.target = target; - this.message = connection.newOutgoingMessage(1024); + sizeHint += RpcProtocol.Call.factory.structSize().total() + + RpcProtocol.Payload.factory.structSize().total() + + MESSAGE_TARGET_SIZE_HINT; + this.message = connection.newOutgoingMessage(sizeHint); this.callBuilder = message.getBody().getAs(RpcProtocol.Message.factory).initCall(); this.paramsBuilder = callBuilder.getParams().getContent().imbue(this.capTable); } @@ -1355,15 +1574,20 @@ public RemotePromise send() { return replacement.hook.send(); } - var question = sendInternal(false); + final var question = sendInternal(false); // The pipeline must get notified of resolution before the app does to maintain ordering. var pipeline = new RpcPipeline(question, question.response); - var appPromise = question.response.thenApply(hook -> { - return new Response<>(hook.getResults(), hook); - }); - return new RemotePromise<>(appPromise, pipeline); + var appPromise = question.response.thenApply( + hook -> new Response<>(hook.getResults(), hook)); + + // complete when either the message loop completes (exceptionally) or + // the appPromise is fulfilled + var loop = CompletableFuture.anyOf( + getMessageLoop(), appPromise).thenCompose(x -> appPromise); + + return new RemotePromise<>(loop, pipeline); } @Override @@ -1378,19 +1602,19 @@ Question sendInternal(boolean isTailCall) { var exports = writeDescriptors(capTable.getTable(), callBuilder.getParams(), fds); message.setFds(fds); var question = questions.next(); - question.isAwaitingReturn = true; + question.setAwaitingReturn(true); question.isTailCall = isTailCall; question.paramExports = exports; - callBuilder.setQuestionId(question.id); + callBuilder.setQuestionId(question.getId()); if (isTailCall) { callBuilder.getSendResultsTo().getYourself(); } try { message.send(); } catch (Exception exc) { - question.isAwaitingReturn = false; - question.skipFinish = true; + question.setAwaitingReturn(false); + question.setSkipFinish(true); question.reject(exc); } return question; @@ -1483,6 +1707,16 @@ private void cleanupImports() { } } + private void cleanupQuestions() { + while (true) { + var ref = (QuestionRef)this.questionRefQueue.poll(); + if (ref == null) { + break; + } + ref.dispose(); + } + } + enum ResolutionType { UNRESOLVED, REMOTE, @@ -1491,16 +1725,17 @@ enum ResolutionType { BROKEN } - class PromiseClient extends RpcClient { - final ClientHook cap; - final Integer importId; - final CompletableFuture promise; - boolean receivedCall = false; - ResolutionType resolutionType = ResolutionType.UNRESOLVED; + private class PromiseClient extends RpcClient { + + private final ClientHook cap; + private final Integer importId; + private final CompletableFuture promise; + private boolean receivedCall = false; + private ResolutionType resolutionType = ResolutionType.UNRESOLVED; - public PromiseClient(RpcClient initial, - CompletableFuture eventual, - Integer importId) { + PromiseClient(RpcClient initial, + CompletableFuture eventual, + Integer importId) { this.cap = initial; this.importId = importId; this.promise = eventual.thenApply(resolution -> resolve(resolution)); @@ -1538,8 +1773,8 @@ private ClientHook resolve(ClientHook replacement) { } } else { - if (replacementBrand == NULL_CAPABILITY_BRAND || - replacementBrand == BROKEN_CAPABILITY_BRAND) { + if (replacementBrand == NULL_CAPABILITY_BRAND + || replacementBrand == BROKEN_CAPABILITY_BRAND) { resolutionType = ResolutionType.BROKEN; } else { @@ -1554,25 +1789,19 @@ private ClientHook resolve(ClientHook replacement) { if (resolutionType == ResolutionType.REFLECTED && receivedCall && !isDisconnected()) { var message = connection.newOutgoingMessage(1024); var disembargo = message.getBody().initAs(RpcProtocol.Message.factory).initDisembargo(); - { - var redirect = RpcState.this.writeTarget(cap, disembargo.initTarget()); - assert redirect == null; - } + var redirect = RpcState.this.writeTarget(cap, disembargo.initTarget()); + assert redirect == null; var embargo = embargos.next(); - disembargo.getContext().setSenderLoopback(embargo.id); - embargo.disembargo = new CompletableFuture<>(); + disembargo.getContext().setSenderLoopback(embargo.id); final ClientHook finalReplacement = replacement; - var embargoPromise = embargo.disembargo.thenApply(x -> { - return finalReplacement; - }); - + var embargoPromise = embargo.disembargo.thenApply(x -> finalReplacement); replacement = Capability.newLocalPromiseClient(embargoPromise); message.send(); - } + return replacement; } @@ -1587,19 +1816,19 @@ ClientHook writeTarget(ClientHook cap, RpcProtocol.MessageTarget.Builder target) @Override public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder target, List fds) { - receivedCall = true; + this.receivedCall = true; return RpcState.this.writeDescriptor(cap, target, fds); } @Override public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { - receivedCall = true; + this.receivedCall = true; return RpcState.this.writeTarget(cap, target); } @Override public ClientHook getInnermostClient() { - receivedCall = true; + this.receivedCall = true; return RpcState.this.getInnermostClient(cap); } @@ -1609,7 +1838,7 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } } - class PipelineClient extends RpcClient { + private class PipelineClient extends RpcClient { private final Question question; private final PipelineOp[] ops; @@ -1632,7 +1861,7 @@ public CompletionStage whenMoreResolved() { @Override public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { var promisedAnswer = descriptor.initReceiverAnswer(); - promisedAnswer.setQuestionId(question.id); + promisedAnswer.setQuestionId(question.getId()); PipelineOp.FromPipelineOps(ops, promisedAnswer); return null; } @@ -1640,7 +1869,7 @@ public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, Lis @Override public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { var builder = target.initPromisedAnswer(); - builder.setQuestionId(question.id); + builder.setQuestionId(question.getId()); PipelineOp.FromPipelineOps(ops, builder); return null; } diff --git a/runtime/src/main/java/org/capnproto/RpcSystem.java b/runtime/src/main/java/org/capnproto/RpcSystem.java index 69624d93..a47bdea5 100644 --- a/runtime/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime/src/main/java/org/capnproto/RpcSystem.java @@ -9,11 +9,22 @@ public abstract class RpcSystem { final VatNetwork network; final Capability.Client bootstrapInterface; final Map connections = new HashMap<>(); - CompletableFuture acceptCompleted = CompletableFuture.completedFuture(null); + final CompletableFuture messageLoop; + final CompletableFuture acceptLoop; public RpcSystem(VatNetwork network, Capability.Client bootstrapInterface) { this.network = network; this.bootstrapInterface = bootstrapInterface; + this.acceptLoop = doAcceptLoop(); + this.messageLoop = doMessageLoop(); + } + + public CompletableFuture getMessageLoop() { + return this.messageLoop; + } + + private CompletableFuture getAcceptLoop() { + return this.acceptLoop; } public void accept(VatNetwork.Connection connection) { @@ -21,24 +32,27 @@ public void accept(VatNetwork.Connection connection) { } synchronized RpcState getConnectionState(VatNetwork.Connection connection) { + + var onDisconnect = new CompletableFuture().thenAccept(lostConnection -> { + this.connections.remove(lostConnection); + }); + return connections.computeIfAbsent(connection, key -> - new RpcState(key, bootstrapInterface)); + new RpcState(bootstrapInterface, connection, onDisconnect)); } - public final CompletableFuture runOnce() { - var done = acceptLoop(); - for (var conn : connections.values()) { - done = CompletableFuture.anyOf(done, conn.runOnce()); - } - return done; + private final CompletableFuture doAcceptLoop() { + return this.network.baseAccept().thenCompose(connection -> { + this.accept(connection); + return this.doAcceptLoop(); + }); } - - CompletableFuture acceptLoop() { - if (this.acceptCompleted.isDone()) { - var accepted = this.network.baseAccept(); - this.acceptCompleted = accepted.thenAccept(this::accept); + private final CompletableFuture doMessageLoop() { + var accept = this.getAcceptLoop(); + for (var conn : connections.values()) { + accept = accept.acceptEither(conn.getMessageLoop(), x -> {}); } - return this.acceptCompleted; + return accept.thenCompose(x -> this.doMessageLoop()); } } diff --git a/runtime/src/main/java/org/capnproto/Schema.java b/runtime/src/main/java/org/capnproto/Schema.java new file mode 100644 index 00000000..bca5e0cd --- /dev/null +++ b/runtime/src/main/java/org/capnproto/Schema.java @@ -0,0 +1,7916 @@ +// Generated by Cap'n Proto compiler, DO NOT EDIT +// source: schema.capnp + +package org.capnproto; + +public final class Schema { + public static class Node { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Node.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(6)) { + case 0 : return Which.FILE; + case 1 : return Which.STRUCT; + case 2 : return Which.ENUM; + case 3 : return Which.INTERFACE; + case 4 : return Which.CONST; + case 5 : return Which.ANNOTATION; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getId() { + return _getLongField(0); + } + public final void setId(long value) { + _setLongField(0, value); + } + + public final boolean hasDisplayName() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getDisplayName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setDisplayName(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setDisplayName(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initDisplayName(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + public final int getDisplayNamePrefixLength() { + return _getIntField(2); + } + public final void setDisplayNamePrefixLength(int value) { + _setIntField(2, value); + } + + public final long getScopeId() { + return _getLongField(2); + } + public final void setScopeId(long value) { + _setLongField(2, value); + } + + public final boolean hasNestedNodes() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Builder getNestedNodes() { + return _getPointerField(org.capnproto.Schema.Node.NestedNode.listFactory, 1, null, 0); + } + public final void setNestedNodes(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Node.NestedNode.listFactory, 1, value); + } + public final org.capnproto.StructList.Builder initNestedNodes(int size) { + return _initPointerField(org.capnproto.Schema.Node.NestedNode.listFactory, 1, size); + } + public final boolean hasAnnotations() { + return !_pointerFieldIsNull(2); + } + public final org.capnproto.StructList.Builder getAnnotations() { + return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 2, null, 0); + } + public final void setAnnotations(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Annotation.listFactory, 2, value); + } + public final org.capnproto.StructList.Builder initAnnotations(int size) { + return _initPointerField(org.capnproto.Schema.Annotation.listFactory, 2, size); + } + public final boolean isFile() { + return which() == Node.Which.FILE; + } + public final org.capnproto.Void getFile() { + assert which() == Node.Which.FILE: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setFile(org.capnproto.Void value) { + _setShortField(6, (short)Node.Which.FILE.ordinal()); + } + + public final boolean isStruct() { + return which() == Node.Which.STRUCT; + } + public final Struct.Builder getStruct() { + return new Node.Struct.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Struct.Builder initStruct() { + _setShortField(6, (short)Node.Which.STRUCT.ordinal()); + _setShortField(7,(short)0); + _setShortField(12,(short)0); + _setShortField(13,(short)0); + _setBooleanField(224,false); + _setShortField(15,(short)0); + _setIntField(8,0); + _clearPointerField(3); + return new Node.Struct.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean isEnum() { + return which() == Node.Which.ENUM; + } + public final Enum.Builder getEnum() { + return new Node.Enum.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Enum.Builder initEnum() { + _setShortField(6, (short)Node.Which.ENUM.ordinal()); + _clearPointerField(3); + return new Node.Enum.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean isInterface() { + return which() == Node.Which.INTERFACE; + } + public final Interface.Builder getInterface() { + return new Node.Interface.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Interface.Builder initInterface() { + _setShortField(6, (short)Node.Which.INTERFACE.ordinal()); + _clearPointerField(3); + _clearPointerField(4); + return new Node.Interface.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean isConst() { + return which() == Node.Which.CONST; + } + public final Const.Builder getConst() { + return new Node.Const.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Const.Builder initConst() { + _setShortField(6, (short)Node.Which.CONST.ordinal()); + _clearPointerField(3); + _clearPointerField(4); + return new Node.Const.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean isAnnotation() { + return which() == Node.Which.ANNOTATION; + } + public final Annotation.Builder getAnnotation() { + return new Node.Annotation.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Annotation.Builder initAnnotation() { + _setShortField(6, (short)Node.Which.ANNOTATION.ordinal()); + _setBooleanField(112,false); + _setBooleanField(113,false); + _setBooleanField(114,false); + _setBooleanField(115,false); + _setBooleanField(116,false); + _setBooleanField(117,false); + _setBooleanField(118,false); + _setBooleanField(119,false); + _setBooleanField(120,false); + _setBooleanField(121,false); + _setBooleanField(122,false); + _setBooleanField(123,false); + _clearPointerField(3); + return new Node.Annotation.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean hasParameters() { + return !_pointerFieldIsNull(5); + } + public final org.capnproto.StructList.Builder getParameters() { + return _getPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 5, null, 0); + } + public final void setParameters(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 5, value); + } + public final org.capnproto.StructList.Builder initParameters(int size) { + return _initPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 5, size); + } + public final boolean getIsGeneric() { + return _getBooleanField(288); + } + public final void setIsGeneric(boolean value) { + _setBooleanField(288, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(6)) { + case 0 : return Which.FILE; + case 1 : return Which.STRUCT; + case 2 : return Which.ENUM; + case 3 : return Which.INTERFACE; + case 4 : return Which.CONST; + case 5 : return Which.ANNOTATION; + default: return Which._NOT_IN_SCHEMA; + } + } + public final long getId() { + return _getLongField(0); + } + + public boolean hasDisplayName() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getDisplayName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + public final int getDisplayNamePrefixLength() { + return _getIntField(2); + } + + public final long getScopeId() { + return _getLongField(2); + } + + public final boolean hasNestedNodes() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Reader getNestedNodes() { + return _getPointerField(org.capnproto.Schema.Node.NestedNode.listFactory, 1, null, 0); + } + + public final boolean hasAnnotations() { + return !_pointerFieldIsNull(2); + } + public final org.capnproto.StructList.Reader getAnnotations() { + return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 2, null, 0); + } + + public final boolean isFile() { + return which() == Node.Which.FILE; + } + public final org.capnproto.Void getFile() { + assert which() == Node.Which.FILE: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isStruct() { + return which() == Node.Which.STRUCT; + } + public Struct.Reader getStruct() { + return new Node.Struct.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean isEnum() { + return which() == Node.Which.ENUM; + } + public Enum.Reader getEnum() { + return new Node.Enum.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean isInterface() { + return which() == Node.Which.INTERFACE; + } + public Interface.Reader getInterface() { + return new Node.Interface.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean isConst() { + return which() == Node.Which.CONST; + } + public Const.Reader getConst() { + return new Node.Const.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean isAnnotation() { + return which() == Node.Which.ANNOTATION; + } + public Annotation.Reader getAnnotation() { + return new Node.Annotation.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean hasParameters() { + return !_pointerFieldIsNull(5); + } + public final org.capnproto.StructList.Reader getParameters() { + return _getPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 5, null, 0); + } + + public final boolean getIsGeneric() { + return _getBooleanField(288); + } + + } + + public enum Which { + FILE, + STRUCT, + ENUM, + INTERFACE, + CONST, + ANNOTATION, + _NOT_IN_SCHEMA, + } + public static class Parameter { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Node.Parameter.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasName() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setName(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setName(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initName(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasName() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class NestedNode { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Node.NestedNode.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasName() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setName(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setName(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initName(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + public final long getId() { + return _getLongField(0); + } + public final void setId(long value) { + _setLongField(0, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasName() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + public final long getId() { + return _getLongField(0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class SourceInfo { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Node.SourceInfo.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getId() { + return _getLongField(0); + } + public final void setId(long value) { + _setLongField(0, value); + } + + public final boolean hasDocComment() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getDocComment() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setDocComment(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setDocComment(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initDocComment(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + public final boolean hasMembers() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Builder getMembers() { + return _getPointerField(org.capnproto.Schema.Node.SourceInfo.Member.listFactory, 1, null, 0); + } + public final void setMembers(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Node.SourceInfo.Member.listFactory, 1, value); + } + public final org.capnproto.StructList.Builder initMembers(int size) { + return _initPointerField(org.capnproto.Schema.Node.SourceInfo.Member.listFactory, 1, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final long getId() { + return _getLongField(0); + } + + public boolean hasDocComment() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getDocComment() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + public final boolean hasMembers() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Reader getMembers() { + return _getPointerField(org.capnproto.Schema.Node.SourceInfo.Member.listFactory, 1, null, 0); + } + + } + + public static class Member { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Node.SourceInfo.Member.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasDocComment() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getDocComment() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setDocComment(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setDocComment(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initDocComment(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasDocComment() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getDocComment() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Struct { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Node.Struct.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final short getDataWordCount() { + return _getShortField(7); + } + public final void setDataWordCount(short value) { + _setShortField(7, value); + } + + public final short getPointerCount() { + return _getShortField(12); + } + public final void setPointerCount(short value) { + _setShortField(12, value); + } + + public final org.capnproto.Schema.ElementSize getPreferredListEncoding() { + switch(_getShortField(13)) { + case 0 : return org.capnproto.Schema.ElementSize.EMPTY; + case 1 : return org.capnproto.Schema.ElementSize.BIT; + case 2 : return org.capnproto.Schema.ElementSize.BYTE; + case 3 : return org.capnproto.Schema.ElementSize.TWO_BYTES; + case 4 : return org.capnproto.Schema.ElementSize.FOUR_BYTES; + case 5 : return org.capnproto.Schema.ElementSize.EIGHT_BYTES; + case 6 : return org.capnproto.Schema.ElementSize.POINTER; + case 7 : return org.capnproto.Schema.ElementSize.INLINE_COMPOSITE; + default: return org.capnproto.Schema.ElementSize._NOT_IN_SCHEMA; + } + } + public final void setPreferredListEncoding(org.capnproto.Schema.ElementSize value) { + _setShortField(13, (short)value.ordinal()); + } + + public final boolean getIsGroup() { + return _getBooleanField(224); + } + public final void setIsGroup(boolean value) { + _setBooleanField(224, value); + } + + public final short getDiscriminantCount() { + return _getShortField(15); + } + public final void setDiscriminantCount(short value) { + _setShortField(15, value); + } + + public final int getDiscriminantOffset() { + return _getIntField(8); + } + public final void setDiscriminantOffset(int value) { + _setIntField(8, value); + } + + public final boolean hasFields() { + return !_pointerFieldIsNull(3); + } + public final org.capnproto.StructList.Builder getFields() { + return _getPointerField(org.capnproto.Schema.Field.listFactory, 3, null, 0); + } + public final void setFields(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Field.listFactory, 3, value); + } + public final org.capnproto.StructList.Builder initFields(int size) { + return _initPointerField(org.capnproto.Schema.Field.listFactory, 3, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final short getDataWordCount() { + return _getShortField(7); + } + + public final short getPointerCount() { + return _getShortField(12); + } + + public final org.capnproto.Schema.ElementSize getPreferredListEncoding() { + switch(_getShortField(13)) { + case 0 : return org.capnproto.Schema.ElementSize.EMPTY; + case 1 : return org.capnproto.Schema.ElementSize.BIT; + case 2 : return org.capnproto.Schema.ElementSize.BYTE; + case 3 : return org.capnproto.Schema.ElementSize.TWO_BYTES; + case 4 : return org.capnproto.Schema.ElementSize.FOUR_BYTES; + case 5 : return org.capnproto.Schema.ElementSize.EIGHT_BYTES; + case 6 : return org.capnproto.Schema.ElementSize.POINTER; + case 7 : return org.capnproto.Schema.ElementSize.INLINE_COMPOSITE; + default: return org.capnproto.Schema.ElementSize._NOT_IN_SCHEMA; + } + } + + public final boolean getIsGroup() { + return _getBooleanField(224); + } + + public final short getDiscriminantCount() { + return _getShortField(15); + } + + public final int getDiscriminantOffset() { + return _getIntField(8); + } + + public final boolean hasFields() { + return !_pointerFieldIsNull(3); + } + public final org.capnproto.StructList.Reader getFields() { + return _getPointerField(org.capnproto.Schema.Field.listFactory, 3, null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Enum { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Node.Enum.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasEnumerants() { + return !_pointerFieldIsNull(3); + } + public final org.capnproto.StructList.Builder getEnumerants() { + return _getPointerField(org.capnproto.Schema.Enumerant.listFactory, 3, null, 0); + } + public final void setEnumerants(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Enumerant.listFactory, 3, value); + } + public final org.capnproto.StructList.Builder initEnumerants(int size) { + return _initPointerField(org.capnproto.Schema.Enumerant.listFactory, 3, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean hasEnumerants() { + return !_pointerFieldIsNull(3); + } + public final org.capnproto.StructList.Reader getEnumerants() { + return _getPointerField(org.capnproto.Schema.Enumerant.listFactory, 3, null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Interface { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Node.Interface.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasMethods() { + return !_pointerFieldIsNull(3); + } + public final org.capnproto.StructList.Builder getMethods() { + return _getPointerField(org.capnproto.Schema.Method.listFactory, 3, null, 0); + } + public final void setMethods(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Method.listFactory, 3, value); + } + public final org.capnproto.StructList.Builder initMethods(int size) { + return _initPointerField(org.capnproto.Schema.Method.listFactory, 3, size); + } + public final boolean hasSuperclasses() { + return !_pointerFieldIsNull(4); + } + public final org.capnproto.StructList.Builder getSuperclasses() { + return _getPointerField(org.capnproto.Schema.Superclass.listFactory, 4, null, 0); + } + public final void setSuperclasses(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Superclass.listFactory, 4, value); + } + public final org.capnproto.StructList.Builder initSuperclasses(int size) { + return _initPointerField(org.capnproto.Schema.Superclass.listFactory, 4, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean hasMethods() { + return !_pointerFieldIsNull(3); + } + public final org.capnproto.StructList.Reader getMethods() { + return _getPointerField(org.capnproto.Schema.Method.listFactory, 3, null, 0); + } + + public final boolean hasSuperclasses() { + return !_pointerFieldIsNull(4); + } + public final org.capnproto.StructList.Reader getSuperclasses() { + return _getPointerField(org.capnproto.Schema.Superclass.listFactory, 4, null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Const { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Node.Const.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final org.capnproto.Schema.Type.Builder getType() { + return _getPointerField(org.capnproto.Schema.Type.factory, 3, null, 0); + } + public final void setType(org.capnproto.Schema.Type.Reader value) { + _setPointerField(org.capnproto.Schema.Type.factory,3, value); + } + public final org.capnproto.Schema.Type.Builder initType() { + return _initPointerField(org.capnproto.Schema.Type.factory,3, 0); + } + public final org.capnproto.Schema.Value.Builder getValue() { + return _getPointerField(org.capnproto.Schema.Value.factory, 4, null, 0); + } + public final void setValue(org.capnproto.Schema.Value.Reader value) { + _setPointerField(org.capnproto.Schema.Value.factory,4, value); + } + public final org.capnproto.Schema.Value.Builder initValue() { + return _initPointerField(org.capnproto.Schema.Value.factory,4, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasType() { + return !_pointerFieldIsNull(3); + } + public org.capnproto.Schema.Type.Reader getType() { + return _getPointerField(org.capnproto.Schema.Type.factory,3,null, 0); + } + + public boolean hasValue() { + return !_pointerFieldIsNull(4); + } + public org.capnproto.Schema.Value.Reader getValue() { + return _getPointerField(org.capnproto.Schema.Value.factory,4,null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Annotation { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Node.Annotation.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final org.capnproto.Schema.Type.Builder getType() { + return _getPointerField(org.capnproto.Schema.Type.factory, 3, null, 0); + } + public final void setType(org.capnproto.Schema.Type.Reader value) { + _setPointerField(org.capnproto.Schema.Type.factory,3, value); + } + public final org.capnproto.Schema.Type.Builder initType() { + return _initPointerField(org.capnproto.Schema.Type.factory,3, 0); + } + public final boolean getTargetsFile() { + return _getBooleanField(112); + } + public final void setTargetsFile(boolean value) { + _setBooleanField(112, value); + } + + public final boolean getTargetsConst() { + return _getBooleanField(113); + } + public final void setTargetsConst(boolean value) { + _setBooleanField(113, value); + } + + public final boolean getTargetsEnum() { + return _getBooleanField(114); + } + public final void setTargetsEnum(boolean value) { + _setBooleanField(114, value); + } + + public final boolean getTargetsEnumerant() { + return _getBooleanField(115); + } + public final void setTargetsEnumerant(boolean value) { + _setBooleanField(115, value); + } + + public final boolean getTargetsStruct() { + return _getBooleanField(116); + } + public final void setTargetsStruct(boolean value) { + _setBooleanField(116, value); + } + + public final boolean getTargetsField() { + return _getBooleanField(117); + } + public final void setTargetsField(boolean value) { + _setBooleanField(117, value); + } + + public final boolean getTargetsUnion() { + return _getBooleanField(118); + } + public final void setTargetsUnion(boolean value) { + _setBooleanField(118, value); + } + + public final boolean getTargetsGroup() { + return _getBooleanField(119); + } + public final void setTargetsGroup(boolean value) { + _setBooleanField(119, value); + } + + public final boolean getTargetsInterface() { + return _getBooleanField(120); + } + public final void setTargetsInterface(boolean value) { + _setBooleanField(120, value); + } + + public final boolean getTargetsMethod() { + return _getBooleanField(121); + } + public final void setTargetsMethod(boolean value) { + _setBooleanField(121, value); + } + + public final boolean getTargetsParam() { + return _getBooleanField(122); + } + public final void setTargetsParam(boolean value) { + _setBooleanField(122, value); + } + + public final boolean getTargetsAnnotation() { + return _getBooleanField(123); + } + public final void setTargetsAnnotation(boolean value) { + _setBooleanField(123, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasType() { + return !_pointerFieldIsNull(3); + } + public org.capnproto.Schema.Type.Reader getType() { + return _getPointerField(org.capnproto.Schema.Type.factory,3,null, 0); + } + + public final boolean getTargetsFile() { + return _getBooleanField(112); + } + + public final boolean getTargetsConst() { + return _getBooleanField(113); + } + + public final boolean getTargetsEnum() { + return _getBooleanField(114); + } + + public final boolean getTargetsEnumerant() { + return _getBooleanField(115); + } + + public final boolean getTargetsStruct() { + return _getBooleanField(116); + } + + public final boolean getTargetsField() { + return _getBooleanField(117); + } + + public final boolean getTargetsUnion() { + return _getBooleanField(118); + } + + public final boolean getTargetsGroup() { + return _getBooleanField(119); + } + + public final boolean getTargetsInterface() { + return _getBooleanField(120); + } + + public final boolean getTargetsMethod() { + return _getBooleanField(121); + } + + public final boolean getTargetsParam() { + return _getBooleanField(122); + } + + public final boolean getTargetsAnnotation() { + return _getBooleanField(123); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Field { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)4); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Field.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(4)) { + case 0 : return Which.SLOT; + case 1 : return Which.GROUP; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasName() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setName(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setName(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initName(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + public final short getCodeOrder() { + return _getShortField(0); + } + public final void setCodeOrder(short value) { + _setShortField(0, value); + } + + public final boolean hasAnnotations() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Builder getAnnotations() { + return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); + } + public final void setAnnotations(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Annotation.listFactory, 1, value); + } + public final org.capnproto.StructList.Builder initAnnotations(int size) { + return _initPointerField(org.capnproto.Schema.Annotation.listFactory, 1, size); + } + public final short getDiscriminantValue() { + return _getShortField(1, (short)-1); + } + public final void setDiscriminantValue(short value) { + _setShortField(1, value, (short)-1); + } + + public final boolean isSlot() { + return which() == Field.Which.SLOT; + } + public final Slot.Builder getSlot() { + return new Field.Slot.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Slot.Builder initSlot() { + _setShortField(4, (short)Field.Which.SLOT.ordinal()); + _setIntField(1,0); + _setBooleanField(128,false); + _clearPointerField(2); + _clearPointerField(3); + return new Field.Slot.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean isGroup() { + return which() == Field.Which.GROUP; + } + public final Group.Builder getGroup() { + return new Field.Group.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Group.Builder initGroup() { + _setShortField(4, (short)Field.Which.GROUP.ordinal()); + _setLongField(2,0L); + return new Field.Group.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final Ordinal.Builder getOrdinal() { + return new Field.Ordinal.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Ordinal.Builder initOrdinal() { + _setShortField(5,(short)0); + _setShortField(6,(short)0); + return new Field.Ordinal.Builder(segment, data, pointers, dataSize, pointerCount); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(4)) { + case 0 : return Which.SLOT; + case 1 : return Which.GROUP; + default: return Which._NOT_IN_SCHEMA; + } + } + public boolean hasName() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + public final short getCodeOrder() { + return _getShortField(0); + } + + public final boolean hasAnnotations() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Reader getAnnotations() { + return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); + } + + public final short getDiscriminantValue() { + return _getShortField(1, (short)-1); + } + + public final boolean isSlot() { + return which() == Field.Which.SLOT; + } + public Slot.Reader getSlot() { + return new Field.Slot.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean isGroup() { + return which() == Field.Which.GROUP; + } + public Group.Reader getGroup() { + return new Field.Group.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Ordinal.Reader getOrdinal() { + return new Field.Ordinal.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + } + + public enum Which { + SLOT, + GROUP, + _NOT_IN_SCHEMA, + } + public static final short NO_DISCRIMINANT = -1; + public static class Slot { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)4); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Field.Slot.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final int getOffset() { + return _getIntField(1); + } + public final void setOffset(int value) { + _setIntField(1, value); + } + + public final org.capnproto.Schema.Type.Builder getType() { + return _getPointerField(org.capnproto.Schema.Type.factory, 2, null, 0); + } + public final void setType(org.capnproto.Schema.Type.Reader value) { + _setPointerField(org.capnproto.Schema.Type.factory,2, value); + } + public final org.capnproto.Schema.Type.Builder initType() { + return _initPointerField(org.capnproto.Schema.Type.factory,2, 0); + } + public final org.capnproto.Schema.Value.Builder getDefaultValue() { + return _getPointerField(org.capnproto.Schema.Value.factory, 3, null, 0); + } + public final void setDefaultValue(org.capnproto.Schema.Value.Reader value) { + _setPointerField(org.capnproto.Schema.Value.factory,3, value); + } + public final org.capnproto.Schema.Value.Builder initDefaultValue() { + return _initPointerField(org.capnproto.Schema.Value.factory,3, 0); + } + public final boolean getHadExplicitDefault() { + return _getBooleanField(128); + } + public final void setHadExplicitDefault(boolean value) { + _setBooleanField(128, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final int getOffset() { + return _getIntField(1); + } + + public boolean hasType() { + return !_pointerFieldIsNull(2); + } + public org.capnproto.Schema.Type.Reader getType() { + return _getPointerField(org.capnproto.Schema.Type.factory,2,null, 0); + } + + public boolean hasDefaultValue() { + return !_pointerFieldIsNull(3); + } + public org.capnproto.Schema.Value.Reader getDefaultValue() { + return _getPointerField(org.capnproto.Schema.Value.factory,3,null, 0); + } + + public final boolean getHadExplicitDefault() { + return _getBooleanField(128); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Group { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)4); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Field.Group.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getTypeId() { + return _getLongField(2); + } + public final void setTypeId(long value) { + _setLongField(2, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final long getTypeId() { + return _getLongField(2); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Ordinal { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)4); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Field.Ordinal.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(5)) { + case 0 : return Which.IMPLICIT; + case 1 : return Which.EXPLICIT; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isImplicit() { + return which() == Field.Ordinal.Which.IMPLICIT; + } + public final org.capnproto.Void getImplicit() { + assert which() == Field.Ordinal.Which.IMPLICIT: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setImplicit(org.capnproto.Void value) { + _setShortField(5, (short)Field.Ordinal.Which.IMPLICIT.ordinal()); + } + + public final boolean isExplicit() { + return which() == Field.Ordinal.Which.EXPLICIT; + } + public final short getExplicit() { + assert which() == Field.Ordinal.Which.EXPLICIT: + "Must check which() before get()ing a union member."; + return _getShortField(6); + } + public final void setExplicit(short value) { + _setShortField(5, (short)Field.Ordinal.Which.EXPLICIT.ordinal()); + _setShortField(6, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(5)) { + case 0 : return Which.IMPLICIT; + case 1 : return Which.EXPLICIT; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isImplicit() { + return which() == Field.Ordinal.Which.IMPLICIT; + } + public final org.capnproto.Void getImplicit() { + assert which() == Field.Ordinal.Which.IMPLICIT: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isExplicit() { + return which() == Field.Ordinal.Which.EXPLICIT; + } + public final short getExplicit() { + assert which() == Field.Ordinal.Which.EXPLICIT: + "Must check which() before get()ing a union member."; + return _getShortField(6); + } + + } + + public enum Which { + IMPLICIT, + EXPLICIT, + _NOT_IN_SCHEMA, + } + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Enumerant { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Enumerant.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasName() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setName(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setName(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initName(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + public final short getCodeOrder() { + return _getShortField(0); + } + public final void setCodeOrder(short value) { + _setShortField(0, value); + } + + public final boolean hasAnnotations() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Builder getAnnotations() { + return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); + } + public final void setAnnotations(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Annotation.listFactory, 1, value); + } + public final org.capnproto.StructList.Builder initAnnotations(int size) { + return _initPointerField(org.capnproto.Schema.Annotation.listFactory, 1, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasName() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + public final short getCodeOrder() { + return _getShortField(0); + } + + public final boolean hasAnnotations() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Reader getAnnotations() { + return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Superclass { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Superclass.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getId() { + return _getLongField(0); + } + public final void setId(long value) { + _setLongField(0, value); + } + + public final org.capnproto.Schema.Brand.Builder getBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory, 0, null, 0); + } + public final void setBrand(org.capnproto.Schema.Brand.Reader value) { + _setPointerField(org.capnproto.Schema.Brand.factory,0, value); + } + public final org.capnproto.Schema.Brand.Builder initBrand() { + return _initPointerField(org.capnproto.Schema.Brand.factory,0, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final long getId() { + return _getLongField(0); + } + + public boolean hasBrand() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Schema.Brand.Reader getBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory,0,null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Method { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)5); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Method.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasName() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setName(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setName(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initName(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + public final short getCodeOrder() { + return _getShortField(0); + } + public final void setCodeOrder(short value) { + _setShortField(0, value); + } + + public final long getParamStructType() { + return _getLongField(1); + } + public final void setParamStructType(long value) { + _setLongField(1, value); + } + + public final long getResultStructType() { + return _getLongField(2); + } + public final void setResultStructType(long value) { + _setLongField(2, value); + } + + public final boolean hasAnnotations() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Builder getAnnotations() { + return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); + } + public final void setAnnotations(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Annotation.listFactory, 1, value); + } + public final org.capnproto.StructList.Builder initAnnotations(int size) { + return _initPointerField(org.capnproto.Schema.Annotation.listFactory, 1, size); + } + public final org.capnproto.Schema.Brand.Builder getParamBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory, 2, null, 0); + } + public final void setParamBrand(org.capnproto.Schema.Brand.Reader value) { + _setPointerField(org.capnproto.Schema.Brand.factory,2, value); + } + public final org.capnproto.Schema.Brand.Builder initParamBrand() { + return _initPointerField(org.capnproto.Schema.Brand.factory,2, 0); + } + public final org.capnproto.Schema.Brand.Builder getResultBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory, 3, null, 0); + } + public final void setResultBrand(org.capnproto.Schema.Brand.Reader value) { + _setPointerField(org.capnproto.Schema.Brand.factory,3, value); + } + public final org.capnproto.Schema.Brand.Builder initResultBrand() { + return _initPointerField(org.capnproto.Schema.Brand.factory,3, 0); + } + public final boolean hasImplicitParameters() { + return !_pointerFieldIsNull(4); + } + public final org.capnproto.StructList.Builder getImplicitParameters() { + return _getPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 4, null, 0); + } + public final void setImplicitParameters(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 4, value); + } + public final org.capnproto.StructList.Builder initImplicitParameters(int size) { + return _initPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 4, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasName() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + public final short getCodeOrder() { + return _getShortField(0); + } + + public final long getParamStructType() { + return _getLongField(1); + } + + public final long getResultStructType() { + return _getLongField(2); + } + + public final boolean hasAnnotations() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Reader getAnnotations() { + return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); + } + + public boolean hasParamBrand() { + return !_pointerFieldIsNull(2); + } + public org.capnproto.Schema.Brand.Reader getParamBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory,2,null, 0); + } + + public boolean hasResultBrand() { + return !_pointerFieldIsNull(3); + } + public org.capnproto.Schema.Brand.Reader getResultBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory,3,null, 0); + } + + public final boolean hasImplicitParameters() { + return !_pointerFieldIsNull(4); + } + public final org.capnproto.StructList.Reader getImplicitParameters() { + return _getPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 4, null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Type { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Type.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.VOID; + case 1 : return Which.BOOL; + case 2 : return Which.INT8; + case 3 : return Which.INT16; + case 4 : return Which.INT32; + case 5 : return Which.INT64; + case 6 : return Which.UINT8; + case 7 : return Which.UINT16; + case 8 : return Which.UINT32; + case 9 : return Which.UINT64; + case 10 : return Which.FLOAT32; + case 11 : return Which.FLOAT64; + case 12 : return Which.TEXT; + case 13 : return Which.DATA; + case 14 : return Which.LIST; + case 15 : return Which.ENUM; + case 16 : return Which.STRUCT; + case 17 : return Which.INTERFACE; + case 18 : return Which.ANY_POINTER; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isVoid() { + return which() == Type.Which.VOID; + } + public final org.capnproto.Void getVoid() { + assert which() == Type.Which.VOID: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setVoid(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.VOID.ordinal()); + } + + public final boolean isBool() { + return which() == Type.Which.BOOL; + } + public final org.capnproto.Void getBool() { + assert which() == Type.Which.BOOL: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setBool(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.BOOL.ordinal()); + } + + public final boolean isInt8() { + return which() == Type.Which.INT8; + } + public final org.capnproto.Void getInt8() { + assert which() == Type.Which.INT8: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setInt8(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.INT8.ordinal()); + } + + public final boolean isInt16() { + return which() == Type.Which.INT16; + } + public final org.capnproto.Void getInt16() { + assert which() == Type.Which.INT16: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setInt16(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.INT16.ordinal()); + } + + public final boolean isInt32() { + return which() == Type.Which.INT32; + } + public final org.capnproto.Void getInt32() { + assert which() == Type.Which.INT32: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setInt32(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.INT32.ordinal()); + } + + public final boolean isInt64() { + return which() == Type.Which.INT64; + } + public final org.capnproto.Void getInt64() { + assert which() == Type.Which.INT64: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setInt64(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.INT64.ordinal()); + } + + public final boolean isUint8() { + return which() == Type.Which.UINT8; + } + public final org.capnproto.Void getUint8() { + assert which() == Type.Which.UINT8: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setUint8(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.UINT8.ordinal()); + } + + public final boolean isUint16() { + return which() == Type.Which.UINT16; + } + public final org.capnproto.Void getUint16() { + assert which() == Type.Which.UINT16: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setUint16(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.UINT16.ordinal()); + } + + public final boolean isUint32() { + return which() == Type.Which.UINT32; + } + public final org.capnproto.Void getUint32() { + assert which() == Type.Which.UINT32: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setUint32(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.UINT32.ordinal()); + } + + public final boolean isUint64() { + return which() == Type.Which.UINT64; + } + public final org.capnproto.Void getUint64() { + assert which() == Type.Which.UINT64: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setUint64(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.UINT64.ordinal()); + } + + public final boolean isFloat32() { + return which() == Type.Which.FLOAT32; + } + public final org.capnproto.Void getFloat32() { + assert which() == Type.Which.FLOAT32: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setFloat32(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.FLOAT32.ordinal()); + } + + public final boolean isFloat64() { + return which() == Type.Which.FLOAT64; + } + public final org.capnproto.Void getFloat64() { + assert which() == Type.Which.FLOAT64: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setFloat64(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.FLOAT64.ordinal()); + } + + public final boolean isText() { + return which() == Type.Which.TEXT; + } + public final org.capnproto.Void getText() { + assert which() == Type.Which.TEXT: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setText(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.TEXT.ordinal()); + } + + public final boolean isData() { + return which() == Type.Which.DATA; + } + public final org.capnproto.Void getData() { + assert which() == Type.Which.DATA: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setData(org.capnproto.Void value) { + _setShortField(0, (short)Type.Which.DATA.ordinal()); + } + + public final boolean isList() { + return which() == Type.Which.LIST; + } + public final List.Builder getList() { + return new Type.List.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final List.Builder initList() { + _setShortField(0, (short)Type.Which.LIST.ordinal()); + _clearPointerField(0); + return new Type.List.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean isEnum() { + return which() == Type.Which.ENUM; + } + public final Enum.Builder getEnum() { + return new Type.Enum.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Enum.Builder initEnum() { + _setShortField(0, (short)Type.Which.ENUM.ordinal()); + _setLongField(1,0L); + _clearPointerField(0); + return new Type.Enum.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean isStruct() { + return which() == Type.Which.STRUCT; + } + public final Struct.Builder getStruct() { + return new Type.Struct.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Struct.Builder initStruct() { + _setShortField(0, (short)Type.Which.STRUCT.ordinal()); + _setLongField(1,0L); + _clearPointerField(0); + return new Type.Struct.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean isInterface() { + return which() == Type.Which.INTERFACE; + } + public final Interface.Builder getInterface() { + return new Type.Interface.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Interface.Builder initInterface() { + _setShortField(0, (short)Type.Which.INTERFACE.ordinal()); + _setLongField(1,0L); + _clearPointerField(0); + return new Type.Interface.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean isAnyPointer() { + return which() == Type.Which.ANY_POINTER; + } + public final AnyPointer.Builder getAnyPointer() { + return new Type.AnyPointer.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final AnyPointer.Builder initAnyPointer() { + _setShortField(0, (short)Type.Which.ANY_POINTER.ordinal()); + _setShortField(4,(short)0); + _setShortField(5,(short)0); + _setLongField(2,0L); + return new Type.AnyPointer.Builder(segment, data, pointers, dataSize, pointerCount); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.VOID; + case 1 : return Which.BOOL; + case 2 : return Which.INT8; + case 3 : return Which.INT16; + case 4 : return Which.INT32; + case 5 : return Which.INT64; + case 6 : return Which.UINT8; + case 7 : return Which.UINT16; + case 8 : return Which.UINT32; + case 9 : return Which.UINT64; + case 10 : return Which.FLOAT32; + case 11 : return Which.FLOAT64; + case 12 : return Which.TEXT; + case 13 : return Which.DATA; + case 14 : return Which.LIST; + case 15 : return Which.ENUM; + case 16 : return Which.STRUCT; + case 17 : return Which.INTERFACE; + case 18 : return Which.ANY_POINTER; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isVoid() { + return which() == Type.Which.VOID; + } + public final org.capnproto.Void getVoid() { + assert which() == Type.Which.VOID: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isBool() { + return which() == Type.Which.BOOL; + } + public final org.capnproto.Void getBool() { + assert which() == Type.Which.BOOL: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isInt8() { + return which() == Type.Which.INT8; + } + public final org.capnproto.Void getInt8() { + assert which() == Type.Which.INT8: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isInt16() { + return which() == Type.Which.INT16; + } + public final org.capnproto.Void getInt16() { + assert which() == Type.Which.INT16: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isInt32() { + return which() == Type.Which.INT32; + } + public final org.capnproto.Void getInt32() { + assert which() == Type.Which.INT32: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isInt64() { + return which() == Type.Which.INT64; + } + public final org.capnproto.Void getInt64() { + assert which() == Type.Which.INT64: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isUint8() { + return which() == Type.Which.UINT8; + } + public final org.capnproto.Void getUint8() { + assert which() == Type.Which.UINT8: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isUint16() { + return which() == Type.Which.UINT16; + } + public final org.capnproto.Void getUint16() { + assert which() == Type.Which.UINT16: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isUint32() { + return which() == Type.Which.UINT32; + } + public final org.capnproto.Void getUint32() { + assert which() == Type.Which.UINT32: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isUint64() { + return which() == Type.Which.UINT64; + } + public final org.capnproto.Void getUint64() { + assert which() == Type.Which.UINT64: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isFloat32() { + return which() == Type.Which.FLOAT32; + } + public final org.capnproto.Void getFloat32() { + assert which() == Type.Which.FLOAT32: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isFloat64() { + return which() == Type.Which.FLOAT64; + } + public final org.capnproto.Void getFloat64() { + assert which() == Type.Which.FLOAT64: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isText() { + return which() == Type.Which.TEXT; + } + public final org.capnproto.Void getText() { + assert which() == Type.Which.TEXT: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isData() { + return which() == Type.Which.DATA; + } + public final org.capnproto.Void getData() { + assert which() == Type.Which.DATA: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isList() { + return which() == Type.Which.LIST; + } + public List.Reader getList() { + return new Type.List.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean isEnum() { + return which() == Type.Which.ENUM; + } + public Enum.Reader getEnum() { + return new Type.Enum.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean isStruct() { + return which() == Type.Which.STRUCT; + } + public Struct.Reader getStruct() { + return new Type.Struct.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean isInterface() { + return which() == Type.Which.INTERFACE; + } + public Interface.Reader getInterface() { + return new Type.Interface.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean isAnyPointer() { + return which() == Type.Which.ANY_POINTER; + } + public AnyPointer.Reader getAnyPointer() { + return new Type.AnyPointer.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + } + + public enum Which { + VOID, + BOOL, + INT8, + INT16, + INT32, + INT64, + UINT8, + UINT16, + UINT32, + UINT64, + FLOAT32, + FLOAT64, + TEXT, + DATA, + LIST, + ENUM, + STRUCT, + INTERFACE, + ANY_POINTER, + _NOT_IN_SCHEMA, + } + public static class List { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Type.List.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final org.capnproto.Schema.Type.Builder getElementType() { + return _getPointerField(org.capnproto.Schema.Type.factory, 0, null, 0); + } + public final void setElementType(org.capnproto.Schema.Type.Reader value) { + _setPointerField(org.capnproto.Schema.Type.factory,0, value); + } + public final org.capnproto.Schema.Type.Builder initElementType() { + return _initPointerField(org.capnproto.Schema.Type.factory,0, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public boolean hasElementType() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Schema.Type.Reader getElementType() { + return _getPointerField(org.capnproto.Schema.Type.factory,0,null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Enum { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Type.Enum.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getTypeId() { + return _getLongField(1); + } + public final void setTypeId(long value) { + _setLongField(1, value); + } + + public final org.capnproto.Schema.Brand.Builder getBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory, 0, null, 0); + } + public final void setBrand(org.capnproto.Schema.Brand.Reader value) { + _setPointerField(org.capnproto.Schema.Brand.factory,0, value); + } + public final org.capnproto.Schema.Brand.Builder initBrand() { + return _initPointerField(org.capnproto.Schema.Brand.factory,0, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final long getTypeId() { + return _getLongField(1); + } + + public boolean hasBrand() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Schema.Brand.Reader getBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory,0,null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Struct { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Type.Struct.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getTypeId() { + return _getLongField(1); + } + public final void setTypeId(long value) { + _setLongField(1, value); + } + + public final org.capnproto.Schema.Brand.Builder getBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory, 0, null, 0); + } + public final void setBrand(org.capnproto.Schema.Brand.Reader value) { + _setPointerField(org.capnproto.Schema.Brand.factory,0, value); + } + public final org.capnproto.Schema.Brand.Builder initBrand() { + return _initPointerField(org.capnproto.Schema.Brand.factory,0, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final long getTypeId() { + return _getLongField(1); + } + + public boolean hasBrand() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Schema.Brand.Reader getBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory,0,null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Interface { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Type.Interface.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getTypeId() { + return _getLongField(1); + } + public final void setTypeId(long value) { + _setLongField(1, value); + } + + public final org.capnproto.Schema.Brand.Builder getBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory, 0, null, 0); + } + public final void setBrand(org.capnproto.Schema.Brand.Reader value) { + _setPointerField(org.capnproto.Schema.Brand.factory,0, value); + } + public final org.capnproto.Schema.Brand.Builder initBrand() { + return _initPointerField(org.capnproto.Schema.Brand.factory,0, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final long getTypeId() { + return _getLongField(1); + } + + public boolean hasBrand() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Schema.Brand.Reader getBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory,0,null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class AnyPointer { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Type.AnyPointer.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(4)) { + case 0 : return Which.UNCONSTRAINED; + case 1 : return Which.PARAMETER; + case 2 : return Which.IMPLICIT_METHOD_PARAMETER; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isUnconstrained() { + return which() == Type.AnyPointer.Which.UNCONSTRAINED; + } + public final Unconstrained.Builder getUnconstrained() { + return new Type.AnyPointer.Unconstrained.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Unconstrained.Builder initUnconstrained() { + _setShortField(4, (short)Type.AnyPointer.Which.UNCONSTRAINED.ordinal()); + _setShortField(5,(short)0); + return new Type.AnyPointer.Unconstrained.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean isParameter() { + return which() == Type.AnyPointer.Which.PARAMETER; + } + public final Parameter.Builder getParameter() { + return new Type.AnyPointer.Parameter.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final Parameter.Builder initParameter() { + _setShortField(4, (short)Type.AnyPointer.Which.PARAMETER.ordinal()); + _setShortField(5,(short)0); + _setLongField(2,0L); + return new Type.AnyPointer.Parameter.Builder(segment, data, pointers, dataSize, pointerCount); + } + + public final boolean isImplicitMethodParameter() { + return which() == Type.AnyPointer.Which.IMPLICIT_METHOD_PARAMETER; + } + public final ImplicitMethodParameter.Builder getImplicitMethodParameter() { + return new Type.AnyPointer.ImplicitMethodParameter.Builder(segment, data, pointers, dataSize, pointerCount); + } + public final ImplicitMethodParameter.Builder initImplicitMethodParameter() { + _setShortField(4, (short)Type.AnyPointer.Which.IMPLICIT_METHOD_PARAMETER.ordinal()); + _setShortField(5,(short)0); + return new Type.AnyPointer.ImplicitMethodParameter.Builder(segment, data, pointers, dataSize, pointerCount); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(4)) { + case 0 : return Which.UNCONSTRAINED; + case 1 : return Which.PARAMETER; + case 2 : return Which.IMPLICIT_METHOD_PARAMETER; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isUnconstrained() { + return which() == Type.AnyPointer.Which.UNCONSTRAINED; + } + public Unconstrained.Reader getUnconstrained() { + return new Type.AnyPointer.Unconstrained.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean isParameter() { + return which() == Type.AnyPointer.Which.PARAMETER; + } + public Parameter.Reader getParameter() { + return new Type.AnyPointer.Parameter.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean isImplicitMethodParameter() { + return which() == Type.AnyPointer.Which.IMPLICIT_METHOD_PARAMETER; + } + public ImplicitMethodParameter.Reader getImplicitMethodParameter() { + return new Type.AnyPointer.ImplicitMethodParameter.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + } + + public enum Which { + UNCONSTRAINED, + PARAMETER, + IMPLICIT_METHOD_PARAMETER, + _NOT_IN_SCHEMA, + } + public static class Unconstrained { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Type.AnyPointer.Unconstrained.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(5)) { + case 0 : return Which.ANY_KIND; + case 1 : return Which.STRUCT; + case 2 : return Which.LIST; + case 3 : return Which.CAPABILITY; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isAnyKind() { + return which() == Type.AnyPointer.Unconstrained.Which.ANY_KIND; + } + public final org.capnproto.Void getAnyKind() { + assert which() == Type.AnyPointer.Unconstrained.Which.ANY_KIND: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setAnyKind(org.capnproto.Void value) { + _setShortField(5, (short)Type.AnyPointer.Unconstrained.Which.ANY_KIND.ordinal()); + } + + public final boolean isStruct() { + return which() == Type.AnyPointer.Unconstrained.Which.STRUCT; + } + public final org.capnproto.Void getStruct() { + assert which() == Type.AnyPointer.Unconstrained.Which.STRUCT: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setStruct(org.capnproto.Void value) { + _setShortField(5, (short)Type.AnyPointer.Unconstrained.Which.STRUCT.ordinal()); + } + + public final boolean isList() { + return which() == Type.AnyPointer.Unconstrained.Which.LIST; + } + public final org.capnproto.Void getList() { + assert which() == Type.AnyPointer.Unconstrained.Which.LIST: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setList(org.capnproto.Void value) { + _setShortField(5, (short)Type.AnyPointer.Unconstrained.Which.LIST.ordinal()); + } + + public final boolean isCapability() { + return which() == Type.AnyPointer.Unconstrained.Which.CAPABILITY; + } + public final org.capnproto.Void getCapability() { + assert which() == Type.AnyPointer.Unconstrained.Which.CAPABILITY: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setCapability(org.capnproto.Void value) { + _setShortField(5, (short)Type.AnyPointer.Unconstrained.Which.CAPABILITY.ordinal()); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(5)) { + case 0 : return Which.ANY_KIND; + case 1 : return Which.STRUCT; + case 2 : return Which.LIST; + case 3 : return Which.CAPABILITY; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isAnyKind() { + return which() == Type.AnyPointer.Unconstrained.Which.ANY_KIND; + } + public final org.capnproto.Void getAnyKind() { + assert which() == Type.AnyPointer.Unconstrained.Which.ANY_KIND: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isStruct() { + return which() == Type.AnyPointer.Unconstrained.Which.STRUCT; + } + public final org.capnproto.Void getStruct() { + assert which() == Type.AnyPointer.Unconstrained.Which.STRUCT: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isList() { + return which() == Type.AnyPointer.Unconstrained.Which.LIST; + } + public final org.capnproto.Void getList() { + assert which() == Type.AnyPointer.Unconstrained.Which.LIST: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isCapability() { + return which() == Type.AnyPointer.Unconstrained.Which.CAPABILITY; + } + public final org.capnproto.Void getCapability() { + assert which() == Type.AnyPointer.Unconstrained.Which.CAPABILITY: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + } + + public enum Which { + ANY_KIND, + STRUCT, + LIST, + CAPABILITY, + _NOT_IN_SCHEMA, + } + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Parameter { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Type.AnyPointer.Parameter.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getScopeId() { + return _getLongField(2); + } + public final void setScopeId(long value) { + _setLongField(2, value); + } + + public final short getParameterIndex() { + return _getShortField(5); + } + public final void setParameterIndex(short value) { + _setShortField(5, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final long getScopeId() { + return _getLongField(2); + } + + public final short getParameterIndex() { + return _getShortField(5); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class ImplicitMethodParameter { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Type.AnyPointer.ImplicitMethodParameter.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final short getParameterIndex() { + return _getShortField(5); + } + public final void setParameterIndex(short value) { + _setShortField(5, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final short getParameterIndex() { + return _getShortField(5); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Brand { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Brand.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasScopes() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.StructList.Builder getScopes() { + return _getPointerField(org.capnproto.Schema.Brand.Scope.listFactory, 0, null, 0); + } + public final void setScopes(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Brand.Scope.listFactory, 0, value); + } + public final org.capnproto.StructList.Builder initScopes(int size) { + return _initPointerField(org.capnproto.Schema.Brand.Scope.listFactory, 0, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean hasScopes() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.StructList.Reader getScopes() { + return _getPointerField(org.capnproto.Schema.Brand.Scope.listFactory, 0, null, 0); + } + + } + + public static class Scope { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)2,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Brand.Scope.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(4)) { + case 0 : return Which.BIND; + case 1 : return Which.INHERIT; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getScopeId() { + return _getLongField(0); + } + public final void setScopeId(long value) { + _setLongField(0, value); + } + + public final boolean isBind() { + return which() == Brand.Scope.Which.BIND; + } + public final boolean hasBind() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.StructList.Builder getBind() { + return _getPointerField(org.capnproto.Schema.Brand.Binding.listFactory, 0, null, 0); + } + public final void setBind(org.capnproto.StructList.Reader value) { + _setShortField(4, (short)Brand.Scope.Which.BIND.ordinal()); + _setPointerField(org.capnproto.Schema.Brand.Binding.listFactory, 0, value); + } + public final org.capnproto.StructList.Builder initBind(int size) { + _setShortField(4, (short)Brand.Scope.Which.BIND.ordinal()); + return _initPointerField(org.capnproto.Schema.Brand.Binding.listFactory, 0, size); + } + public final boolean isInherit() { + return which() == Brand.Scope.Which.INHERIT; + } + public final org.capnproto.Void getInherit() { + assert which() == Brand.Scope.Which.INHERIT: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setInherit(org.capnproto.Void value) { + _setShortField(4, (short)Brand.Scope.Which.INHERIT.ordinal()); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(4)) { + case 0 : return Which.BIND; + case 1 : return Which.INHERIT; + default: return Which._NOT_IN_SCHEMA; + } + } + public final long getScopeId() { + return _getLongField(0); + } + + public final boolean isBind() { + return which() == Brand.Scope.Which.BIND; + } + public final boolean hasBind() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.StructList.Reader getBind() { + return _getPointerField(org.capnproto.Schema.Brand.Binding.listFactory, 0, null, 0); + } + + public final boolean isInherit() { + return which() == Brand.Scope.Which.INHERIT; + } + public final org.capnproto.Void getInherit() { + assert which() == Brand.Scope.Which.INHERIT: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + } + + public enum Which { + BIND, + INHERIT, + _NOT_IN_SCHEMA, + } + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Binding { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Brand.Binding.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.UNBOUND; + case 1 : return Which.TYPE; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isUnbound() { + return which() == Brand.Binding.Which.UNBOUND; + } + public final org.capnproto.Void getUnbound() { + assert which() == Brand.Binding.Which.UNBOUND: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setUnbound(org.capnproto.Void value) { + _setShortField(0, (short)Brand.Binding.Which.UNBOUND.ordinal()); + } + + public final boolean isType() { + return which() == Brand.Binding.Which.TYPE; + } + public final org.capnproto.Schema.Type.Builder getType() { + assert which() == Brand.Binding.Which.TYPE: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.Schema.Type.factory, 0, null, 0); + } + public final void setType(org.capnproto.Schema.Type.Reader value) { + _setShortField(0, (short)Brand.Binding.Which.TYPE.ordinal()); + _setPointerField(org.capnproto.Schema.Type.factory,0, value); + } + public final org.capnproto.Schema.Type.Builder initType() { + _setShortField(0, (short)Brand.Binding.Which.TYPE.ordinal()); + return _initPointerField(org.capnproto.Schema.Type.factory,0, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.UNBOUND; + case 1 : return Which.TYPE; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isUnbound() { + return which() == Brand.Binding.Which.UNBOUND; + } + public final org.capnproto.Void getUnbound() { + assert which() == Brand.Binding.Which.UNBOUND: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isType() { + return which() == Brand.Binding.Which.TYPE; + } + public boolean hasType() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Schema.Type.Reader getType() { + assert which() == Brand.Binding.Which.TYPE: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.Schema.Type.factory,0,null, 0); + } + + } + + public enum Which { + UNBOUND, + TYPE, + _NOT_IN_SCHEMA, + } + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Value { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)2,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Value.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.VOID; + case 1 : return Which.BOOL; + case 2 : return Which.INT8; + case 3 : return Which.INT16; + case 4 : return Which.INT32; + case 5 : return Which.INT64; + case 6 : return Which.UINT8; + case 7 : return Which.UINT16; + case 8 : return Which.UINT32; + case 9 : return Which.UINT64; + case 10 : return Which.FLOAT32; + case 11 : return Which.FLOAT64; + case 12 : return Which.TEXT; + case 13 : return Which.DATA; + case 14 : return Which.LIST; + case 15 : return Which.ENUM; + case 16 : return Which.STRUCT; + case 17 : return Which.INTERFACE; + case 18 : return Which.ANY_POINTER; + default: return Which._NOT_IN_SCHEMA; + } + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean isVoid() { + return which() == Value.Which.VOID; + } + public final org.capnproto.Void getVoid() { + assert which() == Value.Which.VOID: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setVoid(org.capnproto.Void value) { + _setShortField(0, (short)Value.Which.VOID.ordinal()); + } + + public final boolean isBool() { + return which() == Value.Which.BOOL; + } + public final boolean getBool() { + assert which() == Value.Which.BOOL: + "Must check which() before get()ing a union member."; + return _getBooleanField(16); + } + public final void setBool(boolean value) { + _setShortField(0, (short)Value.Which.BOOL.ordinal()); + _setBooleanField(16, value); + } + + public final boolean isInt8() { + return which() == Value.Which.INT8; + } + public final byte getInt8() { + assert which() == Value.Which.INT8: + "Must check which() before get()ing a union member."; + return _getByteField(2); + } + public final void setInt8(byte value) { + _setShortField(0, (short)Value.Which.INT8.ordinal()); + _setByteField(2, value); + } + + public final boolean isInt16() { + return which() == Value.Which.INT16; + } + public final short getInt16() { + assert which() == Value.Which.INT16: + "Must check which() before get()ing a union member."; + return _getShortField(1); + } + public final void setInt16(short value) { + _setShortField(0, (short)Value.Which.INT16.ordinal()); + _setShortField(1, value); + } + + public final boolean isInt32() { + return which() == Value.Which.INT32; + } + public final int getInt32() { + assert which() == Value.Which.INT32: + "Must check which() before get()ing a union member."; + return _getIntField(1); + } + public final void setInt32(int value) { + _setShortField(0, (short)Value.Which.INT32.ordinal()); + _setIntField(1, value); + } + + public final boolean isInt64() { + return which() == Value.Which.INT64; + } + public final long getInt64() { + assert which() == Value.Which.INT64: + "Must check which() before get()ing a union member."; + return _getLongField(1); + } + public final void setInt64(long value) { + _setShortField(0, (short)Value.Which.INT64.ordinal()); + _setLongField(1, value); + } + + public final boolean isUint8() { + return which() == Value.Which.UINT8; + } + public final byte getUint8() { + assert which() == Value.Which.UINT8: + "Must check which() before get()ing a union member."; + return _getByteField(2); + } + public final void setUint8(byte value) { + _setShortField(0, (short)Value.Which.UINT8.ordinal()); + _setByteField(2, value); + } + + public final boolean isUint16() { + return which() == Value.Which.UINT16; + } + public final short getUint16() { + assert which() == Value.Which.UINT16: + "Must check which() before get()ing a union member."; + return _getShortField(1); + } + public final void setUint16(short value) { + _setShortField(0, (short)Value.Which.UINT16.ordinal()); + _setShortField(1, value); + } + + public final boolean isUint32() { + return which() == Value.Which.UINT32; + } + public final int getUint32() { + assert which() == Value.Which.UINT32: + "Must check which() before get()ing a union member."; + return _getIntField(1); + } + public final void setUint32(int value) { + _setShortField(0, (short)Value.Which.UINT32.ordinal()); + _setIntField(1, value); + } + + public final boolean isUint64() { + return which() == Value.Which.UINT64; + } + public final long getUint64() { + assert which() == Value.Which.UINT64: + "Must check which() before get()ing a union member."; + return _getLongField(1); + } + public final void setUint64(long value) { + _setShortField(0, (short)Value.Which.UINT64.ordinal()); + _setLongField(1, value); + } + + public final boolean isFloat32() { + return which() == Value.Which.FLOAT32; + } + public final float getFloat32() { + assert which() == Value.Which.FLOAT32: + "Must check which() before get()ing a union member."; + return _getFloatField(1); + } + public final void setFloat32(float value) { + _setShortField(0, (short)Value.Which.FLOAT32.ordinal()); + _setFloatField(1, value); + } + + public final boolean isFloat64() { + return which() == Value.Which.FLOAT64; + } + public final double getFloat64() { + assert which() == Value.Which.FLOAT64: + "Must check which() before get()ing a union member."; + return _getDoubleField(1); + } + public final void setFloat64(double value) { + _setShortField(0, (short)Value.Which.FLOAT64.ordinal()); + _setDoubleField(1, value); + } + + public final boolean isText() { + return which() == Value.Which.TEXT; + } + public final boolean hasText() { + if (which() != Value.Which.TEXT) return false; + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getText() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setText(org.capnproto.Text.Reader value) { + _setShortField(0, (short)Value.Which.TEXT.ordinal()); + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setText(String value) { + _setShortField(0, (short)Value.Which.TEXT.ordinal()); + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initText(int size) { + _setShortField(0, (short)Value.Which.TEXT.ordinal()); + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + public final boolean isData() { + return which() == Value.Which.DATA; + } + public final boolean hasData() { + if (which() != Value.Which.DATA) return false; + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Data.Builder getData() { + return _getPointerField(org.capnproto.Data.factory, 0, null, 0, 0); + } + public final void setData(org.capnproto.Data.Reader value) { + _setShortField(0, (short)Value.Which.DATA.ordinal()); + _setPointerField(org.capnproto.Data.factory, 0, value); + } + public final void setData(byte [] value) { + _setShortField(0, (short)Value.Which.DATA.ordinal()); + _setPointerField(org.capnproto.Data.factory, 0, new org.capnproto.Data.Reader(value)); + } + public final org.capnproto.Data.Builder initData(int size) { + _setShortField(0, (short)Value.Which.DATA.ordinal()); + return _initPointerField(org.capnproto.Data.factory, 0, size); + } + public final boolean isList() { + return which() == Value.Which.LIST; + } + public final boolean hasList() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getList() { + assert which() == Value.Which.LIST: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initList() { + _setShortField(0, (short)Value.Which.LIST.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initList(int size) { + _setShortField(0, (short)Value.Which.LIST.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + public final boolean isEnum() { + return which() == Value.Which.ENUM; + } + public final short getEnum() { + assert which() == Value.Which.ENUM: + "Must check which() before get()ing a union member."; + return _getShortField(1); + } + public final void setEnum(short value) { + _setShortField(0, (short)Value.Which.ENUM.ordinal()); + _setShortField(1, value); + } + + public final boolean isStruct() { + return which() == Value.Which.STRUCT; + } + public final boolean hasStruct() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getStruct() { + assert which() == Value.Which.STRUCT: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initStruct() { + _setShortField(0, (short)Value.Which.STRUCT.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initStruct(int size) { + _setShortField(0, (short)Value.Which.STRUCT.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + public final boolean isInterface() { + return which() == Value.Which.INTERFACE; + } + public final org.capnproto.Void getInterface() { + assert which() == Value.Which.INTERFACE: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + public final void setInterface(org.capnproto.Void value) { + _setShortField(0, (short)Value.Which.INTERFACE.ordinal()); + } + + public final boolean isAnyPointer() { + return which() == Value.Which.ANY_POINTER; + } + public final boolean hasAnyPointer() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Builder getAnyPointer() { + assert which() == Value.Which.ANY_POINTER: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public org.capnproto.AnyPointer.Builder initAnyPointer() { + _setShortField(0, (short)Value.Which.ANY_POINTER.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); + } + public org.capnproto.AnyPointer.Builder initAnyPointer(int size) { + _setShortField(0, (short)Value.Which.ANY_POINTER.ordinal()); + return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public Which which() { + switch(_getShortField(0)) { + case 0 : return Which.VOID; + case 1 : return Which.BOOL; + case 2 : return Which.INT8; + case 3 : return Which.INT16; + case 4 : return Which.INT32; + case 5 : return Which.INT64; + case 6 : return Which.UINT8; + case 7 : return Which.UINT16; + case 8 : return Which.UINT32; + case 9 : return Which.UINT64; + case 10 : return Which.FLOAT32; + case 11 : return Which.FLOAT64; + case 12 : return Which.TEXT; + case 13 : return Which.DATA; + case 14 : return Which.LIST; + case 15 : return Which.ENUM; + case 16 : return Which.STRUCT; + case 17 : return Which.INTERFACE; + case 18 : return Which.ANY_POINTER; + default: return Which._NOT_IN_SCHEMA; + } + } + public final boolean isVoid() { + return which() == Value.Which.VOID; + } + public final org.capnproto.Void getVoid() { + assert which() == Value.Which.VOID: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isBool() { + return which() == Value.Which.BOOL; + } + public final boolean getBool() { + assert which() == Value.Which.BOOL: + "Must check which() before get()ing a union member."; + return _getBooleanField(16); + } + + public final boolean isInt8() { + return which() == Value.Which.INT8; + } + public final byte getInt8() { + assert which() == Value.Which.INT8: + "Must check which() before get()ing a union member."; + return _getByteField(2); + } + + public final boolean isInt16() { + return which() == Value.Which.INT16; + } + public final short getInt16() { + assert which() == Value.Which.INT16: + "Must check which() before get()ing a union member."; + return _getShortField(1); + } + + public final boolean isInt32() { + return which() == Value.Which.INT32; + } + public final int getInt32() { + assert which() == Value.Which.INT32: + "Must check which() before get()ing a union member."; + return _getIntField(1); + } + + public final boolean isInt64() { + return which() == Value.Which.INT64; + } + public final long getInt64() { + assert which() == Value.Which.INT64: + "Must check which() before get()ing a union member."; + return _getLongField(1); + } + + public final boolean isUint8() { + return which() == Value.Which.UINT8; + } + public final byte getUint8() { + assert which() == Value.Which.UINT8: + "Must check which() before get()ing a union member."; + return _getByteField(2); + } + + public final boolean isUint16() { + return which() == Value.Which.UINT16; + } + public final short getUint16() { + assert which() == Value.Which.UINT16: + "Must check which() before get()ing a union member."; + return _getShortField(1); + } + + public final boolean isUint32() { + return which() == Value.Which.UINT32; + } + public final int getUint32() { + assert which() == Value.Which.UINT32: + "Must check which() before get()ing a union member."; + return _getIntField(1); + } + + public final boolean isUint64() { + return which() == Value.Which.UINT64; + } + public final long getUint64() { + assert which() == Value.Which.UINT64: + "Must check which() before get()ing a union member."; + return _getLongField(1); + } + + public final boolean isFloat32() { + return which() == Value.Which.FLOAT32; + } + public final float getFloat32() { + assert which() == Value.Which.FLOAT32: + "Must check which() before get()ing a union member."; + return _getFloatField(1); + } + + public final boolean isFloat64() { + return which() == Value.Which.FLOAT64; + } + public final double getFloat64() { + assert which() == Value.Which.FLOAT64: + "Must check which() before get()ing a union member."; + return _getDoubleField(1); + } + + public final boolean isText() { + return which() == Value.Which.TEXT; + } + public boolean hasText() { + if (which() != Value.Which.TEXT) return false; + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getText() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + public final boolean isData() { + return which() == Value.Which.DATA; + } + public boolean hasData() { + if (which() != Value.Which.DATA) return false; + return !_pointerFieldIsNull(0); + } + public org.capnproto.Data.Reader getData() { + return _getPointerField(org.capnproto.Data.factory, 0, null, 0, 0); + } + + public final boolean isList() { + return which() == Value.Which.LIST; + } + public boolean hasList() { + if (which() != Value.Which.LIST) return false; + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getList() { + assert which() == Value.Which.LIST: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public final boolean isEnum() { + return which() == Value.Which.ENUM; + } + public final short getEnum() { + assert which() == Value.Which.ENUM: + "Must check which() before get()ing a union member."; + return _getShortField(1); + } + + public final boolean isStruct() { + return which() == Value.Which.STRUCT; + } + public boolean hasStruct() { + if (which() != Value.Which.STRUCT) return false; + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getStruct() { + assert which() == Value.Which.STRUCT: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + public final boolean isInterface() { + return which() == Value.Which.INTERFACE; + } + public final org.capnproto.Void getInterface() { + assert which() == Value.Which.INTERFACE: + "Must check which() before get()ing a union member."; + return org.capnproto.Void.VOID; + } + + public final boolean isAnyPointer() { + return which() == Value.Which.ANY_POINTER; + } + public boolean hasAnyPointer() { + if (which() != Value.Which.ANY_POINTER) return false; + return !_pointerFieldIsNull(0); + } + public org.capnproto.AnyPointer.Reader getAnyPointer() { + assert which() == Value.Which.ANY_POINTER: + "Must check which() before get()ing a union member."; + return _getPointerField(org.capnproto.AnyPointer.factory, 0); + } + } + + public enum Which { + VOID, + BOOL, + INT8, + INT16, + INT32, + INT64, + UINT8, + UINT16, + UINT32, + UINT64, + FLOAT32, + FLOAT64, + TEXT, + DATA, + LIST, + ENUM, + STRUCT, + INTERFACE, + ANY_POINTER, + _NOT_IN_SCHEMA, + } + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Annotation { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return Annotation.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getId() { + return _getLongField(0); + } + public final void setId(long value) { + _setLongField(0, value); + } + + public final org.capnproto.Schema.Value.Builder getValue() { + return _getPointerField(org.capnproto.Schema.Value.factory, 0, null, 0); + } + public final void setValue(org.capnproto.Schema.Value.Reader value) { + _setPointerField(org.capnproto.Schema.Value.factory,0, value); + } + public final org.capnproto.Schema.Value.Builder initValue() { + return _initPointerField(org.capnproto.Schema.Value.factory,0, 0); + } + public final org.capnproto.Schema.Brand.Builder getBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory, 1, null, 0); + } + public final void setBrand(org.capnproto.Schema.Brand.Reader value) { + _setPointerField(org.capnproto.Schema.Brand.factory,1, value); + } + public final org.capnproto.Schema.Brand.Builder initBrand() { + return _initPointerField(org.capnproto.Schema.Brand.factory,1, 0); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final long getId() { + return _getLongField(0); + } + + public boolean hasValue() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Schema.Value.Reader getValue() { + return _getPointerField(org.capnproto.Schema.Value.factory,0,null, 0); + } + + public boolean hasBrand() { + return !_pointerFieldIsNull(1); + } + public org.capnproto.Schema.Brand.Reader getBrand() { + return _getPointerField(org.capnproto.Schema.Brand.factory,1,null, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public enum ElementSize { + EMPTY, + BIT, + BYTE, + TWO_BYTES, + FOUR_BYTES, + EIGHT_BYTES, + POINTER, + INLINE_COMPOSITE, + _NOT_IN_SCHEMA, + } + + public static class CapnpVersion { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return CapnpVersion.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final short getMajor() { + return _getShortField(0); + } + public final void setMajor(short value) { + _setShortField(0, value); + } + + public final byte getMinor() { + return _getByteField(2); + } + public final void setMinor(byte value) { + _setByteField(2, value); + } + + public final byte getMicro() { + return _getByteField(3); + } + public final void setMicro(byte value) { + _setByteField(3, value); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final short getMajor() { + return _getShortField(0); + } + + public final byte getMinor() { + return _getByteField(2); + } + + public final byte getMicro() { + return _getByteField(3); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class CodeGeneratorRequest { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)4); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return CodeGeneratorRequest.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final boolean hasNodes() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.StructList.Builder getNodes() { + return _getPointerField(org.capnproto.Schema.Node.listFactory, 0, null, 0); + } + public final void setNodes(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Node.listFactory, 0, value); + } + public final org.capnproto.StructList.Builder initNodes(int size) { + return _initPointerField(org.capnproto.Schema.Node.listFactory, 0, size); + } + public final boolean hasRequestedFiles() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Builder getRequestedFiles() { + return _getPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.listFactory, 1, null, 0); + } + public final void setRequestedFiles(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.listFactory, 1, value); + } + public final org.capnproto.StructList.Builder initRequestedFiles(int size) { + return _initPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.listFactory, 1, size); + } + public final org.capnproto.Schema.CapnpVersion.Builder getCapnpVersion() { + return _getPointerField(org.capnproto.Schema.CapnpVersion.factory, 2, null, 0); + } + public final void setCapnpVersion(org.capnproto.Schema.CapnpVersion.Reader value) { + _setPointerField(org.capnproto.Schema.CapnpVersion.factory,2, value); + } + public final org.capnproto.Schema.CapnpVersion.Builder initCapnpVersion() { + return _initPointerField(org.capnproto.Schema.CapnpVersion.factory,2, 0); + } + public final boolean hasSourceInfo() { + return !_pointerFieldIsNull(3); + } + public final org.capnproto.StructList.Builder getSourceInfo() { + return _getPointerField(org.capnproto.Schema.Node.SourceInfo.listFactory, 3, null, 0); + } + public final void setSourceInfo(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.Node.SourceInfo.listFactory, 3, value); + } + public final org.capnproto.StructList.Builder initSourceInfo(int size) { + return _initPointerField(org.capnproto.Schema.Node.SourceInfo.listFactory, 3, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final boolean hasNodes() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.StructList.Reader getNodes() { + return _getPointerField(org.capnproto.Schema.Node.listFactory, 0, null, 0); + } + + public final boolean hasRequestedFiles() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Reader getRequestedFiles() { + return _getPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.listFactory, 1, null, 0); + } + + public boolean hasCapnpVersion() { + return !_pointerFieldIsNull(2); + } + public org.capnproto.Schema.CapnpVersion.Reader getCapnpVersion() { + return _getPointerField(org.capnproto.Schema.CapnpVersion.factory,2,null, 0); + } + + public final boolean hasSourceInfo() { + return !_pointerFieldIsNull(3); + } + public final org.capnproto.StructList.Reader getSourceInfo() { + return _getPointerField(org.capnproto.Schema.Node.SourceInfo.listFactory, 3, null, 0); + } + + } + + public static class RequestedFile { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return CodeGeneratorRequest.RequestedFile.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getId() { + return _getLongField(0); + } + public final void setId(long value) { + _setLongField(0, value); + } + + public final boolean hasFilename() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getFilename() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setFilename(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setFilename(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initFilename(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + public final boolean hasImports() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Builder getImports() { + return _getPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.Import.listFactory, 1, null, 0); + } + public final void setImports(org.capnproto.StructList.Reader value) { + _setPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.Import.listFactory, 1, value); + } + public final org.capnproto.StructList.Builder initImports(int size) { + return _initPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.Import.listFactory, 1, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final long getId() { + return _getLongField(0); + } + + public boolean hasFilename() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getFilename() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + public final boolean hasImports() { + return !_pointerFieldIsNull(1); + } + public final org.capnproto.StructList.Reader getImports() { + return _getPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.Import.listFactory, 1, null, 0); + } + + } + + public static class Import { + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); + public static final class Factory + extends org.capnproto.StructFactory + implements org.capnproto.PipelineFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return CodeGeneratorRequest.RequestedFile.Import.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + public Pipeline newPipeline(org.capnproto.RemotePromise promise) { + return new Pipeline(promise); + } + } + public static final Factory factory = new Factory(); + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory(factory); + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + public final long getId() { + return _getLongField(0); + } + public final void setId(long value) { + _setLongField(0, value); + } + + public final boolean hasName() { + return !_pointerFieldIsNull(0); + } + public final org.capnproto.Text.Builder getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + public final void setName(org.capnproto.Text.Reader value) { + _setPointerField(org.capnproto.Text.factory, 0, value); + } + public final void setName(String value) { + _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); + } + public final org.capnproto.Text.Builder initName(int size) { + return _initPointerField(org.capnproto.Text.factory, 0, size); + } + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final long getId() { + return _getLongField(0); + } + + public boolean hasName() { + return !_pointerFieldIsNull(0); + } + public org.capnproto.Text.Reader getName() { + return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); + } + + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + public static class Pipeline extends org.capnproto.Pipeline { + public Pipeline(org.capnproto.RemotePromise remotePromise) { + super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); + } + } + } + + +public static final class Schemas { +public static final org.capnproto.SegmentReader b_e682ab4cf923a417 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + + "\u0031\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0006\u0000\u0007\u0000\u0000\u0000\u0006\u0000" + + "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0037\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0059\u0000\u0000\u0000\u0017\u0003\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004e\u006f\u0064\u0065\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00b1\u00a3\u000f\u00f1\u00cc\u001b\u0052\u00b9" + + "\u0011\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0042\u00c2\u000f\u00fa\u00bb\u0055\u00bf\u00de" + + "\u0011\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u00ae\u0057\u0013\u0004\u00e3\u001d\u008e\u00f3" + + "\u0011\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0050\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + + "\u0072\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004e\u0065\u0073\u0074\u0065\u0064\u004e\u006f" + + "\u0064\u0065\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0053\u006f\u0075\u0072\u0063\u0065\u0049\u006e" + + "\u0066\u006f\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0038\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0079\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0080\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u007d\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u007c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0088\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0085\u0001\u0000\u0000\u00c2\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0088\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0094\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0091\u0001\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u008c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0098\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0095\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0094\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00b0\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0007\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00ad\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00ac\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00c8\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0008\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c5\u0001\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c0\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00cc\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0009\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0035\u0044\u00fb\u0037\u009b\u00b1\u00a0\u009e" + + "\u00c9\u0001\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\n\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0098\u00f5\u0033\u0043\u0036\u00b3\u004a\u00b5" + + "\u00b1\u0001\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000b\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u008f\u0021\u00c2\u00f0\u00cf\u0053\u0027\u00e8" + + "\u0099\u0001\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u00fb\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0020\u0094\r\u007a\u00ac\u00a5\u008a\u00b1" + + "\u0085\u0001\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u00fa\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0090\u0002\n\u0040\u00d4\u0019\u0016\u00ec" + + "\u006d\u0001\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0020\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0059\u0001\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0058\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0074\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u0000\u0000\u0020\u0001\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0021\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0071\u0001\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u007c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0069\u0073\u0070\u006c\u0061\u0079\u004e" + + "\u0061\u006d\u0065\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0069\u0073\u0070\u006c\u0061\u0079\u004e" + + "\u0061\u006d\u0065\u0050\u0072\u0065\u0066\u0069" + + "\u0078\u004c\u0065\u006e\u0067\u0074\u0068\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u0063\u006f\u0070\u0065\u0049\u0064\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006e\u0065\u0073\u0074\u0065\u0064\u004e\u006f" + + "\u0064\u0065\u0073\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0042\u00c2\u000f\u00fa\u00bb\u0055\u00bf\u00de" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u006e\u006e\u006f\u0074\u0061\u0074\u0069" + + "\u006f\u006e\u0073\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0042\u0075\u0025\u00ab\r\u0095\u00c8\u00f1" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0069\u006c\u0065\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u0074\u0072\u0075\u0063\u0074\u0000\u0000" + + "\u0065\u006e\u0075\u006d\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0074\u0065\u0072\u0066\u0061\u0063" + + "\u0065\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u006f\u006e\u0073\u0074\u0000\u0000\u0000" + + "\u0061\u006e\u006e\u006f\u0074\u0061\u0074\u0069" + + "\u006f\u006e\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + + "\u0072\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b1\u00a3\u000f\u00f1\u00cc\u001b\u0052\u00b9" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u0073\u0047\u0065\u006e\u0065\u0072\u0069" + + "\u0063\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_b9521bccf10fa3b1 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00b1\u00a3\u000f\u00f1\u00cc\u001b\u0052\u00b9" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004e\u006f\u0064\u0065\u002e\u0050\u0061" + + "\u0072\u0061\u006d\u0065\u0074\u0065\u0072\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_debf55bbfa0fc242 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0042\u00c2\u000f\u00fa\u00bb\u0055\u00bf\u00de" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004e\u006f\u0064\u0065\u002e\u004e\u0065" + + "\u0073\u0074\u0065\u0064\u004e\u006f\u0064\u0065" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_f38e1de3041357ae = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00ae\u0057\u0013\u0004\u00e3\u001d\u008e\u00f3" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u003d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004e\u006f\u0064\u0065\u002e\u0053\u006f" + + "\u0075\u0072\u0063\u0065\u0049\u006e\u0066\u006f" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00a2\u001f\u008e\u0089\u0038\u0090\u00ba\u00c2" + + "\u0001\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u004d\u0065\u006d\u0062\u0065\u0072\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0068\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u006f\u0063\u0043\u006f\u006d\u006d\u0065" + + "\u006e\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006d\u0065\u006d\u0062\u0065\u0072\u0073\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00a2\u001f\u008e\u0089\u0038\u0090\u00ba\u00c2" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_c2ba9038898e1fa2 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00a2\u001f\u008e\u0089\u0038\u0090\u00ba\u00c2" + + "\u0041\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u00ae\u0057\u0013\u0004\u00e3\u001d\u008e\u00f3" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0042\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004e\u006f\u0064\u0065\u002e\u0053\u006f" + + "\u0075\u0072\u0063\u0065\u0049\u006e\u0066\u006f" + + "\u002e\u004d\u0065\u006d\u0062\u0065\u0072\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0018\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0064\u006f\u0063\u0043\u006f\u006d\u006d\u0065" + + "\u006e\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_9ea0b19b37fb4435 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0035\u0044\u00fb\u0037\u009b\u00b1\u00a0\u009e" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + + "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + + "\u0006\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004e\u006f\u0064\u0065\u002e\u0073\u0074" + + "\u0072\u0075\u0063\u0074\u0000\u0000\u0000\u0000" + + "\u001c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b5\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00c0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u000c\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00bd\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00bc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00c8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\r\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c5\u0000\u0000\u0000\u00b2\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00d4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u0000\u0000\u00e0\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d1\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00cc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00d8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u000f\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d5\u0000\u0000\u0000\u0092\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00e4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u0000\u0000\u0008\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000c\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e1\u0000\u0000\u0000\u009a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00f0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\r\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00ed\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0004\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0064\u0061\u0074\u0061\u0057\u006f\u0072\u0064" + + "\u0043\u006f\u0075\u006e\u0074\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u006f\u0069\u006e\u0074\u0065\u0072\u0043" + + "\u006f\u0075\u006e\u0074\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0072\u0065\u0066\u0065\u0072\u0072\u0065" + + "\u0064\u004c\u0069\u0073\u0074\u0045\u006e\u0063" + + "\u006f\u0064\u0069\u006e\u0067\u0000\u0000\u0000" + + "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0026\u0019\u0052\u00ba\u007d\u008f\u0095\u00d1" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u0073\u0047\u0072\u006f\u0075\u0070\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0069\u0073\u0063\u0072\u0069\u006d\u0069" + + "\u006e\u0061\u006e\u0074\u0043\u006f\u0075\u006e" + + "\u0074\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0069\u0073\u0063\u0072\u0069\u006d\u0069" + + "\u006e\u0061\u006e\u0074\u004f\u0066\u0066\u0073" + + "\u0065\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0069\u0065\u006c\u0064\u0073\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_b54ab3364333f598 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0098\u00f5\u0033\u0043\u0036\u00b3\u004a\u00b5" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + + "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + + "\u0006\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004e\u006f\u0064\u0065\u002e\u0065\u006e" + + "\u0075\u006d\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000e\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0028\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0065\u006e\u0075\u006d\u0065\u0072\u0061\u006e" + + "\u0074\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u009a\u0054\u00dc\u00eb\u007c\u008a\u0097" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_e82753cff0c2218f = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u008f\u0021\u00c2\u00f0\u00cf\u0053\u0027\u00e8" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + + "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + + "\u0006\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004e\u006f\u0064\u0065\u002e\u0069\u006e" + + "\u0074\u0065\u0072\u0066\u0061\u0063\u0065\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0040\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u001f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u003d\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u003c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0058\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006d\u0065\u0074\u0068\u006f\u0064\u0073\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0080\u004d\u0033\u003b\u00e2\u00cc\u0000\u0095" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u0075\u0070\u0065\u0072\u0063\u006c\u0061" + + "\u0073\u0073\u0065\u0073\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00f8\u00d7\u00a4\u00d0\u009e\u002a\u0096\u00a9" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_b18aa5ac7a0d9420 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0020\u0094\r\u007a\u00ac\u00a5\u008a\u00b1" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + + "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + + "\u0006\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004e\u006f\u0064\u0065\u002e\u0063\u006f" + + "\u006e\u0073\u0074\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0010\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0074\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0076\u0061\u006c\u0075\u0065\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u009b\u000c\u00b0\u00d7\u00d2\u00dc\u0023\u00ce" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_ec1619d4400a0290 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0090\u0002\n\u0040\u00d4\u0019\u0016\u00ec" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + + "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + + "\u0006\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u00df\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004e\u006f\u0064\u0065\u002e\u0061\u006e" + + "\u006e\u006f\u0074\u0061\u0074\u0069\u006f\u006e" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0034\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0012\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u005d\u0001\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0058\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0064\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0070\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0013\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0060\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u006c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0071\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0014\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0068\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0074\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0015\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0071\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u007c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0073\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0016\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0079\u0001\u0000\u0000\u008a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u007c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0088\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u0000\u0000\u0074\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0017\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0085\u0001\u0000\u0000\u0072\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0084\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0090\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u0000\u0000\u0075\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0018\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u008d\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u008c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0098\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0007\u0000\u0000\u0000\u0076\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0019\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0095\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0094\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00a0\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u009d\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u009c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00a8\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0009\u0000\u0000\u0000\u0078\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u001b\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00a5\u0001\u0000\u0000\u008a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00a8\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00b4\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\n\u0000\u0000\u0000\u0079\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u001c\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b1\u0001\u0000\u0000\u0072\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b0\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00bc\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000b\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u001d\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b9\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b8\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00c4\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u007b\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u001e\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c1\u0001\u0000\u0000\u0092\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c4\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00d0\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0074\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0046" + + "\u0069\u006c\u0065\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0043" + + "\u006f\u006e\u0073\u0074\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0045" + + "\u006e\u0075\u006d\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0045" + + "\u006e\u0075\u006d\u0065\u0072\u0061\u006e\u0074" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0053" + + "\u0074\u0072\u0075\u0063\u0074\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0046" + + "\u0069\u0065\u006c\u0064\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0055" + + "\u006e\u0069\u006f\u006e\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0047" + + "\u0072\u006f\u0075\u0070\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0049" + + "\u006e\u0074\u0065\u0072\u0066\u0061\u0063\u0065" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u004d" + + "\u0065\u0074\u0068\u006f\u0064\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0050" + + "\u0061\u0072\u0061\u006d\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0041" + + "\u006e\u006e\u006f\u0074\u0061\u0074\u0069\u006f" + + "\u006e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_9aad50a41f4af45f = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + + "\u0031\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0004\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ba\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0039\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0046\u0069\u0065\u006c\u0064\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0012\u00c7\u00fe\u007c\u00be\u004c\u00b1\u0097" + + "\u0001\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + + "\u006e\u006f\u0044\u0069\u0073\u0063\u0072\u0069" + + "\u006d\u0069\u006e\u0061\u006e\u0074\u0000\u0000" + + "\u001c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b5\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00bc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b9\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00c4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c1\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00dc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d9\u0000\u0000\u0000\u0092\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00dc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00e8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0004\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006f\u0074\u00b4\u006b\u0047\u0005\u0023\u00c4" + + "\u00e5\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0005\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0011\u001d\u00db\u0068\u00db\u00cd\u00fc\u00ca" + + "\u00cd\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e6\u000b\u0087\u0087\u00c2\u00d5\u0090\u00bb" + + "\u00b5\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u006f\u0064\u0065\u004f\u0072\u0064\u0065" + + "\u0072\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u006e\u006e\u006f\u0074\u0061\u0074\u0069" + + "\u006f\u006e\u0073\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0042\u0075\u0025\u00ab\r\u0095\u00c8\u00f1" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0069\u0073\u0063\u0072\u0069\u006d\u0069" + + "\u006e\u0061\u006e\u0074\u0056\u0061\u006c\u0075" + + "\u0065\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u006c\u006f\u0074\u0000\u0000\u0000\u0000" + + "\u0067\u0072\u006f\u0075\u0070\u0000\u0000\u0000" + + "\u006f\u0072\u0064\u0069\u006e\u0061\u006c\u0000" + ""); +public static final org.capnproto.SegmentReader b_97b14cbe7cfec712 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0012\u00c7\u00fe\u007c\u00be\u004c\u00b1\u0097" + + "\u0037\u0000\u0000\u0000\u0004\u0000\u0000\u0000" + + "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0032\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0030\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u003c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0046\u0069\u0065\u006c\u0064\u002e\u006e" + + "\u006f\u0044\u0069\u0073\u0063\u0072\u0069\u006d" + + "\u0069\u006e\u0061\u006e\u0074\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_c42305476bb4746f = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u006f\u0074\u00b4\u006b\u0047\u0005\u0023\u00c4" + + "\u0037\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + + "\u0004\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0046\u0069\u0065\u006c\u0064\u002e\u0073" + + "\u006c\u006f\u0074\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\\\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0068\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0060\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u006c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0068\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0074\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u0000\u0000\u0080\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0071\u0000\u0000\u0000\u009a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0080\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006f\u0066\u0066\u0073\u0065\u0074\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0065\u0066\u0061\u0075\u006c\u0074\u0056" + + "\u0061\u006c\u0075\u0065\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u009b\u000c\u00b0\u00d7\u00d2\u00dc\u0023\u00ce" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0068\u0061\u0064\u0045\u0078\u0070\u006c\u0069" + + "\u0063\u0069\u0074\u0044\u0065\u0066\u0061\u0075" + + "\u006c\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_cafccddb68db1d11 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0011\u001d\u00db\u0068\u00db\u00cd\u00fc\u00ca" + + "\u0037\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + + "\u0004\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0046\u0069\u0065\u006c\u0064\u002e\u0067" + + "\u0072\u006f\u0075\u0070\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0074\u0079\u0070\u0065\u0049\u0064\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_bb90d5c287870be6 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00e6\u000b\u0087\u0087\u00c2\u00d5\u0090\u00bb" + + "\u0037\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + + "\u0004\u0000\u0007\u0000\u0001\u0000\u0002\u0000" + + "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00fa\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0046\u0069\u0065\u006c\u0064\u002e\u006f" + + "\u0072\u0064\u0069\u006e\u0061\u006c\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00fe\u00ff\u0006\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0030\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u003c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0069\u006d\u0070\u006c\u0069\u0063\u0069\u0074" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u0078\u0070\u006c\u0069\u0063\u0069\u0074" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_978a7cebdc549a4d = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u004d\u009a\u0054\u00dc\u00eb\u007c\u008a\u0097" + + "\u0031\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0045\u006e\u0075\u006d\u0065\u0072\u0061" + + "\u006e\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0050\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u006c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u006f\u0064\u0065\u004f\u0072\u0064\u0065" + + "\u0072\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u006e\u006e\u006f\u0074\u0061\u0074\u0069" + + "\u006f\u006e\u0073\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0042\u0075\u0025\u00ab\r\u0095\u00c8\u00f1" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_a9962a9ed0a4d7f8 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00f8\u00d7\u00a4\u00d0\u009e\u002a\u0096\u00a9" + + "\u0031\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0053\u0075\u0070\u0065\u0072\u0063\u006c" + + "\u0061\u0073\u0073\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0062\u0072\u0061\u006e\u0064\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_9500cce23b334d80 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0080\u004d\u0033\u003b\u00e2\u00cc\u0000\u0095" + + "\u0031\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0005\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00c2\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u00c7\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u004d\u0065\u0074\u0068\u006f\u0064\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0020\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d1\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00cc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00d8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d5\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00e0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00dd\u0000\u0000\u0000\u0082\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00dc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00e8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e5\u0000\u0000\u0000\u008a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00f4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0007\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00f1\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00f0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u000c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0001\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0011\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u001c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0001\u0000\u0000\u009a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0038\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u006f\u0064\u0065\u004f\u0072\u0064\u0065" + + "\u0072\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0061\u0072\u0061\u006d\u0053\u0074\u0072" + + "\u0075\u0063\u0074\u0054\u0079\u0070\u0065\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0053\u0074" + + "\u0072\u0075\u0063\u0074\u0054\u0079\u0070\u0065" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u006e\u006e\u006f\u0074\u0061\u0074\u0069" + + "\u006f\u006e\u0073\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0042\u0075\u0025\u00ab\r\u0095\u00c8\u00f1" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0061\u0072\u0061\u006d\u0042\u0072\u0061" + + "\u006e\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0073\u0075\u006c\u0074\u0042\u0072" + + "\u0061\u006e\u0064\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006d\u0070\u006c\u0069\u0063\u0069\u0074" + + "\u0050\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + + "\u0072\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00b1\u00a3\u000f\u00f1\u00cc\u001b\u0052\u00b9" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_d07378ede1f9cc60 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + + "\u0031\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0013\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u002f\u0004\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0079\u0070\u0065\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0005\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u000c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0011\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0018\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0004\u0000\u00fb\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u001c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u00fa\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0014\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0020\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u00f9\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0018\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0024\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0007\u0000\u00f8\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0021\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0028\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0008\u0000\u00f7\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0025\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0020\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u002c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0009\u0000\u00f6\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\n\u0000\u00f5\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0002\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000b\u0000\u00f4\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0002\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0038\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000c\u0000\u00f3\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000c\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0035\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0030\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u003c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\r\u0000\u00f2\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\r\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0039\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0034\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0040\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000e\u0000\u00f1\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0097\u00ea\u0060\n\u0025\u0039\u00e7\u0087" + + "\u003d\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000f\u0000\u00f0\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00a9\u0087\u007f\u001a\u0071\u0078\u000e\u009e" + + "\u0025\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u00ef\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00d3\u00c6\u004c\u00ef\u0060\u006f\u003a\u00ac" + + "\r\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0011\u0000\u00ee\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00bf\u000c\u00fb\u00f7\u0069\u00ca\u008b\u00ed" + + "\u00f5\u0001\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u00ed\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00f1\u0049\u003e\u00a2\u00e8\u003f\u0057\u00c2" + + "\u00e1\u0001\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0076\u006f\u0069\u0064\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0062\u006f\u006f\u006c\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0074\u0038\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0074\u0031\u0036\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0074\u0033\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0074\u0036\u0034\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0075\u0069\u006e\u0074\u0038\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0075\u0069\u006e\u0074\u0031\u0036\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0075\u0069\u006e\u0074\u0033\u0032\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0075\u0069\u006e\u0074\u0036\u0034\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u006c\u006f\u0061\u0074\u0033\u0032\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u006c\u006f\u0061\u0074\u0036\u0034\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0065\u0078\u0074\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0061\u0074\u0061\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006c\u0069\u0073\u0074\u0000\u0000\u0000\u0000" + + "\u0065\u006e\u0075\u006d\u0000\u0000\u0000\u0000" + + "\u0073\u0074\u0072\u0075\u0063\u0074\u0000\u0000" + + "\u0069\u006e\u0074\u0065\u0072\u0066\u0061\u0063" + + "\u0065\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u006e\u0079\u0050\u006f\u0069\u006e\u0074" + + "\u0065\u0072\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_87e739250a60ea97 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0097\u00ea\u0060\n\u0025\u0039\u00e7\u0087" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + + "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0079\u0070\u0065\u002e\u006c\u0069" + + "\u0073\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000e\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0018\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0054" + + "\u0079\u0070\u0065\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_9e0e78711a7f87a9 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00a9\u0087\u007f\u001a\u0071\u0078\u000e\u009e" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + + "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0079\u0070\u0065\u002e\u0065\u006e" + + "\u0075\u006d\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0015\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0074\u0079\u0070\u0065\u0049\u0064\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0062\u0072\u0061\u006e\u0064\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_ac3a6f60ef4cc6d3 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00d3\u00c6\u004c\u00ef\u0060\u006f\u003a\u00ac" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + + "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0079\u0070\u0065\u002e\u0073\u0074" + + "\u0072\u0075\u0063\u0074\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0010\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0016\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0074\u0079\u0070\u0065\u0049\u0064\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0062\u0072\u0061\u006e\u0064\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_ed8bca69f7fb0cbf = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00bf\u000c\u00fb\u00f7\u0069\u00ca\u008b\u00ed" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + + "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0079\u0070\u0065\u002e\u0069\u006e" + + "\u0074\u0065\u0072\u0066\u0061\u0063\u0065\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0017\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0074\u0079\u0070\u0065\u0049\u0064\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0062\u0072\u0061\u006e\u0064\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_c2573fe8a23e49f1 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00f1\u0049\u003e\u00a2\u00e8\u003f\u0057\u00c2" + + "\u0036\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + + "\u0001\u0000\u0007\u0000\u0001\u0000\u0003\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0079\u0070\u0065\u002e\u0061\u006e" + + "\u0079\u0050\u006f\u0069\u006e\u0074\u0065\u0072" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0056\u0036\u0059\u00fe\u0079\u005f\u003b\u008e" + + "\u0045\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0085\u004a\u0061\u00f4\u0024\u00f7\u00d1\u009d" + + "\u0031\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0002\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u00e2\u0056\u000c\u0012\u00c9\u00ef\u00ba" + + "\u001d\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0075\u006e\u0063\u006f\u006e\u0073\u0074\u0072" + + "\u0061\u0069\u006e\u0065\u0064\u0000\u0000\u0000" + + "\u0070\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + + "\u0072\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006d\u0070\u006c\u0069\u0063\u0069\u0074" + + "\u004d\u0065\u0074\u0068\u006f\u0064\u0050\u0061" + + "\u0072\u0061\u006d\u0065\u0074\u0065\u0072\u0000" + ""); +public static final org.capnproto.SegmentReader b_8e3b5f79fe593656 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0056\u0036\u0059\u00fe\u0079\u005f\u003b\u008e" + + "\u0041\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u00f1\u0049\u003e\u00a2\u00e8\u003f\u0057\u00c2" + + "\u0001\u0000\u0007\u0000\u0001\u0000\u0004\u0000" + + "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u007a\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0079\u0070\u0065\u002e\u0061\u006e" + + "\u0079\u0050\u006f\u0069\u006e\u0074\u0065\u0072" + + "\u002e\u0075\u006e\u0063\u006f\u006e\u0073\u0074" + + "\u0072\u0061\u0069\u006e\u0065\u0064\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0012\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\\\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0068\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0019\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0060\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u006c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0070\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u001b\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006d\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0078\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0061\u006e\u0079\u004b\u0069\u006e\u0064\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u0074\u0072\u0075\u0063\u0074\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006c\u0069\u0073\u0074\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u0061\u0062\u0069\u006c\u0069" + + "\u0074\u0079\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_9dd1f724f4614a85 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0085\u004a\u0061\u00f4\u0024\u00f7\u00d1\u009d" + + "\u0041\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u00f1\u0049\u003e\u00a2\u00e8\u003f\u0057\u00c2" + + "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u005a\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0079\u0070\u0065\u002e\u0061\u006e" + + "\u0079\u0050\u006f\u0069\u006e\u0074\u0065\u0072" + + "\u002e\u0070\u0061\u0072\u0061\u006d\u0065\u0074" + + "\u0065\u0072\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0013\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0014\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0038\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0073\u0063\u006f\u0070\u0065\u0049\u0064\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + + "\u0072\u0049\u006e\u0064\u0065\u0078\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_baefc9120c56e274 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0074\u00e2\u0056\u000c\u0012\u00c9\u00ef\u00ba" + + "\u0041\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + + "\u00f1\u0049\u003e\u00a2\u00e8\u003f\u0057\u00c2" + + "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ca\u0002\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0039\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0054\u0079\u0070\u0065\u002e\u0061\u006e" + + "\u0079\u0050\u006f\u0069\u006e\u0074\u0065\u0072" + + "\u002e\u0069\u006d\u0070\u006c\u0069\u0063\u0069" + + "\u0074\u004d\u0065\u0074\u0068\u006f\u0064\u0050" + + "\u0061\u0072\u0061\u006d\u0065\u0074\u0065\u0072" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0018\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0018\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0070\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + + "\u0072\u0049\u006e\u0064\u0065\u0078\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_903455f06065422b = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + + "\u0031\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ba\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0027\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0041\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0042\u0072\u0061\u006e\u0064\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00c9\u006b\u0063\u00a9\u0085\u0034\u00d7\u00ab" + + "\u0009\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u00fc\u00e7\u009e\u0096\u0016\u00cd\u0063\u00c8" + + "\u0005\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0053\u0063\u006f\u0070\u0065\u0000\u0000\u0000" + + "\u0042\u0069\u006e\u0064\u0069\u006e\u0067\u0000" + + "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0024\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0073\u0063\u006f\u0070\u0065\u0073\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00c9\u006b\u0063\u00a9\u0085\u0034\u00d7\u00ab" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_abd73485a9636bc9 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00c9\u006b\u0063\u00a9\u0085\u0034\u00d7\u00ab" + + "\u0037\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + + "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0042\u0072\u0061\u006e\u0064\u002e\u0053" + + "\u0063\u006f\u0070\u0065\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0060\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u005d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0058\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0064\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0073\u0063\u006f\u0070\u0065\u0049\u0064\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0062\u0069\u006e\u0064\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00fc\u00e7\u009e\u0096\u0016\u00cd\u0063\u00c8" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0068\u0065\u0072\u0069\u0074\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_c863cd16969ee7fc = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00fc\u00e7\u009e\u0096\u0016\u00cd\u0063\u00c8" + + "\u0037\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00fa\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0042\u0072\u0061\u006e\u0064\u002e\u0042" + + "\u0069\u006e\u0064\u0069\u006e\u0067\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0075\u006e\u0062\u006f\u0075\u006e\u0064\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_ce23dcd2d7b00c9b = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u009b\u000c\u00b0\u00d7\u00d2\u00dc\u0023\u00ce" + + "\u0031\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0013\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ba\u0001\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u002f\u0004\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0056\u0061\u006c\u0075\u0065\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0005\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u000c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u00fe\u00ff\u0010\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u00fd\u00ff\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0014\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u00fc\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0011\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0018\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0004\u0000\u00fb\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u001c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0005\u0000\u00fa\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0019\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0014\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0020\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0006\u0000\u00f9\u00ff\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001d\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0018\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0024\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0007\u0000\u00f8\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0021\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u001c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0028\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0008\u0000\u00f7\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0025\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0020\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u002c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0009\u0000\u00f6\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\n\u0000\u00f5\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0002\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000b\u0000\u00f4\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0031\u0002\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0038\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000c\u0000\u00f3\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000c\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0035\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0030\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u003c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\r\u0000\u00f2\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\r\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0039\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0034\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0040\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000e\u0000\u00f1\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000e\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u003d\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0038\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0044\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u000f\u0000\u00f0\u00ff\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u000f\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0041\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u003c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0048\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0010\u0000\u00ef\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0010\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0011\u0000\u00ee\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0002\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0012\u0000\u00ed\u00ff\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0012\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0002\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0050\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + + "\\\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0076\u006f\u0069\u0064\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0062\u006f\u006f\u006c\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0074\u0038\u0000\u0000\u0000\u0000" + + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0074\u0031\u0036\u0000\u0000\u0000" + + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0074\u0033\u0032\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0074\u0036\u0034\u0000\u0000\u0000" + + "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0075\u0069\u006e\u0074\u0038\u0000\u0000\u0000" + + "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0075\u0069\u006e\u0074\u0031\u0036\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0075\u0069\u006e\u0074\u0033\u0032\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0075\u0069\u006e\u0074\u0036\u0034\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u006c\u006f\u0061\u0074\u0033\u0032\u0000" + + "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u006c\u006f\u0061\u0074\u0036\u0034\u0000" + + "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0065\u0078\u0074\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0064\u0061\u0074\u0061\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006c\u0069\u0073\u0074\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u006e\u0075\u006d\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u0074\u0072\u0075\u0063\u0074\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006e\u0074\u0065\u0072\u0066\u0061\u0063" + + "\u0065\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u006e\u0079\u0050\u006f\u0069\u006e\u0074" + + "\u0065\u0072\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_f1c8950dab257542 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0042\u0075\u0025\u00ab\r\u0095\u00c8\u00f1" + + "\u0031\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0041\u006e\u006e\u006f\u0074\u0061\u0074" + + "\u0069\u006f\u006e\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0076\u0061\u006c\u0075\u0065\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u009b\u000c\u00b0\u00d7\u00d2\u00dc\u0023\u00ce" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0062\u0072\u0061\u006e\u0064\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_d1958f7dba521926 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0026\u0019\u0052\u00ba\u007d\u008f\u0095\u00d1" + + "\u0031\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u00c7\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0045\u006c\u0065\u006d\u0065\u006e\u0074" + + "\u0053\u0069\u007a\u0065\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0020\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0059\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0000\u0000\u0000\"\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0041\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u003d\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0039\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u0082\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u006d\u0070\u0074\u0079\u0000\u0000\u0000" + + "\u0062\u0069\u0074\u0000\u0000\u0000\u0000\u0000" + + "\u0062\u0079\u0074\u0065\u0000\u0000\u0000\u0000" + + "\u0074\u0077\u006f\u0042\u0079\u0074\u0065\u0073" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u006f\u0075\u0072\u0042\u0079\u0074\u0065" + + "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0065\u0069\u0067\u0068\u0074\u0042\u0079\u0074" + + "\u0065\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0070\u006f\u0069\u006e\u0074\u0065\u0072\u0000" + + "\u0069\u006e\u006c\u0069\u006e\u0065\u0043\u006f" + + "\u006d\u0070\u006f\u0073\u0069\u0074\u0065\u0000" + ""); +public static final org.capnproto.SegmentReader b_d85d305b7d839963 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0063\u0099\u0083\u007d\u005b\u0030\u005d\u00d8" + + "\u0031\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00f2\u0001\u0000\u0000" + + "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0043\u0061\u0070\u006e\u0070\u0056\u0065" + + "\u0072\u0073\u0069\u006f\u006e\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006d\u0061\u006a\u006f\u0072\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006d\u0069\u006e\u006f\u0072\u0000\u0000\u0000" + + "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006d\u0069\u0063\u0072\u006f\u0000\u0000\u0000" + + "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_bfc546f6210ad7ce = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00ce\u00d7\n\u0021\u00f6\u0046\u00c5\u00bf" + + "\u0031\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + + "\u0004\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u0032\u0002\u0000\u0000" + + "\u0035\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0041\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0043\u006f\u0064\u0065\u0047\u0065\u006e" + + "\u0065\u0072\u0061\u0074\u006f\u0072\u0052\u0065" + + "\u0071\u0075\u0065\u0073\u0074\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0062\u0000\u0081\u002e\u00b0\u000e\u00ea\u00cf" + + "\u0001\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + + "\u0052\u0065\u0071\u0075\u0065\u0073\u0074\u0065" + + "\u0064\u0046\u0069\u006c\u0065\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0061\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\\\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0078\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0075\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0074\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0090\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u008d\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u008c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0098\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0095\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0094\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u00b0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u006e\u006f\u0064\u0065\u0073\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0065\u0071\u0075\u0065\u0073\u0074\u0065" + + "\u0064\u0046\u0069\u006c\u0065\u0073\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0062\u0000\u0081\u002e\u00b0\u000e\u00ea\u00cf" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0061\u0070\u006e\u0070\u0056\u0065\u0072" + + "\u0073\u0069\u006f\u006e\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0063\u0099\u0083\u007d\u005b\u0030\u005d\u00d8" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0073\u006f\u0075\u0072\u0063\u0065\u0049\u006e" + + "\u0066\u006f\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00ae\u0057\u0013\u0004\u00e3\u001d\u008e\u00f3" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_cfea0eb02e810062 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u0062\u0000\u0081\u002e\u00b0\u000e\u00ea\u00cf" + + "\u0046\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00ce\u00d7\n\u0021\u00f6\u0046\u00c5\u00bf" + + "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00a2\u0002\u0000\u0000" + + "\u003d\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0043\u006f\u0064\u0065\u0047\u0065\u006e" + + "\u0065\u0072\u0061\u0074\u006f\u0072\u0052\u0065" + + "\u0071\u0075\u0065\u0073\u0074\u002e\u0052\u0065" + + "\u0071\u0075\u0065\u0073\u0074\u0065\u0064\u0046" + + "\u0069\u006c\u0065\u0000\u0000\u0000\u0000\u0000" + + "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u00e5\u0057\u0023\u0012\u0093\u0041\u0050\u00ae" + + "\u0001\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + + "\u0049\u006d\u0070\u006f\u0072\u0074\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0045\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0049\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0051\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0068\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0066\u0069\u006c\u0065\u006e\u0061\u006d\u0065" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0069\u006d\u0070\u006f\u0072\u0074\u0073\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u00e5\u0057\u0023\u0012\u0093\u0041\u0050\u00ae" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +public static final org.capnproto.SegmentReader b_ae504193122357e5 = + org.capnproto.GeneratedClassSupport.decodeRawBytes( + "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + + "\u00e5\u0057\u0023\u0012\u0093\u0041\u0050\u00ae" + + "\u0054\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0062\u0000\u0081\u002e\u00b0\u000e\u00ea\u00cf" + + "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0015\u0000\u0000\u0000\u00da\u0002\u0000\u0000" + + "\u0041\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u003d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + + "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + + "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + + "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + + "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + + "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + + "\u003a\u0043\u006f\u0064\u0065\u0047\u0065\u006e" + + "\u0065\u0072\u0061\u0074\u006f\u0072\u0052\u0065" + + "\u0071\u0075\u0065\u0073\u0074\u002e\u0052\u0065" + + "\u0071\u0075\u0065\u0073\u0074\u0065\u0064\u0046" + + "\u0069\u006c\u0065\u002e\u0049\u006d\u0070\u006f" + + "\u0072\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + + "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u002d\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + + "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + + "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); +} +} + diff --git a/runtime/src/main/java/org/capnproto/Serialize.java b/runtime/src/main/java/org/capnproto/Serialize.java index 60b829a5..7bdc158a 100644 --- a/runtime/src/main/java/org/capnproto/Serialize.java +++ b/runtime/src/main/java/org/capnproto/Serialize.java @@ -342,7 +342,7 @@ public static CompletableFuture writeAsync(AsynchronousByteChann table.putInt(4 * (ii + 1), segments[ii].limit() / 8); } - outputChannel.write(table, 0, new CompletionHandler() { + outputChannel.write(table, 0, new CompletionHandler<>() { @Override public void completed(Integer result, Integer attachment) { diff --git a/runtime/src/main/java/org/capnproto/TwoPartyClient.java b/runtime/src/main/java/org/capnproto/TwoPartyClient.java index ee3a89cf..c0884998 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyClient.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyClient.java @@ -1,6 +1,6 @@ package org.capnproto; -import java.nio.channels.AsynchronousByteChannel; +import java.nio.channels.AsynchronousSocketChannel; import java.util.concurrent.CompletableFuture; public class TwoPartyClient { @@ -8,15 +8,15 @@ public class TwoPartyClient { private final TwoPartyVatNetwork network; private final TwoPartyRpcSystem rpcSystem; - public TwoPartyClient(AsynchronousByteChannel channel) { + public TwoPartyClient(AsynchronousSocketChannel channel) { this(channel, null); } - public TwoPartyClient(AsynchronousByteChannel channel, Capability.Client bootstrapInterface) { + public TwoPartyClient(AsynchronousSocketChannel channel, Capability.Client bootstrapInterface) { this(channel, bootstrapInterface, RpcTwoPartyProtocol.Side.CLIENT); } - public TwoPartyClient(AsynchronousByteChannel channel, + public TwoPartyClient(AsynchronousSocketChannel channel, Capability.Client bootstrapInterface, RpcTwoPartyProtocol.Side side) { this.network = new TwoPartyVatNetwork(channel, side); @@ -32,7 +32,13 @@ public Capability.Client bootstrap() { return rpcSystem.bootstrap(vatId.asReader()); } + public CompletableFuture onDisconnect() { + return this.network.onDisconnect(); + } + + /* public CompletableFuture runOnce() { return this.rpcSystem.runOnce(); } + */ } diff --git a/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java b/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java index c99092a9..1add9f9c 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java @@ -7,6 +7,10 @@ public TwoPartyRpcSystem(TwoPartyVatNetwork network, Capability.Client bootstrap super(network, bootstrapInterface); } + public TwoPartyRpcSystem(TwoPartyVatNetwork network, Capability.Server bootstrapInterface) { + super(network, new Capability.Client(bootstrapInterface)); + } + public Capability.Client bootstrap(RpcTwoPartyProtocol.VatId.Reader vatId) { var connection = this.network.baseConnect(vatId); var state = getConnectionState(connection); diff --git a/runtime/src/main/java/org/capnproto/TwoPartyServer.java b/runtime/src/main/java/org/capnproto/TwoPartyServer.java index f34d261a..1aac7a5b 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyServer.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyServer.java @@ -1,64 +1,145 @@ package org.capnproto; -import java.nio.channels.AsynchronousByteChannel; import java.nio.channels.AsynchronousServerSocketChannel; import java.nio.channels.AsynchronousSocketChannel; import java.nio.channels.CompletionHandler; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; public class TwoPartyServer { private class AcceptedConnection { - final AsynchronousByteChannel channel; + final AsynchronousSocketChannel channel; final TwoPartyVatNetwork network; final TwoPartyRpcSystem rpcSystem; + private final CompletableFuture messageLoop; - AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousByteChannel channel) { + AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousSocketChannel channel) { this.channel = channel; this.network = new TwoPartyVatNetwork(channel, RpcTwoPartyProtocol.Side.SERVER); this.rpcSystem = new TwoPartyRpcSystem(network, bootstrapInterface); + this.messageLoop = this.rpcSystem.getMessageLoop().exceptionally(exc -> { + connections.remove(this); + return null; + }); } - public CompletableFuture runOnce() { - return this.rpcSystem.runOnce(); + public CompletableFuture getMessageLoop() { + return this.messageLoop; + } + } + + class ConnectionReceiver { + AsynchronousServerSocketChannel listener; + final CompletableFuture messageLoop; + public ConnectionReceiver(AsynchronousServerSocketChannel listener) { + this.listener = listener; + this.messageLoop = doMessageLoop(); + } + + public CompletableFuture getMessageLoop() { + return this.messageLoop; + } + + private CompletableFuture doMessageLoop() { + final var accepted = new CompletableFuture(); + listener.accept(null, new CompletionHandler<>() { + + @Override + public void completed(AsynchronousSocketChannel channel, Object attachment) { + accepted.complete(channel); + } + + @Override + public void failed(Throwable exc, Object attachment) { + accepted.completeExceptionally(exc); + } + }); + return accepted.thenCompose(channel -> CompletableFuture.allOf( + accept(channel), + doMessageLoop())); } } private final Capability.Client bootstrapInterface; private final List connections = new ArrayList<>(); - private final List listeners = new ArrayList<>(); + private final List listeners = new ArrayList<>(); + private final CompletableFuture messageLoop; public TwoPartyServer(Capability.Client bootstrapInterface) { this.bootstrapInterface = bootstrapInterface; + this.messageLoop = doMessageLoop(); + } + + public TwoPartyServer(Capability.Server bootstrapServer) { + this(new Capability.Client(bootstrapServer)); + } + + private CompletableFuture getMessageLoop() { + return this.messageLoop; } - private synchronized void accept(AsynchronousByteChannel channel) { + public CompletableFuture drain() { + CompletableFuture done = new CompletableFuture<>(); + for (var conn: this.connections) { + done = CompletableFuture.allOf(done, conn.getMessageLoop()); + } + return done; + } + + private CompletableFuture accept(AsynchronousSocketChannel channel) { var connection = new AcceptedConnection(this.bootstrapInterface, channel); this.connections.add(connection); + return connection.network.onDisconnect().whenComplete((x, exc) -> { + this.connections.remove(connection); + }); } +/* + private final CompletableFuture acceptLoop(AsynchronousServerSocketChannel listener) { + final var accepted = new CompletableFuture(); + listener.accept(null, new CompletionHandler<>() { - public void listen(AsynchronousServerSocketChannel listener) { - listener.accept(null, new CompletionHandler() { @Override public void completed(AsynchronousSocketChannel channel, Object attachment) { - accept(channel); - listen(listener); + accepted.complete(channel); } @Override public void failed(Throwable exc, Object attachment) { - listeners.remove(listener); + accepted.completeExceptionally(exc); } }); + return accepted.thenCompose(channel -> CompletableFuture.anyOf( + accept(channel), + acceptLoop(listener))); + } +*/ + public CompletableFuture listen(AsynchronousServerSocketChannel listener) { + var receiver = new ConnectionReceiver(listener); + this.listeners.add(receiver); + return receiver.getMessageLoop(); + } + + private CompletableFuture doMessageLoop() { + var done = new CompletableFuture<>(); + for (var conn: this.connections) { + done = CompletableFuture.anyOf(done, conn.getMessageLoop()); + } + for (var listener: this.listeners) { + done = CompletableFuture.anyOf(done, listener.getMessageLoop()); + } + return done.thenCompose(x -> doMessageLoop()); } - public synchronized CompletableFuture runOnce() { + /* + public CompletableFuture runOnce() { var done = new CompletableFuture<>(); for (var conn: connections) { done = CompletableFuture.anyOf(done, conn.runOnce()); } return done; } + */ } diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 3a204691..c1e60f17 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -1,22 +1,23 @@ package org.capnproto; -import java.nio.channels.AsynchronousByteChannel; +import java.nio.channels.AsynchronousSocketChannel; import java.util.List; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; public class TwoPartyVatNetwork - implements VatNetwork, VatNetwork.Connection { + implements VatNetwork, + VatNetwork.Connection { - private CompletableFuture writeCompleted = CompletableFuture.completedFuture(null); - private final Executor executor = Executors.newSingleThreadExecutor(); - private final AsynchronousByteChannel channel; + private CompletableFuture previousWrite = CompletableFuture.completedFuture(null); + private final CompletableFuture peerDisconnected = new CompletableFuture<>(); + private final AsynchronousSocketChannel channel; private final RpcTwoPartyProtocol.Side side; private final MessageBuilder peerVatId = new MessageBuilder(4); private boolean accepted; - public TwoPartyVatNetwork(AsynchronousByteChannel channel, RpcTwoPartyProtocol.Side side) { + public final RpcDumper dumper = new RpcDumper(); + + public TwoPartyVatNetwork(AsynchronousSocketChannel channel, RpcTwoPartyProtocol.Side side) { this.channel = channel; this.side = side; this.peerVatId.initRoot(RpcTwoPartyProtocol.VatId.factory).setSide( @@ -33,11 +34,12 @@ public RpcTwoPartyProtocol.VatId.Reader getPeerVatId() { return peerVatId.getRoot(RpcTwoPartyProtocol.VatId.factory).asReader(); } + public VatNetwork.Connection asConnection() { + return this; + } + private Connection connect(RpcTwoPartyProtocol.VatId.Reader vatId) { - if (vatId.getSide() != side) { - return this; - } - return null; + return vatId.getSide() != side ? this : null; } private CompletableFuture accept() { @@ -58,8 +60,33 @@ public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { @Override public CompletableFuture receiveIncomingMessage() { - return Serialize.readAsync(channel).thenApply(message -> { - return new IncomingMessage(message); + return Serialize.readAsync(channel).whenComplete((x, exc) -> { + if (exc != null) { + this.peerDisconnected.complete(null); + } + }).thenApply(reader -> { + var msg = new IncomingMessage(reader); + var dump = this.dumper.dump(msg.getBody().getAs(RpcProtocol.Message.factory), getSide()); + if (!dump.isEmpty()) { + System.out.println(dump); + } + return msg; + }); + } + + @Override + public CompletableFuture onDisconnect() { + return this.peerDisconnected.copy(); + } + + @Override + public CompletableFuture shutdown() { + return this.previousWrite.whenComplete((x, exc) -> { + try { + this.channel.shutdownOutput(); + } + catch (Exception ioExc) { + } }); } @@ -70,7 +97,7 @@ public Connection baseConnect(RpcTwoPartyProtocol.VatId.Reader hostId) { @Override public CompletableFuture baseAccept() { - return this.accept().thenApply(conn -> conn); + return this.accept(); } final class OutgoingMessage implements OutgoingRpcMessage { @@ -94,7 +121,7 @@ public void setFds(List fds) { @Override public void send() { - writeCompleted = writeCompleted.thenCompose( + previousWrite = previousWrite.thenCompose( x -> Serialize.writeAsync(channel, message) ); } diff --git a/runtime/src/main/java/org/capnproto/VatNetwork.java b/runtime/src/main/java/org/capnproto/VatNetwork.java index 42921504..c5cf2fd3 100644 --- a/runtime/src/main/java/org/capnproto/VatNetwork.java +++ b/runtime/src/main/java/org/capnproto/VatNetwork.java @@ -7,6 +7,8 @@ public interface VatNetwork { interface Connection { OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize); CompletableFuture receiveIncomingMessage(); + CompletableFuture onDisconnect(); + CompletableFuture shutdown(); } Connection baseConnect(VatId hostId); diff --git a/runtime/src/main/java/org/capnproto/schema.capnp b/runtime/src/main/java/org/capnproto/schema.capnp new file mode 100644 index 00000000..fd9bf0b0 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/schema.capnp @@ -0,0 +1,533 @@ +# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors +# Licensed under the MIT License: +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +using Cxx = import "/capnp/c++.capnp"; + +@0xa93fc509624c72d9; +$Cxx.namespace("capnp::schema"); + +using Java = import "/capnp/java.capnp"; +$Java.package("org.capnproto"); +$Java.outerClassname("Schema"); + +using Id = UInt64; +# The globally-unique ID of a file, type, or annotation. + +struct Node { + id @0 :Id; + + displayName @1 :Text; + # Name to present to humans to identify this Node. You should not attempt to parse this. Its + # format could change. It is not guaranteed to be unique. + # + # (On Zooko's triangle, this is the node's nickname.) + + displayNamePrefixLength @2 :UInt32; + # If you want a shorter version of `displayName` (just naming this node, without its surrounding + # scope), chop off this many characters from the beginning of `displayName`. + + scopeId @3 :Id; + # ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back + # at this node, but robust code should avoid relying on this (and, in fact, group nodes are not + # listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is + # zero if the node has no parent, which is normally only the case with files, but should be + # allowed for any kind of node (in order to make runtime type generation easier). + + parameters @32 :List(Parameter); + # If this node is parameterized (generic), the list of parameters. Empty for non-generic types. + + isGeneric @33 :Bool; + # True if this node is generic, meaning that it or one of its parent scopes has a non-empty + # `parameters`. + + struct Parameter { + # Information about one of the node's parameters. + + name @0 :Text; + } + + nestedNodes @4 :List(NestedNode); + # List of nodes nested within this node, along with the names under which they were declared. + + struct NestedNode { + name @0 :Text; + # Unqualified symbol name. Unlike Node.displayName, this *can* be used programmatically. + # + # (On Zooko's triangle, this is the node's petname according to its parent scope.) + + id @1 :Id; + # ID of the nested node. Typically, the target node's scopeId points back to this node, but + # robust code should avoid relying on this. + } + + annotations @5 :List(Annotation); + # Annotations applied to this node. + + union { + # Info specific to each kind of node. + + file @6 :Void; + + struct :group { + dataWordCount @7 :UInt16; + # Size of the data section, in words. + + pointerCount @8 :UInt16; + # Size of the pointer section, in pointers (which are one word each). + + preferredListEncoding @9 :ElementSize; + # The preferred element size to use when encoding a list of this struct. If this is anything + # other than `inlineComposite` then the struct is one word or less in size and is a candidate + # for list packing optimization. + + isGroup @10 :Bool; + # If true, then this "struct" node is actually not an independent node, but merely represents + # some named union or group within a particular parent struct. This node's scopeId refers + # to the parent struct, which may itself be a union/group in yet another struct. + # + # All group nodes share the same dataWordCount and pointerCount as the top-level + # struct, and their fields live in the same ordinal and offset spaces as all other fields in + # the struct. + # + # Note that a named union is considered a special kind of group -- in fact, a named union + # is exactly equivalent to a group that contains nothing but an unnamed union. + + discriminantCount @11 :UInt16; + # Number of fields in this struct which are members of an anonymous union, and thus may + # overlap. If this is non-zero, then a 16-bit discriminant is present indicating which + # of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be + # two or more. + # + # Note that the fields of an unnamed union are considered fields of the scope containing the + # union -- an unnamed union is not its own group. So, a top-level struct may contain a + # non-zero discriminant count. Named unions, on the other hand, are equivalent to groups + # containing unnamed unions. So, a named union has its own independent schema node, with + # `isGroup` = true. + + discriminantOffset @12 :UInt32; + # If `discriminantCount` is non-zero, this is the offset of the union discriminant, in + # multiples of 16 bits. + + fields @13 :List(Field); + # Fields defined within this scope (either the struct's top-level fields, or the fields of + # a particular group; see `isGroup`). + # + # The fields are sorted by ordinal number, but note that because groups share the same + # ordinal space, the field's index in this list is not necessarily exactly its ordinal. + # On the other hand, the field's position in this list does remain the same even as the + # protocol evolves, since it is not possible to insert or remove an earlier ordinal. + # Therefore, for most use cases, if you want to identify a field by number, it may make the + # most sense to use the field's index in this list rather than its ordinal. + } + + enum :group { + enumerants@14 :List(Enumerant); + # Enumerants ordered by numeric value (ordinal). + } + + interface :group { + methods @15 :List(Method); + # Methods ordered by ordinal. + + superclasses @31 :List(Superclass); + # Superclasses of this interface. + } + + const :group { + type @16 :Type; + value @17 :Value; + } + + annotation :group { + type @18 :Type; + + targetsFile @19 :Bool; + targetsConst @20 :Bool; + targetsEnum @21 :Bool; + targetsEnumerant @22 :Bool; + targetsStruct @23 :Bool; + targetsField @24 :Bool; + targetsUnion @25 :Bool; + targetsGroup @26 :Bool; + targetsInterface @27 :Bool; + targetsMethod @28 :Bool; + targetsParam @29 :Bool; + targetsAnnotation @30 :Bool; + } + } + + struct SourceInfo { + # Additional information about a node which is not needed at runtime, but may be useful for + # documentation or debugging purposes. This is kept in a separate struct to make sure it + # doesn't accidentally get included in contexts where it is not needed. The + # `CodeGeneratorRequest` includes this information in a separate array. + + id @0 :Id; + # ID of the Node which this info describes. + + docComment @1 :Text; + # The top-level doc comment for the Node. + + members @2 :List(Member); + # Information about each member -- i.e. fields (for structs), enumerants (for enums), or + # methods (for interfaces). + # + # This list is the same length and order as the corresponding list in the Node, i.e. + # Node.struct.fields, Node.enum.enumerants, or Node.interface.methods. + + struct Member { + docComment @0 :Text; + # Doc comment on the member. + } + + # TODO(someday): Record location of the declaration in the original source code. + } +} + +struct Field { + # Schema for a field of a struct. + + name @0 :Text; + + codeOrder @1 :UInt16; + # Indicates where this member appeared in the code, relative to other members. + # Code ordering may have semantic relevance -- programmers tend to place related fields + # together. So, using code ordering makes sense in human-readable formats where ordering is + # otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum + # value is count(members) - 1. Fields that are members of a union are only ordered relative to + # the other members of that union, so the maximum value there is count(union.members). + + annotations @2 :List(Annotation); + + const noDiscriminant :UInt16 = 0xffff; + + discriminantValue @3 :UInt16 = Field.noDiscriminant; + # If the field is in a union, this is the value which the union's discriminant should take when + # the field is active. If the field is not in a union, this is 0xffff. + + union { + slot :group { + # A regular, non-group, non-fixed-list field. + + offset @4 :UInt32; + # Offset, in units of the field's size, from the beginning of the section in which the field + # resides. E.g. for a UInt32 field, multiply this by 4 to get the byte offset from the + # beginning of the data section. + + type @5 :Type; + defaultValue @6 :Value; + + hadExplicitDefault @10 :Bool; + # Whether the default value was specified explicitly. Non-explicit default values are always + # zero or empty values. Usually, whether the default value was explicit shouldn't matter. + # The main use case for this flag is for structs representing method parameters: + # explicitly-defaulted parameters may be allowed to be omitted when calling the method. + } + + group :group { + # A group. + + typeId @7 :Id; + # The ID of the group's node. + } + } + + ordinal :union { + implicit @8 :Void; + explicit @9 :UInt16; + # The original ordinal number given to the field. You probably should NOT use this; if you need + # a numeric identifier for a field, use its position within the field array for its scope. + # The ordinal is given here mainly just so that the original schema text can be reproduced given + # the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job. + } +} + +struct Enumerant { + # Schema for member of an enum. + + name @0 :Text; + + codeOrder @1 :UInt16; + # Specifies order in which the enumerants were declared in the code. + # Like Struct.Field.codeOrder. + + annotations @2 :List(Annotation); +} + +struct Superclass { + id @0 :Id; + brand @1 :Brand; +} + +struct Method { + # Schema for method of an interface. + + name @0 :Text; + + codeOrder @1 :UInt16; + # Specifies order in which the methods were declared in the code. + # Like Struct.Field.codeOrder. + + implicitParameters @7 :List(Node.Parameter); + # The parameters listed in [] (typically, type / generic parameters), whose bindings are intended + # to be inferred rather than specified explicitly, although not all languages support this. + + paramStructType @2 :Id; + # ID of the parameter struct type. If a named parameter list was specified in the method + # declaration (rather than a single struct parameter type) then a corresponding struct type is + # auto-generated. Such an auto-generated type will not be listed in the interface's + # `nestedNodes` and its `scopeId` will be zero -- it is completely detached from the namespace. + # (Awkwardly, it does of course inherit generic parameters from the method's scope, which makes + # this a situation where you can't just climb the scope chain to find where a particular + # generic parameter was introduced. Making the `scopeId` zero was a mistake.) + + paramBrand @5 :Brand; + # Brand of param struct type. + + resultStructType @3 :Id; + # ID of the return struct type; similar to `paramStructType`. + + resultBrand @6 :Brand; + # Brand of result struct type. + + annotations @4 :List(Annotation); +} + +struct Type { + # Represents a type expression. + + union { + # The ordinals intentionally match those of Value. + + void @0 :Void; + bool @1 :Void; + int8 @2 :Void; + int16 @3 :Void; + int32 @4 :Void; + int64 @5 :Void; + uint8 @6 :Void; + uint16 @7 :Void; + uint32 @8 :Void; + uint64 @9 :Void; + float32 @10 :Void; + float64 @11 :Void; + text @12 :Void; + data @13 :Void; + + list :group { + elementType @14 :Type; + } + + enum :group { + typeId @15 :Id; + brand @21 :Brand; + } + struct :group { + typeId @16 :Id; + brand @22 :Brand; + } + interface :group { + typeId @17 :Id; + brand @23 :Brand; + } + + anyPointer :union { + unconstrained :union { + # A regular AnyPointer. + # + # The name "unconstrained" means as opposed to constraining it to match a type parameter. + # In retrospect this name is probably a poor choice given that it may still be constrained + # to be a struct, list, or capability. + + anyKind @18 :Void; # truly AnyPointer + struct @25 :Void; # AnyStruct + list @26 :Void; # AnyList + capability @27 :Void; # Capability + } + + parameter :group { + # This is actually a reference to a type parameter defined within this scope. + + scopeId @19 :Id; + # ID of the generic type whose parameter we're referencing. This should be a parent of the + # current scope. + + parameterIndex @20 :UInt16; + # Index of the parameter within the generic type's parameter list. + } + + implicitMethodParameter :group { + # This is actually a reference to an implicit (generic) parameter of a method. The only + # legal context for this type to appear is inside Method.paramBrand or Method.resultBrand. + + parameterIndex @24 :UInt16; + } + } + } +} + +struct Brand { + # Specifies bindings for parameters of generics. Since these bindings turn a generic into a + # non-generic, we call it the "brand". + + scopes @0 :List(Scope); + # For each of the target type and each of its parent scopes, a parameterization may be included + # in this list. If no parameterization is included for a particular relevant scope, then either + # that scope has no parameters or all parameters should be considered to be `AnyPointer`. + + struct Scope { + scopeId @0 :Id; + # ID of the scope to which these params apply. + + union { + bind @1 :List(Binding); + # List of parameter bindings. + + inherit @2 :Void; + # The place where this Brand appears is actually within this scope or a sub-scope, + # and the bindings for this scope should be inherited from the reference point. + } + } + + struct Binding { + union { + unbound @0 :Void; + type @1 :Type; + + # TODO(someday): Allow non-type parameters? Unsure if useful. + } + } +} + +struct Value { + # Represents a value, e.g. a field default value, constant value, or annotation value. + + union { + # The ordinals intentionally match those of Type. + + void @0 :Void; + bool @1 :Bool; + int8 @2 :Int8; + int16 @3 :Int16; + int32 @4 :Int32; + int64 @5 :Int64; + uint8 @6 :UInt8; + uint16 @7 :UInt16; + uint32 @8 :UInt32; + uint64 @9 :UInt64; + float32 @10 :Float32; + float64 @11 :Float64; + text @12 :Text; + data @13 :Data; + + list @14 :AnyPointer; + + enum @15 :UInt16; + struct @16 :AnyPointer; + + interface @17 :Void; + # The only interface value that can be represented statically is "null", whose methods always + # throw exceptions. + + anyPointer @18 :AnyPointer; + } +} + +struct Annotation { + # Describes an annotation applied to a declaration. Note AnnotationNode describes the + # annotation's declaration, while this describes a use of the annotation. + + id @0 :Id; + # ID of the annotation node. + + brand @2 :Brand; + # Brand of the annotation. + # + # Note that the annotation itself is not allowed to be parameterized, but its scope might be. + + value @1 :Value; +} + +enum ElementSize { + # Possible element sizes for encoded lists. These correspond exactly to the possible values of + # the 3-bit element size component of a list pointer. + + empty @0; # aka "void", but that's a keyword. + bit @1; + byte @2; + twoBytes @3; + fourBytes @4; + eightBytes @5; + pointer @6; + inlineComposite @7; +} + +struct CapnpVersion { + major @0 :UInt16; + minor @1 :UInt8; + micro @2 :UInt8; +} + +struct CodeGeneratorRequest { + capnpVersion @2 :CapnpVersion; + # Version of the `capnp` executable. Generally, code generators should ignore this, but the code + # generators that ship with `capnp` itself will print a warning if this mismatches since that + # probably indicates something is misconfigured. + # + # The first version of 'capnp' to set this was 0.6.0. So, if it's missing, the compiler version + # is older than that. + + nodes @0 :List(Node); + # All nodes parsed by the compiler, including for the files on the command line and their + # imports. + + sourceInfo @3 :List(Node.SourceInfo); + # Information about the original source code for each node, where available. This array may be + # omitted or may be missing some nodes if no info is available for them. + + requestedFiles @1 :List(RequestedFile); + # Files which were listed on the command line. + + struct RequestedFile { + id @0 :Id; + # ID of the file. + + filename @1 :Text; + # Name of the file as it appeared on the command-line (minus the src-prefix). You may use + # this to decide where to write the output. + + imports @2 :List(Import); + # List of all imported paths seen in this file. + + struct Import { + id @0 :Id; + # ID of the imported file. + + name @1 :Text; + # Name which *this* file used to refer to the foreign file. This may be a relative name. + # This information is provided because it might be useful for code generation, e.g. to + # generate #include directives in C++. We don't put this in Node.file because this + # information is only meaningful at compile time anyway. + # + # (On Zooko's triangle, this is the import's petname according to the importing file.) + } + } +} diff --git a/runtime/src/test/java/org/capnproto/LocalCapabilityTest.java b/runtime/src/test/java/org/capnproto/LocalCapabilityTest.java new file mode 100644 index 00000000..716d9a16 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/LocalCapabilityTest.java @@ -0,0 +1,66 @@ +package org.capnproto; + +import org.capnproto.demo.Demo; +import org.junit.Assert; +import org.junit.Test; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +public class LocalCapabilityTest { + + @Test + public void testLocalServer() throws ExecutionException, InterruptedException { + var demo = new TestCap0Impl(); + var client = new Demo.TestCap0.Client(demo); + var request = client.testMethod0Request(); + var params = request.getParams(); + params.setParam0(4321); + var response = request.send(); + var results = response.get(); + Assert.assertEquals(params.getParam0(), results.getResult0()); + } + + @Test + public void testGenericServer() throws ExecutionException, InterruptedException { + var demo = new TestCap0Impl(); + var client = new Demo.TestCap0.Client(demo); + var request = client.testMethod0Request(); + var params = request.getParams(); + var response = request.send(); + var results = response.get(); + Assert.assertEquals(params.getParam0(), results.getResult0()); + } + + @Test + public void testLocalTwoStagePipeline() { + + var server0 = new Demo.Iface0.Server() { + boolean method0called = false; + + @Override + protected CompletableFuture method0(CallContext ctx) { + method0called = true; + return CompletableFuture.completedFuture(null); + } + }; + + var server1 = new Demo.Iface1.Server() { + @Override + protected CompletableFuture method1(CallContext ctx) { + ctx.getResults().setResult0(new Demo.Iface0.Client(server0)); + return CompletableFuture.completedFuture(null); + } + }; + + var iface1Client = new Demo.Iface1.Client(server1); + var request1 = iface1Client.method1Request(); + var response = request1.send(); + var iface0 = response.getResult0(); + var request0 = iface0.method0Request(); + var response0 = request0.send(); + response0.join(); + Assert.assertTrue(!response0.isCompletedExceptionally()); + Assert.assertTrue(server0.method0called); + } +} diff --git a/runtime/src/test/java/org/capnproto/RpcStateTest.java b/runtime/src/test/java/org/capnproto/RpcStateTest.java index 4d5f2e9b..96350785 100644 --- a/runtime/src/test/java/org/capnproto/RpcStateTest.java +++ b/runtime/src/test/java/org/capnproto/RpcStateTest.java @@ -25,7 +25,8 @@ public AnyPointer.Reader getBody() { class TestConnection implements VatNetwork.Connection { - Executor executor = Executors.newSingleThreadExecutor(); + private final CompletableFuture disconnect = new CompletableFuture<>(); + @Override public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { var message = new MessageBuilder(); @@ -52,6 +53,17 @@ public int sizeInWords() { public CompletableFuture receiveIncomingMessage() { return null; } + + @Override + public CompletableFuture onDisconnect() { + return this.disconnect.copy(); + } + + @Override + public CompletableFuture shutdown() { + this.disconnect.complete(null); + return this.disconnect.copy(); + } } TestConnection connection; @@ -63,7 +75,7 @@ public CompletableFuture receiveIncomingMessage() { public void setUp() throws Exception { connection = new TestConnection(); bootstrapInterface = new Capability.Client(Capability.newNullCap()); - rpc = new RpcState(connection, bootstrapInterface); + rpc = new RpcState(bootstrapInterface, connection, connection.disconnect); } @After diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index 7ffe2169..2dd81f86 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -6,24 +6,27 @@ import org.junit.Before; import org.junit.Test; +import java.io.IOException; import java.nio.channels.AsynchronousServerSocketChannel; import java.nio.channels.AsynchronousSocketChannel; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; class TestCap0Impl extends Demo.TestCap0.Server { final Demo.TestCap1.Client testCap1a = new Demo.TestCap1.Client(new TestCap1Impl()); final Demo.TestCap1.Client testCap1b = new Demo.TestCap1.Client(new TestCap1Impl()); - public CompletableFuture testMethod0(CallContext ctx) { + public CompletableFuture testMethod0(CallContext ctx) { var params = ctx.getParams(); var results = ctx.getResults(); results.setResult0(params.getParam0()); + ctx.releaseParams(); return CompletableFuture.completedFuture(null); } - public CompletableFuture testMethod1(CallContext ctx) { + public CompletableFuture testMethod1(CallContext ctx) { var params = ctx.getParams(); var results = ctx.getResults(); var res0 = results.getResult0(); @@ -39,11 +42,29 @@ public CompletableFuture testMethod1(CallContext { + try { + network.onDisconnect().get(); + } catch (InterruptedException e) { + e.printStackTrace(); + } catch (ExecutionException e) { + e.printStackTrace(); + } + }, "Server"); + + thread.start(); + return thread; + } + AsynchronousServerSocketChannel serverSocket; AsynchronousSocketChannel clientSocket; TwoPartyClient client; + TwoPartyVatNetwork serverNetwork; + Thread serverThread; @Before public void setUp() throws Exception { @@ -52,14 +73,19 @@ public void setUp() throws Exception { this.clientSocket = AsynchronousSocketChannel.open(); this.clientSocket.connect(this.serverSocket.getLocalAddress()).get(); - this.client = new TwoPartyClient(clientSocket); + + var socket = serverSocket.accept().get(); + this.serverNetwork = new TwoPartyVatNetwork(socket, RpcTwoPartyProtocol.Side.SERVER); + //this.serverNetwork.dumper.addSchema(Demo.TestCap1); + this.serverThread = runServer(this.serverNetwork); } @After public void tearDown() throws Exception { this.clientSocket.close(); this.serverSocket.close(); + this.serverThread.join(); this.client = null; } @@ -73,99 +99,97 @@ public void testNullCap() { } @Test - public void testBasic() throws ExecutionException, InterruptedException { - var capServer = new TestCap0Impl(); - var server = new TwoPartyServer(new Demo.TestCap0.Client(capServer)); - server.listen(serverSocket); - var demoClient = new Demo.TestCap0.Client(this.client.bootstrap()); - var request = demoClient.testMethod0Request(); + public void testBasic() throws ExecutionException, InterruptedException, IOException { + var server = new TwoPartyRpcSystem(this.serverNetwork, new TestCap0Impl()); + + var demo = new Demo.TestCap0.Client(this.client.bootstrap()); + var request = demo.testMethod0Request(); var params = request.getParams(); params.setParam0(4321); var response = request.send(); - while (!response.isDone()) { - CompletableFuture.anyOf(response, this.client.runOnce(), server.runOnce()).join(); - } + response.get(); Assert.assertTrue(response.isDone()); var results = response.get(); Assert.assertEquals(params.getParam0(), results.getResult0()); + this.clientSocket.shutdownOutput(); + serverThread.join(); } @Test - public void testReturnCap() throws ExecutionException, InterruptedException { - // send a capability back from the server to the client - var capServer = new TestCap0Impl(); - var server = new TwoPartyServer(new Demo.TestCap0.Client(capServer)); - server.listen(serverSocket); - var demoClient = new Demo.TestCap0.Client(this.client.bootstrap()); - var request = demoClient.testMethod1Request(); - var params = request.getParams(); - var response = request.send(); - while (!response.isDone()) { - CompletableFuture.anyOf(response, this.client.runOnce(), server.runOnce()).join(); - } - Assert.assertTrue(response.isDone()); - - var results = response.get(); - var cap0 = results.getResult0(); - Assert.assertFalse(cap0.isNull()); - var cap1 = results.getResult1(); - Assert.assertFalse(cap1.isNull()); - var cap2 = results.getResult2(); - Assert.assertFalse(cap2.isNull()); - } - - @Test - public void testLocalServer() throws ExecutionException, InterruptedException { - var demo = new TestCap0Impl(); - var client = new Demo.TestCap0.Client(demo); - var request = client.testMethod0Request(); + public void testBasicCleanup() throws ExecutionException, InterruptedException, TimeoutException { + var server = new TwoPartyRpcSystem(this.serverNetwork, new TestCap0Impl()); + var demo = new Demo.TestCap0.Client(this.client.bootstrap()); + var request = demo.testMethod0Request(); var params = request.getParams(); params.setParam0(4321); var response = request.send(); + response.get(); + Assert.assertTrue(response.isDone()); var results = response.get(); Assert.assertEquals(params.getParam0(), results.getResult0()); + + demo = null; } @Test - public void testGenericServer() throws ExecutionException, InterruptedException { - var demo = new TestCap0Impl(); - var client = new Demo.TestCap0.Client(demo); - var request = client.testMethod0Request(); - var params = request.getParams(); - var response = request.send(); - var results = response.get(); - Assert.assertEquals(params.getParam0(), results.getResult0()); + public void testShutdown() throws InterruptedException, IOException { + var server = new TwoPartyRpcSystem(this.serverNetwork, new TestCap0Impl()); + var demo = new Demo.TestCap0.Client(this.client.bootstrap()); + this.clientSocket.shutdownOutput(); + serverThread.join(); } @Test - public void testLocalTwoStagePipeline() { - - var server0 = new Demo.Iface0.Server() { - boolean method0called = false; - - @Override - protected CompletableFuture method0(CallContext ctx) { - method0called = true; + public void testCallThrows() throws ExecutionException, InterruptedException { + var impl = new Demo.TestCap0.Server() { + public CompletableFuture testMethod0(CallContext ctx) { + return CompletableFuture.failedFuture(new RuntimeException("Call to testMethod0 failed")); + } + public CompletableFuture testMethod1(CallContext ctx) { return CompletableFuture.completedFuture(null); } }; - var server1 = new Demo.Iface1.Server() { - @Override - protected CompletableFuture method1(CallContext ctx) { - ctx.getResults().setResult0(new Demo.Iface0.Client(server0)); - return CompletableFuture.completedFuture(null); + var rpcSystem = new TwoPartyRpcSystem(this.serverNetwork, impl); + + var demoClient = new Demo.TestCap0.Client(this.client.bootstrap()); + { + var request = demoClient.testMethod0Request(); + var response = request.send(); + while (!response.isDone()) { + CompletableFuture.anyOf(response).exceptionally(exc -> { return null; }); } - }; + Assert.assertTrue(response.isCompletedExceptionally()); + } + + // test that the system is still valid + { + var request = demoClient.testMethod1Request(); + var response = request.send(); + response.get(); + Assert.assertFalse(response.isCompletedExceptionally()); + } + } + + @Test + public void testReturnCap() throws ExecutionException, InterruptedException { + // send a capability back from the server to the client + var capServer = new TestCap0Impl(); + var rpcSystem = new TwoPartyRpcSystem(this.serverNetwork, capServer); + var demoClient = new Demo.TestCap0.Client(this.client.bootstrap()); + var request = demoClient.testMethod1Request(); + var response = request.send(); + response.get(); + Assert.assertTrue(response.isDone()); - var iface1Client = new Demo.Iface1.Client(server1); - var request1 = iface1Client.method1Request(); - var response = request1.send(); - var iface0 = response.getResult0(); - var request0 = iface0.method0Request(); - var response0 = request0.send(); - response0.join(); - Assert.assertTrue(!response0.isCompletedExceptionally()); - Assert.assertTrue(server0.method0called); + var results = response.get(); + var cap0 = results.getResult0(); + Assert.assertFalse(cap0.isNull()); + var cap1 = results.getResult1(); + Assert.assertFalse(cap1.isNull()); + var cap2 = results.getResult2(); + Assert.assertFalse(cap2.isNull()); } + + } \ No newline at end of file diff --git a/runtime/src/test/java/org/capnproto/demo/Demo.java b/runtime/src/test/java/org/capnproto/demo/Demo.java index c77cf167..492b8827 100644 --- a/runtime/src/test/java/org/capnproto/demo/Demo.java +++ b/runtime/src/test/java/org/capnproto/demo/Demo.java @@ -411,13 +411,13 @@ protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, } } - protected java.util.concurrent.CompletableFuture method0(org.capnproto.CallContext context) { + protected java.util.concurrent.CompletableFuture method0(org.capnproto.CallContext context) { return org.capnproto.Capability.Server.internalUnimplemented( "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method0", 0xac6d126c2fac16ebL, (short)0); } - protected java.util.concurrent.CompletableFuture method1(org.capnproto.StreamingCallContext context) { + protected java.util.concurrent.CompletableFuture method1(org.capnproto.StreamingCallContext context) { return org.capnproto.Capability.Server.internalUnimplemented( "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method1", 0xac6d126c2fac16ebL, (short)1); @@ -715,13 +715,13 @@ protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, } } - protected java.util.concurrent.CompletableFuture testMethod0(org.capnproto.CallContext context) { + protected java.util.concurrent.CompletableFuture testMethod0(org.capnproto.CallContext context) { return org.capnproto.Capability.Server.internalUnimplemented( "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod0", 0x9c0c5ee4bb0cc725L, (short)0); } - protected java.util.concurrent.CompletableFuture testMethod1(org.capnproto.CallContext context) { + protected java.util.concurrent.CompletableFuture testMethod1(org.capnproto.CallContext context) { return org.capnproto.Capability.Server.internalUnimplemented( "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod1", 0x9c0c5ee4bb0cc725L, (short)1); @@ -829,13 +829,13 @@ protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, } } - protected java.util.concurrent.CompletableFuture method0(org.capnproto.CallContext context) { + protected java.util.concurrent.CompletableFuture method0(org.capnproto.CallContext context) { return org.capnproto.Capability.Server.internalUnimplemented( "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method0", 0xd52dcf38c9f6f7c0L, (short)0); } - protected java.util.concurrent.CompletableFuture method1(org.capnproto.CallContext context) { + protected java.util.concurrent.CompletableFuture method1(org.capnproto.CallContext context) { return org.capnproto.Capability.Server.internalUnimplemented( "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method1", 0xd52dcf38c9f6f7c0L, (short)1); From 85a3565dc3dbd54d654cc9c304d69029a1cc7522 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 21 Oct 2020 21:18:52 +0100 Subject: [PATCH 053/246] add fds accessor --- runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java b/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java index be744dc9..86b7a1e7 100644 --- a/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java +++ b/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java @@ -9,6 +9,10 @@ public interface OutgoingRpcMessage { default void setFds(List fds) { } + default List getFds() { + return List.of(); + } + void send(); int sizeInWords(); From 215f485883121653659b73bd5ef92f71e658de01 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 21 Oct 2020 21:19:30 +0100 Subject: [PATCH 054/246] add network accessor --- runtime/src/main/java/org/capnproto/TwoPartyClient.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/src/main/java/org/capnproto/TwoPartyClient.java b/runtime/src/main/java/org/capnproto/TwoPartyClient.java index c0884998..d5d55b53 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyClient.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyClient.java @@ -32,6 +32,10 @@ public Capability.Client bootstrap() { return rpcSystem.bootstrap(vatId.asReader()); } + public TwoPartyVatNetwork getNetwork() { + return this.network; + } + public CompletableFuture onDisconnect() { return this.network.onDisconnect(); } From 7b939d7c0b056c35920688354dfac5d4311d4ec1 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 21 Oct 2020 21:20:58 +0100 Subject: [PATCH 055/246] add moar size hints --- .../src/main/java/org/capnproto/RpcState.java | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index ff9844e4..a125c936 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -15,6 +15,10 @@ private static int messageSizeHint() { return 1 + RpcProtocol.Message.factory.structSize().total(); } + private static int exceptionSizeHint(Throwable exc) { + return RpcProtocol.Exception.factory.structSize().total() + exc.getMessage().length(); + } + private static int MESSAGE_TARGET_SIZE_HINT = RpcProtocol.MessageTarget.factory.structSize().total() + RpcProtocol.PromisedAnswer.factory.structSize().total() @@ -59,12 +63,12 @@ void dispose() { } } - private final class QuestionRef extends WeakReference { + private static final class QuestionRef extends WeakReference { private final QuestionDisposer disposer; - QuestionRef(Question question) { - super(question, questionRefQueue); + QuestionRef(Question question, ReferenceQueue queue) { + super(question, queue); this.disposer = question.disposer; } @@ -84,10 +88,14 @@ private final class Question { this.disposer = new QuestionDisposer(id); } - public int getId() { + int getId() { return this.disposer.id; } + boolean isAwaitingReturn() { + return this.disposer.isAwaitingReturn; + } + public void setAwaitingReturn(boolean value) { this.disposer.isAwaitingReturn = value; } @@ -100,11 +108,7 @@ void answer(RpcResponse response) { this.response.complete(response); } - public boolean isAwaitingReturn() { - return this.disposer.isAwaitingReturn; - } - - public void setSkipFinish(boolean value) { + void setSkipFinish(boolean value) { this.disposer.skipFinish = value; } } @@ -133,7 +137,7 @@ public Question erase(int id) { public Question next() { int id = freeIds.isEmpty() ? max++ : freeIds.remove(); var value = new Question(id); - var prev = slots.put(id, new QuestionRef(value)); + var prev = slots.put(id, new QuestionRef(value, questionRefs)); assert prev == null; return value; } @@ -173,7 +177,7 @@ static final class Export { final int exportId; int refcount; ClientHook clientHook; - CompletionStage resolveOp; + CompletionStage resolveOp; Export(int exportId) { this.exportId = exportId; @@ -204,8 +208,9 @@ public void dispose() { } // Send a message releasing our remote references. - if (remoteRefCount > 0 && !isDisconnected()) { - var message = connection.newOutgoingMessage(1024); + if (this.remoteRefCount > 0 && isConnected()) { + int sizeHint = messageSizeHint() + RpcProtocol.Release.factory.structSize().total(); + var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initRelease(); builder.setId(importId); builder.setReferenceCount(remoteRefCount); @@ -238,7 +243,8 @@ QuestionRef newExportable(int id) { } }; */ - private final QuestionExportTable questions = new QuestionExportTable(); /*{ + private final QuestionExportTable questions = new QuestionExportTable(); + /*{ @Override Question newExportable(int id) { return new Question(id); @@ -272,9 +278,9 @@ Embargo newExportable(int id) { private final CompletableFuture onDisconnect; private Throwable disconnected = null; private CompletableFuture messageReady = CompletableFuture.completedFuture(null); - private final String name; private final CompletableFuture messageLoop; - private final ReferenceQueue questionRefQueue = new ReferenceQueue<>(); + private final ReferenceQueue questionRefs = new ReferenceQueue<>(); + private final ReferenceQueue importRefs = new ReferenceQueue<>(); RpcState( Capability.Client bootstrapInterface, VatNetwork.Connection connection, @@ -283,13 +289,6 @@ Embargo newExportable(int id) { this.connection = connection; this.onDisconnect = onDisconnect; this.messageLoop = this.doMessageLoop(); - - if (this.connection instanceof TwoPartyVatNetwork) { - this.name = ((TwoPartyVatNetwork)this.connection).getSide().toString(); - } - else { - this.name = this.toString(); - } } public CompletableFuture getMessageLoop() { @@ -311,7 +310,7 @@ CompletableFuture disconnect(Throwable exc) { List pipelinesToRelease = new ArrayList<>(); List clientsToRelease = new ArrayList<>(); List> tailCallsToRelease = new ArrayList<>(); - List> resolveOpsToRelease = new ArrayList<>(); + List> resolveOpsToRelease = new ArrayList<>(); for (var answer : answers) { if (answer.pipeline != null) { @@ -350,12 +349,13 @@ CompletableFuture disconnect(Throwable exc) { } try { - var message = this.connection.newOutgoingMessage(1024); - RpcException.fromException(exc, message.getBody().getAs(RpcProtocol.Message.factory).initAbort()); + int sizeHint = messageSizeHint() + exceptionSizeHint(exc); + var message = this.connection.newOutgoingMessage(sizeHint); + var abort = message.getBody().getAs(RpcProtocol.Message.factory).initAbort(); + RpcException.fromException(exc, abort); message.send(); } - catch (Exception abortFailed) { - // no-op + catch (Throwable abortFailed) { } var onShutdown = this.connection.shutdown().handle((x, ioExc) -> { @@ -738,7 +738,7 @@ void handleFinish(RpcProtocol.Finish.Reader finish) { this.releaseExports(exportsToRelease); } - void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { + private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { var imp = this.imports.find(resolve.getPromiseId()); if (imp == null) { return; @@ -769,7 +769,7 @@ private void handleRelease(RpcProtocol.Release.Reader release) { this.releaseExport(release.getId(), release.getReferenceCount()); } - void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { + private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { var ctx = disembargo.getContext(); switch (ctx.which()) { case SENDER_LOOPBACK: @@ -904,7 +904,7 @@ private int writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builder de return export.exportId; } - CompletionStage resolveExportedPromise(int exportId, CompletionStage promise) { + CompletionStage resolveExportedPromise(int exportId, CompletionStage promise) { return promise.thenCompose(resolution -> { if (isDisconnected()) { return CompletableFuture.completedFuture(null); @@ -949,7 +949,10 @@ CompletionStage resolveExportedPromise(int exportId, CompletionStage importRefs = new ReferenceQueue<>(); - private class ImportRef extends WeakReference { final int importId; @@ -1709,7 +1710,7 @@ private void cleanupImports() { private void cleanupQuestions() { while (true) { - var ref = (QuestionRef)this.questionRefQueue.poll(); + var ref = (QuestionRef)this.questionRefs.poll(); if (ref == null) { break; } From c01228c31cf2a45de0f95c9397f5a31434c1e906 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 21 Oct 2020 21:21:44 +0100 Subject: [PATCH 056/246] add tap for dumping rpc messages --- .../main/java/org/capnproto/RpcDumper.java | 101 +++++++++++++----- .../org/capnproto/TwoPartyVatNetwork.java | 44 +++++--- .../test/java/org/capnproto/TwoPartyTest.java | 22 ++++ 3 files changed, 121 insertions(+), 46 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcDumper.java b/runtime/src/main/java/org/capnproto/RpcDumper.java index 0a2f902c..d6e8a767 100644 --- a/runtime/src/main/java/org/capnproto/RpcDumper.java +++ b/runtime/src/main/java/org/capnproto/RpcDumper.java @@ -37,41 +37,67 @@ private Long getReturnType(RpcTwoPartyProtocol.Side side, int schemaId) { return -1L; } + private String dumpCap(RpcProtocol.CapDescriptor.Reader cap) { + return cap.which().toString(); + } + private String dumpCaps(StructList.Reader capTable) { + switch (capTable.size()) { + case 0: + return ""; + case 1: + return dumpCap(capTable.get(0)); + default: + { + var text = dumpCap(capTable.get(0)); + for (int ii = 1; ii< capTable.size(); ++ii) { + text += ", " + dumpCap(capTable.get(ii)); + } + return text; + } + } + } + String dump(RpcProtocol.Message.Reader message, RpcTwoPartyProtocol.Side sender) { switch (message.which()) { case CALL: { var call = message.getCall(); var iface = call.getInterfaceId(); - var schema = this.schemas.get(iface); - if (schema == null || !schema.isInterface()) { - break; - } - var interfaceSchema = schema.getInterface(); + var interfaceName = String.format("0x%x", iface); + var methodName = String.format("method#%d", call.getMethodId()); + var payload = call.getParams(); + var params = payload.getContent(); + var sendResultsTo = call.getSendResultsTo(); - var methods = interfaceSchema.getMethods(); - if (call.getMethodId() >= methods.size()) { - break; - } + var schema = this.schemas.get(iface); + if (schema != null) { + interfaceName = schema.getDisplayName().toString(); + if (schema.isInterface()) { - var method = methods.get(call.getMethodId()); - var interfaceName = schema.getDisplayName().toString(); - var paramType = method.getParamStructType(); - var resultType = method.getResultStructType(); + interfaceName = schema.getDisplayName().toString(); + var interfaceSchema = schema.getInterface(); - if (call.getSendResultsTo().isCaller()) { - var questionId = call.getQuestionId(); - setReturnType(sender, call.getQuestionId(), resultType); - } + var methods = interfaceSchema.getMethods(); + if (call.getMethodId() < methods.size()) { + var method = methods.get(call.getMethodId()); + methodName = method.getName().toString(); + var paramType = method.getParamStructType(); + var resultType = method.getResultStructType(); - var payload = call.getParams(); - var params = payload.getContent(); - var sendResultsTo = call.getSendResultsTo(); + if (call.getSendResultsTo().isCaller()) { + var questionId = call.getQuestionId(); + setReturnType(sender, call.getQuestionId(), resultType); + } + } + } + } + return sender.name() + "(" + call.getQuestionId() + "): call " + call.getTarget() + " <- " + interfaceName + "." + - method.getName().toString() + " " + params + " caps:[" + - payload.getCapTable() + "]" + (sendResultsTo.isCaller() ? "" : (" sendResultsTo:" + sendResultsTo)); + methodName + " " + params.getClass().getName() + " caps:[" + + dumpCaps(payload.getCapTable()) + "]" + + (sendResultsTo.isCaller() ? "" : (" sendResultsTo:" + sendResultsTo)); } case RETURN: { @@ -81,12 +107,22 @@ String dump(RpcProtocol.Message.Reader message, RpcTwoPartyProtocol.Side sender) ? RpcTwoPartyProtocol.Side.SERVER : RpcTwoPartyProtocol.Side.CLIENT, ret.getAnswerId()); - if (ret.which() != RpcProtocol.Return.Which.RESULTS) { - break; + switch (ret.which()) { + case RESULTS: { + var payload = ret.getResults(); + return sender.name() + "(" + ret.getAnswerId() + "): return " + payload + + " caps:[" + dumpCaps(payload.getCapTable()) + "]"; + } + case EXCEPTION: { + var exc = ret.getException(); + return sender.name() + "(" + ret.getAnswerId() + "): exception " + + exc.getType().toString() + + " " + exc.getReason(); + } + default: { + return sender.name() + "(" + ret.getAnswerId() + "): " + ret.which().name(); + } } - var payload = ret.getResults(); - return sender.name() + "(" + ret.getAnswerId() + "): return " + payload + - " caps:[" + payload.getCapTable() + "]"; } case BOOTSTRAP: { @@ -95,9 +131,16 @@ String dump(RpcProtocol.Message.Reader message, RpcTwoPartyProtocol.Side sender) return sender.name() + "(" + restore.getQuestionId() + "): bootstrap " + restore.getDeprecatedObjectId(); } + + case ABORT: { + var abort = message.getAbort(); + return sender.name() + ": abort " + + abort.getType().toString() + + " \"" + abort.getReason().toString() + "\""; + } + default: - break; + return sender.name() + ": " + message.which().name(); } - return ""; } } diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java index c1e60f17..f5be4618 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -8,14 +8,18 @@ public class TwoPartyVatNetwork implements VatNetwork, VatNetwork.Connection { + public interface MessageTap { + void outgoing(OutgoingRpcMessage message, RpcTwoPartyProtocol.Side side); + void incoming(IncomingRpcMessage message, RpcTwoPartyProtocol.Side side); + } + private CompletableFuture previousWrite = CompletableFuture.completedFuture(null); private final CompletableFuture peerDisconnected = new CompletableFuture<>(); private final AsynchronousSocketChannel channel; private final RpcTwoPartyProtocol.Side side; private final MessageBuilder peerVatId = new MessageBuilder(4); private boolean accepted; - - public final RpcDumper dumper = new RpcDumper(); + private MessageTap tap; public TwoPartyVatNetwork(AsynchronousSocketChannel channel, RpcTwoPartyProtocol.Side side) { this.channel = channel; @@ -34,6 +38,10 @@ public RpcTwoPartyProtocol.VatId.Reader getPeerVatId() { return peerVatId.getRoot(RpcTwoPartyProtocol.VatId.factory).asReader(); } + public void setTap(MessageTap tap) { + this.tap = tap; + } + public VatNetwork.Connection asConnection() { return this; } @@ -60,18 +68,22 @@ public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { @Override public CompletableFuture receiveIncomingMessage() { - return Serialize.readAsync(channel).whenComplete((x, exc) -> { - if (exc != null) { - this.peerDisconnected.complete(null); - } - }).thenApply(reader -> { - var msg = new IncomingMessage(reader); - var dump = this.dumper.dump(msg.getBody().getAs(RpcProtocol.Message.factory), getSide()); - if (!dump.isEmpty()) { - System.out.println(dump); - } - return msg; - }); + return Serialize.readAsync(channel) + .thenApply(reader -> (IncomingRpcMessage) new IncomingMessage(reader)) + .whenComplete((msg, exc) -> { + if (exc != null) { + this.peerDisconnected.complete(null); + } + }) + .whenComplete((msg, exc) -> { + if (this.tap != null && msg != null) { + this.tap.incoming( + msg, + this.getSide() == RpcTwoPartyProtocol.Side.CLIENT + ? RpcTwoPartyProtocol.Side.SERVER + : RpcTwoPartyProtocol.Side.CLIENT); + } + }); } @Override @@ -121,9 +133,7 @@ public void setFds(List fds) { @Override public void send() { - previousWrite = previousWrite.thenCompose( - x -> Serialize.writeAsync(channel, message) - ); + previousWrite = previousWrite.thenCompose(x -> Serialize.writeAsync(channel, message)); } @Override diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index 2dd81f86..8cd52a69 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -42,6 +42,26 @@ public CompletableFuture testMethod1(CallContext 0) { + System.out.println(text); + } + } + + @Override + public void incoming(IncomingRpcMessage message, RpcTwoPartyProtocol.Side side) { + var text = this.dumper.dump(message.getBody().getAs(RpcProtocol.Message.factory), side); + if (text.length() > 0) { + System.out.println(text); + } + } +} public class TwoPartyTest { @@ -74,9 +94,11 @@ public void setUp() throws Exception { this.clientSocket = AsynchronousSocketChannel.open(); this.clientSocket.connect(this.serverSocket.getLocalAddress()).get(); this.client = new TwoPartyClient(clientSocket); + this.client.getNetwork().setTap(new Tap()); var socket = serverSocket.accept().get(); this.serverNetwork = new TwoPartyVatNetwork(socket, RpcTwoPartyProtocol.Side.SERVER); + this.serverNetwork.setTap(new Tap()); //this.serverNetwork.dumper.addSchema(Demo.TestCap1); this.serverThread = runServer(this.serverNetwork); } From 6d082a71b51aa5b5fdab6dd592eed91f22760165 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 21 Oct 2020 21:29:41 +0100 Subject: [PATCH 057/246] use getHook() accessor --- runtime/src/main/java/org/capnproto/CallContext.java | 8 ++++---- runtime/src/main/java/org/capnproto/Capability.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java index a4805997..94292504 100644 --- a/runtime/src/main/java/org/capnproto/CallContext.java +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -6,18 +6,18 @@ public class CallContext { private final FromPointerReader params; private final FromPointerBuilder results; - final CallContextHook hook; + private final CallContextHook hook; public CallContext(FromPointerReader params, FromPointerBuilder results, CallContextHook hook) { - this.hook = hook; this.params = params; this.results = results; + this.hook = hook; } public final Params getParams() { - return hook.getParams().getAs(params); + return this.hook.getParams().getAs(params); } public final void releaseParams() { @@ -33,7 +33,7 @@ public final Results initResults() { } public final CompletableFuture tailCall(Request tailRequest) { - return hook.tailCall(tailRequest.getHook()); + return this.hook.tailCall(tailRequest.getHook()); } public final void allowCancellation() { diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 8dfed406..af298132 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -199,13 +199,13 @@ protected static CallContext internalGetTyped FromPointerReader paramsFactory, FromPointerBuilder resultsFactory, CallContext typeless) { - return new CallContext<>(paramsFactory, resultsFactory, typeless.hook); + return new CallContext<>(paramsFactory, resultsFactory, typeless.getHook()); } protected static StreamingCallContext internalGetTypedStreamingContext( FromPointerReader paramsFactory, CallContext typeless) { - return new StreamingCallContext<>(paramsFactory, typeless.hook); + return new StreamingCallContext<>(paramsFactory, typeless.getHook()); } protected abstract DispatchCallResult dispatchCall( From 05dc84b675d7756e3447d92d945a416d6c0797c0 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 21 Oct 2020 21:37:22 +0100 Subject: [PATCH 058/246] move more CompFutures to void --- runtime/src/main/java/org/capnproto/CallContext.java | 2 +- runtime/src/main/java/org/capnproto/CallContextHook.java | 2 +- runtime/src/main/java/org/capnproto/PipelineHook.java | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java index 94292504..55b58cdc 100644 --- a/runtime/src/main/java/org/capnproto/CallContext.java +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -32,7 +32,7 @@ public final Results initResults() { return this.hook.getResults().initAs(results); } - public final CompletableFuture tailCall(Request tailRequest) { + public final CompletableFuture tailCall(Request tailRequest) { return this.hook.tailCall(tailRequest.getHook()); } diff --git a/runtime/src/main/java/org/capnproto/CallContextHook.java b/runtime/src/main/java/org/capnproto/CallContextHook.java index 08f85c93..461db7cb 100644 --- a/runtime/src/main/java/org/capnproto/CallContextHook.java +++ b/runtime/src/main/java/org/capnproto/CallContextHook.java @@ -13,7 +13,7 @@ default AnyPointer.Builder getResults() { AnyPointer.Builder getResults(int sizeHint); - CompletableFuture tailCall(RequestHook request); + CompletableFuture tailCall(RequestHook request); void allowCancellation(); diff --git a/runtime/src/main/java/org/capnproto/PipelineHook.java b/runtime/src/main/java/org/capnproto/PipelineHook.java index 8d12f227..50c1ac30 100644 --- a/runtime/src/main/java/org/capnproto/PipelineHook.java +++ b/runtime/src/main/java/org/capnproto/PipelineHook.java @@ -1,10 +1,14 @@ package org.capnproto; public interface PipelineHook { - ClientHook getPipelinedCap(PipelineOp[] ops); static PipelineHook newBrokenPipeline(Throwable exc) { - return ops -> Capability.newBrokenCap(exc); + return new PipelineHook() { + @Override + public ClientHook getPipelinedCap(PipelineOp[] ops) { + return Capability.newBrokenCap(exc); + } + }; } } From 83a4d4dc9e5117ddbd1916eb5ab3c1b441aac14f Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 21 Oct 2020 22:27:12 +0100 Subject: [PATCH 059/246] only tap incoming --- .../src/main/java/org/capnproto/TwoPartyVatNetwork.java | 1 - runtime/src/test/java/org/capnproto/TwoPartyTest.java | 8 -------- 2 files changed, 9 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java index f5be4618..b823afb2 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -9,7 +9,6 @@ public class TwoPartyVatNetwork VatNetwork.Connection { public interface MessageTap { - void outgoing(OutgoingRpcMessage message, RpcTwoPartyProtocol.Side side); void incoming(IncomingRpcMessage message, RpcTwoPartyProtocol.Side side); } diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index 8cd52a69..c57250ca 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -46,14 +46,6 @@ class Tap implements TwoPartyVatNetwork.MessageTap { final RpcDumper dumper = new RpcDumper(); - @Override - public void outgoing(OutgoingRpcMessage message, RpcTwoPartyProtocol.Side side) { - var text = this.dumper.dump(message.getBody().asReader().getAs(RpcProtocol.Message.factory), side); - if (text.length() > 0) { - System.out.println(text); - } - } - @Override public void incoming(IncomingRpcMessage message, RpcTwoPartyProtocol.Side side) { var text = this.dumper.dump(message.getBody().getAs(RpcProtocol.Message.factory), side); From f28b7de49426ac28caffa80a4bb37132a2cc5737 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 21 Oct 2020 23:03:28 +0100 Subject: [PATCH 060/246] more message building size hints --- .../src/main/java/org/capnproto/RpcState.java | 25 ++++++++++++++----- .../org/capnproto/TwoPartyVatNetwork.java | 3 ++- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index a125c936..66ff27ac 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -403,7 +403,9 @@ private void evalLast(Callable func) { ClientHook restore() { var question = questions.next(); question.setAwaitingReturn(true); - var message = connection.newOutgoingMessage(64); + int sizeHint = messageSizeHint() + + RpcProtocol.Bootstrap.factory.structSize().total(); + var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initBootstrap(); builder.setQuestionId(question.getId()); message.send(); @@ -465,7 +467,7 @@ synchronized void handleMessage(IncomingRpcMessage message) throws RpcException default: if (!isDisconnected()) { // boomin' back atcha - var msg = connection.newOutgoingMessage(1024); + var msg = connection.newOutgoingMessage(BuilderArena.SUGGESTED_FIRST_SEGMENT_WORDS); msg.getBody().initAs(RpcProtocol.Message.factory).setUnimplemented(reader); msg.send(); } @@ -524,7 +526,10 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo answer.active = true; var capTable = new BuilderCapabilityTable(); - var response = connection.newOutgoingMessage(1024); + int sizeHint = messageSizeHint() + + RpcProtocol.Return.factory.structSize().total() + + RpcProtocol.Payload.factory.structSize().total(); + var response = connection.newOutgoingMessage(sizeHint); var ret = response.getBody().getAs(RpcProtocol.Message.factory).initReturn(); ret.setAnswerId(answerId); @@ -799,7 +804,10 @@ private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { return null; } - var message = connection.newOutgoingMessage(1024); + int sizeHint = messageSizeHint() + + RpcProtocol.Disembargo.factory.structSize().total() + + MESSAGE_TARGET_SIZE_HINT; + var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initDisembargo(); var redirect = rpcTarget.writeTarget(builder.initTarget()); // Disembargoes should only be sent to capabilities that were previously the subject of @@ -937,7 +945,10 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS } // send a Resolve message - var message = connection.newOutgoingMessage(1024); + int sizeHint = messageSizeHint() + + RpcProtocol.Resolve.factory.structSize().total() + + CAP_DESCRIPTOR_SIZE_HINT; + var message = connection.newOutgoingMessage(sizeHint); var resolve = message.getBody().initAs(RpcProtocol.Message.factory).initResolve(); resolve.setPromiseId(exportId); var fds = List.of(); @@ -1788,7 +1799,9 @@ private ClientHook resolve(ClientHook replacement) { // TODO Flow control if (resolutionType == ResolutionType.REFLECTED && receivedCall && !isDisconnected()) { - var message = connection.newOutgoingMessage(1024); + int sizeHint = messageSizeHint() + + RpcProtocol.Disembargo.factory.structSize().total(); + var message = connection.newOutgoingMessage(sizeHint); var disembargo = message.getBody().initAs(RpcProtocol.Message.factory).initDisembargo(); var redirect = RpcState.this.writeTarget(cap, disembargo.initTarget()); assert redirect == null; diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java index b823afb2..9e5d0afa 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -12,6 +12,7 @@ public interface MessageTap { void incoming(IncomingRpcMessage message, RpcTwoPartyProtocol.Side side); } + private static BuilderArena.AllocationStrategy allocationStrategy = BuilderArena.SUGGESTED_ALLOCATION_STRATEGY; private CompletableFuture previousWrite = CompletableFuture.completedFuture(null); private final CompletableFuture peerDisconnected = new CompletableFuture<>(); private final AsynchronousSocketChannel channel; @@ -117,7 +118,7 @@ final class OutgoingMessage implements OutgoingRpcMessage { List fds = List.of(); OutgoingMessage(int firstSegmentWordSize) { - this.message = new MessageBuilder(firstSegmentWordSize); + this.message = new MessageBuilder(firstSegmentWordSize, allocationStrategy); } @Override From 633d3ff8cc89a177309e042e6d02938b0893a549 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 22 Oct 2020 13:26:14 +0100 Subject: [PATCH 061/246] remove redundent AnyPointer.getAsCap --- runtime/src/main/java/org/capnproto/AnyPointer.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 3dfc6cdd..5f8f398d 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -132,12 +132,6 @@ public final void setAs(SetPointerBuilder factory, U reader) { factory.setPointerBuilder(this.segment, this.capTable, this.pointer, reader); } - /* - final Capability.Client getAsCap() { - return new Capability.Client( - WireHelpers.readCapabilityPointer(this.segment, capTable, this.pointer, 0)); - } -*/ final void setAsCap(Capability.Client cap) { WireHelpers.setCapabilityPointer(this.segment, capTable, this.pointer, cap.hook); } From e21ba577b5ffb1fe3b20b36220d2e2159b76d139 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 22 Oct 2020 13:26:48 +0100 Subject: [PATCH 062/246] accept default outgoing message size --- runtime/src/main/java/org/capnproto/VatNetwork.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/src/main/java/org/capnproto/VatNetwork.java b/runtime/src/main/java/org/capnproto/VatNetwork.java index c5cf2fd3..3f63ad63 100644 --- a/runtime/src/main/java/org/capnproto/VatNetwork.java +++ b/runtime/src/main/java/org/capnproto/VatNetwork.java @@ -5,6 +5,9 @@ public interface VatNetwork { interface Connection { + default OutgoingRpcMessage newOutgoingMessage() { + return newOutgoingMessage(0); + } OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize); CompletableFuture receiveIncomingMessage(); CompletableFuture onDisconnect(); From 3161e246ae0c2b00b63b7dfddd3b40c0df64de28 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 22 Oct 2020 13:27:36 +0100 Subject: [PATCH 063/246] tidy up TwoPartyVatNetwork --- .../org/capnproto/TwoPartyVatNetwork.java | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 9e5d0afa..d9f67d84 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -12,7 +12,6 @@ public interface MessageTap { void incoming(IncomingRpcMessage message, RpcTwoPartyProtocol.Side side); } - private static BuilderArena.AllocationStrategy allocationStrategy = BuilderArena.SUGGESTED_ALLOCATION_STRATEGY; private CompletableFuture previousWrite = CompletableFuture.completedFuture(null); private final CompletableFuture peerDisconnected = new CompletableFuture<>(); private final AsynchronousSocketChannel channel; @@ -68,22 +67,30 @@ public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { @Override public CompletableFuture receiveIncomingMessage() { - return Serialize.readAsync(channel) + var message = Serialize.readAsync(channel) .thenApply(reader -> (IncomingRpcMessage) new IncomingMessage(reader)) .whenComplete((msg, exc) -> { if (exc != null) { this.peerDisconnected.complete(null); } - }) - .whenComplete((msg, exc) -> { - if (this.tap != null && msg != null) { - this.tap.incoming( - msg, - this.getSide() == RpcTwoPartyProtocol.Side.CLIENT - ? RpcTwoPartyProtocol.Side.SERVER - : RpcTwoPartyProtocol.Side.CLIENT); - } }); + + // send to message tap + if (this.tap != null) { + message = message.whenComplete((msg, exc) -> { + if (this.tap == null || msg == null) { + return; + } + + var side = this.getSide() == RpcTwoPartyProtocol.Side.CLIENT + ? RpcTwoPartyProtocol.Side.SERVER + : RpcTwoPartyProtocol.Side.CLIENT; + + this.tap.incoming(msg, side); + }); + } + + return message; } @Override @@ -114,11 +121,13 @@ public CompletableFuture baseAccept() { final class OutgoingMessage implements OutgoingRpcMessage { - final MessageBuilder message; - List fds = List.of(); + private final MessageBuilder message; + private List fds = List.of(); OutgoingMessage(int firstSegmentWordSize) { - this.message = new MessageBuilder(firstSegmentWordSize, allocationStrategy); + this.message = new MessageBuilder(firstSegmentWordSize == 0 + ? BuilderArena.SUGGESTED_FIRST_SEGMENT_WORDS + : firstSegmentWordSize); } @Override @@ -148,8 +157,8 @@ public int sizeInWords() { final class IncomingMessage implements IncomingRpcMessage { - final MessageReader message; - final List fds; + private final MessageReader message; + private final List fds; IncomingMessage(MessageReader message) { this(message, List.of()); @@ -162,12 +171,12 @@ final class IncomingMessage implements IncomingRpcMessage { @Override public AnyPointer.Reader getBody() { - return message.getRoot(AnyPointer.factory); + return this.message.getRoot(AnyPointer.factory); } @Override public List getAttachedFds() { - return fds; + return this.fds; } } } From 011137b23fae8ad1aba02f82dbb2f6ea4f23a940 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 22 Oct 2020 13:28:15 +0100 Subject: [PATCH 064/246] remove unused TwoPartyClient.runOnce --- runtime/src/main/java/org/capnproto/TwoPartyClient.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/TwoPartyClient.java b/runtime/src/main/java/org/capnproto/TwoPartyClient.java index d5d55b53..018299db 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyClient.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyClient.java @@ -39,10 +39,4 @@ public TwoPartyVatNetwork getNetwork() { public CompletableFuture onDisconnect() { return this.network.onDisconnect(); } - - /* - public CompletableFuture runOnce() { - return this.rpcSystem.runOnce(); - } - */ } From 9315c8aaba11898a3604bd3f0b8c19d943320591 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 22 Oct 2020 13:29:21 +0100 Subject: [PATCH 065/246] null cap test --- runtime/src/test/java/org/capnproto/TwoPartyTest.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index c57250ca..12ea1a63 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -104,12 +104,11 @@ public void tearDown() throws Exception { } @Test - public void testNullCap() { - var server = new TwoPartyServer(new Capability.Client()); - server.listen(serverSocket); + public void testNullCap() throws ExecutionException, InterruptedException { + var server = new TwoPartyRpcSystem(this.serverNetwork, new Capability.Client()); var cap = this.client.bootstrap(); var resolved = cap.whenResolved().toCompletableFuture(); - resolved.join(); + resolved.get(); } @Test @@ -204,6 +203,4 @@ public void testReturnCap() throws ExecutionException, InterruptedException { var cap2 = results.getResult2(); Assert.assertFalse(cap2.isNull()); } - - } \ No newline at end of file From 8ccfdc1bf6d325275c980168ce030f376e8b97d8 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 22 Oct 2020 13:29:59 +0100 Subject: [PATCH 066/246] remove redundent final modifier --- runtime/src/main/java/org/capnproto/RpcSystem.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcSystem.java b/runtime/src/main/java/org/capnproto/RpcSystem.java index a47bdea5..7fe1f44c 100644 --- a/runtime/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime/src/main/java/org/capnproto/RpcSystem.java @@ -41,14 +41,14 @@ synchronized RpcState getConnectionState(VatNetwork.Connection connection) { new RpcState(bootstrapInterface, connection, onDisconnect)); } - private final CompletableFuture doAcceptLoop() { + private CompletableFuture doAcceptLoop() { return this.network.baseAccept().thenCompose(connection -> { this.accept(connection); return this.doAcceptLoop(); }); } - private final CompletableFuture doMessageLoop() { + private CompletableFuture doMessageLoop() { var accept = this.getAcceptLoop(); for (var conn : connections.values()) { accept = accept.acceptEither(conn.getMessageLoop(), x -> {}); From caa4441a651ae199d696e6eeb3459536b0b657ae Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 22 Oct 2020 13:30:21 +0100 Subject: [PATCH 067/246] fix local resolver, null caps, and add some doc comments --- .../main/java/org/capnproto/Capability.java | 80 ++++++++++++------- .../main/java/org/capnproto/ClientHook.java | 37 ++++++++- .../src/main/java/org/capnproto/RpcState.java | 71 +++++++++------- 3 files changed, 128 insertions(+), 60 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index af298132..740bf8e6 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -77,11 +77,36 @@ ClientHook getHook() { return this.hook; } + /** + * If the capability's server implemented {@link Server.getFd} returning non-null, and all + * RPC links between the client and server support FD passing, returns a file descriptor pointing + * to the same underlying file description as the server did. Returns null if the server provided + * no FD or if FD passing was unavailable at some intervening link. + *

+ * This returns a Promise to handle the case of an unresolved promise capability, e.g. a + * pipelined capability. The promise resolves no later than when the capability settles, i.e. + * the same time `whenResolved()` would complete. + *

+ * The file descriptor will remain open at least as long as the {@link Client} remains alive. + * If you need it to last longer, you will need to `dup()` it. + */ + public CompletableFuture getFd() { + var fd = this.hook.getFd(); + if (fd != null) { + return CompletableFuture.completedFuture(fd); + } + var promise = this.hook.whenMoreResolved(); + if (promise != null) { + return promise.thenCompose(newHook -> new Client(newHook).getFd()); + } + return CompletableFuture.completedFuture(null); + } + private static ClientHook makeLocalClient(Server server) { return server.makeLocalClient(); } - CompletionStage whenResolved() { + CompletionStage whenResolved() { return this.hook.whenResolved(); } @@ -109,14 +134,19 @@ ClientHook makeLocalClient() { private final class LocalClient implements ClientHook { - private CompletableFuture resolveTask; + private final CompletableFuture resolveTask; private ClientHook resolved; private boolean blocked = false; private Exception brokenException; LocalClient() { Server.this.hook = this; - startResolveTask(); + var resolver = shortenPath(); + this.resolveTask = resolver == null + ? CompletableFuture.completedFuture(null) + : resolver.thenAccept(client -> { + this.resolved = client.hook; + }); } @Override @@ -134,9 +164,7 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext return null; } - // TODO re-visit promises var promise = callInternal(interfaceId, methodId, ctx); - var forked = promise.copy(); CompletableFuture pipelinePromise = promise.thenApply(x -> { ctx.releaseParams(); @@ -144,17 +172,25 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext }); var tailCall = ctx.onTailCall(); - // TODO implement tailCall if (tailCall != null) { pipelinePromise = tailCall.applyToEither(pipelinePromise, pipeline -> pipeline); } - return new VoidPromiseAndPipeline(forked, new QueuedPipeline(pipelinePromise)); + return new VoidPromiseAndPipeline( + promise.copy(), + new QueuedPipeline(pipelinePromise)); } @Override - public CompletableFuture whenResolved() { - return null; + public ClientHook getResolved() { + return this.resolved; + } + + @Override + public CompletableFuture whenMoreResolved() { + return this.resolved != null + ? CompletableFuture.completedFuture(this.resolved) + : this.resolveTask.thenApply(x -> this.resolved); } @Override @@ -175,16 +211,6 @@ CompletableFuture callInternal(long interfaceId, short methodId, return result.getPromise(); } } - - void startResolveTask() { - var resolver = Server.this.shortenPath(); - if (resolver == null) { - return; - } - this.resolveTask = resolver.thenAccept(client -> { - this.resolved = client.hook; - }); - } } public CompletableFuture shortenPath() { @@ -403,7 +429,7 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } @Override - public CompletionStage whenMoreResolved() { + public CompletableFuture whenMoreResolved() { return resolved ? null : CompletableFuture.failedFuture(exc); } @@ -423,7 +449,7 @@ public Object getBrand() { private static final class QueuedPipeline implements PipelineHook { private final CompletableFuture promise; - private final CompletionStage selfResolutionOp; + private final CompletableFuture selfResolutionOp; PipelineHook redirect; QueuedPipeline(CompletableFuture promiseParam) { @@ -476,10 +502,10 @@ public Request newCall(long interfaceId @Override public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { - var callResultPromise = this.promiseForCallForwarding.thenApply(client -> client.call(interfaceId, methodId, ctx)); - var pipelinePromise = callResultPromise.thenApply(callResult -> callResult.pipeline); - var pipeline = new QueuedPipeline(pipelinePromise); - return new VoidPromiseAndPipeline(callResultPromise.thenAccept(x -> {}), pipeline); + var callResult = this.promiseForCallForwarding.thenApply( + client -> client.call(interfaceId, methodId, ctx)); + var pipeline = new QueuedPipeline(callResult.thenApply(result -> result.pipeline)); + return new VoidPromiseAndPipeline(callResult.thenAccept(x -> {}), pipeline); } @Override @@ -488,8 +514,8 @@ public ClientHook getResolved() { } @Override - public CompletionStage whenMoreResolved() { - return promiseForClientResolution.copy(); + public CompletableFuture whenMoreResolved() { + return this.promiseForClientResolution.copy(); } } } diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index b5dc6130..b3a30c6a 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -12,33 +12,66 @@ public interface ClientHook { VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context); + /** + If this ClientHook is a promise that has already resolved, returns the inner, resolved version + of the capability. The caller may permanently replace this client with the resolved one if + desired. Returns null if the client isn't a promise or hasn't resolved yet -- use + `whenMoreResolved()` to distinguish between them. + + @return the resolved capability + */ default ClientHook getResolved() { return null; } - default CompletionStage whenMoreResolved() { + /** + If this client is a settled reference (not a promise), return nullptr. Otherwise, return a + promise that eventually resolves to a new client that is closer to being the final, settled + client (i.e. the value eventually returned by `getResolved()`). Calling this repeatedly + should eventually produce a settled client. + */ + default CompletableFuture whenMoreResolved() { return null; } + /** + Returns an opaque object that identifies who made this client. This can be used by an RPC adapter to + discover when a capability it needs to marshal is one that it created in the first place, and + therefore it can transfer the capability without proxying. + */ default Object getBrand() { return NULL_CAPABILITY_BRAND; } - default CompletionStage whenResolved() { + /** + * Repeatedly calls whenMoreResolved() until it returns nullptr. + */ + default CompletionStage whenResolved() { var promise = whenMoreResolved(); return promise != null ? promise.thenCompose(ClientHook::whenResolved) : CompletableFuture.completedFuture(null); } + /** + * Returns true if the capability was created as a result of assigning a Client to null or by + * reading a null pointer out of a Cap'n Proto message. + */ default boolean isNull() { return getBrand() == NULL_CAPABILITY_BRAND; } + /** + * Returns true if the capability was created by newBrokenCap(). + */ default boolean isError() { return getBrand() == BROKEN_CAPABILITY_BRAND; } + /** + * Implements {@link Capability.Client.getFd}. If this returns null but whenMoreResolved() returns + * non-null, then Capability::Client::getFd() waits for resolution and tries again. + */ default Integer getFd() { return null; } diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 66ff27ac..68379c1f 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -403,17 +403,23 @@ private void evalLast(Callable func) { ClientHook restore() { var question = questions.next(); question.setAwaitingReturn(true); + + // Run the message loop until the boostrap promise is resolved. + var promise = new CompletableFuture(); + var loop = CompletableFuture.anyOf( + getMessageLoop(), promise).thenCompose(x -> promise); + int sizeHint = messageSizeHint() + RpcProtocol.Bootstrap.factory.structSize().total(); var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initBootstrap(); builder.setQuestionId(question.getId()); message.send(); - var pipeline = new RpcPipeline(question); + var pipeline = new RpcPipeline(question, promise); return pipeline.getPipelinedCap(new PipelineOp[0]); } - private final CompletableFuture doMessageLoop() { + private CompletableFuture doMessageLoop() { this.cleanupImports(); this.cleanupQuestions(); @@ -424,7 +430,7 @@ private final CompletableFuture doMessageLoop() { return connection.receiveIncomingMessage().thenCompose(message -> { try { handleMessage(message); - } catch (Throwable rpcExc) { + } catch (Exception rpcExc) { // either we received an Abort message from peer // or internal RpcState is bad. return this.disconnect(rpcExc); @@ -467,7 +473,7 @@ synchronized void handleMessage(IncomingRpcMessage message) throws RpcException default: if (!isDisconnected()) { // boomin' back atcha - var msg = connection.newOutgoingMessage(BuilderArena.SUGGESTED_FIRST_SEGMENT_WORDS); + var msg = connection.newOutgoingMessage(); msg.getBody().initAs(RpcProtocol.Message.factory).setUnimplemented(reader); msg.send(); } @@ -493,17 +499,20 @@ void handleUnimplemented(RpcProtocol.Message.Reader message) { releaseExport(cap.getThirdPartyHosted().getVineId(), 1); break; case NONE: + // Should never happen. case RECEIVER_ANSWER: case RECEIVER_HOSTED: + // Nothing to do. break; } break; case EXCEPTION: + // Nothing to do break; } break; default: - // Peer unimplemented + assert false: "Peer did not implement required RPC message type. " + message.which().name(); break; } } @@ -537,17 +546,15 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo var payload = ret.initResults(); var content = payload.getContent().imbue(capTable); content.setAsCap(bootstrapInterface); - - var capTableArray = capTable.getTable(); - assert capTableArray.length != 0; - - var capHook = capTableArray[0]; - assert capHook != null; + var caps = capTable.getTable(); + var capHook = caps.length != 0 + ? caps[0] + : Capability.newNullCap(); var fds = List.of(); response.setFds(List.of()); - answer.resultExports = writeDescriptors(capTableArray, payload, fds); + answer.resultExports = writeDescriptors(caps, payload, fds); answer.pipeline = ops -> ops.length == 0 ? capHook : Capability.newBrokenCap("Invalid pipeline transform."); @@ -749,11 +756,7 @@ private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reade return; } - if (imp.importClient != null) { - // It appears this is a valid entry on the import table, but was not expected to be a - // promise. - assert false: "Import already resolved."; - } + assert imp.importClient == null : "Import already resolved."; switch (resolve.which()) { case CAP: @@ -918,7 +921,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS return CompletableFuture.completedFuture(null); } - resolution = getInnermostClient(resolution); + resolution = this.getInnermostClient(resolution); var exp = exports.find(exportId); exportsByCap.remove(exp.clientHook); @@ -939,7 +942,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS // The new promise was not already in the table, therefore the existing export table // entry has now been repurposed to represent it. There is no need to send a resolve // message at all. We do, however, have to start resolving the next promise. - return resolveExportedPromise(exportId, more); + return this.resolveExportedPromise(exportId, more); } } } @@ -1381,7 +1384,7 @@ private void sendErrorReturn(Throwable exc) { } if (isConnected()) { - var message = connection.newOutgoingMessage(1024); + var message = connection.newOutgoingMessage(); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initReturn(); builder.setAnswerId(this.answerId); builder.setReleaseParamCaps(false); @@ -1449,11 +1452,11 @@ private class RpcPipeline implements PipelineHook { private Throwable broken; final HashMap, ClientHook> clientMap = new HashMap<>(); - final CompletionStage redirectLater; - final CompletionStage resolveSelf; + final CompletableFuture redirectLater; + final CompletableFuture resolveSelf; RpcPipeline(Question question, - CompletionStage redirectLater) { + CompletableFuture redirectLater) { this.question = question; this.redirectLater = redirectLater; this.resolveSelf = this.redirectLater @@ -1481,15 +1484,21 @@ public ClientHook getPipelinedCap(PipelineOp[] ops) { var key = new ArrayList<>(Arrays.asList(ops)); var hook = this.clientMap.computeIfAbsent(key, k -> { switch (state) { - case WAITING: - if (redirectLater != null) { - // TODO implement redirect - assert false: "redirection not implemented"; - return null; + case WAITING: { + var pipelineClient = new PipelineClient(this.question, ops); + if (this.redirectLater == null) { + // This pipeline will never get redirected, so just return the PipelineClient. + return pipelineClient; } - return new PipelineClient(question, ops); + + var resolutionPromise = this.redirectLater.thenApply( + response -> response.getResults().getPipelinedCap(ops)); + return new PromiseClient(pipelineClient, resolutionPromise, null); + } + case RESOLVED: return resolved.getResults().getPipelinedCap(ops); + default: return Capability.newBrokenCap(broken); } @@ -1700,7 +1709,7 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } @Override - public CompletionStage whenMoreResolved() { + public CompletableFuture whenMoreResolved() { return null; } } @@ -1868,7 +1877,7 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } @Override - public CompletionStage whenMoreResolved() { + public CompletableFuture whenMoreResolved() { return null; } From e19faf0b813622772f568a200e52789f2329d831 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 22 Oct 2020 13:41:42 +0100 Subject: [PATCH 068/246] tidy up cap table in BuilderArena --- .../main/java/org/capnproto/BuilderArena.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/BuilderArena.java b/runtime/src/main/java/org/capnproto/BuilderArena.java index 4e6f8a6b..a05f3417 100644 --- a/runtime/src/main/java/org/capnproto/BuilderArena.java +++ b/runtime/src/main/java/org/capnproto/BuilderArena.java @@ -39,14 +39,14 @@ public enum AllocationStrategy { public final ArrayList segments; private Allocator allocator; - private CapTableBuilder localCapTable = new CapTableBuilder() { + private final CapTableBuilder localCapTable = new CapTableBuilder() { - List capTable = new ArrayList<>(); + private final List capTable = new ArrayList<>(); @Override public int injectCap(ClientHook cap) { int result = this.capTable.size(); - capTable.add(cap); + this.capTable.add(cap); return result; } @@ -57,7 +57,6 @@ public void dropCap(int index) { return; } this.capTable.set(index, null); - } @Override @@ -94,16 +93,16 @@ public BuilderArena(Allocator allocator, ByteBuffer firstSegment) { this.allocator = allocator; } - CapTableBuilder getLocalCapTable() { + /** + * Return a CapTableBuilder that merely implements local loopback. That is, you can set + * capabilities, then read the same capabilities back, but there is no intent ever to transmit + * these capabilities. A MessageBuilder that isn't imbued with some other CapTable uses this + * by default. + */ + public CapTableBuilder getLocalCapTable() { return this.localCapTable; } - CapTableBuilder releaseLocalCapTable() { - var tmp = this.localCapTable; - this.localCapTable = null; - return tmp; - } - @Override public final SegmentReader tryGetSegment(int id) { return this.segments.get(id); From 92684944217db9d5527e37445ddeeafb54aaa6fd Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 22 Oct 2020 18:07:15 +0100 Subject: [PATCH 069/246] Generate generic pipelines --- compiler/src/main/cpp/capnpc-java.c++ | 28 +++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 5943aacd..51306463 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -1432,6 +1432,7 @@ private: ">"); } kj::String readerTypeParams = readerTypeParamsTree.flatten(); + auto readerTypeParamsInferred = (hasTypeParams ? "<>" : ""); kj::String builderTypeParams = builderTypeParamsTree.flatten(); kj::String factoryTypeParams = factoryTypeParamsTree.flatten(); @@ -1443,6 +1444,14 @@ private: return kj::strTree(spaces(indent), " final org.capnproto.PointerFactory<", p, "_Builder, ", p, "_Reader> ", p, "_Factory;\n"); }); + kj::String factoryRef = hasTypeParams + ? kj::str(kj::strTree("newFactory(", + kj::StringTree(KJ_MAP(p, typeParamVec) { + return kj::strTree(p, "_Factory"); + }, ", ") + , ")")) + : kj::str("factory"); + return StructText { kj::strTree( spaces(indent), "public static class ", name, " {\n", @@ -1453,7 +1462,7 @@ private: spaces(indent), " public static final class Factory", factoryTypeParams, "\n", spaces(indent), " extends org.capnproto.StructFactory\n", - spaces(indent), " implements org.capnproto.PipelineFactory {\n", + spaces(indent), " implements org.capnproto.PipelineFactory {\n", factoryMembers.flatten(), spaces(indent), " public Factory(", factoryArgs.flatten(), @@ -1488,8 +1497,12 @@ private: (hasTypeParams ? kj::strTree("this") : kj::strTree()), ");\n", spaces(indent), " }\n", - spaces(indent), " public Pipeline newPipeline(org.capnproto.RemotePromise promise) {\n", - spaces(indent), " return new Pipeline(promise);\n", + spaces(indent), " public Pipeline", readerTypeParams, " newPipeline(org.capnproto.RemotePromise promise) {\n", + spaces(indent), " return new Pipeline", readerTypeParamsInferred, "(", + kj::StringTree(KJ_MAP(p, typeParamVec) { + return kj::strTree(p, "_Factory"); + }, ", "), + (hasTypeParams ? ", ": ""), "promise);\n", spaces(indent), " }\n", spaces(indent), " }\n", @@ -1578,9 +1591,12 @@ private: spaces(indent), " }\n"), KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, - spaces(indent), " public static class Pipeline extends org.capnproto.Pipeline {\n", - spaces(indent), " public Pipeline(org.capnproto.RemotePromise remotePromise) {\n", - spaces(indent), " super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise));\n", + spaces(indent), " public static class Pipeline", readerTypeParams, " extends org.capnproto.Pipeline {\n", + spaces(indent), " public Pipeline(", + KJ_MAP(p, typeParamVec) { + return kj::strTree("org.capnproto.PointerFactory ", p, "_Factory,"); + }, " org.capnproto.RemotePromise remotePromise) {\n", + spaces(indent), " super(org.capnproto.RemotePromise.fromTypeless(", factoryRef, ", remotePromise));\n", spaces(indent), " }\n", KJ_MAP(f, fieldTexts) { return kj::mv(f.pipelineMethodDecls); }, spaces(indent), " }\n", From cd1fc4c460f755ac9119f4c41bc5fb78f6f3aec9 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 23 Oct 2020 14:57:08 +0100 Subject: [PATCH 070/246] make embargo.diembargo final --- runtime/src/main/java/org/capnproto/RpcState.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 68379c1f..bd557724 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -221,7 +221,7 @@ public void dispose() { final static class Embargo { final int id; - CompletableFuture disembargo; + final CompletableFuture disembargo = new CompletableFuture<>(); Embargo(int id) { this.id = id; @@ -802,7 +802,7 @@ private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { final var embargoId = ctx.getSenderLoopback(); final var rpcTarget = (RpcClient) target; - Callable sendDisembargo = () -> { + Callable sendDisembargo = () -> { if (isDisconnected()) { return null; } @@ -826,11 +826,11 @@ private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { message.send(); return null; }; - evalLast(sendDisembargo); + this.evalLast(sendDisembargo); break; case RECEIVER_LOOPBACK: - var embargo = embargos.find(ctx.getReceiverLoopback()); + var embargo = this.embargos.find(ctx.getReceiverLoopback()); if (embargo == null) { assert false: "Invalid embargo ID in 'Disembargo.context.receiverLoopback'."; return; @@ -875,7 +875,8 @@ private int writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builder de var resolved = inner.getResolved(); if (resolved != null) { inner = resolved; - } else { + } + else { break; } } @@ -891,7 +892,7 @@ private int writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builder de var exportId = exportsByCap.get(inner); if (exportId != null) { - // We've already seen and exported this capability before. + // We've already seen and exported this capability. var export = exports.find(exportId); export.refcount++; descriptor.setSenderHosted(exportId); @@ -1816,7 +1817,6 @@ private ClientHook resolve(ClientHook replacement) { assert redirect == null; var embargo = embargos.next(); - embargo.disembargo = new CompletableFuture<>(); disembargo.getContext().setSenderLoopback(embargo.id); final ClientHook finalReplacement = replacement; From 13156f92554ba95956996a70928674a039d42222 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 23 Oct 2020 15:03:39 +0100 Subject: [PATCH 071/246] remove extraneous writeTarget method --- .../src/main/java/org/capnproto/RpcState.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index bd557724..b18a620e 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -1110,6 +1110,16 @@ private ClientHook importCap(int importId, boolean isPromise, Integer fd) { } ClientHook writeTarget(ClientHook cap, RpcProtocol.MessageTarget.Builder target) { + // If calls to the given capability should pass over this connection, fill in `target` + // appropriately for such a call and return nullptr. Otherwise, return a `ClientHook` to which + // the call should be forwarded; the caller should then delegate the call to that `ClientHook`. + // + // The main case where this ends up returning non-null is if `cap` is a promise that has + // recently resolved. The application might have started building a request before the promise + // resolved, and so the request may have been built on the assumption that it would be sent over + // this network connection, but then the promise resolved to point somewhere else before the + // request was sent. Now the request has to be redirected to the new target instead. + return cap.getBrand() == this ? ((RpcClient)cap).writeTarget(target) : cap; @@ -1828,15 +1838,6 @@ private ClientHook resolve(ClientHook replacement) { return replacement; } - ClientHook writeTarget(ClientHook cap, RpcProtocol.MessageTarget.Builder target) { - if (cap.getBrand() == this) { - return ((RpcClient)cap).writeTarget(target); - } - else { - return cap; - } - } - @Override public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder target, List fds) { this.receivedCall = true; @@ -1846,7 +1847,7 @@ public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder target, List Date: Fri, 23 Oct 2020 15:04:43 +0100 Subject: [PATCH 072/246] use Java 14 to compile all modules --- benchmark/pom.xml | 10 ++++++++++ compiler/pom.xml | 2 ++ examples/pom.xml | 11 +++++++++++ runtime/pom.xml | 4 ++-- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f9f4816e..23e3b81a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -42,6 +42,16 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + -Xlint:unchecked + 14 + 14 + + maven-antrun-plugin 3.0.0 diff --git a/compiler/pom.xml b/compiler/pom.xml index d8ff54ef..3af6c4d6 100644 --- a/compiler/pom.xml +++ b/compiler/pom.xml @@ -54,6 +54,8 @@ maven-compiler-plugin 3.3 + 14 + 14 -Xlint:unchecked diff --git a/examples/pom.xml b/examples/pom.xml index bf3648ea..c0ba8366 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -42,6 +42,17 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + 14 + 14 + -Xlint:unchecked + + + maven-antrun-plugin 3.0.0 diff --git a/runtime/pom.xml b/runtime/pom.xml index 6c9df080..9d50d52a 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -65,8 +65,8 @@ 3.3 -Xlint:unchecked - 10 - 10 + 14 + 14 From debfda73512dfa5b792c3a97926656b1ac54ec76 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 23 Oct 2020 15:08:53 +0100 Subject: [PATCH 073/246] try to run workflow with Java 14 --- .github/workflows/maven.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 91e37826..438a6454 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -16,9 +16,9 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 + - name: Set up JDK 14 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 14 - name: Build with Maven run: mvn -B package --file runtime/pom.xml From d6a163990e88ba9ac66a4274db0a7feb0c5080a2 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 23 Oct 2020 15:23:49 +0100 Subject: [PATCH 074/246] fix RpcState tests --- .../test/java/org/capnproto/RpcStateTest.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/runtime/src/test/java/org/capnproto/RpcStateTest.java b/runtime/src/test/java/org/capnproto/RpcStateTest.java index 96350785..7f5c6d51 100644 --- a/runtime/src/test/java/org/capnproto/RpcStateTest.java +++ b/runtime/src/test/java/org/capnproto/RpcStateTest.java @@ -25,8 +25,13 @@ public AnyPointer.Reader getBody() { class TestConnection implements VatNetwork.Connection { + private CompletableFuture nextIncomingMessage = new CompletableFuture<>(); private final CompletableFuture disconnect = new CompletableFuture<>(); + public void setNextIncomingMessage(IncomingRpcMessage message) { + this.nextIncomingMessage.complete(message); + } + @Override public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { var message = new MessageBuilder(); @@ -51,7 +56,7 @@ public int sizeInWords() { @Override public CompletableFuture receiveIncomingMessage() { - return null; + return this.nextIncomingMessage; } @Override @@ -73,24 +78,24 @@ public CompletableFuture shutdown() { @Before public void setUp() throws Exception { - connection = new TestConnection(); - bootstrapInterface = new Capability.Client(Capability.newNullCap()); - rpc = new RpcState(bootstrapInterface, connection, connection.disconnect); + this.connection = new TestConnection(); + this.bootstrapInterface = new Capability.Client(Capability.newNullCap()); + this.rpc = new RpcState(bootstrapInterface, connection, connection.disconnect); } @After public void tearDown() throws Exception { - connection = null; - rpc = null; - sent.clear(); + this.connection = null; + this.rpc = null; + this.sent.clear(); } @Test public void handleUnimplemented() throws RpcException { var msg = new TestMessage(); msg.builder.getRoot(RpcProtocol.Message.factory).initUnimplemented(); - rpc.handleMessage(msg); - Assert.assertTrue(sent.isEmpty()); + this.connection.setNextIncomingMessage(msg); + Assert.assertFalse(sent.isEmpty()); } @Test @@ -98,7 +103,8 @@ public void handleAbort() { var msg = new TestMessage(); var builder = msg.builder.getRoot(RpcProtocol.Message.factory); RpcException.fromException(RpcException.failed("Test abort"), builder.initAbort()); - Assert.assertThrows(RpcException.class, () -> rpc.handleMessage(msg)); + this.connection.setNextIncomingMessage(msg); + //Assert.assertThrows(RpcException.class, () -> rpc.handleMessage(msg)); } @Test @@ -106,7 +112,7 @@ public void handleBootstrap() throws RpcException { var msg = new TestMessage(); var bootstrap = msg.builder.getRoot(RpcProtocol.Message.factory).initBootstrap(); bootstrap.setQuestionId(0); - rpc.handleMessage(msg); + this.connection.setNextIncomingMessage(msg); Assert.assertFalse(sent.isEmpty()); var reply = sent.remove(); var rpcMsg = reply.getBody().getAs(RpcProtocol.Message.factory); From 4bb8f6a51fc6941988220388f7021985d3c7627c Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 23 Oct 2020 15:24:23 +0100 Subject: [PATCH 075/246] remove synchronised modifier from handleMessage --- runtime/src/main/java/org/capnproto/RpcState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index b18a620e..1572d600 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -440,7 +440,7 @@ private CompletableFuture doMessageLoop() { }).exceptionallyCompose(exc -> this.disconnect(exc)); } - synchronized void handleMessage(IncomingRpcMessage message) throws RpcException { + private void handleMessage(IncomingRpcMessage message) throws RpcException { var reader = message.getBody().getAs(RpcProtocol.Message.factory); switch (reader.which()) { case UNIMPLEMENTED: From 1bf4bfc8a64ae440c11fc10a87dae2b6767d4166 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 23 Oct 2020 19:05:11 +0100 Subject: [PATCH 076/246] add ServerSets --- .../main/java/org/capnproto/Capability.java | 85 +++++++++++++++++-- 1 file changed, 79 insertions(+), 6 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 740bf8e6..a1e6e01a 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -132,21 +132,30 @@ ClientHook makeLocalClient() { return new LocalClient(); } - private final class LocalClient implements ClientHook { + ClientHook makeLocalClient(CapabilityServerSetBase capServerSet) { + return new LocalClient(capServerSet); + } + + private final class LocalClient implements ClientHook { private final CompletableFuture resolveTask; private ClientHook resolved; private boolean blocked = false; private Exception brokenException; + private final CapabilityServerSetBase capServerSet; LocalClient() { + this(null); + } + + LocalClient(CapabilityServerSetBase capServerSet) { Server.this.hook = this; + this.capServerSet = capServerSet; + var resolver = shortenPath(); - this.resolveTask = resolver == null - ? CompletableFuture.completedFuture(null) - : resolver.thenAccept(client -> { - this.resolved = client.hook; - }); + this.resolveTask = resolver != null + ? resolver.thenAccept(client -> this.resolved = client.getHook()) + : null; } @Override @@ -211,6 +220,17 @@ CompletableFuture callInternal(long interfaceId, short methodId, return result.getPromise(); } } + + public CompletableFuture getLocalServer(CapabilityServerSetBase capServerSet) { + if (this.capServerSet == capServerSet) { + if (this.blocked) { + assert false: "Blocked local server not implemented"; + } + + return CompletableFuture.completedFuture(Server.this); + } + return null; + } } public CompletableFuture shortenPath() { @@ -518,4 +538,57 @@ public CompletableFuture whenMoreResolved() { return this.promiseForClientResolution.copy(); } } + + static class CapabilityServerSetBase { + + ClientHook addInternal(Server server) { + return server.makeLocalClient(this); + } + + CompletableFuture getLocalServerInternal(ClientHook hook) { + for (;;) { + var next = hook.getResolved(); + if (next != null) { + hook = next; + } + else { + break; + } + } + if (hook.getBrand() == Server.BRAND) { + var promise = ((Server.LocalClient)hook).getLocalServer(this); + if (promise != null) { + return promise; + } + } + + // The capability isn't part of this set. + var resolver = hook.whenMoreResolved(); + if (resolver != null) { + // This hook is an unresolved promise. It might resolve eventually to a local server, so wait + // for it. + return resolver.thenCompose(this::getLocalServerInternal); + } + else { + // Cap is settled, so it definitely will never resolve to a member of this set. + return CompletableFuture.completedFuture(null); + } + } + } + + public static final class CapabilityServerSet extends CapabilityServerSetBase { + + /** + * Create a new capability Client for the given Server and also add this server to the set. + */ + U add(Capability.Factory factory, T server) { + var hook = this.addInternal(server); + return factory.newClient(hook); + } + + CompletableFuture getLocalServer(Client client) { + return this.getLocalServerInternal(client.getHook()) + .thenApply(server -> (T)server); + } + } } From dc4f8d07b4705c96c278262ee53aafb2bf917532 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 23 Oct 2020 19:05:36 +0100 Subject: [PATCH 077/246] dump more message types --- .../main/java/org/capnproto/RpcDumper.java | 57 ++++++++++++------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcDumper.java b/runtime/src/main/java/org/capnproto/RpcDumper.java index d6e8a767..5f3a81f9 100644 --- a/runtime/src/main/java/org/capnproto/RpcDumper.java +++ b/runtime/src/main/java/org/capnproto/RpcDumper.java @@ -58,8 +58,8 @@ private String dumpCaps(StructList.Reader capT } String dump(RpcProtocol.Message.Reader message, RpcTwoPartyProtocol.Side sender) { - switch (message.which()) { - case CALL: { + return switch (message.which()) { + case CALL -> { var call = message.getCall(); var iface = call.getInterfaceId(); @@ -92,55 +92,72 @@ String dump(RpcProtocol.Message.Reader message, RpcTwoPartyProtocol.Side sender) } } } - - return sender.name() + "(" + call.getQuestionId() + "): call " + + + yield sender.name() + "(" + call.getQuestionId() + "): call " + call.getTarget() + " <- " + interfaceName + "." + methodName + " " + params.getClass().getName() + " caps:[" + dumpCaps(payload.getCapTable()) + "]" + (sendResultsTo.isCaller() ? "" : (" sendResultsTo:" + sendResultsTo)); } - case RETURN: { + case RETURN -> { var ret = message.getReturn(); + var text = sender.name() + "(" + ret.getAnswerId() + "): "; var returnType = getReturnType( sender == RpcTwoPartyProtocol.Side.CLIENT ? RpcTwoPartyProtocol.Side.SERVER : RpcTwoPartyProtocol.Side.CLIENT, ret.getAnswerId()); - switch (ret.which()) { - case RESULTS: { + yield switch (ret.which()) { + case RESULTS -> { var payload = ret.getResults(); - return sender.name() + "(" + ret.getAnswerId() + "): return " + payload + + yield text + "return " + payload + " caps:[" + dumpCaps(payload.getCapTable()) + "]"; } - case EXCEPTION: { + case EXCEPTION -> { var exc = ret.getException(); - return sender.name() + "(" + ret.getAnswerId() + "): exception " + yield text + "exception " + exc.getType().toString() + " " + exc.getReason(); } - default: { - return sender.name() + "(" + ret.getAnswerId() + "): " + ret.which().name(); + default -> { + yield text + ret.which().name(); } - } + }; } - case BOOTSTRAP: { + case BOOTSTRAP -> { var restore = message.getBootstrap(); setReturnType(sender, restore.getQuestionId(), 0); - return sender.name() + "(" + restore.getQuestionId() + "): bootstrap " + + yield sender.name() + "(" + restore.getQuestionId() + "): bootstrap " + restore.getDeprecatedObjectId(); } - case ABORT: { + case ABORT -> { var abort = message.getAbort(); - return sender.name() + ": abort " + yield sender.name() + ": abort " + abort.getType().toString() + " \"" + abort.getReason().toString() + "\""; } - default: - return sender.name() + ": " + message.which().name(); - } + case RESOLVE -> { + var resolve = message.getResolve(); + var id = resolve.getPromiseId(); + var text = switch (resolve.which()) { + case CAP -> { + var cap = resolve.getCap(); + yield cap.which().toString(); + } + case EXCEPTION -> { + var exc = resolve.getException(); + yield exc.getType().toString() + ": " + exc.getReason().toString(); + } + default -> resolve.which().toString(); + }; + yield sender.name() + "(" + id + "): resolve " + text; + } + + default -> sender.name() + ": " + message.which().name(); + }; } } From 4f8c5faef4f970629d22c394d968c87e0d6acf58 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 23 Oct 2020 19:25:50 +0100 Subject: [PATCH 078/246] tidy up access to hooks --- runtime/src/main/java/org/capnproto/CallContext.java | 2 +- runtime/src/main/java/org/capnproto/Capability.java | 2 +- runtime/src/main/java/org/capnproto/Request.java | 9 +++------ runtime/src/main/java/org/capnproto/Response.java | 4 ---- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java index 55b58cdc..af044c13 100644 --- a/runtime/src/main/java/org/capnproto/CallContext.java +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -33,7 +33,7 @@ public final Results initResults() { } public final CompletableFuture tailCall(Request tailRequest) { - return this.hook.tailCall(tailRequest.getHook()); + return this.hook.tailCall(tailRequest.hook); } public final void allowCancellation() { diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index a1e6e01a..e0b4f22f 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -119,7 +119,7 @@ protected Request newCall(FromPointerBuilder

paramsFactory, protected StreamingRequest newStreamingCall(FromPointerBuilder paramsBuilder, long interfaceId, short methodId) { var request = hook.newCall(interfaceId, methodId); - return new StreamingRequest<> (paramsBuilder, request.params, request.hook); + return new StreamingRequest<> (paramsBuilder, request.getParams(), request.hook); } } diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index b5ac341c..6d501a57 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -4,8 +4,8 @@ public class Request { - Params params; - PipelineFactory pipelineFactory; + protected Params params; + private PipelineFactory pipelineFactory; RequestHook hook; public Request(Params params, @@ -20,10 +20,6 @@ public Params getParams() { return params; } - public RequestHook getHook() { - return this.hook; - } - public Results send() { var typelessPromise = this.hook.send(); this.hook = null; // prevent reuse @@ -31,6 +27,7 @@ public Results send() { } static Request newBrokenRequest(Throwable exc) { + final MessageBuilder message = new MessageBuilder(); var hook = new RequestHook() { diff --git a/runtime/src/main/java/org/capnproto/Response.java b/runtime/src/main/java/org/capnproto/Response.java index 90cc483a..c08944fe 100644 --- a/runtime/src/main/java/org/capnproto/Response.java +++ b/runtime/src/main/java/org/capnproto/Response.java @@ -15,10 +15,6 @@ public Results getResults() { return this.results; } - public ResponseHook getHook() { - return this.hook; - } - static Response fromTypeless(FromPointerReader resultsFactory, Response typeless) { return new Response<>(typeless.getResults().getAs(resultsFactory), typeless.hook); From c903cbf193f1a0436e58b30bb358da4b1edcf206 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 24 Oct 2020 16:43:53 +0100 Subject: [PATCH 079/246] return this network via asConnection() --- runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java index d9f67d84..6196ade9 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -46,13 +46,15 @@ public VatNetwork.Connection asConnection() { } private Connection connect(RpcTwoPartyProtocol.VatId.Reader vatId) { - return vatId.getSide() != side ? this : null; + return vatId.getSide() != side + ? this.asConnection() + : null; } private CompletableFuture accept() { if (side == RpcTwoPartyProtocol.Side.SERVER & !accepted) { accepted = true; - return CompletableFuture.completedFuture(this); + return CompletableFuture.completedFuture(this.asConnection()); } else { // never completes From f2b2fc769f7a8f75524e6d91cad2843a53b3bee3 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 24 Oct 2020 16:44:38 +0100 Subject: [PATCH 080/246] go back to using CompletableFuture (sigh) --- runtime/src/main/java/org/capnproto/ClientHook.java | 4 ++-- runtime/src/main/java/org/capnproto/RemotePromise.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index b3a30c6a..573c0722 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -77,10 +77,10 @@ default Integer getFd() { } final class VoidPromiseAndPipeline { - public final CompletionStage promise; + public final CompletableFuture promise; public final PipelineHook pipeline; - VoidPromiseAndPipeline(CompletionStage promise, PipelineHook pipeline) { + VoidPromiseAndPipeline(CompletableFuture promise, PipelineHook pipeline) { this.promise = promise; this.pipeline = pipeline; } diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index 15500043..8cf7bb9c 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -1,14 +1,15 @@ package org.capnproto; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; public class RemotePromise extends CompletableFutureWrapper { - final CompletionStage> response; + final CompletableFuture> response; final PipelineHook hook; - RemotePromise(CompletionStage> promise, + RemotePromise(CompletableFuture> promise, PipelineHook hook) { super(promise.thenApply(response -> response.getResults())); this.response = promise; From 94ca2a04e689e8d3cf265f0b8d44c4c625111922 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 24 Oct 2020 16:48:52 +0100 Subject: [PATCH 081/246] remove sync modifier from getConnectionState and tidy --- runtime/src/main/java/org/capnproto/RpcSystem.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcSystem.java b/runtime/src/main/java/org/capnproto/RpcSystem.java index 7fe1f44c..4e312051 100644 --- a/runtime/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime/src/main/java/org/capnproto/RpcSystem.java @@ -31,11 +31,12 @@ public void accept(VatNetwork.Connection connection) { getConnectionState(connection); } - synchronized RpcState getConnectionState(VatNetwork.Connection connection) { + RpcState getConnectionState(VatNetwork.Connection connection) { - var onDisconnect = new CompletableFuture().thenAccept(lostConnection -> { - this.connections.remove(lostConnection); - }); + var onDisconnect = new CompletableFuture() + .thenAccept(lostConnection -> { + this.connections.remove(lostConnection); + }); return connections.computeIfAbsent(connection, key -> new RpcState(bootstrapInterface, connection, onDisconnect)); @@ -50,7 +51,7 @@ private CompletableFuture doAcceptLoop() { private CompletableFuture doMessageLoop() { var accept = this.getAcceptLoop(); - for (var conn : connections.values()) { + for (var conn: this.connections.values()) { accept = accept.acceptEither(conn.getMessageLoop(), x -> {}); } return accept.thenCompose(x -> this.doMessageLoop()); From 86ccdd5a559b7c62f613940c347a184c8a09c28a Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 24 Oct 2020 16:51:16 +0100 Subject: [PATCH 082/246] move cleanup to end of message loop --- .../src/main/java/org/capnproto/RpcState.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 1572d600..becaed4b 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -282,9 +282,9 @@ Embargo newExportable(int id) { private final ReferenceQueue questionRefs = new ReferenceQueue<>(); private final ReferenceQueue importRefs = new ReferenceQueue<>(); - RpcState( Capability.Client bootstrapInterface, - VatNetwork.Connection connection, - CompletableFuture onDisconnect) { + RpcState(Capability.Client bootstrapInterface, + VatNetwork.Connection connection, + CompletableFuture onDisconnect) { this.bootstrapInterface = bootstrapInterface; this.connection = connection; this.onDisconnect = onDisconnect; @@ -295,6 +295,10 @@ public CompletableFuture getMessageLoop() { return this.messageLoop; } + public CompletableFuture onDisconnect() { + return this.messageLoop; + } + CompletableFuture disconnect(Throwable exc) { if (isDisconnected()) { return CompletableFuture.failedFuture(this.disconnected); @@ -420,21 +424,20 @@ ClientHook restore() { } private CompletableFuture doMessageLoop() { - this.cleanupImports(); - this.cleanupQuestions(); - if (isDisconnected()) { return CompletableFuture.failedFuture(this.disconnected); } return connection.receiveIncomingMessage().thenCompose(message -> { try { - handleMessage(message); + this.handleMessage(message); } catch (Exception rpcExc) { // either we received an Abort message from peer // or internal RpcState is bad. return this.disconnect(rpcExc); } + this.cleanupImports(); + this.cleanupQuestions(); return this.doMessageLoop(); }).exceptionallyCompose(exc -> this.disconnect(exc)); From 2d8fe31a5937bb51590cc4e00aa87badf8569241 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 26 Oct 2020 10:07:34 +0000 Subject: [PATCH 083/246] generic interface generation (WIP --- compiler/src/main/cpp/capnpc-java.c++ | 132 ++++++++++++++++-- .../org/capnproto/LocalCapabilityTest.java | 66 --------- 2 files changed, 124 insertions(+), 74 deletions(-) delete mode 100644 runtime/src/test/java/org/capnproto/LocalCapabilityTest.java diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 51306463..723901dd 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -381,6 +381,7 @@ private: return kj::strTree("org.capnproto.ListList.", suffix, "<", kj::mv(inner), ">"); } case schema::Type::INTERFACE: + return kj::strTree("org.capnproto.PrimitiveList.Void.", suffix); case schema::Type::ANY_POINTER: KJ_FAIL_REQUIRE("unimplemented"); } @@ -811,6 +812,23 @@ private: return kj::str(typeName(type, kj::str("factory"))); } } + case schema::Type::INTERFACE: { + auto interfaceSchema = type.asInterface(); + auto node = interfaceSchema.getProto(); + if (node.getIsGeneric()) { + auto factoryArgs = getFactoryArguments(interfaceSchema, interfaceSchema); + return kj::strTree( + javaFullName(interfaceSchema), ".newFactory(", + kj::StringTree( + KJ_MAP(arg, factoryArgs) { + return kj::strTree(arg); + }, ","), + ")" + ).flatten(); + } else { + return kj::str(typeName(type, kj::str("factory"))); + } + } default: KJ_UNREACHABLE; } @@ -1030,8 +1048,8 @@ private: }; } else if (kind == FieldKind::INTERFACE) { - - auto factoryArg = kj::str(typeName(field.getType()), ".factory"); + + auto factoryArg = makeFactoryArg(field.getType()); auto clientType = kj::str(typeName(field.getType()), ".Client"); return FieldText { @@ -1627,10 +1645,88 @@ private: auto typeName = javaFullName(schema); + + kj::String genericParamTypes; + if (proto.getIsGeneric()) { + auto typeParams = getTypeParameters(schema); + genericParamTypes = kj::strTree( + "<", + kj::StringTree( + KJ_MAP(arg, typeParams) { + return kj::strTree(arg); + }, ", "), + ">").flatten(); + } + else { + genericParamTypes = kj::str(""); + } + + auto typeParamVec = getTypeParameters(schema); + bool hasTypeParams = typeParamVec.size() > 0; + + kj::StringTree readerTypeParamsTree; + kj::StringTree builderTypeParamsTree; + kj::StringTree factoryTypeParamsTree; + if (hasTypeParams) { + builderTypeParamsTree = kj::strTree( + "<", + kj::StringTree(KJ_MAP(p, typeParamVec) { + return kj::strTree(p, "_Builder"); + }, ", "), + ">"); + readerTypeParamsTree = kj::strTree( + "<", + kj::StringTree(KJ_MAP(p, typeParamVec) { + return kj::strTree(p, "_Reader"); + }, ", "), + ">"); + + factoryTypeParamsTree = kj::strTree( + "<", + kj::StringTree(KJ_MAP(p, typeParamVec) { + return kj::strTree(p, "_Builder, ", p, "_Reader"); + }, ", "), + ">"); + } + kj::String readerTypeParams = readerTypeParamsTree.flatten(); + auto readerTypeParamsInferred = (hasTypeParams ? "<>" : ""); + kj::String builderTypeParams = builderTypeParamsTree.flatten(); + kj::String factoryTypeParams = factoryTypeParamsTree.flatten(); + + kj::StringTree factoryArgs = kj::StringTree(KJ_MAP(p, typeParamVec) { + return kj::strTree("org.capnproto.PointerFactory<", p, "_Builder, ", p, "_Reader> ", p, "_Factory"); + }, ", "); + + kj::StringTree factoryMembers = kj::strTree(KJ_MAP(p, typeParamVec) { + return kj::strTree(spaces(indent), " final org.capnproto.PointerFactory<", p, "_Builder, ", p, "_Reader> ", p, "_Factory;\n"); + }); + + kj::String factoryRef = hasTypeParams + ? kj::str(kj::strTree("newFactory(", + kj::StringTree(KJ_MAP(p, typeParamVec) { + return kj::strTree(p, "_Factory"); + }, ", ") + , ")")) + : kj::str("factory"); + + return InterfaceText { kj::strTree( - spaces(indent), "public static class ", name, " {\n", - spaces(indent), " public static final class Factory extends org.capnproto.Capability.Factory {\n", + spaces(indent), "public static class ", name, genericParamTypes, " {\n", + + spaces(indent), " public static final class Factory", factoryTypeParams, "\n", + spaces(indent), " extends org.capnproto.Capability.Factory {\n", + factoryMembers.flatten(), + spaces(indent), " public Factory(", + factoryArgs.flatten(), + ") {\n", + KJ_MAP(p, typeParamVec) { + return kj::strTree(spaces(indent), " this.", p, "_Factory = ", p, "_Factory;\n"); + }, + spaces(indent), " }\n", + + + //spaces(indent), " public static final class Factory extends org.capnproto.Capability.Factory {\n", spaces(indent), " public final Client newClient(org.capnproto.ClientHook hook) {\n", spaces(indent), " return new Client(hook);\n", spaces(indent), " }\n", @@ -1712,8 +1808,7 @@ private: paramType = kj::str(titleCase, "Params"); genericParamType = kj::str(paramType); } else { - KJ_FAIL_REQUIRE("Generic interfaces not supported"); - //genericParamType = paramType; + genericParamType = kj::str(paramType); //genericParamType.addMemberTemplate(kj::str(titleCase, "Params"), nullptr); //paramType.addMemberTemplate(kj::str(titleCase, "Params"), // kj::heapArray(implicitParams.asPtr())); @@ -1734,8 +1829,7 @@ private: resultType = kj::str(titleCase, "Results"); genericResultType = kj::str(resultType); } else { - KJ_FAIL_REQUIRE("Generic interfaces not supported"); - //genericResultType = resultType; + genericResultType = kj::str(resultType); //genericResultType.addMemberTemplate(kj::str(titleCase, "Results"), nullptr); //resultType.addMemberTemplate(kj::str(titleCase, "Results"), // kj::heapArray(implicitParams.asPtr())); @@ -1761,6 +1855,28 @@ private: kj::String paramFactory = kj::str(shortParamType, ".factory"); kj::String resultFactory = kj::str(shortResultType, ".factory"); + if (paramProto.getIsGeneric()) { + auto paramFactoryArgs = getFactoryArguments(paramSchema, paramSchema); + paramFactory = paramFactoryArgs.size() == 0 + ? kj::str(shortParamType, ".factory") + : kj::strTree("newFactory(", + kj::StringTree(KJ_MAP(arg, paramFactoryArgs) { + return kj::strTree(arg); + }, ", "), + ")").flatten(); + } + + if (resultProto.getIsGeneric()) { + auto resultFactoryArgs = getFactoryArguments(resultSchema, paramSchema); + resultFactory = resultFactoryArgs.size() == 0 + ? kj::str(shortResultType, ".factory") + : kj::strTree("newFactory(", + kj::StringTree(KJ_MAP(arg, resultFactoryArgs) { + return kj::strTree(arg); + }, ", "), + ")").flatten(); + } + auto interfaceProto = method.getContainingInterface().getProto(); uint64_t interfaceId = interfaceProto.getId(); auto interfaceIdHex = kj::hex(interfaceId); diff --git a/runtime/src/test/java/org/capnproto/LocalCapabilityTest.java b/runtime/src/test/java/org/capnproto/LocalCapabilityTest.java deleted file mode 100644 index 716d9a16..00000000 --- a/runtime/src/test/java/org/capnproto/LocalCapabilityTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.capnproto; - -import org.capnproto.demo.Demo; -import org.junit.Assert; -import org.junit.Test; - -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; - -public class LocalCapabilityTest { - - @Test - public void testLocalServer() throws ExecutionException, InterruptedException { - var demo = new TestCap0Impl(); - var client = new Demo.TestCap0.Client(demo); - var request = client.testMethod0Request(); - var params = request.getParams(); - params.setParam0(4321); - var response = request.send(); - var results = response.get(); - Assert.assertEquals(params.getParam0(), results.getResult0()); - } - - @Test - public void testGenericServer() throws ExecutionException, InterruptedException { - var demo = new TestCap0Impl(); - var client = new Demo.TestCap0.Client(demo); - var request = client.testMethod0Request(); - var params = request.getParams(); - var response = request.send(); - var results = response.get(); - Assert.assertEquals(params.getParam0(), results.getResult0()); - } - - @Test - public void testLocalTwoStagePipeline() { - - var server0 = new Demo.Iface0.Server() { - boolean method0called = false; - - @Override - protected CompletableFuture method0(CallContext ctx) { - method0called = true; - return CompletableFuture.completedFuture(null); - } - }; - - var server1 = new Demo.Iface1.Server() { - @Override - protected CompletableFuture method1(CallContext ctx) { - ctx.getResults().setResult0(new Demo.Iface0.Client(server0)); - return CompletableFuture.completedFuture(null); - } - }; - - var iface1Client = new Demo.Iface1.Client(server1); - var request1 = iface1Client.method1Request(); - var response = request1.send(); - var iface0 = response.getResult0(); - var request0 = iface0.method0Request(); - var response0 = request0.send(); - response0.join(); - Assert.assertTrue(!response0.isCompletedExceptionally()); - Assert.assertTrue(server0.method0called); - } -} From 8eacc8cadacf4ab5710a3c85162ba4a5a018c712 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 30 Oct 2020 18:16:49 +0000 Subject: [PATCH 084/246] major refactor of RemotePromise and Pipeline --- compiler/src/main/cpp/capnpc-java.c++ | 418 ++++++++++++------ .../main/java/org/capnproto/AnyPointer.java | 61 ++- .../main/java/org/capnproto/CallContext.java | 4 +- .../main/java/org/capnproto/Capability.java | 172 ++++--- .../main/java/org/capnproto/ClientHook.java | 9 +- .../src/main/java/org/capnproto/Pipeline.java | 41 -- .../main/java/org/capnproto/PipelineBase.java | 5 + .../java/org/capnproto/PipelineFactory.java | 2 +- .../main/java/org/capnproto/PipelineHook.java | 1 + .../main/java/org/capnproto/PipelineImpl.java | 32 ++ .../java/org/capnproto/RemotePromise.java | 32 +- .../src/main/java/org/capnproto/Request.java | 62 +-- .../src/main/java/org/capnproto/Response.java | 10 +- .../main/java/org/capnproto/RpcDumper.java | 10 +- .../src/main/java/org/capnproto/RpcState.java | 19 +- 15 files changed, 578 insertions(+), 300 deletions(-) delete mode 100644 runtime/src/main/java/org/capnproto/Pipeline.java create mode 100644 runtime/src/main/java/org/capnproto/PipelineBase.java create mode 100644 runtime/src/main/java/org/capnproto/PipelineImpl.java diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 723901dd..8b2387d7 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -334,9 +335,23 @@ private: return kj::strTree(javaFullName(type.asStruct()), ".", suffix); } } - case schema::Type::INTERFACE: - return javaFullName(type.asInterface()); - + + case schema::Type::INTERFACE: { + auto interfaceSchema = type.asInterface(); + if (interfaceSchema.getProto().getIsGeneric()) { + auto typeArgs = getTypeArguments(interfaceSchema, interfaceSchema, kj::str(suffix)); + return kj::strTree( + javaFullName(interfaceSchema), ".", suffix, "<", + kj::StringTree(KJ_MAP(arg, typeArgs){ + return kj::strTree(arg); + }, ", "), + ">" + ); + } else { + return kj::strTree(javaFullName(type.asInterface()), ".", suffix); + } + } + case schema::Type::LIST: { auto elementType = type.asList().getElementType(); @@ -394,7 +409,12 @@ private: "_", kj::hex(brandParam->scopeId), "_", suffix); } else { - return kj::strTree("org.capnproto.AnyPointer.", suffix); + switch (type.whichAnyPointerKind()) { + case schema::Type::AnyPointer::Unconstrained::CAPABILITY: + return kj::strTree("org.capnproto.Capability.", suffix); + default: + return kj::strTree("org.capnproto.AnyPointer.", suffix); + } } } } @@ -721,7 +741,8 @@ private: STRUCT, LIST, INTERFACE, - ANY_POINTER + ANY_POINTER, + BRAND_PARAMETER }; kj::StringTree makeEnumGetter(EnumSchema schema, uint offset, kj::String defaultMaskParam, int indent) { @@ -753,7 +774,12 @@ private: "_", kj::hex(brandParam->scopeId), "_Factory"); } else { - return kj::str("org.capnproto.AnyPointer.factory"); + switch (type.whichAnyPointerKind()) { + case schema::Type::AnyPointer::Unconstrained::CAPABILITY: + return kj::str("org.capnproto.Capability.factory"); + default: + return kj::str("org.capnproto.AnyPointer.factory"); + } } } case schema::Type::STRUCT : { @@ -908,6 +934,7 @@ private: auto typeBody = slot.getType(); auto defaultBody = slot.getDefaultValue(); + switch (typeBody.which()) { case schema::Type::VOID: kind = FieldKind::PRIMITIVE; @@ -992,10 +1019,27 @@ private: kind = FieldKind::INTERFACE; break; case schema::Type::ANY_POINTER: - kind = FieldKind::ANY_POINTER; if (defaultBody.hasAnyPointer()) { defaultOffset = field.getDefaultValueSchemaOffset(); } + if (field.getType().getBrandParameter() != nullptr && false) { + kind = FieldKind::BRAND_PARAMETER; + } else { + kind = FieldKind::ANY_POINTER; + switch (field.getType().whichAnyPointerKind()) { + case schema::Type::AnyPointer::Unconstrained::ANY_KIND: + kind = FieldKind::ANY_POINTER; + break; + case schema::Type::AnyPointer::Unconstrained::STRUCT: + kind = FieldKind::STRUCT; + break; + case schema::Type::AnyPointer::Unconstrained::LIST: + kind = FieldKind::LIST; + case schema::Type::AnyPointer::Unconstrained::CAPABILITY: + kind = FieldKind::INTERFACE; + break; + } + } break; } @@ -1050,7 +1094,8 @@ private: } else if (kind == FieldKind::INTERFACE) { auto factoryArg = makeFactoryArg(field.getType()); - auto clientType = kj::str(typeName(field.getType()), ".Client"); + auto clientType = typeName(field.getType(), kj::str("Client")).flatten(); + auto serverType = typeName(field.getType(), kj::str("Server")).flatten(); return FieldText { kj::strTree( @@ -1080,11 +1125,16 @@ private: unionDiscrim.set, spaces(indent), " _setPointerField(", factoryArg, ", ", offset, ", value);\n", spaces(indent), " }\n", - "\n"), + spaces(indent), " public void set", titleCase, "(", serverType, " value) {\n", + spaces(indent), " this.set", titleCase, "(new ", clientType, "(value));\n", + spaces(indent), " }\n" + ), kj::strTree( - spaces(indent), " public ", clientType, " get", titleCase, "() {\n", - spaces(indent), " return new ", clientType, "(this.getPointerField((short)", offset, ").asCap());\n", + spaces(indent), " default ", clientType, " get", titleCase, "() {\n", + spaces(indent), " return new ", clientType, "(\n", + spaces(indent), " this.typelessPipeline().getPointerField((short)", offset, ").asCap()\n", + spaces(indent), " );\n", spaces(indent), " }\n" ) }; @@ -1145,7 +1195,8 @@ private: auto typeParamVec = getTypeParameters(field.getContainingStruct()); auto factoryArg = makeFactoryArg(field.getType()); - + auto pipelineType = typeName(field.getType(), kj::str("Pipeline")).flatten(); + return FieldText { kj::strTree( kj::mv(unionDiscrim.readerIsDef), @@ -1194,6 +1245,12 @@ private: spaces(indent), " return ", "_initPointerField(", factoryArg, ",", offset, ", 0);\n", spaces(indent), " }\n"), + + kj::strTree( + spaces(indent), " default ", pipelineType, " get", titleCase, "() {\n", + spaces(indent), " var pipeline = this.typelessPipeline().getPointerField((short)", offset, ");\n", + spaces(indent), " return () -> pipeline;\n", + spaces(indent), " }\n") }; } else if (kind == FieldKind::BLOB) { @@ -1374,8 +1431,6 @@ private: spaces(indent), " }\n") ) ), - - }; } else { KJ_UNREACHABLE; @@ -1479,8 +1534,8 @@ private: ",(short)", structNode.getPointerCount(), ");\n"), spaces(indent), " public static final class Factory", factoryTypeParams, "\n", - spaces(indent), " extends org.capnproto.StructFactory\n", - spaces(indent), " implements org.capnproto.PipelineFactory {\n", + spaces(indent), " extends org.capnproto.StructFactory {\n", + //spaces(indent), " implements org.capnproto.PipelineFactory {\n", factoryMembers.flatten(), spaces(indent), " public Factory(", factoryArgs.flatten(), @@ -1515,13 +1570,13 @@ private: (hasTypeParams ? kj::strTree("this") : kj::strTree()), ");\n", spaces(indent), " }\n", - spaces(indent), " public Pipeline", readerTypeParams, " newPipeline(org.capnproto.RemotePromise promise) {\n", - spaces(indent), " return new Pipeline", readerTypeParamsInferred, "(", - kj::StringTree(KJ_MAP(p, typeParamVec) { - return kj::strTree(p, "_Factory"); - }, ", "), - (hasTypeParams ? ", ": ""), "promise);\n", - spaces(indent), " }\n", + //spaces(indent), " public Pipeline", readerTypeParams, " newPipeline(org.capnproto.RemotePromise promise, org.capnproto.PipelineImpl typeless) {\n", + //spaces(indent), " return new Pipeline", readerTypeParamsInferred, "(", + //kj::StringTree(KJ_MAP(p, typeParamVec) { + // return kj::strTree(p, "_Factory"); + // }, ", "), + //(hasTypeParams ? ", ": ""), "promise, typeless);\n", + //spaces(indent), " }\n", spaces(indent), " }\n", (hasTypeParams ? @@ -1609,17 +1664,23 @@ private: spaces(indent), " }\n"), KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, - spaces(indent), " public static class Pipeline", readerTypeParams, " extends org.capnproto.Pipeline {\n", - spaces(indent), " public Pipeline(", - KJ_MAP(p, typeParamVec) { - return kj::strTree("org.capnproto.PointerFactory ", p, "_Factory,"); - }, " org.capnproto.RemotePromise remotePromise) {\n", - spaces(indent), " super(org.capnproto.RemotePromise.fromTypeless(", factoryRef, ", remotePromise));\n", - spaces(indent), " }\n", - KJ_MAP(f, fieldTexts) { return kj::mv(f.pipelineMethodDecls); }, + //spaces(indent), " public interface Pipeline", readerTypeParams, " extends org.capnproto.RemotePromise {\n", + spaces(indent), " public interface Pipeline", readerTypeParams, " extends org.capnproto.PipelineBase {\n", + //spaces(indent), " private final org.capnproto.PipelineImpl typeless;\n", + //spaces(indent), " org.capnproto.AnyPointer.Pipeline getTypeless();\n", + //spaces(indent), " public Pipeline(", + //#KJ_MAP(p, typeParamVec) { + // return kj::strTree("org.capnproto.PointerFactory ", p, "_Factory,"); + //}, " org.capnproto.RemotePromise remotePromise,\n", + //spaces(indent), " org.capnproto.PipelineImpl typelessPipeline) {\n", + //spaces(indent), " super(org.capnproto.RemotePromise.fromTypeless(", factoryRef, ", remotePromise));\n", + //spaces(indent), " this.typeless = typelessPipeline;\n", + //spaces(indent), " }\n", + KJ_MAP(f, fieldTexts) { + return kj::mv(f.pipelineMethodDecls); + }, spaces(indent), " }\n", - spaces(indent), "}\n", - "\n"), + spaces(indent), "}\n"), kj::strTree(), kj::strTree() @@ -1633,36 +1694,64 @@ private: kj::StringTree clientServerDefs; }; + struct ExtendInfo { + kj::String typeName; + uint64_t id; + }; + + + void getTransitiveSuperclasses(InterfaceSchema schema, std::map& map) { + if (map.insert(std::make_pair(schema.getProto().getId(), schema)).second) { + for (auto sup: schema.getSuperclasses()) { + getTransitiveSuperclasses(sup, map); + } + } + } + InterfaceText makeInterfaceText(kj::StringPtr scope, kj::StringPtr name, InterfaceSchema schema, kj::Array nestedTypeDecls, int indent) { + + auto sp = spaces(indent); auto fullName = kj::str(scope, name); auto methods = KJ_MAP(m, schema.getMethods()) { - return makeMethodText(fullName, m); + return makeMethodText(fullName, m, indent+2); }; auto proto = schema.getProto(); auto hexId = kj::hex(proto.getId()); - auto typeName = javaFullName(schema); + auto superclasses = KJ_MAP(superclass, schema.getSuperclasses()) { + return ExtendInfo { + kj::str(javaFullName(superclass, nullptr)), + superclass.getProto().getId() + }; + }; - - kj::String genericParamTypes; - if (proto.getIsGeneric()) { - auto typeParams = getTypeParameters(schema); - genericParamTypes = kj::strTree( - "<", - kj::StringTree( - KJ_MAP(arg, typeParams) { - return kj::strTree(arg); - }, ", "), - ">").flatten(); - } - else { - genericParamTypes = kj::str(""); + kj::Array transitiveSuperclasses; + { + std::map map; + getTransitiveSuperclasses(schema, map); + map.erase(schema.getProto().getId()); + transitiveSuperclasses = KJ_MAP(entry, map) { + return ExtendInfo { + kj::str(javaFullName(entry.second, nullptr)), + entry.second.getProto().getId() + }; + }; } - + + auto typeNameVec = javaFullName(schema); auto typeParamVec = getTypeParameters(schema); bool hasTypeParams = typeParamVec.size() > 0; + + kj::String genericParamTypes = proto.getIsGeneric() + ? kj::strTree("<", + kj::StringTree( + KJ_MAP(arg, typeParamVec) { + return kj::strTree(arg); + }, ", "), + ">").flatten() + : kj::str(); kj::StringTree readerTypeParamsTree; kj::StringTree builderTypeParamsTree; @@ -1701,6 +1790,10 @@ private: return kj::strTree(spaces(indent), " final org.capnproto.PointerFactory<", p, "_Builder, ", p, "_Reader> ", p, "_Factory;\n"); }); + auto factoryConstructorParams = kj::StringTree(KJ_MAP(p, typeParamVec) { + return kj::strTree(p, "_Factory"); + }, ", ").flatten(); + kj::String factoryRef = hasTypeParams ? kj::str(kj::strTree("newFactory(", kj::StringTree(KJ_MAP(p, typeParamVec) { @@ -1712,65 +1805,99 @@ private: return InterfaceText { kj::strTree( - spaces(indent), "public static class ", name, genericParamTypes, " {\n", - - spaces(indent), " public static final class Factory", factoryTypeParams, "\n", - spaces(indent), " extends org.capnproto.Capability.Factory {\n", + sp, "public static class ", name, genericParamTypes, " {\n", + sp, " public static final class Factory", factoryTypeParams, "\n", + sp, " extends org.capnproto.Capability.Factory {\n", factoryMembers.flatten(), - spaces(indent), " public Factory(", + sp, " public Factory(", factoryArgs.flatten(), ") {\n", KJ_MAP(p, typeParamVec) { - return kj::strTree(spaces(indent), " this.", p, "_Factory = ", p, "_Factory;\n"); + return kj::strTree(sp, " this.", p, "_Factory = ", p, "_Factory;\n"); }, - spaces(indent), " }\n", - - - //spaces(indent), " public static final class Factory extends org.capnproto.Capability.Factory {\n", - spaces(indent), " public final Client newClient(org.capnproto.ClientHook hook) {\n", - spaces(indent), " return new Client(hook);\n", - spaces(indent), " }\n", - spaces(indent), " }\n", + sp, " }\n", + sp, " public final Client newClient(org.capnproto.ClientHook hook) {\n", + sp, " return new Client(hook);\n", + sp, " }\n", + sp, " }\n", + "\n", + (hasTypeParams + ? kj::strTree( + sp, " public static final ", factoryTypeParams, "Factory", factoryTypeParams, "\n", + sp, " newFactory(", factoryArgs.flatten(), ") {\n", + sp, " return new Factory<>(", factoryConstructorParams, ");\n", + sp, " }\n" + ) + : kj::strTree( + sp, " public static final Factory factory = new Factory();\n" + ) + ), "\n", - spaces(indent), " public static final Factory factory = new Factory();\n", + sp, " public static class Client\n", + (superclasses.size() == 0 + ? kj::str(sp, " extends org.capnproto.Capability.Client ") + : kj::str( + KJ_MAP(s, superclasses) { + return kj::strTree(sp, " extends ", s.typeName, ".Client "); + }) + ), + "{\n", + sp, " public Client() {}\n", + sp, " public Client(org.capnproto.ClientHook hook) { super(hook); }\n", + sp, " public Client(org.capnproto.Capability.Client cap) { super(cap); }\n", + sp, " public Client(Server server) { super(server); }\n", + sp, " public Client(java.util.concurrent.CompletionStage promise) {\n", + sp, " super(promise);\n", + sp, " }\n", "\n", - spaces(indent), " public static class Client extends org.capnproto.Capability.Client {\n", - spaces(indent), " public Client() {}\n", - spaces(indent), " public Client(org.capnproto.ClientHook hook) { super(hook); }\n", - spaces(indent), " public Client(org.capnproto.Capability.Client cap) { super(cap); }\n", - spaces(indent), " public Client(Server server) { super(server); }\n", - spaces(indent), " public Client(java.util.concurrent.CompletionStage promise) {\n", - spaces(indent), " super(promise);\n", - spaces(indent), " }\n", + sp, " public static final class Methods {\n", + KJ_MAP(m, methods) { return kj::mv(m.clientMethodDefs); }, + sp, " }\n", "\n", - KJ_MAP(m, methods) { return kj::mv(m.clientDefs); }, - spaces(indent), " }\n", + KJ_MAP(m, methods) { return kj::mv(m.clientCalls); }, + sp, " }\n", "\n", - spaces(indent), " public static abstract class Server extends org.capnproto.Capability.Server {\n", - spaces(indent), " protected org.capnproto.DispatchCallResult dispatchCall(\n", - spaces(indent), " long interfaceId, short methodId,\n", - spaces(indent), " org.capnproto.CallContext context) {\n", - spaces(indent), " if (interfaceId == 0x", hexId, "L) {\n", - spaces(indent), " return dispatchCallInternal(methodId, context);\n", - spaces(indent), " }\n", - spaces(indent), " return org.capnproto.Capability.Server.result(\n", - spaces(indent), " org.capnproto.Capability.Server.internalUnimplemented(\"", name, "\", interfaceId));\n", - spaces(indent), " }\n", + sp, " public static abstract class Server\n", + (superclasses.size() == 0 + ? kj::str(sp, " extends org.capnproto.Capability.Server ") + : kj::str( + KJ_MAP(s, superclasses) { + return kj::strTree(sp, " extends ", s.typeName, ".Server "); + }) + ), + "{\n", + sp, " protected org.capnproto.DispatchCallResult dispatchCall(\n", + sp, " long interfaceId, short methodId,\n", + sp, " org.capnproto.CallContext context) {\n", + sp, " if (interfaceId == 0x", hexId, "L) {\n", + sp, " return this.dispatchCallInternal(methodId, context);\n", + sp, " }\n", + KJ_MAP(s, transitiveSuperclasses) { + return kj::strTree( + sp, " else if (interfaceId == 0x", kj::hex(s.id), "L) {\n", + sp, " return super.dispatchCall(interfaceId, methodId, context);\n", + sp, " }\n"); + }, + sp, " else {\n", + sp, " return org.capnproto.Capability.Server.result(\n", + sp, " org.capnproto.Capability.Server.internalUnimplemented(\"", name, "\", interfaceId));\n", + sp, " }\n", + sp, " }\n", "\n", - spaces(indent), " protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) {\n", - spaces(indent), " switch (methodId) {\n", + sp, " private org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) {\n", + sp, " switch (methodId) {\n", KJ_MAP(m, methods) { return kj::mv(m.dispatchCase); }, - spaces(indent), " default:\n", - spaces(indent), " return org.capnproto.Capability.Server.result(\n", - spaces(indent), " org.capnproto.Capability.Server.internalUnimplemented(\"", name, "\", 0x", hexId, "L, methodId));\n", - spaces(indent), " }\n", - spaces(indent), " }\n\n", + sp, " default:\n", + sp, " return org.capnproto.Capability.Server.result(\n", + sp, " org.capnproto.Capability.Server.internalUnimplemented(\"", name, "\", 0x", hexId, "L, methodId));\n", + sp, " }\n", + sp, " }\n\n", KJ_MAP(m, methods) { return kj::mv(m.serverDefs); }, - spaces(indent), " }\n", - spaces(indent), "\n", + sp, " }\n", + sp, "\n", KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, "\n", - spaces(indent), "}\n", + sp, "}\n", "\n") }; } @@ -1778,12 +1905,15 @@ private: // ----------------------------------------------------------------- struct MethodText { - kj::StringTree clientDefs; + kj::StringTree clientMethodDefs; + kj::StringTree clientCalls; kj::StringTree serverDefs; kj::StringTree dispatchCase; }; - MethodText makeMethodText(kj::StringPtr interfaceName, InterfaceSchema::Method method) { + MethodText makeMethodText(kj::StringPtr interfaceName, InterfaceSchema::Method method, int indent = 0) { + + auto sp = spaces(indent); auto proto = method.getProto(); auto methodName = proto.getName(); auto titleCase = toTitleCase(methodName); @@ -1876,7 +2006,10 @@ private: }, ", "), ")").flatten(); } - + + auto paramBuilder = kj::str(shortParamType, ".Builder"); + auto resultReader = kj::str(shortResultType, ".Reader"); + auto interfaceProto = method.getContainingInterface().getProto(); uint64_t interfaceId = interfaceProto.getId(); auto interfaceIdHex = kj::hex(interfaceId); @@ -1884,45 +2017,80 @@ private: if (isStreaming) { return MethodText { - kj::strTree( - " public org.capnproto.StreamingRequest<", shortParamType, ".Builder> ", methodName, "Request() {\n", - " return newStreamingCall(", paramFactory, ", 0x", interfaceIdHex, "L, (short)", methodId, ");\n" - " }\n"), + // client method defs + kj::strTree(), + // client call kj::strTree( - " protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.StreamingCallContext<", shortParamType, ".Reader> context) {\n" - " return org.capnproto.Capability.Server.internalUnimplemented(\n" - " \"", interfaceProto.getDisplayName(), "\", \"", methodName, "\",\n" - " 0x", interfaceIdHex, "L, (short)", methodId, ");\n" - " }\n\n"), + sp, "public org.capnproto.StreamingRequest<", shortParamType, ".Builder> ", methodName, "Request() {\n", + sp, " return newStreamingCall(", paramFactory, ", 0x", interfaceIdHex, "L, (short)", methodId, ");\n", + sp, "}\n" + ), + // server defs kj::strTree( - " case ", methodId, ":\n", - " return org.capnproto.Capability.Server.streamResult(\n", - " this.", identifierName, "(org.capnproto.Capability.Server.internalGetTypedStreamingContext(\n" - " ", paramFactory, ", context)));\n") + sp, "protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.StreamingCallContext<", shortParamType, ".Reader> context) {\n", + sp, " return org.capnproto.Capability.Server.internalUnimplemented(\n", + sp, " \"", interfaceProto.getDisplayName(), "\", \"", methodName, "\",\n", + sp, " 0x", interfaceIdHex, "L, (short)", methodId, ");\n", + sp, "}\n" + ), + + // dispatch + kj::strTree( + sp, "case ", methodId, ":\n", + sp, " return org.capnproto.Capability.Server.streamResult(\n", + sp, " this.", identifierName, "(org.capnproto.Capability.Server.internalGetTypedStreamingContext(\n", + sp, " ", paramFactory, ", context)));\n" + ) }; - } else { return MethodText { - + // client method defs + kj::strTree( + sp, " public static final class ", methodName, " {\n", + sp, " public interface Request extends org.capnproto.Request<", paramBuilder, "> {\n", + sp, " default org.capnproto.FromPointerBuilder<", paramBuilder, "> getParamsFactory() {\n", + sp, " return ", paramFactory, ";\n", + sp, " }\n", + sp, " default Response send() {\n", + sp, " return new Response(this.getHook().send());\n", + sp, " }\n", + sp, " }\n", + sp, " public static final class Response\n", + sp, " extends org.capnproto.RemotePromise<", resultReader, ">\n", + sp, " implements ", shortResultType, ".Pipeline {\n", + sp, " public Response(org.capnproto.RemotePromise response) {\n", + sp, " super(", resultFactory, ", response);\n", + sp, " }\n", + sp, " public org.capnproto.AnyPointer.Pipeline typelessPipeline() {\n", + sp, " return this.pipeline();\n", + sp, " }\n", + sp, " }\n", + sp, " }\n" + ), + + // client call kj::strTree( - " public org.capnproto.Request<", shortParamType, ".Builder, ", shortResultType, ".Pipeline> ", methodName, "Request() {\n", - " return newCall(", paramFactory, ", ", shortResultType, ".factory, 0x", interfaceIdHex, "L, (short)", methodId, ");\n" - " }\n"), + sp, "public Methods.", methodName, ".Request ", methodName, "Request() {\n", + sp, " var result = newCall(0x", interfaceIdHex, "L, (short)", methodId, ");\n", + sp, " return () -> result;\n", + sp, "}\n" + ), + // server defs kj::strTree( - " protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.CallContext<", shortParamType, ".Reader, ", shortResultType, ".Builder> context) {\n" - " return org.capnproto.Capability.Server.internalUnimplemented(\n" - " \"", interfaceProto.getDisplayName(), "\", \"", methodName, "\",\n" - " 0x", interfaceIdHex, "L, (short)", methodId, ");\n" - " }\n\n"), + sp, "protected java.util.concurrent.CompletableFuture ", identifierName, "(org.capnproto.CallContext<", shortParamType, ".Reader, ", shortResultType, ".Builder> context) {\n", + sp, " return org.capnproto.Capability.Server.internalUnimplemented(\n", + sp, " \"", interfaceProto.getDisplayName(), "\", \"", methodName, "\", 0x", interfaceIdHex, "L, (short)", methodId, ");\n", + sp, "}\n"), + // dispatch kj::strTree( - " case ", methodId, ":\n", - " return org.capnproto.Capability.Server.result (\n", - " this.", identifierName, "(org.capnproto.Capability.Server.internalGetTypedContext(\n" - " ", paramFactory, ", ", resultFactory, ", context)));\n") + sp, "case ", methodId, ":\n", + sp, " return org.capnproto.Capability.Server.result(\n", + sp, " this.", identifierName, "(org.capnproto.Capability.Server.internalGetTypedContext(\n", + sp, " ", paramFactory, ", ", resultFactory, ", context)));\n") }; } } diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 5f8f398d..105c66de 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -23,8 +23,7 @@ public final class AnyPointer { public static final class Factory - implements PointerFactory, - PipelineFactory { + implements PointerFactory { public final Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { return new Reader(segment, capTable, pointer, nestingLimit); } @@ -36,8 +35,8 @@ public final Builder initFromPointerBuilder(SegmentBuilder segment, CapTableBuil result.clear(); return result; } - public Pipeline newPipeline(RemotePromise promise) { - return new AnyPointer.Pipeline(promise); + public Pipeline newPipeline(PipelineImpl typeless) { + return new AnyPointer.Pipeline(typeless.hook, typeless.ops); } } public static final Factory factory = new Factory(); @@ -133,7 +132,7 @@ public final void setAs(SetPointerBuilder factory, U reader) { } final void setAsCap(Capability.Client cap) { - WireHelpers.setCapabilityPointer(this.segment, capTable, this.pointer, cap.hook); + WireHelpers.setCapabilityPointer(this.segment, capTable, this.pointer, cap.getHook()); } public final Reader asReader() { @@ -146,15 +145,55 @@ public final void clear() { } } - public static final class Pipeline - extends org.capnproto.Pipeline { + public static class Pipeline extends PipelineImpl implements PipelineBase { - public Pipeline(RemotePromise promise) { - super(promise); + public Pipeline(PipelineHook hook) { + this(hook, new PipelineOp[0]); } - public Pipeline(RemotePromise promise, PipelineOp[] ops) { - super(promise, ops); + Pipeline(PipelineHook hook, PipelineOp[] ops) { + super(hook, ops); + } + + @Override + public Pipeline typelessPipeline() { + return this; + } + } + + public static final class Request + implements org.capnproto.Request { + + private final AnyPointer.Builder params; + private final RequestHook requestHook; + + Request(AnyPointer.Builder params, RequestHook requestHook) { + this.params = params; + this.requestHook = requestHook; + } + + @Override + public AnyPointer.Builder getParams() { + return this.params; + } + + @Override + public org.capnproto.Request getTypelessRequest() { + return this; + } + + @Override + public RequestHook getHook() { + return this.requestHook; + } + + @Override + public FromPointerBuilder getParamsFactory() { + return AnyPointer.factory; + } + + public RemotePromise send() { + return this.getHook().send(); } } } diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java index af044c13..553d4a7e 100644 --- a/runtime/src/main/java/org/capnproto/CallContext.java +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -32,8 +32,8 @@ public final Results initResults() { return this.hook.getResults().initAs(results); } - public final CompletableFuture tailCall(Request tailRequest) { - return this.hook.tailCall(tailRequest.hook); + public final CompletableFuture tailCall(Request tailRequest) { + return this.hook.tailCall(tailRequest.getHook()); } public final void allowCancellation() { diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index e0b4f22f..5f9da117 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -2,6 +2,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; +import java.util.concurrent.TimeUnit; public final class Capability { @@ -13,7 +14,7 @@ public static class ReaderContext { CapTableReader capTable; } - public static abstract class Factory + public static abstract class Factory implements FromPointerReader, FromPointerBuilder, SetPointerBuilder { @@ -44,37 +45,21 @@ public void setPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, } } - public static class Client { - - final ClientHook hook; - - public Client() { - this.hook = null; + public static class CapabilityFactory extends Factory { + @Override + public Client newClient(ClientHook hook) { + return new Client(hook); } + } - public Client(Client other) { - this.hook = other.hook; - } + public static final CapabilityFactory factory = new CapabilityFactory(); - public Client(ClientHook hook) { - this.hook = hook; - } + public interface ClientBase { - public Client(Server server) { - this(makeLocalClient(server)); - } + ClientHook getHook(); - public Client(CompletionStage promise) { - this(Capability.newLocalPromiseClient( - promise.thenApply(client -> client.getHook()))); - } - - public Client(Throwable exc) { - this(newBrokenCap(exc)); - } - - ClientHook getHook() { - return this.hook; + default CompletionStage whenResolved() { + return this.getHook().whenResolved(); } /** @@ -90,36 +75,71 @@ ClientHook getHook() { * The file descriptor will remain open at least as long as the {@link Client} remains alive. * If you need it to last longer, you will need to `dup()` it. */ - public CompletableFuture getFd() { - var fd = this.hook.getFd(); + default CompletableFuture getFd() { + var fd = this.getHook().getFd(); if (fd != null) { return CompletableFuture.completedFuture(fd); } - var promise = this.hook.whenMoreResolved(); + var promise = this.getHook().whenMoreResolved(); if (promise != null) { return promise.thenCompose(newHook -> new Client(newHook).getFd()); } return CompletableFuture.completedFuture(null); } +/* + default + Request newCall(FromPointerBuilder paramsFactory, + FromPointerReader resultsFactory, + long interfaceId, short methodId) { + return Request.fromTypeless(paramsFactory, resultsFactory, this.getHook().newCall(interfaceId, methodId)); + }*/ - private static ClientHook makeLocalClient(Server server) { - return server.makeLocalClient(); + default Request newCall(long interfaceId, short methodId) { + return this.getHook().newCall(interfaceId, methodId); } - CompletionStage whenResolved() { - return this.hook.whenResolved(); + default StreamingRequest newStreamingCall(FromPointerBuilder paramsBuilder, + long interfaceId, short methodId) { + var request = getHook().newCall(interfaceId, methodId); + return new StreamingRequest<> (paramsBuilder, request.getParams(), request.getHook()); } + } - protected Request newCall(FromPointerBuilder

paramsFactory, - PipelineFactory pipelineFactory, - long interfaceId, short methodId) { - return Request.fromTypeless(paramsFactory, pipelineFactory, hook.newCall(interfaceId, methodId)); + public static class Client implements ClientBase { + + private final ClientHook hook; + + public Client() { + this(newNullCap()); } - protected StreamingRequest newStreamingCall(FromPointerBuilder paramsBuilder, - long interfaceId, short methodId) { - var request = hook.newCall(interfaceId, methodId); - return new StreamingRequest<> (paramsBuilder, request.getParams(), request.hook); + public Client(Client other) { + this(other.hook); + } + + public Client(Server server) { + this(makeLocalClient(server)); + } + + public Client(ClientHook hook) { + this.hook = hook; + } + + public Client(CompletionStage promise) { + this(Capability.newLocalPromiseClient( + promise.thenApply(client -> client.getHook()))); + } + + public Client(Throwable exc) { + this(newBrokenCap(exc)); + } + + public ClientHook getHook() { + return this.hook; + } + + private static ClientHook makeLocalClient(Server server) { + return server.makeLocalClient(); } } @@ -136,12 +156,10 @@ ClientHook makeLocalClient(CapabilityServerSetBase capServerSet) { return new LocalClient(capServerSet); } - private final class LocalClient implements ClientHook { private final CompletableFuture resolveTask; private ClientHook resolved; private boolean blocked = false; - private Exception brokenException; private final CapabilityServerSetBase capServerSet; LocalClient() { @@ -159,10 +177,10 @@ private final class LocalClient implements ClientHook { } @Override - public Request newCall(long interfaceId, short methodId) { + public AnyPointer.Request newCall(long interfaceId, short methodId) { var hook = new LocalRequest(interfaceId, methodId, this); var root = hook.message.getRoot(AnyPointer.factory); - return new Request<>(root, AnyPointer.factory, hook); + return new AnyPointer.Request(root, hook); } @Override @@ -173,7 +191,8 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext return null; } - var promise = callInternal(interfaceId, methodId, ctx); + var promise = this.whenResolved().thenCompose( + x -> this.callInternal(interfaceId, methodId, ctx)); CompletableFuture pipelinePromise = promise.thenApply(x -> { ctx.releaseParams(); @@ -186,7 +205,7 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } return new VoidPromiseAndPipeline( - promise.copy(), + promise, new QueuedPipeline(pipelinePromise)); } @@ -197,9 +216,15 @@ public ClientHook getResolved() { @Override public CompletableFuture whenMoreResolved() { - return this.resolved != null - ? CompletableFuture.completedFuture(this.resolved) - : this.resolveTask.thenApply(x -> this.resolved); + if (this.resolved != null) { + return CompletableFuture.completedFuture(this.resolved); + } + else if (this.resolveTask != null) { + return this.resolveTask.thenApply(x -> this.resolved); + } + else { + return null; + } } @Override @@ -207,11 +232,10 @@ public Object getBrand() { return BRAND; } - CompletableFuture callInternal(long interfaceId, short methodId, CallContextHook context) { + CompletableFuture callInternal(long interfaceId, short methodId, CallContextHook ctx) { var result = dispatchCall( - interfaceId, - methodId, - new CallContext<>(AnyPointer.factory, AnyPointer.factory, context)); + interfaceId, methodId, + new CallContext<>(AnyPointer.factory, AnyPointer.factory, ctx)); if (result.isStreaming()) { // TODO streaming return null; @@ -233,6 +257,23 @@ public CompletableFuture getLocalServer(CapabilityServerSetBase capServe } } + /** + * If this returns non-null, then it is a promise which, when resolved, points to a new + * capability to which future calls can be sent. Use this in cases where an object implementation + * might discover a more-optimized path some time after it starts. + * + * Implementing this (and returning non-null) will cause the capability to be advertised as a + * promise at the RPC protocol level. Once the promise returned by shortenPath() resolves, the + * remote client will receive a `Resolve` message updating it to point at the new destination. + * + * `shortenPath()` can also be used as a hack to shut up the client. If shortenPath() returns + * a promise that resolves to an exception, then the client will be notified that the capability + * is now broken. Assuming the client is using a correct RPC implemnetation, this should cause + * all further calls initiated by the client to this capability to immediately fail client-side, + * sparing the server's bandwidth. + * + * The default implementation always returns null. + */ public CompletableFuture shortenPath() { return null; } @@ -320,7 +361,7 @@ public RemotePromise send() { }); assert promiseAndPipeline.pipeline != null; - return new RemotePromise<>(promise, promiseAndPipeline.pipeline); + return new RemotePromise<>(promise, new AnyPointer.Pipeline(promiseAndPipeline.pipeline)); } @Override @@ -337,12 +378,12 @@ public Object getBrand() { } private static final class LocalPipeline implements PipelineHook { - private final CallContextHook context; + private final CallContextHook ctx; private final AnyPointer.Reader results; - LocalPipeline(CallContextHook context) { - this.context = context; - this.results = context.getResults().asReader(); + LocalPipeline(CallContextHook ctx) { + this.ctx = ctx; + this.results = ctx.getResults().asReader(); } @Override @@ -439,13 +480,14 @@ static private ClientHook newBrokenClient(String reason, boolean resolved, Objec static private ClientHook newBrokenClient(Throwable exc, boolean resolved, Object brand) { return new ClientHook() { @Override - public Request newCall(long interfaceId, short methodId) { - return Request.newBrokenRequest(exc); + public AnyPointer.Request newCall(long interfaceId, short methodId) { + var broken = Request.newBrokenRequest(AnyPointer.factory, exc); + return new AnyPointer.Request(broken.getParams(), broken.getHook()); } @Override public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { - return new VoidPromiseAndPipeline(CompletableFuture.failedFuture(exc), null); + return new VoidPromiseAndPipeline(CompletableFuture.failedFuture(exc), PipelineHook.newBrokenPipeline(exc)); } @Override @@ -514,10 +556,10 @@ private static class QueuedClient implements ClientHook { } @Override - public Request newCall(long interfaceId, short methodId) { + public AnyPointer.Request newCall(long interfaceId, short methodId) { var hook = new LocalRequest(interfaceId, methodId, this); var root = hook.message.getRoot(AnyPointer.factory); - return new Request<>(root, AnyPointer.factory, hook); + return new AnyPointer.Request(root, hook); } @Override diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index 573c0722..7dd34dea 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -8,7 +8,7 @@ public interface ClientHook { Object NULL_CAPABILITY_BRAND = new Object(); Object BROKEN_CAPABILITY_BRAND = new Object(); - Request newCall(long interfaceId, short methodId); + Request newCall(long interfaceId, short methodId); VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context); @@ -46,7 +46,7 @@ default Object getBrand() { /** * Repeatedly calls whenMoreResolved() until it returns nullptr. */ - default CompletionStage whenResolved() { + default CompletableFuture whenResolved() { var promise = whenMoreResolved(); return promise != null ? promise.thenCompose(ClientHook::whenResolved) @@ -77,13 +77,14 @@ default Integer getFd() { } final class VoidPromiseAndPipeline { + public final CompletableFuture promise; public final PipelineHook pipeline; - VoidPromiseAndPipeline(CompletableFuture promise, PipelineHook pipeline) { + VoidPromiseAndPipeline(CompletableFuture promise, + PipelineHook pipeline) { this.promise = promise; this.pipeline = pipeline; } } - } diff --git a/runtime/src/main/java/org/capnproto/Pipeline.java b/runtime/src/main/java/org/capnproto/Pipeline.java deleted file mode 100644 index 0d06cfc5..00000000 --- a/runtime/src/main/java/org/capnproto/Pipeline.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.capnproto; - -public class Pipeline - extends RemotePromise { - - protected final PipelineOp[] ops; - protected PipelineHook hook; - - public Pipeline(RemotePromise remotePromise) { - this(remotePromise, new PipelineOp[0]); - } - - public Pipeline(RemotePromise remotePromise, PipelineOp[] ops) { - super(remotePromise.response, remotePromise.hook); - this.ops = ops; - this.hook = remotePromise.hook; - } - - public PipelineHook getHook() { - return hook; - } - - Pipeline noop() { - return new Pipeline<>(this, this.ops.clone()); - } - - public ClientHook asCap() { - return this.hook.getPipelinedCap(this.ops); - } - - public Pipeline getPointerField(short pointerIndex) { - var newOps = new PipelineOp[this.ops.length+1]; - for (int ii = 0; ii < this.ops.length; ++ii) { - newOps[ii] = this.ops[ii]; - } - newOps[this.ops.length] = PipelineOp.PointerField(pointerIndex); - return new Pipeline<>(this, newOps); - } -} - - diff --git a/runtime/src/main/java/org/capnproto/PipelineBase.java b/runtime/src/main/java/org/capnproto/PipelineBase.java new file mode 100644 index 00000000..03cc4d57 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/PipelineBase.java @@ -0,0 +1,5 @@ +package org.capnproto; + +public interface PipelineBase { + AnyPointer.Pipeline typelessPipeline(); +} diff --git a/runtime/src/main/java/org/capnproto/PipelineFactory.java b/runtime/src/main/java/org/capnproto/PipelineFactory.java index fb817ec2..0adad032 100644 --- a/runtime/src/main/java/org/capnproto/PipelineFactory.java +++ b/runtime/src/main/java/org/capnproto/PipelineFactory.java @@ -1,5 +1,5 @@ package org.capnproto; public interface PipelineFactory { - Pipeline newPipeline(RemotePromise promise); + Pipeline newPipeline(RemotePromise promise, PipelineImpl typeless); } diff --git a/runtime/src/main/java/org/capnproto/PipelineHook.java b/runtime/src/main/java/org/capnproto/PipelineHook.java index 50c1ac30..e42a5db8 100644 --- a/runtime/src/main/java/org/capnproto/PipelineHook.java +++ b/runtime/src/main/java/org/capnproto/PipelineHook.java @@ -1,6 +1,7 @@ package org.capnproto; public interface PipelineHook { + ClientHook getPipelinedCap(PipelineOp[] ops); static PipelineHook newBrokenPipeline(Throwable exc) { diff --git a/runtime/src/main/java/org/capnproto/PipelineImpl.java b/runtime/src/main/java/org/capnproto/PipelineImpl.java new file mode 100644 index 00000000..de97fff7 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/PipelineImpl.java @@ -0,0 +1,32 @@ +package org.capnproto; + +public class PipelineImpl { + protected final PipelineHook hook; + protected final PipelineOp[] ops; + + public PipelineImpl(PipelineHook hook) { + this(hook, new PipelineOp[0]); + } + + public PipelineImpl(PipelineHook hook, PipelineOp[] ops) { + this.hook = hook; + this.ops = ops; + } + + PipelineImpl noop() { + return new PipelineImpl(this.hook, this.ops.clone()); + } + + public ClientHook asCap() { + return this.hook.getPipelinedCap(ops); + } + + public AnyPointer.Pipeline getPointerField(short pointerIndex) { + var newOps = new PipelineOp[this.ops.length+1]; + for (int ii = 0; ii < this.ops.length; ++ii) { + newOps[ii] = this.ops[ii]; + } + newOps[this.ops.length] = PipelineOp.PointerField(pointerIndex); + return new AnyPointer.Pipeline(this.hook, newOps); + } +} diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index 8cf7bb9c..9b60a341 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -1,19 +1,35 @@ package org.capnproto; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; public class RemotePromise extends CompletableFutureWrapper { - final CompletableFuture> response; - final PipelineHook hook; + private final CompletableFuture> response; + private final AnyPointer.Pipeline pipeline; - RemotePromise(CompletableFuture> promise, - PipelineHook hook) { - super(promise.thenApply(response -> response.getResults())); + public RemotePromise(FromPointerReader factory, + RemotePromise other) { + super(other.thenApply(response -> response.getAs(factory))); + this.response = other.response.thenApply( + response -> new Response<>( + response.getResults().getAs(factory), + response.getHook())); + this.pipeline = other.pipeline; + } + + public RemotePromise(CompletableFuture> promise, + AnyPointer.Pipeline pipeline) { + super(promise.thenApply(response -> { + //System.out.println("Got a response for remote promise " + promise.toString()); + return response.getResults(); + })); this.response = promise; - this.hook = hook; + this.pipeline = pipeline; + } + + public AnyPointer.Pipeline pipeline() { + return this.pipeline; } public static RemotePromise fromTypeless( @@ -21,7 +37,7 @@ public static RemotePromise fromTypeless( RemotePromise typeless) { var promise = typeless.response.thenApply( response -> Response.fromTypeless(resultsFactory, response)); - return new RemotePromise<>(promise, typeless.hook); + return new RemotePromise<>(promise, typeless.pipeline); } } diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index 6d501a57..6bde1ff2 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -2,31 +2,22 @@ import java.util.concurrent.CompletableFuture; -public class Request { - - protected Params params; - private PipelineFactory pipelineFactory; - RequestHook hook; - - public Request(Params params, - PipelineFactory pipelineFactory, - RequestHook hook) { - this.params = params; - this.pipelineFactory = pipelineFactory; - this.hook = hook; - } +public interface Request { + + FromPointerBuilder getParamsFactory(); - public Params getParams() { - return params; + default Params getParams() { + return this.getTypelessRequest().getParams().getAs(this.getParamsFactory()); } - public Results send() { - var typelessPromise = this.hook.send(); - this.hook = null; // prevent reuse - return pipelineFactory.newPipeline(typelessPromise); + default RequestHook getHook() { + return this.getTypelessRequest().getHook(); } - static Request newBrokenRequest(Throwable exc) { + Request getTypelessRequest(); + + static Request newBrokenRequest(FromPointerBuilder paramsFactory, + Throwable exc) { final MessageBuilder message = new MessageBuilder(); @@ -48,13 +39,32 @@ public Object getBrand() { }; var root = message.getRoot(AnyPointer.factory); - return new Request(null, null, hook); + return new Request<>() { + @Override + public FromPointerBuilder getParamsFactory() { + return paramsFactory; + } + + @Override + public Request getTypelessRequest() { + return null; + } + }; } - static Request fromTypeless( - FromPointerBuilder

paramsFactory, - PipelineFactory pipelineFactory, - Request typeless) { - return new Request<>(typeless.params.getAs(paramsFactory), pipelineFactory, typeless.hook); + static Request fromTypeless( + FromPointerBuilder paramsFactory, + Request typeless) { + return new Request<>() { + @Override + public FromPointerBuilder getParamsFactory() { + return paramsFactory; + } + + @Override + public Request getTypelessRequest() { + return typeless; + } + }; } } diff --git a/runtime/src/main/java/org/capnproto/Response.java b/runtime/src/main/java/org/capnproto/Response.java index c08944fe..3d5ab0de 100644 --- a/runtime/src/main/java/org/capnproto/Response.java +++ b/runtime/src/main/java/org/capnproto/Response.java @@ -1,9 +1,9 @@ package org.capnproto; -public class Response { +public final class Response { - private Results results; - private ResponseHook hook; + private final Results results; + private final ResponseHook hook; public Response(Results results, ResponseHook hook) { @@ -15,6 +15,10 @@ public Results getResults() { return this.results; } + public ResponseHook getHook() { + return this.hook; + } + static Response fromTypeless(FromPointerReader resultsFactory, Response typeless) { return new Response<>(typeless.getResults().getAs(resultsFactory), typeless.hook); diff --git a/runtime/src/main/java/org/capnproto/RpcDumper.java b/runtime/src/main/java/org/capnproto/RpcDumper.java index 5f3a81f9..220ff238 100644 --- a/runtime/src/main/java/org/capnproto/RpcDumper.java +++ b/runtime/src/main/java/org/capnproto/RpcDumper.java @@ -5,13 +5,13 @@ public class RpcDumper { - private final Map schemas = new HashMap<>(); + //private final Map schemas = new HashMap<>(); private final Map clientReturnTypes = new HashMap<>(); private final Map serverReturnTypes = new HashMap<>(); - void addSchema(long schemaId, Schema.Node.Reader node) { + /*void addSchema(long schemaId, Schema.Node.Reader node) { this.schemas.put(schemaId, node); - } + }*/ private void setReturnType(RpcTwoPartyProtocol.Side side, int schemaId, long schema) { switch (side) { @@ -68,7 +68,7 @@ String dump(RpcProtocol.Message.Reader message, RpcTwoPartyProtocol.Side sender) var payload = call.getParams(); var params = payload.getContent(); var sendResultsTo = call.getSendResultsTo(); - +/* var schema = this.schemas.get(iface); if (schema != null) { interfaceName = schema.getDisplayName().toString(); @@ -91,7 +91,7 @@ String dump(RpcProtocol.Message.Reader message, RpcTwoPartyProtocol.Side sender) } } - } + }*/ yield sender.name() + "(" + call.getQuestionId() + "): call " + call.getTarget() + " <- " + interfaceName + "." + diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index becaed4b..af704f2f 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -1532,7 +1532,7 @@ public ClientHook getInnermostClient() { } @Override - public Request newCall(long interfaceId, short methodId) { + public Request newCall(long interfaceId, short methodId) { return newCallNoIntercept(interfaceId, methodId); } @@ -1545,7 +1545,7 @@ public VoidPromiseAndPipeline callNoIntercept(long interfaceId, short methodId, var params = context.getParams(); var request = newCallNoIntercept(interfaceId, methodId); context.allowCancellation(); - return context.directTailCall(request.hook); + return context.directTailCall(request.getHook()); } @Override @@ -1553,9 +1553,9 @@ public final Object getBrand() { return RpcState.this; } - private Request newCallNoIntercept(long interfaceId, short methodId) { + private Request newCallNoIntercept(long interfaceId, short methodId) { if (isDisconnected()) { - return Request.newBrokenRequest(disconnected); + return Request.newBrokenRequest(AnyPointer.factory, disconnected); } var request = new RpcRequest(this); @@ -1563,7 +1563,7 @@ private Request newCallNoIntercept(long callBuilder.setInterfaceId(interfaceId); callBuilder.setMethodId(methodId); var root = request.getRoot(); - return new Request<>(root, AnyPointer.factory, request); + return new AnyPointer.Request(root, request); } } @@ -1605,10 +1605,11 @@ public RemotePromise send() { var redirect = this.target.writeTarget(this.callBuilder.getTarget()); if (redirect != null) { - var replacement = redirect.newCall( + var redirected = redirect.newCall( this.callBuilder.getInterfaceId(), this.callBuilder.getMethodId()); - replacement.params = paramsBuilder; - return replacement.hook.send(); + //replacement.params = paramsBuilder; + var replacement = new AnyPointer.Request(paramsBuilder, redirected.getHook()); + return replacement.send(); } final var question = sendInternal(false); @@ -1624,7 +1625,7 @@ public RemotePromise send() { var loop = CompletableFuture.anyOf( getMessageLoop(), appPromise).thenCompose(x -> appPromise); - return new RemotePromise<>(loop, pipeline); + return new RemotePromise<>(loop, new AnyPointer.Pipeline(pipeline)); } @Override From d51550099638640bb09f3eea623617add11d7719 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 30 Oct 2020 18:27:21 +0000 Subject: [PATCH 085/246] get rid of PipelineBase and PipelineImpl again --- compiler/src/main/cpp/capnpc-java.c++ | 2 +- .../main/java/org/capnproto/AnyPointer.java | 30 +++++++++++++---- .../{PipelineBase.java => Pipeline.java} | 2 +- .../java/org/capnproto/PipelineFactory.java | 5 --- .../main/java/org/capnproto/PipelineImpl.java | 32 ------------------- 5 files changed, 26 insertions(+), 45 deletions(-) rename runtime/src/main/java/org/capnproto/{PipelineBase.java => Pipeline.java} (68%) delete mode 100644 runtime/src/main/java/org/capnproto/PipelineFactory.java delete mode 100644 runtime/src/main/java/org/capnproto/PipelineImpl.java diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 8b2387d7..480b6fa8 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -1665,7 +1665,7 @@ private: KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, //spaces(indent), " public interface Pipeline", readerTypeParams, " extends org.capnproto.RemotePromise {\n", - spaces(indent), " public interface Pipeline", readerTypeParams, " extends org.capnproto.PipelineBase {\n", + spaces(indent), " public interface Pipeline", readerTypeParams, " extends org.capnproto.Pipeline {\n", //spaces(indent), " private final org.capnproto.PipelineImpl typeless;\n", //spaces(indent), " org.capnproto.AnyPointer.Pipeline getTypeless();\n", //spaces(indent), " public Pipeline(", diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 105c66de..0d5a18bd 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -35,9 +35,6 @@ public final Builder initFromPointerBuilder(SegmentBuilder segment, CapTableBuil result.clear(); return result; } - public Pipeline newPipeline(PipelineImpl typeless) { - return new AnyPointer.Pipeline(typeless.hook, typeless.ops); - } } public static final Factory factory = new Factory(); @@ -145,20 +142,41 @@ public final void clear() { } } - public static class Pipeline extends PipelineImpl implements PipelineBase { + public static class Pipeline implements org.capnproto.Pipeline { + + protected final PipelineHook hook; + protected final PipelineOp[] ops; public Pipeline(PipelineHook hook) { this(hook, new PipelineOp[0]); } Pipeline(PipelineHook hook, PipelineOp[] ops) { - super(hook, ops); + this.hook = hook; + this.ops = ops; } @Override public Pipeline typelessPipeline() { return this; } + + Pipeline noop() { + return new Pipeline(this.hook, this.ops.clone()); + } + + public ClientHook asCap() { + return this.hook.getPipelinedCap(ops); + } + + public Pipeline getPointerField(short pointerIndex) { + var newOps = new PipelineOp[this.ops.length + 1]; + for (int ii = 0; ii < this.ops.length; ++ii) { + newOps[ii] = this.ops[ii]; + } + newOps[this.ops.length] = PipelineOp.PointerField(pointerIndex); + return new Pipeline(this.hook, newOps); + } } public static final class Request @@ -186,7 +204,7 @@ public org.capnproto.Request getTypelessRequest() { public RequestHook getHook() { return this.requestHook; } - + @Override public FromPointerBuilder getParamsFactory() { return AnyPointer.factory; diff --git a/runtime/src/main/java/org/capnproto/PipelineBase.java b/runtime/src/main/java/org/capnproto/Pipeline.java similarity index 68% rename from runtime/src/main/java/org/capnproto/PipelineBase.java rename to runtime/src/main/java/org/capnproto/Pipeline.java index 03cc4d57..1cfe25e1 100644 --- a/runtime/src/main/java/org/capnproto/PipelineBase.java +++ b/runtime/src/main/java/org/capnproto/Pipeline.java @@ -1,5 +1,5 @@ package org.capnproto; -public interface PipelineBase { +public interface Pipeline { AnyPointer.Pipeline typelessPipeline(); } diff --git a/runtime/src/main/java/org/capnproto/PipelineFactory.java b/runtime/src/main/java/org/capnproto/PipelineFactory.java deleted file mode 100644 index 0adad032..00000000 --- a/runtime/src/main/java/org/capnproto/PipelineFactory.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.capnproto; - -public interface PipelineFactory { - Pipeline newPipeline(RemotePromise promise, PipelineImpl typeless); -} diff --git a/runtime/src/main/java/org/capnproto/PipelineImpl.java b/runtime/src/main/java/org/capnproto/PipelineImpl.java deleted file mode 100644 index de97fff7..00000000 --- a/runtime/src/main/java/org/capnproto/PipelineImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.capnproto; - -public class PipelineImpl { - protected final PipelineHook hook; - protected final PipelineOp[] ops; - - public PipelineImpl(PipelineHook hook) { - this(hook, new PipelineOp[0]); - } - - public PipelineImpl(PipelineHook hook, PipelineOp[] ops) { - this.hook = hook; - this.ops = ops; - } - - PipelineImpl noop() { - return new PipelineImpl(this.hook, this.ops.clone()); - } - - public ClientHook asCap() { - return this.hook.getPipelinedCap(ops); - } - - public AnyPointer.Pipeline getPointerField(short pointerIndex) { - var newOps = new PipelineOp[this.ops.length+1]; - for (int ii = 0; ii < this.ops.length; ++ii) { - newOps[ii] = this.ops[ii]; - } - newOps[this.ops.length] = PipelineOp.PointerField(pointerIndex); - return new AnyPointer.Pipeline(this.hook, newOps); - } -} From a68b6ed81ae22b56cad02f7da30affd0c7a7b86d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 30 Oct 2020 18:29:51 +0000 Subject: [PATCH 086/246] schema generation script for dev work --- gen | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 gen diff --git a/gen b/gen new file mode 100755 index 00000000..49bcae87 --- /dev/null +++ b/gen @@ -0,0 +1,23 @@ +#!/bin/bash + +set -eux + +make CXX=g++-8 capnpc-java + +capnp compile -I./compiler/src/main/schema/ -o/bin/cat ./runtime/src/test/schema/test.capnp > ./runtime/src/test/schema/test.raw +capnp compile -I./compiler/src/main/schema/ -oc++ ./runtime/src/test/schema/test.capnp +capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./runtime/src/test/schema/test.capnp +cp ./runtime/src/test/schema/Test.java ./runtime/src/test/java/org/capnproto/test/ + +capnp compile -I./compiler/src/main/schema/ -oc++ ./runtime/src/test/schema/demo.capnp +capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./runtime/src/test/schema/demo.capnp +cp ./runtime/src/test/schema/Demo.java ./runtime/src/test/java/org/capnproto/demo/ + +capnp compile -I./compiler/src/main/schema/ -o/bin/cat ./runtime/src/test/schema/generics.capnp > ./runtime/src/test/schema/generics.raw +capnp compile -I./compiler/src/main/schema/ -oc++ ./runtime/src/test/schema/generics.capnp +capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./runtime/src/test/schema/generics.capnp +cp ./runtime/src/test/schema/TestGenerics.java ./runtime/src/test/java/org/capnproto/demo/ + +capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./examples/src/main/schema/addressbook.capnp +cp ./examples/src/main/schema/Addressbook.java ./examples/src/main/java/org/capnproto/examples/ + From a10e48d14025774ffc3611356a17e59c8e5aa087 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 30 Oct 2020 18:30:51 +0000 Subject: [PATCH 087/246] test schemas --- runtime/src/test/schema/demo.capnp | 59 ++++++++++++++++++++++++++ runtime/src/test/schema/generics.capnp | 27 ++++++++++++ runtime/src/test/schema/test.capnp | 56 ++++++++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 runtime/src/test/schema/demo.capnp create mode 100644 runtime/src/test/schema/generics.capnp create mode 100644 runtime/src/test/schema/test.capnp diff --git a/runtime/src/test/schema/demo.capnp b/runtime/src/test/schema/demo.capnp new file mode 100644 index 00000000..efdbc9ee --- /dev/null +++ b/runtime/src/test/schema/demo.capnp @@ -0,0 +1,59 @@ +@0xb6577a1582e84742; + +using Java = import "/capnp/java.capnp"; +$Java.package("org.capnproto.demo"); +$Java.outerClassname("Demo"); + +struct TestParams0 { + param0 @0 :Int32; +} + +struct TestResults0 { + result0 @0 :Int32; +} + +struct TestParams1 { + param0 @0 :AnyPointer; +} + +struct TestResults1 { + result0 @0 :AnyPointer; + result1 @1 :AnyPointer; + result2 @2 :AnyPointer; +} + +struct Struct0 { + f0 @0 :Bool; +} + +interface Iface0 { + method0 @0 (); + method1 @1 () -> stream; +} + +struct Struct2 { + f0 @0 :AnyPointer; + f1i @1 :Iface0; +} + +interface TestCap0 { + testMethod0 @0 TestParams0 -> TestResults0; + testMethod1 @1 TestParams1 -> TestResults1; +} + +interface TestCap1 { +} + + +interface Iface1 { + + struct Struct1 { + f0 @0 :Bool; + f1 @1 :AnyPointer; + } + + method0 @0 () -> (result0 :Struct0, result1 :Struct1); + method1 @1 () -> (result0: Iface0); +} + + diff --git a/runtime/src/test/schema/generics.capnp b/runtime/src/test/schema/generics.capnp new file mode 100644 index 00000000..54ffe6d6 --- /dev/null +++ b/runtime/src/test/schema/generics.capnp @@ -0,0 +1,27 @@ +@0xbf250a886b8a4258; + +using Java = import "/capnp/java.capnp"; +$Java.package("org.capnproto.test"); +$Java.outerClassname("TestGenerics"); + +interface Aaa { + struct S { + bar @0 :UInt32; + } +} + +struct Sss(X) { +} + +interface Bbb(X) { + + foo @0 (value: Aaa); +} + +interface Ccc(X) { +} + +#interface Ddd(X, Y) { +# foo @0 (value: X); +# bar @1 () -> (value: X); +#} \ No newline at end of file diff --git a/runtime/src/test/schema/test.capnp b/runtime/src/test/schema/test.capnp new file mode 100644 index 00000000..1a30b384 --- /dev/null +++ b/runtime/src/test/schema/test.capnp @@ -0,0 +1,56 @@ +@0xb365fb00cc89383b; + +using Java = import "/capnp/java.capnp"; +$Java.package("org.capnproto.test"); +$Java.outerClassname("Test"); + +struct TestAllTypes { + voidField @0 : Void; + boolField @1 : Bool; + int8Field @2 : Int8; + int16Field @3 : Int16; + int32Field @4 : Int32; + int64Field @5 : Int64; + uInt8Field @6 : UInt8; + uInt16Field @7 : UInt16; + uInt32Field @8 : UInt32; + uInt64Field @9 : UInt64; + float32Field @10 : Float32; + float64Field @11 : Float64; + textField @12 : Text; + dataField @13 : Data; +} + +interface TestInterface { + foo @0 (i :UInt32, j :Bool) -> (x :Text); + bar @1 () -> (); +} + +interface TestExtends extends(TestInterface) { + qux @0 (); + corge @1 TestAllTypes -> (); + grault @2 () -> TestAllTypes; +} + +interface TestExtends2 extends(TestExtends) {} + +interface TestPipeline { + getCap @0 (n: UInt32, inCap :TestInterface) -> (s: Text, outBox :Box); + testPointers @1 (cap :TestInterface, obj :AnyPointer, list :List(TestInterface)) -> (); + getAnyCap @2 (n: UInt32, inCap :Capability) -> (s: Text, outBox :AnyBox); + + struct Box { + cap @0 :TestInterface; + } + struct AnyBox { + cap @0 :Capability; + } +} + +struct TestGenerics(Foo, Bar) { + foo @0 :Foo; + rev @1 :TestGenerics(Bar, Foo); + + interface Interface(Qux) { + } +} From 8565c40c14db7c656f1aee56c70c973af078d51b Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 30 Oct 2020 18:31:19 +0000 Subject: [PATCH 088/246] capability test suite --- .../java/org/capnproto/CapabilityTest.java | 172 ++++++++++++++++++ .../src/test/java/org/capnproto/TestUtil.java | 37 ++++ 2 files changed, 209 insertions(+) create mode 100644 runtime/src/test/java/org/capnproto/CapabilityTest.java create mode 100644 runtime/src/test/java/org/capnproto/TestUtil.java diff --git a/runtime/src/test/java/org/capnproto/CapabilityTest.java b/runtime/src/test/java/org/capnproto/CapabilityTest.java new file mode 100644 index 00000000..24120827 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/CapabilityTest.java @@ -0,0 +1,172 @@ +// Copyright (c) 2018 Sandstorm Development Group, Inc. and contributors +// Licensed under the MIT License: +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package org.capnproto; + +import org.junit.Assert; +import org.junit.Test; + +import java.nio.ByteBuffer; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +class Counter { + private int count = 0; + + public void inc() { + count++; + } + + public int value() { + return count; + } +} + +class TestInterfaceImpl extends org.capnproto.test.Test.TestInterface.Server { + + + final Counter counter; + + TestInterfaceImpl(Counter counter) { + this.counter = counter; + } + + @Override + protected CompletableFuture foo(CallContext ctx) { + this.counter.inc(); + var params = ctx.getParams(); + var result = ctx.getResults(); + Assert.assertEquals(123, params.getI()); + Assert.assertTrue(params.getJ()); + result.setX("foo"); + return CompletableFuture.completedFuture(null); + } +} + +class TestExtendsImpl extends org.capnproto.test.Test.TestExtends2.Server { + + final Counter counter; + + TestExtendsImpl(Counter counter) { + this.counter = counter; + } + + @Override + protected CompletableFuture foo(CallContext context) { + counter.inc(); + var params = context.getParams(); + var result = context.getResults(); + Assert.assertEquals(321, params.getI()); + Assert.assertFalse(params.getJ()); + result.setX("bar"); + return CompletableFuture.completedFuture(null); + } + + @Override + protected CompletableFuture grault(CallContext context) { + counter.inc(); + context.releaseParams(); + TestUtil.initTestMessage(context.getResults()); + return CompletableFuture.completedFuture(null); + } +} + +class TestPipelineImpl extends org.capnproto.test.Test.TestPipeline.Server { + + final Counter counter; + + TestPipelineImpl(Counter counter) { + this.counter = counter; + } + + @Override + protected CompletableFuture getCap(CallContext ctx) { + this.counter.inc(); + var params = ctx.getParams(); + Assert.assertEquals(234, params.getN()); + var cap = params.getInCap(); + ctx.releaseParams(); + + var request = cap.fooRequest(); + var fooParams = request.getParams(); + fooParams.setI(123); + fooParams.setJ(true); + + return request.send().thenAccept(response -> { + Assert.assertEquals("foo", response.getX().toString()); + var result = ctx.getResults(); + result.setS("bar"); + + org.capnproto.test.Test.TestExtends.Server server = new TestExtendsImpl(this.counter); + result.initOutBox().setCap(server); + }); + } + + @Override + protected CompletableFuture getAnyCap(CallContext context) { + return super.getAnyCap(context); + } +} + +public class CapabilityTest { + + @Test + public void testPipelining() throws ExecutionException, InterruptedException { + var callCount = new Counter(); + var chainedCallCount = new Counter(); + + var client = new org.capnproto.test.Test.TestPipeline.Client( + new TestPipelineImpl(callCount)); + + var request = client.getCapRequest(); + var params = request.getParams(); + params.setN(234); + params.setInCap(new org.capnproto.test.Test.TestInterface.Client( + new TestInterfaceImpl(chainedCallCount))); + + var promise = request.send(); + var outbox = promise.getOutBox(); + var pipelineRequest = outbox.getCap().fooRequest(); + pipelineRequest.getParams().setI(321); + var pipelinePromise = pipelineRequest.send(); + var pipelineRequest2 = new org.capnproto.test.Test.TestExtends.Client(promise.getOutBox().getCap()).graultRequest(); + var pipelinePromise2 = pipelineRequest2.send(); + + // Hmm, we have no means to defer the evaluation of callInternal. The best we can do is + // wait for the client to have resolved. + + //Assert.assertEquals(0, callCount.value()); + //Assert.assertEquals(0, chainedCallCount.value()); + + var response = pipelinePromise.get(); + Assert.assertEquals("bar", response.getX().toString()); + var response2 = pipelinePromise2.get(); + TestUtil.checkTestMessage(response2); + Assert.assertEquals(3, callCount.value()); + Assert.assertEquals(1, chainedCallCount.value()); + } + + @Test + public void testGenerics() { + var factory = org.capnproto.test.Test.TestGenerics.newFactory(org.capnproto.test.Test.TestAllTypes.factory, AnyPointer.factory); + + } +} \ No newline at end of file diff --git a/runtime/src/test/java/org/capnproto/TestUtil.java b/runtime/src/test/java/org/capnproto/TestUtil.java new file mode 100644 index 00000000..75f97270 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/TestUtil.java @@ -0,0 +1,37 @@ +package org.capnproto; + +import org.junit.Assert; + +class TestUtil { + static void initTestMessage(org.capnproto.test.Test.TestAllTypes.Builder builder) { + builder.setVoidField(Void.VOID); + builder.setBoolField(true); + builder.setInt8Field((byte) -123); + builder.setInt16Field((short) -12345); + builder.setInt32Field(-12345678); + builder.setInt64Field(-123456789012345L); + builder.setUInt8Field((byte) 234); + builder.setUInt16Field((short) 45678); + builder.setUInt32Field((int) 3456789012l); + builder.setUInt64Field(1234567890123456789L); + builder.setFloat32Field(1234.5f); + builder.setFloat64Field(-123e45); + builder.setTextField("foo"); + } + + static void checkTestMessage(org.capnproto.test.Test.TestAllTypes.Reader reader) { + Assert.assertEquals(Void.VOID, reader.getVoidField()); + Assert.assertTrue(reader.getBoolField()); + Assert.assertEquals((byte)-123, reader.getInt8Field()); + Assert.assertEquals((short)-12345, reader.getInt16Field()); + Assert.assertEquals(-12345678, reader.getInt32Field()); + Assert.assertEquals(-123456789012345l, reader.getInt64Field()); + Assert.assertEquals((byte)234, reader.getUInt8Field()); + Assert.assertEquals((short)45678, reader.getUInt16Field()); + Assert.assertEquals((int)3456789012l, reader.getUInt32Field()); + Assert.assertEquals(1234567890123456789l, reader.getUInt64Field()); + Assert.assertEquals(null, 1234.5f, reader.getFloat32Field(), 0.1f); + Assert.assertEquals(null, -123e45, reader.getFloat64Field(), 0.1f); + Assert.assertEquals("foo", reader.getTextField().toString()); + } +} From 069da9b0adb6c07f7b163780fad2194191b2c4b4 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 2 Nov 2020 15:09:05 +0000 Subject: [PATCH 089/246] tidy up generated output and remove dead code --- compiler/src/main/cpp/capnpc-java.c++ | 33 ++++----------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 480b6fa8..8bbe6440 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -1535,7 +1535,6 @@ private: spaces(indent), " public static final class Factory", factoryTypeParams, "\n", spaces(indent), " extends org.capnproto.StructFactory {\n", - //spaces(indent), " implements org.capnproto.PipelineFactory {\n", factoryMembers.flatten(), spaces(indent), " public Factory(", factoryArgs.flatten(), @@ -1570,14 +1569,6 @@ private: (hasTypeParams ? kj::strTree("this") : kj::strTree()), ");\n", spaces(indent), " }\n", - //spaces(indent), " public Pipeline", readerTypeParams, " newPipeline(org.capnproto.RemotePromise promise, org.capnproto.PipelineImpl typeless) {\n", - //spaces(indent), " return new Pipeline", readerTypeParamsInferred, "(", - //kj::StringTree(KJ_MAP(p, typeParamVec) { - // return kj::strTree(p, "_Factory"); - // }, ", "), - //(hasTypeParams ? ", ": ""), "promise, typeless);\n", - //spaces(indent), " }\n", - spaces(indent), " }\n", (hasTypeParams ? kj::strTree( @@ -1663,19 +1654,8 @@ private: spaces(indent), " _NOT_IN_SCHEMA,\n", spaces(indent), " }\n"), KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, - - //spaces(indent), " public interface Pipeline", readerTypeParams, " extends org.capnproto.RemotePromise {\n", - spaces(indent), " public interface Pipeline", readerTypeParams, " extends org.capnproto.Pipeline {\n", - //spaces(indent), " private final org.capnproto.PipelineImpl typeless;\n", - //spaces(indent), " org.capnproto.AnyPointer.Pipeline getTypeless();\n", - //spaces(indent), " public Pipeline(", - //#KJ_MAP(p, typeParamVec) { - // return kj::strTree("org.capnproto.PointerFactory ", p, "_Factory,"); - //}, " org.capnproto.RemotePromise remotePromise,\n", - //spaces(indent), " org.capnproto.PipelineImpl typelessPipeline) {\n", - //spaces(indent), " super(org.capnproto.RemotePromise.fromTypeless(", factoryRef, ", remotePromise));\n", - //spaces(indent), " this.typeless = typelessPipeline;\n", - //spaces(indent), " }\n", + spaces(indent), " public interface Pipeline", readerTypeParams, "\n", + spaces(indent), " extends org.capnproto.Pipeline {\n", KJ_MAP(f, fieldTexts) { return kj::mv(f.pipelineMethodDecls); }, @@ -1849,14 +1829,11 @@ private: sp, " public Client(java.util.concurrent.CompletionStage promise) {\n", sp, " super(promise);\n", sp, " }\n", - "\n", sp, " public static final class Methods {\n", KJ_MAP(m, methods) { return kj::mv(m.clientMethodDefs); }, sp, " }\n", - "\n", KJ_MAP(m, methods) { return kj::mv(m.clientCalls); }, sp, " }\n", - "\n", sp, " public static abstract class Server\n", (superclasses.size() == 0 ? kj::str(sp, " extends org.capnproto.Capability.Server ") @@ -1883,7 +1860,6 @@ private: sp, " org.capnproto.Capability.Server.internalUnimplemented(\"", name, "\", interfaceId));\n", sp, " }\n", sp, " }\n", - "\n", sp, " private org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) {\n", sp, " switch (methodId) {\n", KJ_MAP(m, methods) { return kj::mv(m.dispatchCase); }, @@ -1891,12 +1867,11 @@ private: sp, " return org.capnproto.Capability.Server.result(\n", sp, " org.capnproto.Capability.Server.internalUnimplemented(\"", name, "\", 0x", hexId, "L, methodId));\n", sp, " }\n", - sp, " }\n\n", + sp, " }\n", KJ_MAP(m, methods) { return kj::mv(m.serverDefs); }, + sp, " protected Client thisCap() { return new Client(super.thisCap()); }\n", sp, " }\n", - sp, "\n", KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, - "\n", sp, "}\n", "\n") }; From aaa11f777ce5609b8db359d6f09c30f8c14c8b5b Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 2 Nov 2020 15:09:29 +0000 Subject: [PATCH 090/246] reduce gen script paths --- gen | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gen b/gen index 49bcae87..6fd2d73a 100755 --- a/gen +++ b/gen @@ -2,6 +2,8 @@ set -eux +export PATH=/usr/local/bin:/usr/bin:/bin + make CXX=g++-8 capnpc-java capnp compile -I./compiler/src/main/schema/ -o/bin/cat ./runtime/src/test/schema/test.capnp > ./runtime/src/test/schema/test.raw From 33d16c4fb60f97637104adf0d00ebfaf9c7c6e2d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 2 Nov 2020 15:09:50 +0000 Subject: [PATCH 091/246] add READY_NOW --- runtime/src/main/java/org/capnproto/Capability.java | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 5f9da117..58cdcfdd 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -145,6 +145,7 @@ private static ClientHook makeLocalClient(Server server) { public abstract static class Server { + public static final CompletableFuture READY_NOW = CompletableFuture.completedFuture(null); private static final Object BRAND = new Object(); private ClientHook hook; From 630d71d4e50a8e4faf5a006387e088a6bbaf8785 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 2 Nov 2020 15:10:13 +0000 Subject: [PATCH 092/246] implement more capability tests --- .../java/org/capnproto/CapabilityTest.java | 117 ++++++++++++++++-- 1 file changed, 105 insertions(+), 12 deletions(-) diff --git a/runtime/src/test/java/org/capnproto/CapabilityTest.java b/runtime/src/test/java/org/capnproto/CapabilityTest.java index 24120827..49ba7bcf 100644 --- a/runtime/src/test/java/org/capnproto/CapabilityTest.java +++ b/runtime/src/test/java/org/capnproto/CapabilityTest.java @@ -24,25 +24,17 @@ import org.junit.Assert; import org.junit.Test; -import java.nio.ByteBuffer; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; class Counter { private int count = 0; - - public void inc() { - count++; - } - - public int value() { - return count; - } + void inc() { count++; } + int value() { return count; } } class TestInterfaceImpl extends org.capnproto.test.Test.TestInterface.Server { - final Counter counter; TestInterfaceImpl(Counter counter) { @@ -57,7 +49,17 @@ protected CompletableFuture foo(CallContext baz(CallContext context) { + this.counter.inc(); + var params = context.getParams(); + TestUtil.checkTestMessage(params.getS()); + context.releaseParams(); + Assert.assertThrows(RpcException.class, () -> context.getParams()); + return READY_NOW; } } @@ -128,6 +130,59 @@ protected CompletableFuture getAnyCap(CallContext { + Assert.assertNotNull(exc); + Assert.assertTrue(exc instanceof RpcException); + var rpcExc = (RpcException)exc; + Assert.assertEquals(RpcException.Type.UNIMPLEMENTED, rpcExc.getType()); + }); + } + + @Test + public void testInheritance() throws ExecutionException, InterruptedException { + var callCount = new Counter(); + + var client1 = new org.capnproto.test.Test.TestExtends.Client( + new TestExtendsImpl(callCount)); + + org.capnproto.test.Test.TestInterface.Client client2 = client1; + var client = (org.capnproto.test.Test.TestExtends.Client)client2; + + var request1 = client.fooRequest(); + request1.getParams().setI(321); + var promise1 = request1.send(); + + var request2 = client.graultRequest(); + var promise2 = request2.send(); + + // Hmm, we have no means to defer the evaluation of callInternal. + //Assert.assertEquals(0, callCount.value()); + + var response2 = promise2.get(); + TestUtil.checkTestMessage(response2); + + var response1 = promise1.get(); + Assert.assertEquals("bar", response1.getX().toString()); + Assert.assertEquals(2, callCount.value()); + } + @Test public void testPipelining() throws ExecutionException, InterruptedException { var callCount = new Counter(); @@ -164,9 +219,47 @@ public void testPipelining() throws ExecutionException, InterruptedException { Assert.assertEquals(1, chainedCallCount.value()); } + class TestThisCap extends org.capnproto.test.Test.TestInterface.Server { + + Counter counter; + + TestThisCap(Counter counter) { + this.counter = counter; + } + + org.capnproto.test.Test.TestInterface.Client getSelf() { + return this.thisCap(); + } + + @Override + protected CompletableFuture bar(CallContext context) { + this.counter.inc(); + return READY_NOW; + } + } + @Test public void testGenerics() { var factory = org.capnproto.test.Test.TestGenerics.newFactory(org.capnproto.test.Test.TestAllTypes.factory, AnyPointer.factory); + } + + + @Test + public void thisCap() { + var callCount = new Counter(); + var server = new TestThisCap(callCount); + var client = new org.capnproto.test.Test.TestInterface.Client(server); + client.barRequest().send().join(); + Assert.assertEquals(1, callCount.value()); + + var client2 = server.getSelf(); + Assert.assertEquals(1, callCount.value()); + client2.barRequest().send().join(); + Assert.assertEquals(2, callCount.value()); + client = null; + Assert.assertEquals(2, callCount.value()); + client2.barRequest().send().join(); + Assert.assertEquals(3, callCount.value()); } -} \ No newline at end of file +} From 02789acf29d76263e18d2f81cf86434fb439ddba Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 2 Nov 2020 15:11:25 +0000 Subject: [PATCH 093/246] add TestInterface.baz. Stub out broken TestGenerics --- runtime/src/test/schema/test.capnp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/src/test/schema/test.capnp b/runtime/src/test/schema/test.capnp index 1a30b384..d6c2f334 100644 --- a/runtime/src/test/schema/test.capnp +++ b/runtime/src/test/schema/test.capnp @@ -24,6 +24,7 @@ struct TestAllTypes { interface TestInterface { foo @0 (i :UInt32, j :Bool) -> (x :Text); bar @1 () -> (); + baz @2 (s: TestAllTypes); } interface TestExtends extends(TestInterface) { @@ -49,7 +50,7 @@ interface TestPipeline { struct TestGenerics(Foo, Bar) { foo @0 :Foo; - rev @1 :TestGenerics(Bar, Foo); +# rev @1 :TestGenerics(Bar, Foo); interface Interface(Qux) { } From 518769247bdd02c7f87c44aa09d0eb52000451fe Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 2 Nov 2020 15:13:37 +0000 Subject: [PATCH 094/246] remove generated schema.schema --- .../src/main/java/org/capnproto/Schema.java | 7916 ----------------- 1 file changed, 7916 deletions(-) delete mode 100644 runtime/src/main/java/org/capnproto/Schema.java diff --git a/runtime/src/main/java/org/capnproto/Schema.java b/runtime/src/main/java/org/capnproto/Schema.java deleted file mode 100644 index bca5e0cd..00000000 --- a/runtime/src/main/java/org/capnproto/Schema.java +++ /dev/null @@ -1,7916 +0,0 @@ -// Generated by Cap'n Proto compiler, DO NOT EDIT -// source: schema.capnp - -package org.capnproto; - -public final class Schema { - public static class Node { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Node.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(6)) { - case 0 : return Which.FILE; - case 1 : return Which.STRUCT; - case 2 : return Which.ENUM; - case 3 : return Which.INTERFACE; - case 4 : return Which.CONST; - case 5 : return Which.ANNOTATION; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getId() { - return _getLongField(0); - } - public final void setId(long value) { - _setLongField(0, value); - } - - public final boolean hasDisplayName() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getDisplayName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setDisplayName(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setDisplayName(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initDisplayName(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - public final int getDisplayNamePrefixLength() { - return _getIntField(2); - } - public final void setDisplayNamePrefixLength(int value) { - _setIntField(2, value); - } - - public final long getScopeId() { - return _getLongField(2); - } - public final void setScopeId(long value) { - _setLongField(2, value); - } - - public final boolean hasNestedNodes() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Builder getNestedNodes() { - return _getPointerField(org.capnproto.Schema.Node.NestedNode.listFactory, 1, null, 0); - } - public final void setNestedNodes(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Node.NestedNode.listFactory, 1, value); - } - public final org.capnproto.StructList.Builder initNestedNodes(int size) { - return _initPointerField(org.capnproto.Schema.Node.NestedNode.listFactory, 1, size); - } - public final boolean hasAnnotations() { - return !_pointerFieldIsNull(2); - } - public final org.capnproto.StructList.Builder getAnnotations() { - return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 2, null, 0); - } - public final void setAnnotations(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Annotation.listFactory, 2, value); - } - public final org.capnproto.StructList.Builder initAnnotations(int size) { - return _initPointerField(org.capnproto.Schema.Annotation.listFactory, 2, size); - } - public final boolean isFile() { - return which() == Node.Which.FILE; - } - public final org.capnproto.Void getFile() { - assert which() == Node.Which.FILE: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setFile(org.capnproto.Void value) { - _setShortField(6, (short)Node.Which.FILE.ordinal()); - } - - public final boolean isStruct() { - return which() == Node.Which.STRUCT; - } - public final Struct.Builder getStruct() { - return new Node.Struct.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Struct.Builder initStruct() { - _setShortField(6, (short)Node.Which.STRUCT.ordinal()); - _setShortField(7,(short)0); - _setShortField(12,(short)0); - _setShortField(13,(short)0); - _setBooleanField(224,false); - _setShortField(15,(short)0); - _setIntField(8,0); - _clearPointerField(3); - return new Node.Struct.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean isEnum() { - return which() == Node.Which.ENUM; - } - public final Enum.Builder getEnum() { - return new Node.Enum.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Enum.Builder initEnum() { - _setShortField(6, (short)Node.Which.ENUM.ordinal()); - _clearPointerField(3); - return new Node.Enum.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean isInterface() { - return which() == Node.Which.INTERFACE; - } - public final Interface.Builder getInterface() { - return new Node.Interface.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Interface.Builder initInterface() { - _setShortField(6, (short)Node.Which.INTERFACE.ordinal()); - _clearPointerField(3); - _clearPointerField(4); - return new Node.Interface.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean isConst() { - return which() == Node.Which.CONST; - } - public final Const.Builder getConst() { - return new Node.Const.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Const.Builder initConst() { - _setShortField(6, (short)Node.Which.CONST.ordinal()); - _clearPointerField(3); - _clearPointerField(4); - return new Node.Const.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean isAnnotation() { - return which() == Node.Which.ANNOTATION; - } - public final Annotation.Builder getAnnotation() { - return new Node.Annotation.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Annotation.Builder initAnnotation() { - _setShortField(6, (short)Node.Which.ANNOTATION.ordinal()); - _setBooleanField(112,false); - _setBooleanField(113,false); - _setBooleanField(114,false); - _setBooleanField(115,false); - _setBooleanField(116,false); - _setBooleanField(117,false); - _setBooleanField(118,false); - _setBooleanField(119,false); - _setBooleanField(120,false); - _setBooleanField(121,false); - _setBooleanField(122,false); - _setBooleanField(123,false); - _clearPointerField(3); - return new Node.Annotation.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean hasParameters() { - return !_pointerFieldIsNull(5); - } - public final org.capnproto.StructList.Builder getParameters() { - return _getPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 5, null, 0); - } - public final void setParameters(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 5, value); - } - public final org.capnproto.StructList.Builder initParameters(int size) { - return _initPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 5, size); - } - public final boolean getIsGeneric() { - return _getBooleanField(288); - } - public final void setIsGeneric(boolean value) { - _setBooleanField(288, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(6)) { - case 0 : return Which.FILE; - case 1 : return Which.STRUCT; - case 2 : return Which.ENUM; - case 3 : return Which.INTERFACE; - case 4 : return Which.CONST; - case 5 : return Which.ANNOTATION; - default: return Which._NOT_IN_SCHEMA; - } - } - public final long getId() { - return _getLongField(0); - } - - public boolean hasDisplayName() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getDisplayName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - public final int getDisplayNamePrefixLength() { - return _getIntField(2); - } - - public final long getScopeId() { - return _getLongField(2); - } - - public final boolean hasNestedNodes() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Reader getNestedNodes() { - return _getPointerField(org.capnproto.Schema.Node.NestedNode.listFactory, 1, null, 0); - } - - public final boolean hasAnnotations() { - return !_pointerFieldIsNull(2); - } - public final org.capnproto.StructList.Reader getAnnotations() { - return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 2, null, 0); - } - - public final boolean isFile() { - return which() == Node.Which.FILE; - } - public final org.capnproto.Void getFile() { - assert which() == Node.Which.FILE: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isStruct() { - return which() == Node.Which.STRUCT; - } - public Struct.Reader getStruct() { - return new Node.Struct.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean isEnum() { - return which() == Node.Which.ENUM; - } - public Enum.Reader getEnum() { - return new Node.Enum.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean isInterface() { - return which() == Node.Which.INTERFACE; - } - public Interface.Reader getInterface() { - return new Node.Interface.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean isConst() { - return which() == Node.Which.CONST; - } - public Const.Reader getConst() { - return new Node.Const.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean isAnnotation() { - return which() == Node.Which.ANNOTATION; - } - public Annotation.Reader getAnnotation() { - return new Node.Annotation.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean hasParameters() { - return !_pointerFieldIsNull(5); - } - public final org.capnproto.StructList.Reader getParameters() { - return _getPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 5, null, 0); - } - - public final boolean getIsGeneric() { - return _getBooleanField(288); - } - - } - - public enum Which { - FILE, - STRUCT, - ENUM, - INTERFACE, - CONST, - ANNOTATION, - _NOT_IN_SCHEMA, - } - public static class Parameter { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Node.Parameter.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasName() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setName(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setName(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initName(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasName() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class NestedNode { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Node.NestedNode.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasName() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setName(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setName(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initName(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - public final long getId() { - return _getLongField(0); - } - public final void setId(long value) { - _setLongField(0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasName() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - public final long getId() { - return _getLongField(0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class SourceInfo { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Node.SourceInfo.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getId() { - return _getLongField(0); - } - public final void setId(long value) { - _setLongField(0, value); - } - - public final boolean hasDocComment() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getDocComment() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setDocComment(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setDocComment(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initDocComment(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - public final boolean hasMembers() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Builder getMembers() { - return _getPointerField(org.capnproto.Schema.Node.SourceInfo.Member.listFactory, 1, null, 0); - } - public final void setMembers(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Node.SourceInfo.Member.listFactory, 1, value); - } - public final org.capnproto.StructList.Builder initMembers(int size) { - return _initPointerField(org.capnproto.Schema.Node.SourceInfo.Member.listFactory, 1, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final long getId() { - return _getLongField(0); - } - - public boolean hasDocComment() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getDocComment() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - public final boolean hasMembers() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Reader getMembers() { - return _getPointerField(org.capnproto.Schema.Node.SourceInfo.Member.listFactory, 1, null, 0); - } - - } - - public static class Member { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Node.SourceInfo.Member.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasDocComment() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getDocComment() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setDocComment(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setDocComment(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initDocComment(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasDocComment() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getDocComment() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Struct { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Node.Struct.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final short getDataWordCount() { - return _getShortField(7); - } - public final void setDataWordCount(short value) { - _setShortField(7, value); - } - - public final short getPointerCount() { - return _getShortField(12); - } - public final void setPointerCount(short value) { - _setShortField(12, value); - } - - public final org.capnproto.Schema.ElementSize getPreferredListEncoding() { - switch(_getShortField(13)) { - case 0 : return org.capnproto.Schema.ElementSize.EMPTY; - case 1 : return org.capnproto.Schema.ElementSize.BIT; - case 2 : return org.capnproto.Schema.ElementSize.BYTE; - case 3 : return org.capnproto.Schema.ElementSize.TWO_BYTES; - case 4 : return org.capnproto.Schema.ElementSize.FOUR_BYTES; - case 5 : return org.capnproto.Schema.ElementSize.EIGHT_BYTES; - case 6 : return org.capnproto.Schema.ElementSize.POINTER; - case 7 : return org.capnproto.Schema.ElementSize.INLINE_COMPOSITE; - default: return org.capnproto.Schema.ElementSize._NOT_IN_SCHEMA; - } - } - public final void setPreferredListEncoding(org.capnproto.Schema.ElementSize value) { - _setShortField(13, (short)value.ordinal()); - } - - public final boolean getIsGroup() { - return _getBooleanField(224); - } - public final void setIsGroup(boolean value) { - _setBooleanField(224, value); - } - - public final short getDiscriminantCount() { - return _getShortField(15); - } - public final void setDiscriminantCount(short value) { - _setShortField(15, value); - } - - public final int getDiscriminantOffset() { - return _getIntField(8); - } - public final void setDiscriminantOffset(int value) { - _setIntField(8, value); - } - - public final boolean hasFields() { - return !_pointerFieldIsNull(3); - } - public final org.capnproto.StructList.Builder getFields() { - return _getPointerField(org.capnproto.Schema.Field.listFactory, 3, null, 0); - } - public final void setFields(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Field.listFactory, 3, value); - } - public final org.capnproto.StructList.Builder initFields(int size) { - return _initPointerField(org.capnproto.Schema.Field.listFactory, 3, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final short getDataWordCount() { - return _getShortField(7); - } - - public final short getPointerCount() { - return _getShortField(12); - } - - public final org.capnproto.Schema.ElementSize getPreferredListEncoding() { - switch(_getShortField(13)) { - case 0 : return org.capnproto.Schema.ElementSize.EMPTY; - case 1 : return org.capnproto.Schema.ElementSize.BIT; - case 2 : return org.capnproto.Schema.ElementSize.BYTE; - case 3 : return org.capnproto.Schema.ElementSize.TWO_BYTES; - case 4 : return org.capnproto.Schema.ElementSize.FOUR_BYTES; - case 5 : return org.capnproto.Schema.ElementSize.EIGHT_BYTES; - case 6 : return org.capnproto.Schema.ElementSize.POINTER; - case 7 : return org.capnproto.Schema.ElementSize.INLINE_COMPOSITE; - default: return org.capnproto.Schema.ElementSize._NOT_IN_SCHEMA; - } - } - - public final boolean getIsGroup() { - return _getBooleanField(224); - } - - public final short getDiscriminantCount() { - return _getShortField(15); - } - - public final int getDiscriminantOffset() { - return _getIntField(8); - } - - public final boolean hasFields() { - return !_pointerFieldIsNull(3); - } - public final org.capnproto.StructList.Reader getFields() { - return _getPointerField(org.capnproto.Schema.Field.listFactory, 3, null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Enum { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Node.Enum.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasEnumerants() { - return !_pointerFieldIsNull(3); - } - public final org.capnproto.StructList.Builder getEnumerants() { - return _getPointerField(org.capnproto.Schema.Enumerant.listFactory, 3, null, 0); - } - public final void setEnumerants(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Enumerant.listFactory, 3, value); - } - public final org.capnproto.StructList.Builder initEnumerants(int size) { - return _initPointerField(org.capnproto.Schema.Enumerant.listFactory, 3, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean hasEnumerants() { - return !_pointerFieldIsNull(3); - } - public final org.capnproto.StructList.Reader getEnumerants() { - return _getPointerField(org.capnproto.Schema.Enumerant.listFactory, 3, null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Interface { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Node.Interface.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasMethods() { - return !_pointerFieldIsNull(3); - } - public final org.capnproto.StructList.Builder getMethods() { - return _getPointerField(org.capnproto.Schema.Method.listFactory, 3, null, 0); - } - public final void setMethods(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Method.listFactory, 3, value); - } - public final org.capnproto.StructList.Builder initMethods(int size) { - return _initPointerField(org.capnproto.Schema.Method.listFactory, 3, size); - } - public final boolean hasSuperclasses() { - return !_pointerFieldIsNull(4); - } - public final org.capnproto.StructList.Builder getSuperclasses() { - return _getPointerField(org.capnproto.Schema.Superclass.listFactory, 4, null, 0); - } - public final void setSuperclasses(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Superclass.listFactory, 4, value); - } - public final org.capnproto.StructList.Builder initSuperclasses(int size) { - return _initPointerField(org.capnproto.Schema.Superclass.listFactory, 4, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean hasMethods() { - return !_pointerFieldIsNull(3); - } - public final org.capnproto.StructList.Reader getMethods() { - return _getPointerField(org.capnproto.Schema.Method.listFactory, 3, null, 0); - } - - public final boolean hasSuperclasses() { - return !_pointerFieldIsNull(4); - } - public final org.capnproto.StructList.Reader getSuperclasses() { - return _getPointerField(org.capnproto.Schema.Superclass.listFactory, 4, null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Const { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Node.Const.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final org.capnproto.Schema.Type.Builder getType() { - return _getPointerField(org.capnproto.Schema.Type.factory, 3, null, 0); - } - public final void setType(org.capnproto.Schema.Type.Reader value) { - _setPointerField(org.capnproto.Schema.Type.factory,3, value); - } - public final org.capnproto.Schema.Type.Builder initType() { - return _initPointerField(org.capnproto.Schema.Type.factory,3, 0); - } - public final org.capnproto.Schema.Value.Builder getValue() { - return _getPointerField(org.capnproto.Schema.Value.factory, 4, null, 0); - } - public final void setValue(org.capnproto.Schema.Value.Reader value) { - _setPointerField(org.capnproto.Schema.Value.factory,4, value); - } - public final org.capnproto.Schema.Value.Builder initValue() { - return _initPointerField(org.capnproto.Schema.Value.factory,4, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasType() { - return !_pointerFieldIsNull(3); - } - public org.capnproto.Schema.Type.Reader getType() { - return _getPointerField(org.capnproto.Schema.Type.factory,3,null, 0); - } - - public boolean hasValue() { - return !_pointerFieldIsNull(4); - } - public org.capnproto.Schema.Value.Reader getValue() { - return _getPointerField(org.capnproto.Schema.Value.factory,4,null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Annotation { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)5,(short)6); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Node.Annotation.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final org.capnproto.Schema.Type.Builder getType() { - return _getPointerField(org.capnproto.Schema.Type.factory, 3, null, 0); - } - public final void setType(org.capnproto.Schema.Type.Reader value) { - _setPointerField(org.capnproto.Schema.Type.factory,3, value); - } - public final org.capnproto.Schema.Type.Builder initType() { - return _initPointerField(org.capnproto.Schema.Type.factory,3, 0); - } - public final boolean getTargetsFile() { - return _getBooleanField(112); - } - public final void setTargetsFile(boolean value) { - _setBooleanField(112, value); - } - - public final boolean getTargetsConst() { - return _getBooleanField(113); - } - public final void setTargetsConst(boolean value) { - _setBooleanField(113, value); - } - - public final boolean getTargetsEnum() { - return _getBooleanField(114); - } - public final void setTargetsEnum(boolean value) { - _setBooleanField(114, value); - } - - public final boolean getTargetsEnumerant() { - return _getBooleanField(115); - } - public final void setTargetsEnumerant(boolean value) { - _setBooleanField(115, value); - } - - public final boolean getTargetsStruct() { - return _getBooleanField(116); - } - public final void setTargetsStruct(boolean value) { - _setBooleanField(116, value); - } - - public final boolean getTargetsField() { - return _getBooleanField(117); - } - public final void setTargetsField(boolean value) { - _setBooleanField(117, value); - } - - public final boolean getTargetsUnion() { - return _getBooleanField(118); - } - public final void setTargetsUnion(boolean value) { - _setBooleanField(118, value); - } - - public final boolean getTargetsGroup() { - return _getBooleanField(119); - } - public final void setTargetsGroup(boolean value) { - _setBooleanField(119, value); - } - - public final boolean getTargetsInterface() { - return _getBooleanField(120); - } - public final void setTargetsInterface(boolean value) { - _setBooleanField(120, value); - } - - public final boolean getTargetsMethod() { - return _getBooleanField(121); - } - public final void setTargetsMethod(boolean value) { - _setBooleanField(121, value); - } - - public final boolean getTargetsParam() { - return _getBooleanField(122); - } - public final void setTargetsParam(boolean value) { - _setBooleanField(122, value); - } - - public final boolean getTargetsAnnotation() { - return _getBooleanField(123); - } - public final void setTargetsAnnotation(boolean value) { - _setBooleanField(123, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasType() { - return !_pointerFieldIsNull(3); - } - public org.capnproto.Schema.Type.Reader getType() { - return _getPointerField(org.capnproto.Schema.Type.factory,3,null, 0); - } - - public final boolean getTargetsFile() { - return _getBooleanField(112); - } - - public final boolean getTargetsConst() { - return _getBooleanField(113); - } - - public final boolean getTargetsEnum() { - return _getBooleanField(114); - } - - public final boolean getTargetsEnumerant() { - return _getBooleanField(115); - } - - public final boolean getTargetsStruct() { - return _getBooleanField(116); - } - - public final boolean getTargetsField() { - return _getBooleanField(117); - } - - public final boolean getTargetsUnion() { - return _getBooleanField(118); - } - - public final boolean getTargetsGroup() { - return _getBooleanField(119); - } - - public final boolean getTargetsInterface() { - return _getBooleanField(120); - } - - public final boolean getTargetsMethod() { - return _getBooleanField(121); - } - - public final boolean getTargetsParam() { - return _getBooleanField(122); - } - - public final boolean getTargetsAnnotation() { - return _getBooleanField(123); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Field { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)4); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Field.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(4)) { - case 0 : return Which.SLOT; - case 1 : return Which.GROUP; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasName() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setName(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setName(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initName(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - public final short getCodeOrder() { - return _getShortField(0); - } - public final void setCodeOrder(short value) { - _setShortField(0, value); - } - - public final boolean hasAnnotations() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Builder getAnnotations() { - return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); - } - public final void setAnnotations(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Annotation.listFactory, 1, value); - } - public final org.capnproto.StructList.Builder initAnnotations(int size) { - return _initPointerField(org.capnproto.Schema.Annotation.listFactory, 1, size); - } - public final short getDiscriminantValue() { - return _getShortField(1, (short)-1); - } - public final void setDiscriminantValue(short value) { - _setShortField(1, value, (short)-1); - } - - public final boolean isSlot() { - return which() == Field.Which.SLOT; - } - public final Slot.Builder getSlot() { - return new Field.Slot.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Slot.Builder initSlot() { - _setShortField(4, (short)Field.Which.SLOT.ordinal()); - _setIntField(1,0); - _setBooleanField(128,false); - _clearPointerField(2); - _clearPointerField(3); - return new Field.Slot.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean isGroup() { - return which() == Field.Which.GROUP; - } - public final Group.Builder getGroup() { - return new Field.Group.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Group.Builder initGroup() { - _setShortField(4, (short)Field.Which.GROUP.ordinal()); - _setLongField(2,0L); - return new Field.Group.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final Ordinal.Builder getOrdinal() { - return new Field.Ordinal.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Ordinal.Builder initOrdinal() { - _setShortField(5,(short)0); - _setShortField(6,(short)0); - return new Field.Ordinal.Builder(segment, data, pointers, dataSize, pointerCount); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(4)) { - case 0 : return Which.SLOT; - case 1 : return Which.GROUP; - default: return Which._NOT_IN_SCHEMA; - } - } - public boolean hasName() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - public final short getCodeOrder() { - return _getShortField(0); - } - - public final boolean hasAnnotations() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Reader getAnnotations() { - return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); - } - - public final short getDiscriminantValue() { - return _getShortField(1, (short)-1); - } - - public final boolean isSlot() { - return which() == Field.Which.SLOT; - } - public Slot.Reader getSlot() { - return new Field.Slot.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean isGroup() { - return which() == Field.Which.GROUP; - } - public Group.Reader getGroup() { - return new Field.Group.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Ordinal.Reader getOrdinal() { - return new Field.Ordinal.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public enum Which { - SLOT, - GROUP, - _NOT_IN_SCHEMA, - } - public static final short NO_DISCRIMINANT = -1; - public static class Slot { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)4); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Field.Slot.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getOffset() { - return _getIntField(1); - } - public final void setOffset(int value) { - _setIntField(1, value); - } - - public final org.capnproto.Schema.Type.Builder getType() { - return _getPointerField(org.capnproto.Schema.Type.factory, 2, null, 0); - } - public final void setType(org.capnproto.Schema.Type.Reader value) { - _setPointerField(org.capnproto.Schema.Type.factory,2, value); - } - public final org.capnproto.Schema.Type.Builder initType() { - return _initPointerField(org.capnproto.Schema.Type.factory,2, 0); - } - public final org.capnproto.Schema.Value.Builder getDefaultValue() { - return _getPointerField(org.capnproto.Schema.Value.factory, 3, null, 0); - } - public final void setDefaultValue(org.capnproto.Schema.Value.Reader value) { - _setPointerField(org.capnproto.Schema.Value.factory,3, value); - } - public final org.capnproto.Schema.Value.Builder initDefaultValue() { - return _initPointerField(org.capnproto.Schema.Value.factory,3, 0); - } - public final boolean getHadExplicitDefault() { - return _getBooleanField(128); - } - public final void setHadExplicitDefault(boolean value) { - _setBooleanField(128, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getOffset() { - return _getIntField(1); - } - - public boolean hasType() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.Schema.Type.Reader getType() { - return _getPointerField(org.capnproto.Schema.Type.factory,2,null, 0); - } - - public boolean hasDefaultValue() { - return !_pointerFieldIsNull(3); - } - public org.capnproto.Schema.Value.Reader getDefaultValue() { - return _getPointerField(org.capnproto.Schema.Value.factory,3,null, 0); - } - - public final boolean getHadExplicitDefault() { - return _getBooleanField(128); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Group { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)4); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Field.Group.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getTypeId() { - return _getLongField(2); - } - public final void setTypeId(long value) { - _setLongField(2, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final long getTypeId() { - return _getLongField(2); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Ordinal { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)4); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Field.Ordinal.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(5)) { - case 0 : return Which.IMPLICIT; - case 1 : return Which.EXPLICIT; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isImplicit() { - return which() == Field.Ordinal.Which.IMPLICIT; - } - public final org.capnproto.Void getImplicit() { - assert which() == Field.Ordinal.Which.IMPLICIT: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setImplicit(org.capnproto.Void value) { - _setShortField(5, (short)Field.Ordinal.Which.IMPLICIT.ordinal()); - } - - public final boolean isExplicit() { - return which() == Field.Ordinal.Which.EXPLICIT; - } - public final short getExplicit() { - assert which() == Field.Ordinal.Which.EXPLICIT: - "Must check which() before get()ing a union member."; - return _getShortField(6); - } - public final void setExplicit(short value) { - _setShortField(5, (short)Field.Ordinal.Which.EXPLICIT.ordinal()); - _setShortField(6, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(5)) { - case 0 : return Which.IMPLICIT; - case 1 : return Which.EXPLICIT; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isImplicit() { - return which() == Field.Ordinal.Which.IMPLICIT; - } - public final org.capnproto.Void getImplicit() { - assert which() == Field.Ordinal.Which.IMPLICIT: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isExplicit() { - return which() == Field.Ordinal.Which.EXPLICIT; - } - public final short getExplicit() { - assert which() == Field.Ordinal.Which.EXPLICIT: - "Must check which() before get()ing a union member."; - return _getShortField(6); - } - - } - - public enum Which { - IMPLICIT, - EXPLICIT, - _NOT_IN_SCHEMA, - } - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Enumerant { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Enumerant.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasName() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setName(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setName(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initName(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - public final short getCodeOrder() { - return _getShortField(0); - } - public final void setCodeOrder(short value) { - _setShortField(0, value); - } - - public final boolean hasAnnotations() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Builder getAnnotations() { - return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); - } - public final void setAnnotations(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Annotation.listFactory, 1, value); - } - public final org.capnproto.StructList.Builder initAnnotations(int size) { - return _initPointerField(org.capnproto.Schema.Annotation.listFactory, 1, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasName() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - public final short getCodeOrder() { - return _getShortField(0); - } - - public final boolean hasAnnotations() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Reader getAnnotations() { - return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Superclass { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Superclass.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getId() { - return _getLongField(0); - } - public final void setId(long value) { - _setLongField(0, value); - } - - public final org.capnproto.Schema.Brand.Builder getBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory, 0, null, 0); - } - public final void setBrand(org.capnproto.Schema.Brand.Reader value) { - _setPointerField(org.capnproto.Schema.Brand.factory,0, value); - } - public final org.capnproto.Schema.Brand.Builder initBrand() { - return _initPointerField(org.capnproto.Schema.Brand.factory,0, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final long getId() { - return _getLongField(0); - } - - public boolean hasBrand() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Schema.Brand.Reader getBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory,0,null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)5); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Method.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasName() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setName(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setName(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initName(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - public final short getCodeOrder() { - return _getShortField(0); - } - public final void setCodeOrder(short value) { - _setShortField(0, value); - } - - public final long getParamStructType() { - return _getLongField(1); - } - public final void setParamStructType(long value) { - _setLongField(1, value); - } - - public final long getResultStructType() { - return _getLongField(2); - } - public final void setResultStructType(long value) { - _setLongField(2, value); - } - - public final boolean hasAnnotations() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Builder getAnnotations() { - return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); - } - public final void setAnnotations(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Annotation.listFactory, 1, value); - } - public final org.capnproto.StructList.Builder initAnnotations(int size) { - return _initPointerField(org.capnproto.Schema.Annotation.listFactory, 1, size); - } - public final org.capnproto.Schema.Brand.Builder getParamBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory, 2, null, 0); - } - public final void setParamBrand(org.capnproto.Schema.Brand.Reader value) { - _setPointerField(org.capnproto.Schema.Brand.factory,2, value); - } - public final org.capnproto.Schema.Brand.Builder initParamBrand() { - return _initPointerField(org.capnproto.Schema.Brand.factory,2, 0); - } - public final org.capnproto.Schema.Brand.Builder getResultBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory, 3, null, 0); - } - public final void setResultBrand(org.capnproto.Schema.Brand.Reader value) { - _setPointerField(org.capnproto.Schema.Brand.factory,3, value); - } - public final org.capnproto.Schema.Brand.Builder initResultBrand() { - return _initPointerField(org.capnproto.Schema.Brand.factory,3, 0); - } - public final boolean hasImplicitParameters() { - return !_pointerFieldIsNull(4); - } - public final org.capnproto.StructList.Builder getImplicitParameters() { - return _getPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 4, null, 0); - } - public final void setImplicitParameters(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 4, value); - } - public final org.capnproto.StructList.Builder initImplicitParameters(int size) { - return _initPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 4, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasName() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - public final short getCodeOrder() { - return _getShortField(0); - } - - public final long getParamStructType() { - return _getLongField(1); - } - - public final long getResultStructType() { - return _getLongField(2); - } - - public final boolean hasAnnotations() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Reader getAnnotations() { - return _getPointerField(org.capnproto.Schema.Annotation.listFactory, 1, null, 0); - } - - public boolean hasParamBrand() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.Schema.Brand.Reader getParamBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory,2,null, 0); - } - - public boolean hasResultBrand() { - return !_pointerFieldIsNull(3); - } - public org.capnproto.Schema.Brand.Reader getResultBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory,3,null, 0); - } - - public final boolean hasImplicitParameters() { - return !_pointerFieldIsNull(4); - } - public final org.capnproto.StructList.Reader getImplicitParameters() { - return _getPointerField(org.capnproto.Schema.Node.Parameter.listFactory, 4, null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Type { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Type.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.VOID; - case 1 : return Which.BOOL; - case 2 : return Which.INT8; - case 3 : return Which.INT16; - case 4 : return Which.INT32; - case 5 : return Which.INT64; - case 6 : return Which.UINT8; - case 7 : return Which.UINT16; - case 8 : return Which.UINT32; - case 9 : return Which.UINT64; - case 10 : return Which.FLOAT32; - case 11 : return Which.FLOAT64; - case 12 : return Which.TEXT; - case 13 : return Which.DATA; - case 14 : return Which.LIST; - case 15 : return Which.ENUM; - case 16 : return Which.STRUCT; - case 17 : return Which.INTERFACE; - case 18 : return Which.ANY_POINTER; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isVoid() { - return which() == Type.Which.VOID; - } - public final org.capnproto.Void getVoid() { - assert which() == Type.Which.VOID: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setVoid(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.VOID.ordinal()); - } - - public final boolean isBool() { - return which() == Type.Which.BOOL; - } - public final org.capnproto.Void getBool() { - assert which() == Type.Which.BOOL: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setBool(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.BOOL.ordinal()); - } - - public final boolean isInt8() { - return which() == Type.Which.INT8; - } - public final org.capnproto.Void getInt8() { - assert which() == Type.Which.INT8: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setInt8(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.INT8.ordinal()); - } - - public final boolean isInt16() { - return which() == Type.Which.INT16; - } - public final org.capnproto.Void getInt16() { - assert which() == Type.Which.INT16: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setInt16(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.INT16.ordinal()); - } - - public final boolean isInt32() { - return which() == Type.Which.INT32; - } - public final org.capnproto.Void getInt32() { - assert which() == Type.Which.INT32: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setInt32(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.INT32.ordinal()); - } - - public final boolean isInt64() { - return which() == Type.Which.INT64; - } - public final org.capnproto.Void getInt64() { - assert which() == Type.Which.INT64: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setInt64(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.INT64.ordinal()); - } - - public final boolean isUint8() { - return which() == Type.Which.UINT8; - } - public final org.capnproto.Void getUint8() { - assert which() == Type.Which.UINT8: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setUint8(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.UINT8.ordinal()); - } - - public final boolean isUint16() { - return which() == Type.Which.UINT16; - } - public final org.capnproto.Void getUint16() { - assert which() == Type.Which.UINT16: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setUint16(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.UINT16.ordinal()); - } - - public final boolean isUint32() { - return which() == Type.Which.UINT32; - } - public final org.capnproto.Void getUint32() { - assert which() == Type.Which.UINT32: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setUint32(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.UINT32.ordinal()); - } - - public final boolean isUint64() { - return which() == Type.Which.UINT64; - } - public final org.capnproto.Void getUint64() { - assert which() == Type.Which.UINT64: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setUint64(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.UINT64.ordinal()); - } - - public final boolean isFloat32() { - return which() == Type.Which.FLOAT32; - } - public final org.capnproto.Void getFloat32() { - assert which() == Type.Which.FLOAT32: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setFloat32(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.FLOAT32.ordinal()); - } - - public final boolean isFloat64() { - return which() == Type.Which.FLOAT64; - } - public final org.capnproto.Void getFloat64() { - assert which() == Type.Which.FLOAT64: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setFloat64(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.FLOAT64.ordinal()); - } - - public final boolean isText() { - return which() == Type.Which.TEXT; - } - public final org.capnproto.Void getText() { - assert which() == Type.Which.TEXT: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setText(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.TEXT.ordinal()); - } - - public final boolean isData() { - return which() == Type.Which.DATA; - } - public final org.capnproto.Void getData() { - assert which() == Type.Which.DATA: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setData(org.capnproto.Void value) { - _setShortField(0, (short)Type.Which.DATA.ordinal()); - } - - public final boolean isList() { - return which() == Type.Which.LIST; - } - public final List.Builder getList() { - return new Type.List.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final List.Builder initList() { - _setShortField(0, (short)Type.Which.LIST.ordinal()); - _clearPointerField(0); - return new Type.List.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean isEnum() { - return which() == Type.Which.ENUM; - } - public final Enum.Builder getEnum() { - return new Type.Enum.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Enum.Builder initEnum() { - _setShortField(0, (short)Type.Which.ENUM.ordinal()); - _setLongField(1,0L); - _clearPointerField(0); - return new Type.Enum.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean isStruct() { - return which() == Type.Which.STRUCT; - } - public final Struct.Builder getStruct() { - return new Type.Struct.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Struct.Builder initStruct() { - _setShortField(0, (short)Type.Which.STRUCT.ordinal()); - _setLongField(1,0L); - _clearPointerField(0); - return new Type.Struct.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean isInterface() { - return which() == Type.Which.INTERFACE; - } - public final Interface.Builder getInterface() { - return new Type.Interface.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Interface.Builder initInterface() { - _setShortField(0, (short)Type.Which.INTERFACE.ordinal()); - _setLongField(1,0L); - _clearPointerField(0); - return new Type.Interface.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean isAnyPointer() { - return which() == Type.Which.ANY_POINTER; - } - public final AnyPointer.Builder getAnyPointer() { - return new Type.AnyPointer.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final AnyPointer.Builder initAnyPointer() { - _setShortField(0, (short)Type.Which.ANY_POINTER.ordinal()); - _setShortField(4,(short)0); - _setShortField(5,(short)0); - _setLongField(2,0L); - return new Type.AnyPointer.Builder(segment, data, pointers, dataSize, pointerCount); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.VOID; - case 1 : return Which.BOOL; - case 2 : return Which.INT8; - case 3 : return Which.INT16; - case 4 : return Which.INT32; - case 5 : return Which.INT64; - case 6 : return Which.UINT8; - case 7 : return Which.UINT16; - case 8 : return Which.UINT32; - case 9 : return Which.UINT64; - case 10 : return Which.FLOAT32; - case 11 : return Which.FLOAT64; - case 12 : return Which.TEXT; - case 13 : return Which.DATA; - case 14 : return Which.LIST; - case 15 : return Which.ENUM; - case 16 : return Which.STRUCT; - case 17 : return Which.INTERFACE; - case 18 : return Which.ANY_POINTER; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isVoid() { - return which() == Type.Which.VOID; - } - public final org.capnproto.Void getVoid() { - assert which() == Type.Which.VOID: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isBool() { - return which() == Type.Which.BOOL; - } - public final org.capnproto.Void getBool() { - assert which() == Type.Which.BOOL: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isInt8() { - return which() == Type.Which.INT8; - } - public final org.capnproto.Void getInt8() { - assert which() == Type.Which.INT8: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isInt16() { - return which() == Type.Which.INT16; - } - public final org.capnproto.Void getInt16() { - assert which() == Type.Which.INT16: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isInt32() { - return which() == Type.Which.INT32; - } - public final org.capnproto.Void getInt32() { - assert which() == Type.Which.INT32: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isInt64() { - return which() == Type.Which.INT64; - } - public final org.capnproto.Void getInt64() { - assert which() == Type.Which.INT64: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isUint8() { - return which() == Type.Which.UINT8; - } - public final org.capnproto.Void getUint8() { - assert which() == Type.Which.UINT8: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isUint16() { - return which() == Type.Which.UINT16; - } - public final org.capnproto.Void getUint16() { - assert which() == Type.Which.UINT16: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isUint32() { - return which() == Type.Which.UINT32; - } - public final org.capnproto.Void getUint32() { - assert which() == Type.Which.UINT32: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isUint64() { - return which() == Type.Which.UINT64; - } - public final org.capnproto.Void getUint64() { - assert which() == Type.Which.UINT64: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isFloat32() { - return which() == Type.Which.FLOAT32; - } - public final org.capnproto.Void getFloat32() { - assert which() == Type.Which.FLOAT32: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isFloat64() { - return which() == Type.Which.FLOAT64; - } - public final org.capnproto.Void getFloat64() { - assert which() == Type.Which.FLOAT64: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isText() { - return which() == Type.Which.TEXT; - } - public final org.capnproto.Void getText() { - assert which() == Type.Which.TEXT: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isData() { - return which() == Type.Which.DATA; - } - public final org.capnproto.Void getData() { - assert which() == Type.Which.DATA: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isList() { - return which() == Type.Which.LIST; - } - public List.Reader getList() { - return new Type.List.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean isEnum() { - return which() == Type.Which.ENUM; - } - public Enum.Reader getEnum() { - return new Type.Enum.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean isStruct() { - return which() == Type.Which.STRUCT; - } - public Struct.Reader getStruct() { - return new Type.Struct.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean isInterface() { - return which() == Type.Which.INTERFACE; - } - public Interface.Reader getInterface() { - return new Type.Interface.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean isAnyPointer() { - return which() == Type.Which.ANY_POINTER; - } - public AnyPointer.Reader getAnyPointer() { - return new Type.AnyPointer.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public enum Which { - VOID, - BOOL, - INT8, - INT16, - INT32, - INT64, - UINT8, - UINT16, - UINT32, - UINT64, - FLOAT32, - FLOAT64, - TEXT, - DATA, - LIST, - ENUM, - STRUCT, - INTERFACE, - ANY_POINTER, - _NOT_IN_SCHEMA, - } - public static class List { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Type.List.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final org.capnproto.Schema.Type.Builder getElementType() { - return _getPointerField(org.capnproto.Schema.Type.factory, 0, null, 0); - } - public final void setElementType(org.capnproto.Schema.Type.Reader value) { - _setPointerField(org.capnproto.Schema.Type.factory,0, value); - } - public final org.capnproto.Schema.Type.Builder initElementType() { - return _initPointerField(org.capnproto.Schema.Type.factory,0, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasElementType() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Schema.Type.Reader getElementType() { - return _getPointerField(org.capnproto.Schema.Type.factory,0,null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Enum { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Type.Enum.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getTypeId() { - return _getLongField(1); - } - public final void setTypeId(long value) { - _setLongField(1, value); - } - - public final org.capnproto.Schema.Brand.Builder getBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory, 0, null, 0); - } - public final void setBrand(org.capnproto.Schema.Brand.Reader value) { - _setPointerField(org.capnproto.Schema.Brand.factory,0, value); - } - public final org.capnproto.Schema.Brand.Builder initBrand() { - return _initPointerField(org.capnproto.Schema.Brand.factory,0, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final long getTypeId() { - return _getLongField(1); - } - - public boolean hasBrand() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Schema.Brand.Reader getBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory,0,null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Struct { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Type.Struct.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getTypeId() { - return _getLongField(1); - } - public final void setTypeId(long value) { - _setLongField(1, value); - } - - public final org.capnproto.Schema.Brand.Builder getBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory, 0, null, 0); - } - public final void setBrand(org.capnproto.Schema.Brand.Reader value) { - _setPointerField(org.capnproto.Schema.Brand.factory,0, value); - } - public final org.capnproto.Schema.Brand.Builder initBrand() { - return _initPointerField(org.capnproto.Schema.Brand.factory,0, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final long getTypeId() { - return _getLongField(1); - } - - public boolean hasBrand() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Schema.Brand.Reader getBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory,0,null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Interface { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Type.Interface.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getTypeId() { - return _getLongField(1); - } - public final void setTypeId(long value) { - _setLongField(1, value); - } - - public final org.capnproto.Schema.Brand.Builder getBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory, 0, null, 0); - } - public final void setBrand(org.capnproto.Schema.Brand.Reader value) { - _setPointerField(org.capnproto.Schema.Brand.factory,0, value); - } - public final org.capnproto.Schema.Brand.Builder initBrand() { - return _initPointerField(org.capnproto.Schema.Brand.factory,0, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final long getTypeId() { - return _getLongField(1); - } - - public boolean hasBrand() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Schema.Brand.Reader getBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory,0,null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class AnyPointer { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Type.AnyPointer.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(4)) { - case 0 : return Which.UNCONSTRAINED; - case 1 : return Which.PARAMETER; - case 2 : return Which.IMPLICIT_METHOD_PARAMETER; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isUnconstrained() { - return which() == Type.AnyPointer.Which.UNCONSTRAINED; - } - public final Unconstrained.Builder getUnconstrained() { - return new Type.AnyPointer.Unconstrained.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Unconstrained.Builder initUnconstrained() { - _setShortField(4, (short)Type.AnyPointer.Which.UNCONSTRAINED.ordinal()); - _setShortField(5,(short)0); - return new Type.AnyPointer.Unconstrained.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean isParameter() { - return which() == Type.AnyPointer.Which.PARAMETER; - } - public final Parameter.Builder getParameter() { - return new Type.AnyPointer.Parameter.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Parameter.Builder initParameter() { - _setShortField(4, (short)Type.AnyPointer.Which.PARAMETER.ordinal()); - _setShortField(5,(short)0); - _setLongField(2,0L); - return new Type.AnyPointer.Parameter.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean isImplicitMethodParameter() { - return which() == Type.AnyPointer.Which.IMPLICIT_METHOD_PARAMETER; - } - public final ImplicitMethodParameter.Builder getImplicitMethodParameter() { - return new Type.AnyPointer.ImplicitMethodParameter.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final ImplicitMethodParameter.Builder initImplicitMethodParameter() { - _setShortField(4, (short)Type.AnyPointer.Which.IMPLICIT_METHOD_PARAMETER.ordinal()); - _setShortField(5,(short)0); - return new Type.AnyPointer.ImplicitMethodParameter.Builder(segment, data, pointers, dataSize, pointerCount); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(4)) { - case 0 : return Which.UNCONSTRAINED; - case 1 : return Which.PARAMETER; - case 2 : return Which.IMPLICIT_METHOD_PARAMETER; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isUnconstrained() { - return which() == Type.AnyPointer.Which.UNCONSTRAINED; - } - public Unconstrained.Reader getUnconstrained() { - return new Type.AnyPointer.Unconstrained.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean isParameter() { - return which() == Type.AnyPointer.Which.PARAMETER; - } - public Parameter.Reader getParameter() { - return new Type.AnyPointer.Parameter.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean isImplicitMethodParameter() { - return which() == Type.AnyPointer.Which.IMPLICIT_METHOD_PARAMETER; - } - public ImplicitMethodParameter.Reader getImplicitMethodParameter() { - return new Type.AnyPointer.ImplicitMethodParameter.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public enum Which { - UNCONSTRAINED, - PARAMETER, - IMPLICIT_METHOD_PARAMETER, - _NOT_IN_SCHEMA, - } - public static class Unconstrained { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Type.AnyPointer.Unconstrained.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(5)) { - case 0 : return Which.ANY_KIND; - case 1 : return Which.STRUCT; - case 2 : return Which.LIST; - case 3 : return Which.CAPABILITY; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isAnyKind() { - return which() == Type.AnyPointer.Unconstrained.Which.ANY_KIND; - } - public final org.capnproto.Void getAnyKind() { - assert which() == Type.AnyPointer.Unconstrained.Which.ANY_KIND: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setAnyKind(org.capnproto.Void value) { - _setShortField(5, (short)Type.AnyPointer.Unconstrained.Which.ANY_KIND.ordinal()); - } - - public final boolean isStruct() { - return which() == Type.AnyPointer.Unconstrained.Which.STRUCT; - } - public final org.capnproto.Void getStruct() { - assert which() == Type.AnyPointer.Unconstrained.Which.STRUCT: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setStruct(org.capnproto.Void value) { - _setShortField(5, (short)Type.AnyPointer.Unconstrained.Which.STRUCT.ordinal()); - } - - public final boolean isList() { - return which() == Type.AnyPointer.Unconstrained.Which.LIST; - } - public final org.capnproto.Void getList() { - assert which() == Type.AnyPointer.Unconstrained.Which.LIST: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setList(org.capnproto.Void value) { - _setShortField(5, (short)Type.AnyPointer.Unconstrained.Which.LIST.ordinal()); - } - - public final boolean isCapability() { - return which() == Type.AnyPointer.Unconstrained.Which.CAPABILITY; - } - public final org.capnproto.Void getCapability() { - assert which() == Type.AnyPointer.Unconstrained.Which.CAPABILITY: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setCapability(org.capnproto.Void value) { - _setShortField(5, (short)Type.AnyPointer.Unconstrained.Which.CAPABILITY.ordinal()); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(5)) { - case 0 : return Which.ANY_KIND; - case 1 : return Which.STRUCT; - case 2 : return Which.LIST; - case 3 : return Which.CAPABILITY; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isAnyKind() { - return which() == Type.AnyPointer.Unconstrained.Which.ANY_KIND; - } - public final org.capnproto.Void getAnyKind() { - assert which() == Type.AnyPointer.Unconstrained.Which.ANY_KIND: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isStruct() { - return which() == Type.AnyPointer.Unconstrained.Which.STRUCT; - } - public final org.capnproto.Void getStruct() { - assert which() == Type.AnyPointer.Unconstrained.Which.STRUCT: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isList() { - return which() == Type.AnyPointer.Unconstrained.Which.LIST; - } - public final org.capnproto.Void getList() { - assert which() == Type.AnyPointer.Unconstrained.Which.LIST: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isCapability() { - return which() == Type.AnyPointer.Unconstrained.Which.CAPABILITY; - } - public final org.capnproto.Void getCapability() { - assert which() == Type.AnyPointer.Unconstrained.Which.CAPABILITY: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - } - - public enum Which { - ANY_KIND, - STRUCT, - LIST, - CAPABILITY, - _NOT_IN_SCHEMA, - } - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Parameter { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Type.AnyPointer.Parameter.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getScopeId() { - return _getLongField(2); - } - public final void setScopeId(long value) { - _setLongField(2, value); - } - - public final short getParameterIndex() { - return _getShortField(5); - } - public final void setParameterIndex(short value) { - _setShortField(5, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final long getScopeId() { - return _getLongField(2); - } - - public final short getParameterIndex() { - return _getShortField(5); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class ImplicitMethodParameter { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Type.AnyPointer.ImplicitMethodParameter.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final short getParameterIndex() { - return _getShortField(5); - } - public final void setParameterIndex(short value) { - _setShortField(5, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final short getParameterIndex() { - return _getShortField(5); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Brand { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Brand.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasScopes() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.StructList.Builder getScopes() { - return _getPointerField(org.capnproto.Schema.Brand.Scope.listFactory, 0, null, 0); - } - public final void setScopes(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Brand.Scope.listFactory, 0, value); - } - public final org.capnproto.StructList.Builder initScopes(int size) { - return _initPointerField(org.capnproto.Schema.Brand.Scope.listFactory, 0, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean hasScopes() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.StructList.Reader getScopes() { - return _getPointerField(org.capnproto.Schema.Brand.Scope.listFactory, 0, null, 0); - } - - } - - public static class Scope { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)2,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Brand.Scope.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(4)) { - case 0 : return Which.BIND; - case 1 : return Which.INHERIT; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getScopeId() { - return _getLongField(0); - } - public final void setScopeId(long value) { - _setLongField(0, value); - } - - public final boolean isBind() { - return which() == Brand.Scope.Which.BIND; - } - public final boolean hasBind() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.StructList.Builder getBind() { - return _getPointerField(org.capnproto.Schema.Brand.Binding.listFactory, 0, null, 0); - } - public final void setBind(org.capnproto.StructList.Reader value) { - _setShortField(4, (short)Brand.Scope.Which.BIND.ordinal()); - _setPointerField(org.capnproto.Schema.Brand.Binding.listFactory, 0, value); - } - public final org.capnproto.StructList.Builder initBind(int size) { - _setShortField(4, (short)Brand.Scope.Which.BIND.ordinal()); - return _initPointerField(org.capnproto.Schema.Brand.Binding.listFactory, 0, size); - } - public final boolean isInherit() { - return which() == Brand.Scope.Which.INHERIT; - } - public final org.capnproto.Void getInherit() { - assert which() == Brand.Scope.Which.INHERIT: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setInherit(org.capnproto.Void value) { - _setShortField(4, (short)Brand.Scope.Which.INHERIT.ordinal()); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(4)) { - case 0 : return Which.BIND; - case 1 : return Which.INHERIT; - default: return Which._NOT_IN_SCHEMA; - } - } - public final long getScopeId() { - return _getLongField(0); - } - - public final boolean isBind() { - return which() == Brand.Scope.Which.BIND; - } - public final boolean hasBind() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.StructList.Reader getBind() { - return _getPointerField(org.capnproto.Schema.Brand.Binding.listFactory, 0, null, 0); - } - - public final boolean isInherit() { - return which() == Brand.Scope.Which.INHERIT; - } - public final org.capnproto.Void getInherit() { - assert which() == Brand.Scope.Which.INHERIT: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - } - - public enum Which { - BIND, - INHERIT, - _NOT_IN_SCHEMA, - } - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Binding { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Brand.Binding.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.UNBOUND; - case 1 : return Which.TYPE; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isUnbound() { - return which() == Brand.Binding.Which.UNBOUND; - } - public final org.capnproto.Void getUnbound() { - assert which() == Brand.Binding.Which.UNBOUND: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setUnbound(org.capnproto.Void value) { - _setShortField(0, (short)Brand.Binding.Which.UNBOUND.ordinal()); - } - - public final boolean isType() { - return which() == Brand.Binding.Which.TYPE; - } - public final org.capnproto.Schema.Type.Builder getType() { - assert which() == Brand.Binding.Which.TYPE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.Schema.Type.factory, 0, null, 0); - } - public final void setType(org.capnproto.Schema.Type.Reader value) { - _setShortField(0, (short)Brand.Binding.Which.TYPE.ordinal()); - _setPointerField(org.capnproto.Schema.Type.factory,0, value); - } - public final org.capnproto.Schema.Type.Builder initType() { - _setShortField(0, (short)Brand.Binding.Which.TYPE.ordinal()); - return _initPointerField(org.capnproto.Schema.Type.factory,0, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.UNBOUND; - case 1 : return Which.TYPE; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isUnbound() { - return which() == Brand.Binding.Which.UNBOUND; - } - public final org.capnproto.Void getUnbound() { - assert which() == Brand.Binding.Which.UNBOUND: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isType() { - return which() == Brand.Binding.Which.TYPE; - } - public boolean hasType() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Schema.Type.Reader getType() { - assert which() == Brand.Binding.Which.TYPE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.Schema.Type.factory,0,null, 0); - } - - } - - public enum Which { - UNBOUND, - TYPE, - _NOT_IN_SCHEMA, - } - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Value { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)2,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Value.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.VOID; - case 1 : return Which.BOOL; - case 2 : return Which.INT8; - case 3 : return Which.INT16; - case 4 : return Which.INT32; - case 5 : return Which.INT64; - case 6 : return Which.UINT8; - case 7 : return Which.UINT16; - case 8 : return Which.UINT32; - case 9 : return Which.UINT64; - case 10 : return Which.FLOAT32; - case 11 : return Which.FLOAT64; - case 12 : return Which.TEXT; - case 13 : return Which.DATA; - case 14 : return Which.LIST; - case 15 : return Which.ENUM; - case 16 : return Which.STRUCT; - case 17 : return Which.INTERFACE; - case 18 : return Which.ANY_POINTER; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isVoid() { - return which() == Value.Which.VOID; - } - public final org.capnproto.Void getVoid() { - assert which() == Value.Which.VOID: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setVoid(org.capnproto.Void value) { - _setShortField(0, (short)Value.Which.VOID.ordinal()); - } - - public final boolean isBool() { - return which() == Value.Which.BOOL; - } - public final boolean getBool() { - assert which() == Value.Which.BOOL: - "Must check which() before get()ing a union member."; - return _getBooleanField(16); - } - public final void setBool(boolean value) { - _setShortField(0, (short)Value.Which.BOOL.ordinal()); - _setBooleanField(16, value); - } - - public final boolean isInt8() { - return which() == Value.Which.INT8; - } - public final byte getInt8() { - assert which() == Value.Which.INT8: - "Must check which() before get()ing a union member."; - return _getByteField(2); - } - public final void setInt8(byte value) { - _setShortField(0, (short)Value.Which.INT8.ordinal()); - _setByteField(2, value); - } - - public final boolean isInt16() { - return which() == Value.Which.INT16; - } - public final short getInt16() { - assert which() == Value.Which.INT16: - "Must check which() before get()ing a union member."; - return _getShortField(1); - } - public final void setInt16(short value) { - _setShortField(0, (short)Value.Which.INT16.ordinal()); - _setShortField(1, value); - } - - public final boolean isInt32() { - return which() == Value.Which.INT32; - } - public final int getInt32() { - assert which() == Value.Which.INT32: - "Must check which() before get()ing a union member."; - return _getIntField(1); - } - public final void setInt32(int value) { - _setShortField(0, (short)Value.Which.INT32.ordinal()); - _setIntField(1, value); - } - - public final boolean isInt64() { - return which() == Value.Which.INT64; - } - public final long getInt64() { - assert which() == Value.Which.INT64: - "Must check which() before get()ing a union member."; - return _getLongField(1); - } - public final void setInt64(long value) { - _setShortField(0, (short)Value.Which.INT64.ordinal()); - _setLongField(1, value); - } - - public final boolean isUint8() { - return which() == Value.Which.UINT8; - } - public final byte getUint8() { - assert which() == Value.Which.UINT8: - "Must check which() before get()ing a union member."; - return _getByteField(2); - } - public final void setUint8(byte value) { - _setShortField(0, (short)Value.Which.UINT8.ordinal()); - _setByteField(2, value); - } - - public final boolean isUint16() { - return which() == Value.Which.UINT16; - } - public final short getUint16() { - assert which() == Value.Which.UINT16: - "Must check which() before get()ing a union member."; - return _getShortField(1); - } - public final void setUint16(short value) { - _setShortField(0, (short)Value.Which.UINT16.ordinal()); - _setShortField(1, value); - } - - public final boolean isUint32() { - return which() == Value.Which.UINT32; - } - public final int getUint32() { - assert which() == Value.Which.UINT32: - "Must check which() before get()ing a union member."; - return _getIntField(1); - } - public final void setUint32(int value) { - _setShortField(0, (short)Value.Which.UINT32.ordinal()); - _setIntField(1, value); - } - - public final boolean isUint64() { - return which() == Value.Which.UINT64; - } - public final long getUint64() { - assert which() == Value.Which.UINT64: - "Must check which() before get()ing a union member."; - return _getLongField(1); - } - public final void setUint64(long value) { - _setShortField(0, (short)Value.Which.UINT64.ordinal()); - _setLongField(1, value); - } - - public final boolean isFloat32() { - return which() == Value.Which.FLOAT32; - } - public final float getFloat32() { - assert which() == Value.Which.FLOAT32: - "Must check which() before get()ing a union member."; - return _getFloatField(1); - } - public final void setFloat32(float value) { - _setShortField(0, (short)Value.Which.FLOAT32.ordinal()); - _setFloatField(1, value); - } - - public final boolean isFloat64() { - return which() == Value.Which.FLOAT64; - } - public final double getFloat64() { - assert which() == Value.Which.FLOAT64: - "Must check which() before get()ing a union member."; - return _getDoubleField(1); - } - public final void setFloat64(double value) { - _setShortField(0, (short)Value.Which.FLOAT64.ordinal()); - _setDoubleField(1, value); - } - - public final boolean isText() { - return which() == Value.Which.TEXT; - } - public final boolean hasText() { - if (which() != Value.Which.TEXT) return false; - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getText() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setText(org.capnproto.Text.Reader value) { - _setShortField(0, (short)Value.Which.TEXT.ordinal()); - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setText(String value) { - _setShortField(0, (short)Value.Which.TEXT.ordinal()); - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initText(int size) { - _setShortField(0, (short)Value.Which.TEXT.ordinal()); - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - public final boolean isData() { - return which() == Value.Which.DATA; - } - public final boolean hasData() { - if (which() != Value.Which.DATA) return false; - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Data.Builder getData() { - return _getPointerField(org.capnproto.Data.factory, 0, null, 0, 0); - } - public final void setData(org.capnproto.Data.Reader value) { - _setShortField(0, (short)Value.Which.DATA.ordinal()); - _setPointerField(org.capnproto.Data.factory, 0, value); - } - public final void setData(byte [] value) { - _setShortField(0, (short)Value.Which.DATA.ordinal()); - _setPointerField(org.capnproto.Data.factory, 0, new org.capnproto.Data.Reader(value)); - } - public final org.capnproto.Data.Builder initData(int size) { - _setShortField(0, (short)Value.Which.DATA.ordinal()); - return _initPointerField(org.capnproto.Data.factory, 0, size); - } - public final boolean isList() { - return which() == Value.Which.LIST; - } - public final boolean hasList() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getList() { - assert which() == Value.Which.LIST: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initList() { - _setShortField(0, (short)Value.Which.LIST.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initList(int size) { - _setShortField(0, (short)Value.Which.LIST.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - public final boolean isEnum() { - return which() == Value.Which.ENUM; - } - public final short getEnum() { - assert which() == Value.Which.ENUM: - "Must check which() before get()ing a union member."; - return _getShortField(1); - } - public final void setEnum(short value) { - _setShortField(0, (short)Value.Which.ENUM.ordinal()); - _setShortField(1, value); - } - - public final boolean isStruct() { - return which() == Value.Which.STRUCT; - } - public final boolean hasStruct() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getStruct() { - assert which() == Value.Which.STRUCT: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initStruct() { - _setShortField(0, (short)Value.Which.STRUCT.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initStruct(int size) { - _setShortField(0, (short)Value.Which.STRUCT.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - public final boolean isInterface() { - return which() == Value.Which.INTERFACE; - } - public final org.capnproto.Void getInterface() { - assert which() == Value.Which.INTERFACE: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setInterface(org.capnproto.Void value) { - _setShortField(0, (short)Value.Which.INTERFACE.ordinal()); - } - - public final boolean isAnyPointer() { - return which() == Value.Which.ANY_POINTER; - } - public final boolean hasAnyPointer() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getAnyPointer() { - assert which() == Value.Which.ANY_POINTER: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initAnyPointer() { - _setShortField(0, (short)Value.Which.ANY_POINTER.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initAnyPointer(int size) { - _setShortField(0, (short)Value.Which.ANY_POINTER.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.VOID; - case 1 : return Which.BOOL; - case 2 : return Which.INT8; - case 3 : return Which.INT16; - case 4 : return Which.INT32; - case 5 : return Which.INT64; - case 6 : return Which.UINT8; - case 7 : return Which.UINT16; - case 8 : return Which.UINT32; - case 9 : return Which.UINT64; - case 10 : return Which.FLOAT32; - case 11 : return Which.FLOAT64; - case 12 : return Which.TEXT; - case 13 : return Which.DATA; - case 14 : return Which.LIST; - case 15 : return Which.ENUM; - case 16 : return Which.STRUCT; - case 17 : return Which.INTERFACE; - case 18 : return Which.ANY_POINTER; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isVoid() { - return which() == Value.Which.VOID; - } - public final org.capnproto.Void getVoid() { - assert which() == Value.Which.VOID: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isBool() { - return which() == Value.Which.BOOL; - } - public final boolean getBool() { - assert which() == Value.Which.BOOL: - "Must check which() before get()ing a union member."; - return _getBooleanField(16); - } - - public final boolean isInt8() { - return which() == Value.Which.INT8; - } - public final byte getInt8() { - assert which() == Value.Which.INT8: - "Must check which() before get()ing a union member."; - return _getByteField(2); - } - - public final boolean isInt16() { - return which() == Value.Which.INT16; - } - public final short getInt16() { - assert which() == Value.Which.INT16: - "Must check which() before get()ing a union member."; - return _getShortField(1); - } - - public final boolean isInt32() { - return which() == Value.Which.INT32; - } - public final int getInt32() { - assert which() == Value.Which.INT32: - "Must check which() before get()ing a union member."; - return _getIntField(1); - } - - public final boolean isInt64() { - return which() == Value.Which.INT64; - } - public final long getInt64() { - assert which() == Value.Which.INT64: - "Must check which() before get()ing a union member."; - return _getLongField(1); - } - - public final boolean isUint8() { - return which() == Value.Which.UINT8; - } - public final byte getUint8() { - assert which() == Value.Which.UINT8: - "Must check which() before get()ing a union member."; - return _getByteField(2); - } - - public final boolean isUint16() { - return which() == Value.Which.UINT16; - } - public final short getUint16() { - assert which() == Value.Which.UINT16: - "Must check which() before get()ing a union member."; - return _getShortField(1); - } - - public final boolean isUint32() { - return which() == Value.Which.UINT32; - } - public final int getUint32() { - assert which() == Value.Which.UINT32: - "Must check which() before get()ing a union member."; - return _getIntField(1); - } - - public final boolean isUint64() { - return which() == Value.Which.UINT64; - } - public final long getUint64() { - assert which() == Value.Which.UINT64: - "Must check which() before get()ing a union member."; - return _getLongField(1); - } - - public final boolean isFloat32() { - return which() == Value.Which.FLOAT32; - } - public final float getFloat32() { - assert which() == Value.Which.FLOAT32: - "Must check which() before get()ing a union member."; - return _getFloatField(1); - } - - public final boolean isFloat64() { - return which() == Value.Which.FLOAT64; - } - public final double getFloat64() { - assert which() == Value.Which.FLOAT64: - "Must check which() before get()ing a union member."; - return _getDoubleField(1); - } - - public final boolean isText() { - return which() == Value.Which.TEXT; - } - public boolean hasText() { - if (which() != Value.Which.TEXT) return false; - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getText() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - public final boolean isData() { - return which() == Value.Which.DATA; - } - public boolean hasData() { - if (which() != Value.Which.DATA) return false; - return !_pointerFieldIsNull(0); - } - public org.capnproto.Data.Reader getData() { - return _getPointerField(org.capnproto.Data.factory, 0, null, 0, 0); - } - - public final boolean isList() { - return which() == Value.Which.LIST; - } - public boolean hasList() { - if (which() != Value.Which.LIST) return false; - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getList() { - assert which() == Value.Which.LIST: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public final boolean isEnum() { - return which() == Value.Which.ENUM; - } - public final short getEnum() { - assert which() == Value.Which.ENUM: - "Must check which() before get()ing a union member."; - return _getShortField(1); - } - - public final boolean isStruct() { - return which() == Value.Which.STRUCT; - } - public boolean hasStruct() { - if (which() != Value.Which.STRUCT) return false; - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getStruct() { - assert which() == Value.Which.STRUCT: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public final boolean isInterface() { - return which() == Value.Which.INTERFACE; - } - public final org.capnproto.Void getInterface() { - assert which() == Value.Which.INTERFACE: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isAnyPointer() { - return which() == Value.Which.ANY_POINTER; - } - public boolean hasAnyPointer() { - if (which() != Value.Which.ANY_POINTER) return false; - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getAnyPointer() { - assert which() == Value.Which.ANY_POINTER: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - } - - public enum Which { - VOID, - BOOL, - INT8, - INT16, - INT32, - INT64, - UINT8, - UINT16, - UINT32, - UINT64, - FLOAT32, - FLOAT64, - TEXT, - DATA, - LIST, - ENUM, - STRUCT, - INTERFACE, - ANY_POINTER, - _NOT_IN_SCHEMA, - } - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Annotation { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Annotation.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getId() { - return _getLongField(0); - } - public final void setId(long value) { - _setLongField(0, value); - } - - public final org.capnproto.Schema.Value.Builder getValue() { - return _getPointerField(org.capnproto.Schema.Value.factory, 0, null, 0); - } - public final void setValue(org.capnproto.Schema.Value.Reader value) { - _setPointerField(org.capnproto.Schema.Value.factory,0, value); - } - public final org.capnproto.Schema.Value.Builder initValue() { - return _initPointerField(org.capnproto.Schema.Value.factory,0, 0); - } - public final org.capnproto.Schema.Brand.Builder getBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory, 1, null, 0); - } - public final void setBrand(org.capnproto.Schema.Brand.Reader value) { - _setPointerField(org.capnproto.Schema.Brand.factory,1, value); - } - public final org.capnproto.Schema.Brand.Builder initBrand() { - return _initPointerField(org.capnproto.Schema.Brand.factory,1, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final long getId() { - return _getLongField(0); - } - - public boolean hasValue() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Schema.Value.Reader getValue() { - return _getPointerField(org.capnproto.Schema.Value.factory,0,null, 0); - } - - public boolean hasBrand() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.Schema.Brand.Reader getBrand() { - return _getPointerField(org.capnproto.Schema.Brand.factory,1,null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public enum ElementSize { - EMPTY, - BIT, - BYTE, - TWO_BYTES, - FOUR_BYTES, - EIGHT_BYTES, - POINTER, - INLINE_COMPOSITE, - _NOT_IN_SCHEMA, - } - - public static class CapnpVersion { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return CapnpVersion.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final short getMajor() { - return _getShortField(0); - } - public final void setMajor(short value) { - _setShortField(0, value); - } - - public final byte getMinor() { - return _getByteField(2); - } - public final void setMinor(byte value) { - _setByteField(2, value); - } - - public final byte getMicro() { - return _getByteField(3); - } - public final void setMicro(byte value) { - _setByteField(3, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final short getMajor() { - return _getShortField(0); - } - - public final byte getMinor() { - return _getByteField(2); - } - - public final byte getMicro() { - return _getByteField(3); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class CodeGeneratorRequest { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)4); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return CodeGeneratorRequest.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasNodes() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.StructList.Builder getNodes() { - return _getPointerField(org.capnproto.Schema.Node.listFactory, 0, null, 0); - } - public final void setNodes(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Node.listFactory, 0, value); - } - public final org.capnproto.StructList.Builder initNodes(int size) { - return _initPointerField(org.capnproto.Schema.Node.listFactory, 0, size); - } - public final boolean hasRequestedFiles() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Builder getRequestedFiles() { - return _getPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.listFactory, 1, null, 0); - } - public final void setRequestedFiles(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.listFactory, 1, value); - } - public final org.capnproto.StructList.Builder initRequestedFiles(int size) { - return _initPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.listFactory, 1, size); - } - public final org.capnproto.Schema.CapnpVersion.Builder getCapnpVersion() { - return _getPointerField(org.capnproto.Schema.CapnpVersion.factory, 2, null, 0); - } - public final void setCapnpVersion(org.capnproto.Schema.CapnpVersion.Reader value) { - _setPointerField(org.capnproto.Schema.CapnpVersion.factory,2, value); - } - public final org.capnproto.Schema.CapnpVersion.Builder initCapnpVersion() { - return _initPointerField(org.capnproto.Schema.CapnpVersion.factory,2, 0); - } - public final boolean hasSourceInfo() { - return !_pointerFieldIsNull(3); - } - public final org.capnproto.StructList.Builder getSourceInfo() { - return _getPointerField(org.capnproto.Schema.Node.SourceInfo.listFactory, 3, null, 0); - } - public final void setSourceInfo(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.Node.SourceInfo.listFactory, 3, value); - } - public final org.capnproto.StructList.Builder initSourceInfo(int size) { - return _initPointerField(org.capnproto.Schema.Node.SourceInfo.listFactory, 3, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean hasNodes() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.StructList.Reader getNodes() { - return _getPointerField(org.capnproto.Schema.Node.listFactory, 0, null, 0); - } - - public final boolean hasRequestedFiles() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Reader getRequestedFiles() { - return _getPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.listFactory, 1, null, 0); - } - - public boolean hasCapnpVersion() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.Schema.CapnpVersion.Reader getCapnpVersion() { - return _getPointerField(org.capnproto.Schema.CapnpVersion.factory,2,null, 0); - } - - public final boolean hasSourceInfo() { - return !_pointerFieldIsNull(3); - } - public final org.capnproto.StructList.Reader getSourceInfo() { - return _getPointerField(org.capnproto.Schema.Node.SourceInfo.listFactory, 3, null, 0); - } - - } - - public static class RequestedFile { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return CodeGeneratorRequest.RequestedFile.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getId() { - return _getLongField(0); - } - public final void setId(long value) { - _setLongField(0, value); - } - - public final boolean hasFilename() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getFilename() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setFilename(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setFilename(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initFilename(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - public final boolean hasImports() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Builder getImports() { - return _getPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.Import.listFactory, 1, null, 0); - } - public final void setImports(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.Import.listFactory, 1, value); - } - public final org.capnproto.StructList.Builder initImports(int size) { - return _initPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.Import.listFactory, 1, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final long getId() { - return _getLongField(0); - } - - public boolean hasFilename() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getFilename() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - public final boolean hasImports() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Reader getImports() { - return _getPointerField(org.capnproto.Schema.CodeGeneratorRequest.RequestedFile.Import.listFactory, 1, null, 0); - } - - } - - public static class Import { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return CodeGeneratorRequest.RequestedFile.Import.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final long getId() { - return _getLongField(0); - } - public final void setId(long value) { - _setLongField(0, value); - } - - public final boolean hasName() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setName(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setName(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initName(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final long getId() { - return _getLongField(0); - } - - public boolean hasName() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getName() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - -public static final class Schemas { -public static final org.capnproto.SegmentReader b_e682ab4cf923a417 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + - "\u0031\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0006\u0000\u0007\u0000\u0000\u0000\u0006\u0000" + - "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0037\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0059\u0000\u0000\u0000\u0017\u0003\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004e\u006f\u0064\u0065\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00b1\u00a3\u000f\u00f1\u00cc\u001b\u0052\u00b9" + - "\u0011\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0042\u00c2\u000f\u00fa\u00bb\u0055\u00bf\u00de" + - "\u0011\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u00ae\u0057\u0013\u0004\u00e3\u001d\u008e\u00f3" + - "\u0011\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0050\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + - "\u0072\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004e\u0065\u0073\u0074\u0065\u0064\u004e\u006f" + - "\u0064\u0065\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0053\u006f\u0075\u0072\u0063\u0065\u0049\u006e" + - "\u0066\u006f\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0038\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0079\u0001\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0080\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u007d\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u007c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0088\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0085\u0001\u0000\u0000\u00c2\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0088\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0094\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0091\u0001\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u008c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0098\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0095\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0094\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00b0\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0007\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00ad\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00ac\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00c8\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0008\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c5\u0001\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c0\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00cc\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0009\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0035\u0044\u00fb\u0037\u009b\u00b1\u00a0\u009e" + - "\u00c9\u0001\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\n\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0098\u00f5\u0033\u0043\u0036\u00b3\u004a\u00b5" + - "\u00b1\u0001\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000b\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u008f\u0021\u00c2\u00f0\u00cf\u0053\u0027\u00e8" + - "\u0099\u0001\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u00fb\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0020\u0094\r\u007a\u00ac\u00a5\u008a\u00b1" + - "\u0085\u0001\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u00fa\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0090\u0002\n\u0040\u00d4\u0019\u0016\u00ec" + - "\u006d\u0001\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0020\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0059\u0001\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0058\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0074\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u0000\u0000\u0020\u0001\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0021\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0071\u0001\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u007c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0069\u0073\u0070\u006c\u0061\u0079\u004e" + - "\u0061\u006d\u0065\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0069\u0073\u0070\u006c\u0061\u0079\u004e" + - "\u0061\u006d\u0065\u0050\u0072\u0065\u0066\u0069" + - "\u0078\u004c\u0065\u006e\u0067\u0074\u0068\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u0063\u006f\u0070\u0065\u0049\u0064\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006e\u0065\u0073\u0074\u0065\u0064\u004e\u006f" + - "\u0064\u0065\u0073\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0042\u00c2\u000f\u00fa\u00bb\u0055\u00bf\u00de" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u006e\u006e\u006f\u0074\u0061\u0074\u0069" + - "\u006f\u006e\u0073\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0042\u0075\u0025\u00ab\r\u0095\u00c8\u00f1" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0069\u006c\u0065\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u0074\u0072\u0075\u0063\u0074\u0000\u0000" + - "\u0065\u006e\u0075\u006d\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0074\u0065\u0072\u0066\u0061\u0063" + - "\u0065\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u006f\u006e\u0073\u0074\u0000\u0000\u0000" + - "\u0061\u006e\u006e\u006f\u0074\u0061\u0074\u0069" + - "\u006f\u006e\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + - "\u0072\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b1\u00a3\u000f\u00f1\u00cc\u001b\u0052\u00b9" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u0073\u0047\u0065\u006e\u0065\u0072\u0069" + - "\u0063\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_b9521bccf10fa3b1 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00b1\u00a3\u000f\u00f1\u00cc\u001b\u0052\u00b9" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004e\u006f\u0064\u0065\u002e\u0050\u0061" + - "\u0072\u0061\u006d\u0065\u0074\u0065\u0072\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_debf55bbfa0fc242 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0042\u00c2\u000f\u00fa\u00bb\u0055\u00bf\u00de" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004e\u006f\u0064\u0065\u002e\u004e\u0065" + - "\u0073\u0074\u0065\u0064\u004e\u006f\u0064\u0065" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_f38e1de3041357ae = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00ae\u0057\u0013\u0004\u00e3\u001d\u008e\u00f3" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + - "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004e\u006f\u0064\u0065\u002e\u0053\u006f" + - "\u0075\u0072\u0063\u0065\u0049\u006e\u0066\u006f" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00a2\u001f\u008e\u0089\u0038\u0090\u00ba\u00c2" + - "\u0001\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u004d\u0065\u006d\u0062\u0065\u0072\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0068\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u006f\u0063\u0043\u006f\u006d\u006d\u0065" + - "\u006e\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006d\u0065\u006d\u0062\u0065\u0072\u0073\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00a2\u001f\u008e\u0089\u0038\u0090\u00ba\u00c2" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_c2ba9038898e1fa2 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00a2\u001f\u008e\u0089\u0038\u0090\u00ba\u00c2" + - "\u0041\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u00ae\u0057\u0013\u0004\u00e3\u001d\u008e\u00f3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0042\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004e\u006f\u0064\u0065\u002e\u0053\u006f" + - "\u0075\u0072\u0063\u0065\u0049\u006e\u0066\u006f" + - "\u002e\u004d\u0065\u006d\u0062\u0065\u0072\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0018\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0064\u006f\u0063\u0043\u006f\u006d\u006d\u0065" + - "\u006e\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_9ea0b19b37fb4435 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0035\u0044\u00fb\u0037\u009b\u00b1\u00a0\u009e" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + - "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + - "\u0006\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004e\u006f\u0064\u0065\u002e\u0073\u0074" + - "\u0072\u0075\u0063\u0074\u0000\u0000\u0000\u0000" + - "\u001c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b5\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00c0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u000c\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00bd\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00bc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00c8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\r\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c5\u0000\u0000\u0000\u00b2\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00d4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u0000\u0000\u00e0\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d1\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00cc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00d8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u000f\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d5\u0000\u0000\u0000\u0092\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00e4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u0000\u0000\u0008\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000c\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e1\u0000\u0000\u0000\u009a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00f0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\r\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00ed\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0004\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0064\u0061\u0074\u0061\u0057\u006f\u0072\u0064" + - "\u0043\u006f\u0075\u006e\u0074\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u006f\u0069\u006e\u0074\u0065\u0072\u0043" + - "\u006f\u0075\u006e\u0074\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0072\u0065\u0066\u0065\u0072\u0072\u0065" + - "\u0064\u004c\u0069\u0073\u0074\u0045\u006e\u0063" + - "\u006f\u0064\u0069\u006e\u0067\u0000\u0000\u0000" + - "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0026\u0019\u0052\u00ba\u007d\u008f\u0095\u00d1" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u0073\u0047\u0072\u006f\u0075\u0070\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0069\u0073\u0063\u0072\u0069\u006d\u0069" + - "\u006e\u0061\u006e\u0074\u0043\u006f\u0075\u006e" + - "\u0074\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0069\u0073\u0063\u0072\u0069\u006d\u0069" + - "\u006e\u0061\u006e\u0074\u004f\u0066\u0066\u0073" + - "\u0065\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0069\u0065\u006c\u0064\u0073\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_b54ab3364333f598 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0098\u00f5\u0033\u0043\u0036\u00b3\u004a\u00b5" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + - "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + - "\u0006\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004e\u006f\u0064\u0065\u002e\u0065\u006e" + - "\u0075\u006d\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000e\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0028\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0065\u006e\u0075\u006d\u0065\u0072\u0061\u006e" + - "\u0074\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u009a\u0054\u00dc\u00eb\u007c\u008a\u0097" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_e82753cff0c2218f = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u008f\u0021\u00c2\u00f0\u00cf\u0053\u0027\u00e8" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + - "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + - "\u0006\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004e\u006f\u0064\u0065\u002e\u0069\u006e" + - "\u0074\u0065\u0072\u0066\u0061\u0063\u0065\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0040\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u001f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003d\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0058\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006d\u0065\u0074\u0068\u006f\u0064\u0073\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0080\u004d\u0033\u003b\u00e2\u00cc\u0000\u0095" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u0075\u0070\u0065\u0072\u0063\u006c\u0061" + - "\u0073\u0073\u0065\u0073\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00f8\u00d7\u00a4\u00d0\u009e\u002a\u0096\u00a9" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_b18aa5ac7a0d9420 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0020\u0094\r\u007a\u00ac\u00a5\u008a\u00b1" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + - "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + - "\u0006\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004e\u006f\u0064\u0065\u002e\u0063\u006f" + - "\u006e\u0073\u0074\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0010\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0074\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0076\u0061\u006c\u0075\u0065\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u009b\u000c\u00b0\u00d7\u00d2\u00dc\u0023\u00ce" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_ec1619d4400a0290 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0090\u0002\n\u0040\u00d4\u0019\u0016\u00ec" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0005\u0000" + - "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + - "\u0006\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u00df\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004e\u006f\u0064\u0065\u002e\u0061\u006e" + - "\u006e\u006f\u0074\u0061\u0074\u0069\u006f\u006e" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0034\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0012\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u005d\u0001\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0058\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0064\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0070\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0013\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0060\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u006c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0071\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0014\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0068\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0074\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0015\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0071\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u007c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0073\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0016\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0079\u0001\u0000\u0000\u008a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u007c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0088\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u0000\u0000\u0074\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0017\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0085\u0001\u0000\u0000\u0072\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0084\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0090\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u0000\u0000\u0075\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0018\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u008d\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u008c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0098\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0007\u0000\u0000\u0000\u0076\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0019\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0095\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0094\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00a0\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u009d\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u009c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00a8\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0009\u0000\u0000\u0000\u0078\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u001b\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00a5\u0001\u0000\u0000\u008a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00a8\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00b4\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\n\u0000\u0000\u0000\u0079\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u001c\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b1\u0001\u0000\u0000\u0072\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b0\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00bc\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000b\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u001d\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b9\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b8\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00c4\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u007b\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u001e\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c1\u0001\u0000\u0000\u0092\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c4\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00d0\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0074\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0046" + - "\u0069\u006c\u0065\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0043" + - "\u006f\u006e\u0073\u0074\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0045" + - "\u006e\u0075\u006d\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0045" + - "\u006e\u0075\u006d\u0065\u0072\u0061\u006e\u0074" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0053" + - "\u0074\u0072\u0075\u0063\u0074\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0046" + - "\u0069\u0065\u006c\u0064\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0055" + - "\u006e\u0069\u006f\u006e\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0047" + - "\u0072\u006f\u0075\u0070\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0049" + - "\u006e\u0074\u0065\u0072\u0066\u0061\u0063\u0065" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u004d" + - "\u0065\u0074\u0068\u006f\u0064\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0050" + - "\u0061\u0072\u0061\u006d\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0073\u0041" + - "\u006e\u006e\u006f\u0074\u0061\u0074\u0069\u006f" + - "\u006e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_9aad50a41f4af45f = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + - "\u0031\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0004\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ba\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0039\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0046\u0069\u0065\u006c\u0064\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0012\u00c7\u00fe\u007c\u00be\u004c\u00b1\u0097" + - "\u0001\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + - "\u006e\u006f\u0044\u0069\u0073\u0063\u0072\u0069" + - "\u006d\u0069\u006e\u0061\u006e\u0074\u0000\u0000" + - "\u001c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b5\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00bc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b9\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00c4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c1\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00dc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d9\u0000\u0000\u0000\u0092\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00dc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00e8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0004\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006f\u0074\u00b4\u006b\u0047\u0005\u0023\u00c4" + - "\u00e5\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0005\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u001d\u00db\u0068\u00db\u00cd\u00fc\u00ca" + - "\u00cd\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e6\u000b\u0087\u0087\u00c2\u00d5\u0090\u00bb" + - "\u00b5\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u006f\u0064\u0065\u004f\u0072\u0064\u0065" + - "\u0072\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u006e\u006e\u006f\u0074\u0061\u0074\u0069" + - "\u006f\u006e\u0073\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0042\u0075\u0025\u00ab\r\u0095\u00c8\u00f1" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0069\u0073\u0063\u0072\u0069\u006d\u0069" + - "\u006e\u0061\u006e\u0074\u0056\u0061\u006c\u0075" + - "\u0065\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u006c\u006f\u0074\u0000\u0000\u0000\u0000" + - "\u0067\u0072\u006f\u0075\u0070\u0000\u0000\u0000" + - "\u006f\u0072\u0064\u0069\u006e\u0061\u006c\u0000" + ""); -public static final org.capnproto.SegmentReader b_97b14cbe7cfec712 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0012\u00c7\u00fe\u007c\u00be\u004c\u00b1\u0097" + - "\u0037\u0000\u0000\u0000\u0004\u0000\u0000\u0000" + - "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0032\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0030\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u003c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0046\u0069\u0065\u006c\u0064\u002e\u006e" + - "\u006f\u0044\u0069\u0073\u0063\u0072\u0069\u006d" + - "\u0069\u006e\u0061\u006e\u0074\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_c42305476bb4746f = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u006f\u0074\u00b4\u006b\u0047\u0005\u0023\u00c4" + - "\u0037\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + - "\u0004\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0046\u0069\u0065\u006c\u0064\u002e\u0073" + - "\u006c\u006f\u0074\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\\\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0068\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0060\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u006c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0068\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0074\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u0000\u0000\u0080\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0071\u0000\u0000\u0000\u009a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0080\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006f\u0066\u0066\u0073\u0065\u0074\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0065\u0066\u0061\u0075\u006c\u0074\u0056" + - "\u0061\u006c\u0075\u0065\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u009b\u000c\u00b0\u00d7\u00d2\u00dc\u0023\u00ce" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0068\u0061\u0064\u0045\u0078\u0070\u006c\u0069" + - "\u0063\u0069\u0074\u0044\u0065\u0066\u0061\u0075" + - "\u006c\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_cafccddb68db1d11 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0011\u001d\u00db\u0068\u00db\u00cd\u00fc\u00ca" + - "\u0037\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + - "\u0004\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0046\u0069\u0065\u006c\u0064\u002e\u0067" + - "\u0072\u006f\u0075\u0070\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0074\u0079\u0070\u0065\u0049\u0064\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_bb90d5c287870be6 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00e6\u000b\u0087\u0087\u00c2\u00d5\u0090\u00bb" + - "\u0037\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u005f\u00f4\u004a\u001f\u00a4\u0050\u00ad\u009a" + - "\u0004\u0000\u0007\u0000\u0001\u0000\u0002\u0000" + - "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00fa\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0046\u0069\u0065\u006c\u0064\u002e\u006f" + - "\u0072\u0064\u0069\u006e\u0061\u006c\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00fe\u00ff\u0006\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0030\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u003c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0069\u006d\u0070\u006c\u0069\u0063\u0069\u0074" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u0078\u0070\u006c\u0069\u0063\u0069\u0074" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_978a7cebdc549a4d = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u004d\u009a\u0054\u00dc\u00eb\u007c\u008a\u0097" + - "\u0031\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0045\u006e\u0075\u006d\u0065\u0072\u0061" + - "\u006e\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0050\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u006c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u006f\u0064\u0065\u004f\u0072\u0064\u0065" + - "\u0072\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u006e\u006e\u006f\u0074\u0061\u0074\u0069" + - "\u006f\u006e\u0073\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0042\u0075\u0025\u00ab\r\u0095\u00c8\u00f1" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_a9962a9ed0a4d7f8 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00f8\u00d7\u00a4\u00d0\u009e\u002a\u0096\u00a9" + - "\u0031\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0053\u0075\u0070\u0065\u0072\u0063\u006c" + - "\u0061\u0073\u0073\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0062\u0072\u0061\u006e\u0064\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_9500cce23b334d80 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0080\u004d\u0033\u003b\u00e2\u00cc\u0000\u0095" + - "\u0031\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0005\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00c2\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u00c7\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u004d\u0065\u0074\u0068\u006f\u0064\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0020\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d1\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00cc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00d8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d5\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00e0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00dd\u0000\u0000\u0000\u0082\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00dc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00e8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e5\u0000\u0000\u0000\u008a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00f4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0007\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00f1\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00f0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u000c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0001\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0001\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u001c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0001\u0000\u0000\u009a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0038\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u006f\u0064\u0065\u004f\u0072\u0064\u0065" + - "\u0072\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0053\u0074\u0072" + - "\u0075\u0063\u0074\u0054\u0079\u0070\u0065\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0053\u0074" + - "\u0072\u0075\u0063\u0074\u0054\u0079\u0070\u0065" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u006e\u006e\u006f\u0074\u0061\u0074\u0069" + - "\u006f\u006e\u0073\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0042\u0075\u0025\u00ab\r\u0095\u00c8\u00f1" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0042\u0072\u0061" + - "\u006e\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0042\u0072" + - "\u0061\u006e\u0064\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006d\u0070\u006c\u0069\u0063\u0069\u0074" + - "\u0050\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + - "\u0072\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b1\u00a3\u000f\u00f1\u00cc\u001b\u0052\u00b9" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_d07378ede1f9cc60 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + - "\u0031\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0013\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u002f\u0004\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0079\u0070\u0065\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0005\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u000c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0018\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0004\u0000\u00fb\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u001c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u00fa\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0014\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0020\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u00f9\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0018\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0024\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0007\u0000\u00f8\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0021\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0028\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0008\u0000\u00f7\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0025\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0020\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u002c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0009\u0000\u00f6\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\n\u0000\u00f5\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0002\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000b\u0000\u00f4\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0002\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0038\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000c\u0000\u00f3\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000c\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0035\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0030\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u003c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\r\u0000\u00f2\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\r\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0039\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0034\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0040\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000e\u0000\u00f1\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0097\u00ea\u0060\n\u0025\u0039\u00e7\u0087" + - "\u003d\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000f\u0000\u00f0\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00a9\u0087\u007f\u001a\u0071\u0078\u000e\u009e" + - "\u0025\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u00ef\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d3\u00c6\u004c\u00ef\u0060\u006f\u003a\u00ac" + - "\r\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0000\u00ee\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00bf\u000c\u00fb\u00f7\u0069\u00ca\u008b\u00ed" + - "\u00f5\u0001\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u00ed\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00f1\u0049\u003e\u00a2\u00e8\u003f\u0057\u00c2" + - "\u00e1\u0001\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0076\u006f\u0069\u0064\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0062\u006f\u006f\u006c\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0074\u0038\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0074\u0031\u0036\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0074\u0033\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0074\u0036\u0034\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0075\u0069\u006e\u0074\u0038\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0075\u0069\u006e\u0074\u0031\u0036\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0075\u0069\u006e\u0074\u0033\u0032\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0075\u0069\u006e\u0074\u0036\u0034\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u006c\u006f\u0061\u0074\u0033\u0032\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u006c\u006f\u0061\u0074\u0036\u0034\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0065\u0078\u0074\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0061\u0074\u0061\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006c\u0069\u0073\u0074\u0000\u0000\u0000\u0000" + - "\u0065\u006e\u0075\u006d\u0000\u0000\u0000\u0000" + - "\u0073\u0074\u0072\u0075\u0063\u0074\u0000\u0000" + - "\u0069\u006e\u0074\u0065\u0072\u0066\u0061\u0063" + - "\u0065\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u006e\u0079\u0050\u006f\u0069\u006e\u0074" + - "\u0065\u0072\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_87e739250a60ea97 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0097\u00ea\u0060\n\u0025\u0039\u00e7\u0087" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + - "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0079\u0070\u0065\u002e\u006c\u0069" + - "\u0073\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000e\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0018\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0054" + - "\u0079\u0070\u0065\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_9e0e78711a7f87a9 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00a9\u0087\u007f\u001a\u0071\u0078\u000e\u009e" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + - "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0079\u0070\u0065\u002e\u0065\u006e" + - "\u0075\u006d\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0015\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0074\u0079\u0070\u0065\u0049\u0064\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0062\u0072\u0061\u006e\u0064\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_ac3a6f60ef4cc6d3 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00d3\u00c6\u004c\u00ef\u0060\u006f\u003a\u00ac" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + - "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0079\u0070\u0065\u002e\u0073\u0074" + - "\u0072\u0075\u0063\u0074\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0010\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0016\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0074\u0079\u0070\u0065\u0049\u0064\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0062\u0072\u0061\u006e\u0064\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_ed8bca69f7fb0cbf = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00bf\u000c\u00fb\u00f7\u0069\u00ca\u008b\u00ed" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + - "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0079\u0070\u0065\u002e\u0069\u006e" + - "\u0074\u0065\u0072\u0066\u0061\u0063\u0065\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0017\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0074\u0079\u0070\u0065\u0049\u0064\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0062\u0072\u0061\u006e\u0064\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_c2573fe8a23e49f1 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00f1\u0049\u003e\u00a2\u00e8\u003f\u0057\u00c2" + - "\u0036\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + - "\u0001\u0000\u0007\u0000\u0001\u0000\u0003\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0079\u0070\u0065\u002e\u0061\u006e" + - "\u0079\u0050\u006f\u0069\u006e\u0074\u0065\u0072" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0056\u0036\u0059\u00fe\u0079\u005f\u003b\u008e" + - "\u0045\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0085\u004a\u0061\u00f4\u0024\u00f7\u00d1\u009d" + - "\u0031\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0002\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u00e2\u0056\u000c\u0012\u00c9\u00ef\u00ba" + - "\u001d\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0075\u006e\u0063\u006f\u006e\u0073\u0074\u0072" + - "\u0061\u0069\u006e\u0065\u0064\u0000\u0000\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + - "\u0072\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006d\u0070\u006c\u0069\u0063\u0069\u0074" + - "\u004d\u0065\u0074\u0068\u006f\u0064\u0050\u0061" + - "\u0072\u0061\u006d\u0065\u0074\u0065\u0072\u0000" + ""); -public static final org.capnproto.SegmentReader b_8e3b5f79fe593656 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0056\u0036\u0059\u00fe\u0079\u005f\u003b\u008e" + - "\u0041\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u00f1\u0049\u003e\u00a2\u00e8\u003f\u0057\u00c2" + - "\u0001\u0000\u0007\u0000\u0001\u0000\u0004\u0000" + - "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u007a\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0079\u0070\u0065\u002e\u0061\u006e" + - "\u0079\u0050\u006f\u0069\u006e\u0074\u0065\u0072" + - "\u002e\u0075\u006e\u0063\u006f\u006e\u0073\u0074" + - "\u0072\u0061\u0069\u006e\u0065\u0064\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0012\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\\\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0068\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0019\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0060\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u006c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0070\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u001b\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006d\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0078\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0061\u006e\u0079\u004b\u0069\u006e\u0064\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u0074\u0072\u0075\u0063\u0074\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006c\u0069\u0073\u0074\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u0061\u0062\u0069\u006c\u0069" + - "\u0074\u0079\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_9dd1f724f4614a85 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0085\u004a\u0061\u00f4\u0024\u00f7\u00d1\u009d" + - "\u0041\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u00f1\u0049\u003e\u00a2\u00e8\u003f\u0057\u00c2" + - "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u005a\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0079\u0070\u0065\u002e\u0061\u006e" + - "\u0079\u0050\u006f\u0069\u006e\u0074\u0065\u0072" + - "\u002e\u0070\u0061\u0072\u0061\u006d\u0065\u0074" + - "\u0065\u0072\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0013\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0014\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0038\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0073\u0063\u006f\u0070\u0065\u0049\u0064\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + - "\u0072\u0049\u006e\u0064\u0065\u0078\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_baefc9120c56e274 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0074\u00e2\u0056\u000c\u0012\u00c9\u00ef\u00ba" + - "\u0041\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u00f1\u0049\u003e\u00a2\u00e8\u003f\u0057\u00c2" + - "\u0001\u0000\u0007\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ca\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0039\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0054\u0079\u0070\u0065\u002e\u0061\u006e" + - "\u0079\u0050\u006f\u0069\u006e\u0074\u0065\u0072" + - "\u002e\u0069\u006d\u0070\u006c\u0069\u0063\u0069" + - "\u0074\u004d\u0065\u0074\u0068\u006f\u0064\u0050" + - "\u0061\u0072\u0061\u006d\u0065\u0074\u0065\u0072" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0018\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0018\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0065\u0074\u0065" + - "\u0072\u0049\u006e\u0064\u0065\u0078\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_903455f06065422b = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + - "\u0031\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ba\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0027\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0041\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0042\u0072\u0061\u006e\u0064\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00c9\u006b\u0063\u00a9\u0085\u0034\u00d7\u00ab" + - "\u0009\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u00fc\u00e7\u009e\u0096\u0016\u00cd\u0063\u00c8" + - "\u0005\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0053\u0063\u006f\u0070\u0065\u0000\u0000\u0000" + - "\u0042\u0069\u006e\u0064\u0069\u006e\u0067\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0024\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0073\u0063\u006f\u0070\u0065\u0073\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c9\u006b\u0063\u00a9\u0085\u0034\u00d7\u00ab" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_abd73485a9636bc9 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00c9\u006b\u0063\u00a9\u0085\u0034\u00d7\u00ab" + - "\u0037\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + - "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0042\u0072\u0061\u006e\u0064\u002e\u0053" + - "\u0063\u006f\u0070\u0065\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0060\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u005d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0058\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0064\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0073\u0063\u006f\u0070\u0065\u0049\u0064\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0062\u0069\u006e\u0064\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00fc\u00e7\u009e\u0096\u0016\u00cd\u0063\u00c8" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0068\u0065\u0072\u0069\u0074\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_c863cd16969ee7fc = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00fc\u00e7\u009e\u0096\u0016\u00cd\u0063\u00c8" + - "\u0037\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00fa\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0042\u0072\u0061\u006e\u0064\u002e\u0042" + - "\u0069\u006e\u0064\u0069\u006e\u0067\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0075\u006e\u0062\u006f\u0075\u006e\u0064\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0060\u00cc\u00f9\u00e1\u00ed\u0078\u0073\u00d0" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_ce23dcd2d7b00c9b = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u009b\u000c\u00b0\u00d7\u00d2\u00dc\u0023\u00ce" + - "\u0031\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0013\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ba\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u002f\u0004\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0056\u0061\u006c\u0075\u0065\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0005\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u000c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00fe\u00ff\u0010\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u00fd\u00ff\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u00fc\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0018\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0004\u0000\u00fb\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u001c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u00fa\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0014\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0020\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u00f9\u00ff\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0002\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0018\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0024\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0007\u0000\u00f8\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0021\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0028\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0008\u0000\u00f7\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0025\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0020\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u002c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0009\u0000\u00f6\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\n\u0000\u00f5\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0002\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000b\u0000\u00f4\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0002\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0038\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000c\u0000\u00f3\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000c\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0035\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0030\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u003c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\r\u0000\u00f2\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\r\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0039\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0034\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0040\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000e\u0000\u00f1\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000e\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003d\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0038\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0044\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000f\u0000\u00f0\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0041\u0002\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003c\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0048\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0010\u0000\u00ef\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0010\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0002\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0011\u0000\u00ee\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0002\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0012\u0000\u00ed\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0012\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0002\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0050\u0002\u0000\u0000\u0003\u0000\u0001\u0000" + - "\\\u0002\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0076\u006f\u0069\u0064\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0062\u006f\u006f\u006c\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0074\u0038\u0000\u0000\u0000\u0000" + - "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0074\u0031\u0036\u0000\u0000\u0000" + - "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0074\u0033\u0032\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0074\u0036\u0034\u0000\u0000\u0000" + - "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0075\u0069\u006e\u0074\u0038\u0000\u0000\u0000" + - "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0075\u0069\u006e\u0074\u0031\u0036\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0075\u0069\u006e\u0074\u0033\u0032\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0075\u0069\u006e\u0074\u0036\u0034\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u006c\u006f\u0061\u0074\u0033\u0032\u0000" + - "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u006c\u006f\u0061\u0074\u0036\u0034\u0000" + - "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0065\u0078\u0074\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0061\u0074\u0061\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006c\u0069\u0073\u0074\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u006e\u0075\u006d\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u0074\u0072\u0075\u0063\u0074\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0074\u0065\u0072\u0066\u0061\u0063" + - "\u0065\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u006e\u0079\u0050\u006f\u0069\u006e\u0074" + - "\u0065\u0072\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_f1c8950dab257542 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0042\u0075\u0025\u00ab\r\u0095\u00c8\u00f1" + - "\u0031\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0041\u006e\u006e\u006f\u0074\u0061\u0074" + - "\u0069\u006f\u006e\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0076\u0061\u006c\u0075\u0065\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u009b\u000c\u00b0\u00d7\u00d2\u00dc\u0023\u00ce" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0062\u0072\u0061\u006e\u0064\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002b\u0042\u0065\u0060\u00f0\u0055\u0034\u0090" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_d1958f7dba521926 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0026\u0019\u0052\u00ba\u007d\u008f\u0095\u00d1" + - "\u0031\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u00c7\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0045\u006c\u0065\u006d\u0065\u006e\u0074" + - "\u0053\u0069\u007a\u0065\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0020\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0059\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0000\u0000\u0000\"\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0041\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003d\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0005\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0039\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0082\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u006d\u0070\u0074\u0079\u0000\u0000\u0000" + - "\u0062\u0069\u0074\u0000\u0000\u0000\u0000\u0000" + - "\u0062\u0079\u0074\u0065\u0000\u0000\u0000\u0000" + - "\u0074\u0077\u006f\u0042\u0079\u0074\u0065\u0073" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u006f\u0075\u0072\u0042\u0079\u0074\u0065" + - "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u0069\u0067\u0068\u0074\u0042\u0079\u0074" + - "\u0065\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u006f\u0069\u006e\u0074\u0065\u0072\u0000" + - "\u0069\u006e\u006c\u0069\u006e\u0065\u0043\u006f" + - "\u006d\u0070\u006f\u0073\u0069\u0074\u0065\u0000" + ""); -public static final org.capnproto.SegmentReader b_d85d305b7d839963 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0063\u0099\u0083\u007d\u005b\u0030\u005d\u00d8" + - "\u0031\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00f2\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0043\u0061\u0070\u006e\u0070\u0056\u0065" + - "\u0072\u0073\u0069\u006f\u006e\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006d\u0061\u006a\u006f\u0072\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006d\u0069\u006e\u006f\u0072\u0000\u0000\u0000" + - "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006d\u0069\u0063\u0072\u006f\u0000\u0000\u0000" + - "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_bfc546f6210ad7ce = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00ce\u00d7\n\u0021\u00f6\u0046\u00c5\u00bf" + - "\u0031\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u00d9\u0072\u004c\u0062\u0009\u00c5\u003f\u00a9" + - "\u0004\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0032\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0041\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0043\u006f\u0064\u0065\u0047\u0065\u006e" + - "\u0065\u0072\u0061\u0074\u006f\u0072\u0052\u0065" + - "\u0071\u0075\u0065\u0073\u0074\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0062\u0000\u0081\u002e\u00b0\u000e\u00ea\u00cf" + - "\u0001\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + - "\u0052\u0065\u0071\u0075\u0065\u0073\u0074\u0065" + - "\u0064\u0046\u0069\u006c\u0065\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0000\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\\\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0078\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0075\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0090\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u008d\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u008c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0098\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0095\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0094\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00b0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006e\u006f\u0064\u0065\u0073\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0017\u00a4\u0023\u00f9\u004c\u00ab\u0082\u00e6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0071\u0075\u0065\u0073\u0074\u0065" + - "\u0064\u0046\u0069\u006c\u0065\u0073\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0062\u0000\u0081\u002e\u00b0\u000e\u00ea\u00cf" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u006e\u0070\u0056\u0065\u0072" + - "\u0073\u0069\u006f\u006e\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0099\u0083\u007d\u005b\u0030\u005d\u00d8" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u006f\u0075\u0072\u0063\u0065\u0049\u006e" + - "\u0066\u006f\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00ae\u0057\u0013\u0004\u00e3\u001d\u008e\u00f3" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_cfea0eb02e810062 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0062\u0000\u0081\u002e\u00b0\u000e\u00ea\u00cf" + - "\u0046\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00ce\u00d7\n\u0021\u00f6\u0046\u00c5\u00bf" + - "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00a2\u0002\u0000\u0000" + - "\u003d\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0043\u006f\u0064\u0065\u0047\u0065\u006e" + - "\u0065\u0072\u0061\u0074\u006f\u0072\u0052\u0065" + - "\u0071\u0075\u0065\u0073\u0074\u002e\u0052\u0065" + - "\u0071\u0075\u0065\u0073\u0074\u0065\u0064\u0046" + - "\u0069\u006c\u0065\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00e5\u0057\u0023\u0012\u0093\u0041\u0050\u00ae" + - "\u0001\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0049\u006d\u0070\u006f\u0072\u0074\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0068\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0069\u006c\u0065\u006e\u0061\u006d\u0065" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006d\u0070\u006f\u0072\u0074\u0073\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e5\u0057\u0023\u0012\u0093\u0041\u0050\u00ae" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_ae504193122357e5 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00e5\u0057\u0023\u0012\u0093\u0041\u0050\u00ae" + - "\u0054\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0062\u0000\u0081\u002e\u00b0\u000e\u00ea\u00cf" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00da\u0002\u0000\u0000" + - "\u0041\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0073\u0063\u0068\u0065" + - "\u006d\u0061\u002e\u0063\u0061\u0070\u006e\u0070" + - "\u003a\u0043\u006f\u0064\u0065\u0047\u0065\u006e" + - "\u0065\u0072\u0061\u0074\u006f\u0072\u0052\u0065" + - "\u0071\u0075\u0065\u0073\u0074\u002e\u0052\u0065" + - "\u0071\u0075\u0065\u0073\u0074\u0065\u0064\u0046" + - "\u0069\u006c\u0065\u002e\u0049\u006d\u0070\u006f" + - "\u0072\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006e\u0061\u006d\u0065\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -} -} - From dba99ca17aeb9176d71476551801cba60bdc0245 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 2 Nov 2020 15:22:17 +0000 Subject: [PATCH 095/246] combine javaFullName methods --- compiler/src/main/cpp/capnpc-java.c++ | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 8bbe6440..c9a986a8 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -199,11 +199,7 @@ private: std::unordered_set usedImports; bool hasInterfaces = false; - kj::StringTree javaFullName(Schema schema) { - return javaFullName(schema, nullptr); - } - - kj::StringTree javaFullName(Schema schema, kj::Maybe method) { + kj::StringTree javaFullName(Schema schema, kj::Maybe method = nullptr) { auto node = schema.getProto(); if (node.getScopeId() == 0) { usedImports.insert(node.getId()); From 407d25c8c25ec2767f1f90d0fa7469bcabdc4671 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 2 Nov 2020 16:56:10 +0000 Subject: [PATCH 096/246] tidy up interface generation --- compiler/src/main/cpp/capnpc-java.c++ | 118 +++++++++----------------- 1 file changed, 38 insertions(+), 80 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index c9a986a8..5508bec5 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -331,7 +331,6 @@ private: return kj::strTree(javaFullName(type.asStruct()), ".", suffix); } } - case schema::Type::INTERFACE: { auto interfaceSchema = type.asInterface(); if (interfaceSchema.getProto().getIsGeneric()) { @@ -347,7 +346,6 @@ private: return kj::strTree(javaFullName(type.asInterface()), ".", suffix); } } - case schema::Type::LIST: { auto elementType = type.asList().getElementType(); @@ -392,7 +390,7 @@ private: return kj::strTree("org.capnproto.ListList.", suffix, "<", kj::mv(inner), ">"); } case schema::Type::INTERFACE: - return kj::strTree("org.capnproto.PrimitiveList.Void.", suffix); + return kj::strTree("org.capnproto.AnyPointer.", suffix); case schema::Type::ANY_POINTER: KJ_FAIL_REQUIRE("unimplemented"); } @@ -930,7 +928,6 @@ private: auto typeBody = slot.getType(); auto defaultBody = slot.getDefaultValue(); - switch (typeBody.which()) { case schema::Type::VOID: kind = FieldKind::PRIMITIVE; @@ -1088,7 +1085,6 @@ private: }; } else if (kind == FieldKind::INTERFACE) { - auto factoryArg = makeFactoryArg(field.getType()); auto clientType = typeName(field.getType(), kj::str("Client")).flatten(); auto serverType = typeName(field.getType(), kj::str("Server")).flatten(); @@ -1192,7 +1188,7 @@ private: auto typeParamVec = getTypeParameters(field.getContainingStruct()); auto factoryArg = makeFactoryArg(field.getType()); auto pipelineType = typeName(field.getType(), kj::str("Pipeline")).flatten(); - + return FieldText { kj::strTree( kj::mv(unionDiscrim.readerIsDef), @@ -1501,7 +1497,6 @@ private: ">"); } kj::String readerTypeParams = readerTypeParamsTree.flatten(); - auto readerTypeParamsInferred = (hasTypeParams ? "<>" : ""); kj::String builderTypeParams = builderTypeParamsTree.flatten(); kj::String factoryTypeParams = factoryTypeParamsTree.flatten(); @@ -1529,8 +1524,8 @@ private: " new org.capnproto.StructSize((short)", structNode.getDataWordCount(), ",(short)", structNode.getPointerCount(), ");\n"), - spaces(indent), " public static final class Factory", factoryTypeParams, "\n", - spaces(indent), " extends org.capnproto.StructFactory {\n", + spaces(indent), " public static final class Factory", factoryTypeParams, + " extends org.capnproto.StructFactory {\n", factoryMembers.flatten(), spaces(indent), " public Factory(", factoryArgs.flatten(), @@ -1650,8 +1645,7 @@ private: spaces(indent), " _NOT_IN_SCHEMA,\n", spaces(indent), " }\n"), KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, - spaces(indent), " public interface Pipeline", readerTypeParams, "\n", - spaces(indent), " extends org.capnproto.Pipeline {\n", + spaces(indent), " public interface Pipeline", readerTypeParams, " extends org.capnproto.Pipeline {\n", KJ_MAP(f, fieldTexts) { return kj::mv(f.pipelineMethodDecls); }, @@ -1683,7 +1677,7 @@ private: } } } - + InterfaceText makeInterfaceText(kj::StringPtr scope, kj::StringPtr name, InterfaceSchema schema, kj::Array nestedTypeDecls, int indent) { @@ -1715,78 +1709,45 @@ private: }; }; } - + auto typeNameVec = javaFullName(schema); auto typeParamVec = getTypeParameters(schema); bool hasTypeParams = typeParamVec.size() > 0; - kj::String genericParamTypes = proto.getIsGeneric() - ? kj::strTree("<", - kj::StringTree( - KJ_MAP(arg, typeParamVec) { - return kj::strTree(arg); - }, ", "), - ">").flatten() + auto params = [&](auto& prefix, auto& sep, auto& suffix, auto item) { + return kj::strTree(prefix, kj::StringTree(KJ_MAP(p, typeParamVec) { return item(p); }, sep), suffix).flatten(); + }; + + auto genericParamTypes = proto.getIsGeneric() + ? params("<", ", ", ">", [](auto& p) { return kj::strTree(p); }) : kj::str(); - - kj::StringTree readerTypeParamsTree; - kj::StringTree builderTypeParamsTree; - kj::StringTree factoryTypeParamsTree; - if (hasTypeParams) { - builderTypeParamsTree = kj::strTree( - "<", - kj::StringTree(KJ_MAP(p, typeParamVec) { - return kj::strTree(p, "_Builder"); - }, ", "), - ">"); - readerTypeParamsTree = kj::strTree( - "<", - kj::StringTree(KJ_MAP(p, typeParamVec) { - return kj::strTree(p, "_Reader"); - }, ", "), - ">"); - factoryTypeParamsTree = kj::strTree( - "<", - kj::StringTree(KJ_MAP(p, typeParamVec) { - return kj::strTree(p, "_Builder, ", p, "_Reader"); - }, ", "), - ">"); - } - kj::String readerTypeParams = readerTypeParamsTree.flatten(); - auto readerTypeParamsInferred = (hasTypeParams ? "<>" : ""); - kj::String builderTypeParams = builderTypeParamsTree.flatten(); - kj::String factoryTypeParams = factoryTypeParamsTree.flatten(); + auto readerTypeParamsInferred = hasTypeParams ? "<>" : ""; - kj::StringTree factoryArgs = kj::StringTree(KJ_MAP(p, typeParamVec) { - return kj::strTree("org.capnproto.PointerFactory<", p, "_Builder, ", p, "_Reader> ", p, "_Factory"); - }, ", "); + auto factoryRef = hasTypeParams + ? params("newFactory(", ", ", ")", [](auto& p) { return kj::strTree(p, "_Factory"); }) + : kj::str("factory"); - kj::StringTree factoryMembers = kj::strTree(KJ_MAP(p, typeParamVec) { - return kj::strTree(spaces(indent), " final org.capnproto.PointerFactory<", p, "_Builder, ", p, "_Reader> ", p, "_Factory;\n"); - }); + auto factoryTypeParams = hasTypeParams + ? params("<", ", ", ">", [](auto& p) { return kj::strTree(p, "_Builder, ", p, "_Reader"); }) + : kj::str(); - auto factoryConstructorParams = kj::StringTree(KJ_MAP(p, typeParamVec) { - return kj::strTree(p, "_Factory"); + auto factoryArgs = kj::StringTree(KJ_MAP(p, typeParamVec) { + return kj::strTree("org.capnproto.PointerFactory<", p, "_Builder, ", p, "_Reader> ", p, "_Factory"); }, ", ").flatten(); - kj::String factoryRef = hasTypeParams - ? kj::str(kj::strTree("newFactory(", - kj::StringTree(KJ_MAP(p, typeParamVec) { - return kj::strTree(p, "_Factory"); - }, ", ") - , ")")) - : kj::str("factory"); - + auto factoryMembers = kj::strTree(KJ_MAP(p, typeParamVec) { + return kj::strTree(spaces(indent), " final org.capnproto.PointerFactory<", p, "_Builder, ", p, "_Reader> ", p, "_Factory;\n"); + }).flatten(); return InterfaceText { kj::strTree( sp, "public static class ", name, genericParamTypes, " {\n", sp, " public static final class Factory", factoryTypeParams, "\n", sp, " extends org.capnproto.Capability.Factory {\n", - factoryMembers.flatten(), + factoryMembers, sp, " public Factory(", - factoryArgs.flatten(), + factoryArgs, ") {\n", KJ_MAP(p, typeParamVec) { return kj::strTree(sp, " this.", p, "_Factory = ", p, "_Factory;\n"); @@ -1799,24 +1760,21 @@ private: "\n", (hasTypeParams ? kj::strTree( - sp, " public static final ", factoryTypeParams, "Factory", factoryTypeParams, "\n", - sp, " newFactory(", factoryArgs.flatten(), ") {\n", - sp, " return new Factory<>(", factoryConstructorParams, ");\n", - sp, " }\n" - ) - : kj::strTree( - sp, " public static final Factory factory = new Factory();\n" - ) + sp, " public static ", factoryTypeParams, "Factory", factoryTypeParams, " newFactory(", factoryArgs, ") {\n", + sp, " return new Factory<>(", + params("", ", ", "", [](auto& p) { return kj::strTree(p, "_Factory"); }), ");\n", + sp, " }\n") + : kj::strTree(sp, " public static final Factory factory = new Factory();\n") ), "\n", sp, " public static class Client\n", (superclasses.size() == 0 - ? kj::str(sp, " extends org.capnproto.Capability.Client ") - : kj::str( - KJ_MAP(s, superclasses) { - return kj::strTree(sp, " extends ", s.typeName, ".Client "); - }) - ), + ? kj::str(sp, " extends org.capnproto.Capability.Client ") + : kj::str( + KJ_MAP(s, superclasses) { + return kj::strTree(sp, " extends ", s.typeName, ".Client "); + }) + ), "{\n", sp, " public Client() {}\n", sp, " public Client(org.capnproto.ClientHook hook) { super(hook); }\n", From 9d023f04492febe8165eee564c7e05c68fcf23ff Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 2 Nov 2020 17:33:48 +0000 Subject: [PATCH 097/246] fix generic pipeline params. add (non-generic, for now) capability list --- compiler/src/main/cpp/capnpc-java.c++ | 16 ++- .../main/java/org/capnproto/Capability.java | 8 -- .../java/org/capnproto/CapabilityList.java | 123 ++++++++++++++++++ runtime/src/test/schema/test.capnp | 2 +- 4 files changed, 138 insertions(+), 11 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/CapabilityList.java diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 5508bec5..77123fff 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -390,7 +390,7 @@ private: return kj::strTree("org.capnproto.ListList.", suffix, "<", kj::mv(inner), ">"); } case schema::Type::INTERFACE: - return kj::strTree("org.capnproto.AnyPointer.", suffix); + return kj::strTree("org.capnproto.CapabilityList.", suffix); case schema::Type::ANY_POINTER: KJ_FAIL_REQUIRE("unimplemented"); } @@ -1187,7 +1187,19 @@ private: auto typeParamVec = getTypeParameters(field.getContainingStruct()); auto factoryArg = makeFactoryArg(field.getType()); - auto pipelineType = typeName(field.getType(), kj::str("Pipeline")).flatten(); + + kj::String pipelineType; + if (field.getType().asStruct().getProto().getIsGeneric()) { + auto typeArgs = getTypeArguments(structSchema, structSchema, kj::str("Reader")); + pipelineType = kj::strTree( + javaFullName(structSchema), ".Pipeline<", + kj::StringTree(KJ_MAP(arg, typeArgs){ + return kj::strTree(arg); + }, ", "), + ">").flatten(); + } else { + pipelineType = typeName(field.getType(), kj::str("Pipeline")).flatten(); + } return FieldText { kj::strTree( diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 58cdcfdd..9a45e7d5 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -2,7 +2,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; -import java.util.concurrent.TimeUnit; public final class Capability { @@ -86,13 +85,6 @@ default CompletableFuture getFd() { } return CompletableFuture.completedFuture(null); } -/* - default - Request newCall(FromPointerBuilder paramsFactory, - FromPointerReader resultsFactory, - long interfaceId, short methodId) { - return Request.fromTypeless(paramsFactory, resultsFactory, this.getHook().newCall(interfaceId, methodId)); - }*/ default Request newCall(long interfaceId, short methodId) { return this.getHook().newCall(interfaceId, methodId); diff --git a/runtime/src/main/java/org/capnproto/CapabilityList.java b/runtime/src/main/java/org/capnproto/CapabilityList.java new file mode 100644 index 00000000..e49066e8 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/CapabilityList.java @@ -0,0 +1,123 @@ +// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors +// Licensed under the MIT License: +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package org.capnproto; + +public final class CapabilityList { + public static final class Factory extends ListFactory { + Factory() {super (ElementSize.POINTER); } + public final Reader constructReader(SegmentReader segment, + int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount, + int nestingLimit) { + return new Reader(segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); + } + + public final Builder constructBuilder(SegmentBuilder segment, + int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount) { + return new Builder(segment, ptr, elementCount, step, structDataSize, structPointerCount); + } + } + public static final Factory factory = new Factory(); + + public static final class Reader extends ListReader implements Iterable { + public Reader(SegmentReader segment, + int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount, + int nestingLimit) { + super(segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); + } + + public Capability.Client get(int index) { + return _getPointerElement(Capability.factory, index); + } + + public final class Iterator implements java.util.Iterator { + public Reader list; + public int idx = 0; + public Iterator(Reader list) { + this.list = list; + } + + public Capability.Client next() { + return this.list._getPointerElement(Capability.factory, idx++); + } + public boolean hasNext() { + return idx < list.size(); + } + public void remove() { + throw new UnsupportedOperationException(); + } + } + + public java.util.Iterator iterator() { + return new Iterator(this); + } + } + + public static final class Builder extends ListBuilder implements Iterable { + public Builder(SegmentBuilder segment, int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount){ + super(segment, ptr, elementCount, step, structDataSize, structPointerCount); + } + + public final Capability.Client get(int index) { + return _getPointerElement(Capability.factory, index); + } + + public final void set(int index, Capability.Client value) { + _setPointerElement(Capability.factory, index, value); + } + + public final Reader asReader() { + return new Reader(this.segment, this.ptr, this.elementCount, this.step, + this.structDataSize, this.structPointerCount, + Integer.MAX_VALUE); + } + + public final class Iterator implements java.util.Iterator { + public Builder list; + public int idx = 0; + public Iterator(Builder list) { + this.list = list; + } + + public Capability.Client next() { + return this.list._getPointerElement(Capability.factory, idx++); + } + public boolean hasNext() { + return this.idx < this.list.size(); + } + public void remove() { + throw new UnsupportedOperationException(); + } + } + + public java.util.Iterator iterator() { + return new Iterator(this); + } + } +} diff --git a/runtime/src/test/schema/test.capnp b/runtime/src/test/schema/test.capnp index d6c2f334..cf824c88 100644 --- a/runtime/src/test/schema/test.capnp +++ b/runtime/src/test/schema/test.capnp @@ -50,7 +50,7 @@ interface TestPipeline { struct TestGenerics(Foo, Bar) { foo @0 :Foo; -# rev @1 :TestGenerics(Bar, Foo); + rev @1 :TestGenerics(Bar, Foo); interface Interface(Qux) { } From 054213a0ac7b7c57e2cfcea2575b86c7b4ea2e2a Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 2 Nov 2020 21:39:58 +0000 Subject: [PATCH 098/246] add rpc bootstrap factory --- .../java/org/capnproto/BootstrapFactory.java | 8 + .../src/main/java/org/capnproto/Request.java | 5 +- .../src/main/java/org/capnproto/RpcState.java | 49 +++--- .../main/java/org/capnproto/RpcSystem.java | 98 ++++++++--- .../java/org/capnproto/TwoPartyRpcSystem.java | 12 +- .../org/capnproto/TwoPartyVatNetwork.java | 33 ++-- .../main/java/org/capnproto/VatNetwork.java | 29 ++-- .../java/org/capnproto/CapabilityTest.java | 117 ++++--------- .../test/java/org/capnproto/RpcStateTest.java | 23 ++- .../src/test/java/org/capnproto/TestUtil.java | 154 +++++++++++++++++- runtime/src/test/schema/test.capnp | 96 +++++++++++ 11 files changed, 443 insertions(+), 181 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/BootstrapFactory.java diff --git a/runtime/src/main/java/org/capnproto/BootstrapFactory.java b/runtime/src/main/java/org/capnproto/BootstrapFactory.java new file mode 100644 index 00000000..c6bd0758 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/BootstrapFactory.java @@ -0,0 +1,8 @@ +package org.capnproto; + +public interface BootstrapFactory { + + FromPointerReader getVatIdFactory(); + + Capability.Client createFor(VatId clientId); +} \ No newline at end of file diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index 6bde1ff2..e1fb41d7 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -24,7 +24,8 @@ static Request newBrokenRequest(FromPointerBuilder para var hook = new RequestHook() { @Override public RemotePromise send() { - return new RemotePromise<>(CompletableFuture.failedFuture(exc), null); + return new RemotePromise<>(CompletableFuture.failedFuture(exc), + new AnyPointer.Pipeline(PipelineHook.newBrokenPipeline(exc))); } @Override @@ -47,7 +48,7 @@ public FromPointerBuilder getParamsFactory() { @Override public Request getTypelessRequest() { - return null; + return new AnyPointer.Request(message.getRoot(AnyPointer.factory), hook); } }; } diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index af704f2f..580bdbab 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -1,6 +1,7 @@ package org.capnproto; import java.io.IOException; +import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.*; @@ -9,7 +10,7 @@ import java.util.concurrent.CompletionStage; import java.util.function.Consumer; -final class RpcState { +final class RpcState { private static int messageSizeHint() { return 1 + RpcProtocol.Message.factory.structSize().total(); @@ -19,12 +20,12 @@ private static int exceptionSizeHint(Throwable exc) { return RpcProtocol.Exception.factory.structSize().total() + exc.getMessage().length(); } - private static int MESSAGE_TARGET_SIZE_HINT + private static final int MESSAGE_TARGET_SIZE_HINT = RpcProtocol.MessageTarget.factory.structSize().total() + RpcProtocol.PromisedAnswer.factory.structSize().total() + 16; - private static int CAP_DESCRIPTOR_SIZE_HINT + private static final int CAP_DESCRIPTOR_SIZE_HINT = RpcProtocol.CapDescriptor.factory.structSize().total() + RpcProtocol.PromisedAnswer.factory.structSize().total(); @@ -63,7 +64,7 @@ void dispose() { } } - private static final class QuestionRef extends WeakReference { + private final class QuestionRef extends WeakReference { private final QuestionDisposer disposer; @@ -77,7 +78,7 @@ void dispose() { } } - private final class Question { + private class Question { CompletableFuture response = new CompletableFuture<>(); int[] paramExports = new int[0]; @@ -146,8 +147,8 @@ public Question next() { public Iterator iterator() { return this.slots.values() .stream() - .map(ref -> ref.get()) - .filter(question -> question != null) + .map(Reference::get) + .filter(Objects::nonNull) .iterator(); } @@ -160,7 +161,7 @@ public void forEach(Consumer action) { } } - static final class Answer { + final class Answer { final int answerId; boolean active = false; PipelineHook pipeline; @@ -228,28 +229,14 @@ final static class Embargo { } } - private final ExportTable exports = new ExportTable() { + private final ExportTable exports = new ExportTable<>() { @Override Export newExportable(int id) { return new Export(id); } }; - /* - private final ExportTable questions = new ExportTable<>() { - @Override - QuestionRef newExportable(int id) { - return new QuestionRef(new Question(id)); - } - }; -*/ private final QuestionExportTable questions = new QuestionExportTable(); - /*{ - @Override - Question newExportable(int id) { - return new Question(id); - } -*/ private final ImportTable answers = new ImportTable<>() { @Override @@ -273,8 +260,8 @@ Embargo newExportable(int id) { }; private final Map exportsByCap = new HashMap<>(); - private final Capability.Client bootstrapInterface; - private final VatNetwork.Connection connection; + private final BootstrapFactory bootstrapFactory; + private final VatNetwork.Connection connection; private final CompletableFuture onDisconnect; private Throwable disconnected = null; private CompletableFuture messageReady = CompletableFuture.completedFuture(null); @@ -282,10 +269,10 @@ Embargo newExportable(int id) { private final ReferenceQueue questionRefs = new ReferenceQueue<>(); private final ReferenceQueue importRefs = new ReferenceQueue<>(); - RpcState(Capability.Client bootstrapInterface, - VatNetwork.Connection connection, + RpcState(BootstrapFactory bootstrapFactory, + VatNetwork.Connection connection, CompletableFuture onDisconnect) { - this.bootstrapInterface = bootstrapInterface; + this.bootstrapFactory = bootstrapFactory; this.connection = connection; this.onDisconnect = onDisconnect; this.messageLoop = this.doMessageLoop(); @@ -445,6 +432,7 @@ private CompletableFuture doMessageLoop() { private void handleMessage(IncomingRpcMessage message) throws RpcException { var reader = message.getBody().getAs(RpcProtocol.Message.factory); + //System.out.println(reader.which()); switch (reader.which()) { case UNIMPLEMENTED: handleUnimplemented(reader.getUnimplemented()); @@ -548,7 +536,8 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo var payload = ret.initResults(); var content = payload.getContent().imbue(capTable); - content.setAsCap(bootstrapInterface); + var cap = this.bootstrapFactory.createFor(connection.getPeerVatId()); + content.setAsCap(cap); var caps = capTable.getTable(); var capHook = caps.length != 0 ? caps[0] @@ -1193,7 +1182,7 @@ interface RpcServerResponse { AnyPointer.Builder getResultsBuilder(); } - static class RpcResponseImpl implements RpcResponse { + class RpcResponseImpl implements RpcResponse { private final Question question; private final IncomingRpcMessage message; private final AnyPointer.Reader results; diff --git a/runtime/src/main/java/org/capnproto/RpcSystem.java b/runtime/src/main/java/org/capnproto/RpcSystem.java index 4e312051..73cc7d32 100644 --- a/runtime/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime/src/main/java/org/capnproto/RpcSystem.java @@ -4,46 +4,81 @@ import java.util.Map; import java.util.concurrent.CompletableFuture; -public abstract class RpcSystem { +public class RpcSystem { - final VatNetwork network; - final Capability.Client bootstrapInterface; - final Map connections = new HashMap<>(); - final CompletableFuture messageLoop; - final CompletableFuture acceptLoop; + private final VatNetwork network; + private final BootstrapFactory bootstrapFactory; + private final Map, RpcState> connections = new HashMap<>(); + private final CompletableFuture messageLoop; + private final CompletableFuture acceptLoop; - public RpcSystem(VatNetwork network, Capability.Client bootstrapInterface) { + public RpcSystem(VatNetwork network) { this.network = network; - this.bootstrapInterface = bootstrapInterface; - this.acceptLoop = doAcceptLoop(); + this.bootstrapFactory = null; + this.acceptLoop = new CompletableFuture<>(); this.messageLoop = doMessageLoop(); } - public CompletableFuture getMessageLoop() { - return this.messageLoop; + public VatNetwork getNetwork() { + return this.network; } - private CompletableFuture getAcceptLoop() { - return this.acceptLoop; + public RpcSystem(VatNetwork network, + Capability.Client bootstrapInterface) { + this(network, new BootstrapFactory() { + + @Override + public FromPointerReader getVatIdFactory() { + return this.getVatIdFactory(); + } + + @Override + public Capability.Client createFor(VatId clientId) { + return bootstrapInterface; + } + }); } - public void accept(VatNetwork.Connection connection) { - getConnectionState(connection); + public RpcSystem(VatNetwork network, + BootstrapFactory bootstrapFactory) { + this.network = network; + this.bootstrapFactory = bootstrapFactory; + this.acceptLoop = doAcceptLoop(); + this.messageLoop = doMessageLoop(); + } + + public Capability.Client bootstrap(VatId vatId) { + var connection = this.getNetwork().connect(vatId); + if (connection != null) { + var state = getConnectionState(connection); + var hook = state.restore(); + return new Capability.Client(hook); + } + else if (this.bootstrapFactory != null) { + return this.bootstrapFactory.createFor(vatId); + } + else { + return new Capability.Client(Capability.newBrokenCap("No bootstrap interface available")); + } } - RpcState getConnectionState(VatNetwork.Connection connection) { + RpcState getConnectionState(VatNetwork.Connection connection) { - var onDisconnect = new CompletableFuture() + var onDisconnect = new CompletableFuture>() .thenAccept(lostConnection -> { this.connections.remove(lostConnection); }); return connections.computeIfAbsent(connection, key -> - new RpcState(bootstrapInterface, connection, onDisconnect)); + new RpcState(this.bootstrapFactory, connection, onDisconnect)); + } + + public void accept(VatNetwork.Connection connection) { + getConnectionState(connection); } private CompletableFuture doAcceptLoop() { - return this.network.baseAccept().thenCompose(connection -> { + return this.getNetwork().baseAccept().thenCompose(connection -> { this.accept(connection); return this.doAcceptLoop(); }); @@ -56,4 +91,29 @@ private CompletableFuture doMessageLoop() { } return accept.thenCompose(x -> this.doMessageLoop()); } + + public CompletableFuture getMessageLoop() { + return this.messageLoop; + } + + private CompletableFuture getAcceptLoop() { + return this.acceptLoop; + } + + public static + RpcSystem makeRpcClient(VatNetwork network) { + return new RpcSystem<>(network); + } + + public static + RpcSystem makeRpcServer(VatNetwork network, + BootstrapFactory bootstrapFactory) { + return new RpcSystem<>(network, bootstrapFactory); + } + + public static + RpcSystem makeRpcServer(VatNetwork network, + Capability.Client bootstrapInterface) { + return new RpcSystem<>(network, bootstrapInterface); + } } diff --git a/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java b/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java index 1add9f9c..66e7efe7 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java @@ -3,18 +3,20 @@ public class TwoPartyRpcSystem extends RpcSystem { + private TwoPartyVatNetwork network; + public TwoPartyRpcSystem(TwoPartyVatNetwork network, Capability.Client bootstrapInterface) { super(network, bootstrapInterface); + this.network = network; } public TwoPartyRpcSystem(TwoPartyVatNetwork network, Capability.Server bootstrapInterface) { super(network, new Capability.Client(bootstrapInterface)); + this.network = network; } - public Capability.Client bootstrap(RpcTwoPartyProtocol.VatId.Reader vatId) { - var connection = this.network.baseConnect(vatId); - var state = getConnectionState(connection); - var hook = state.restore(); - return new Capability.Client(hook); + @Override + public VatNetwork getNetwork() { + return this.network; } } diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 6196ade9..3e48db71 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -4,9 +4,15 @@ import java.util.List; import java.util.concurrent.CompletableFuture; + public class TwoPartyVatNetwork implements VatNetwork, - VatNetwork.Connection { + VatNetwork.Connection { + + @Override + public CompletableFuture> baseAccept() { + return this.accept(); + } public interface MessageTap { void incoming(IncomingRpcMessage message, RpcTwoPartyProtocol.Side side); @@ -33,25 +39,22 @@ public RpcTwoPartyProtocol.Side getSide() { return side; } - public RpcTwoPartyProtocol.VatId.Reader getPeerVatId() { - return peerVatId.getRoot(RpcTwoPartyProtocol.VatId.factory).asReader(); - } - public void setTap(MessageTap tap) { this.tap = tap; } - public VatNetwork.Connection asConnection() { + public Connection asConnection() { return this; } - private Connection connect(RpcTwoPartyProtocol.VatId.Reader vatId) { + @Override + public Connection connect(RpcTwoPartyProtocol.VatId.Reader vatId) { return vatId.getSide() != side ? this.asConnection() : null; } - private CompletableFuture accept() { + public CompletableFuture> accept() { if (side == RpcTwoPartyProtocol.Side.SERVER & !accepted) { accepted = true; return CompletableFuture.completedFuture(this.asConnection()); @@ -62,6 +65,10 @@ private CompletableFuture accept() { } } + public RpcTwoPartyProtocol.VatId.Reader getPeerVatId() { + return this.peerVatId.getRoot(RpcTwoPartyProtocol.VatId.factory).asReader(); + } + @Override public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { return new OutgoingMessage(firstSegmentWordSize); @@ -111,16 +118,6 @@ public CompletableFuture shutdown() { }); } - @Override - public Connection baseConnect(RpcTwoPartyProtocol.VatId.Reader hostId) { - return this.connect(hostId); - } - - @Override - public CompletableFuture baseAccept() { - return this.accept(); - } - final class OutgoingMessage implements OutgoingRpcMessage { private final MessageBuilder message; diff --git a/runtime/src/main/java/org/capnproto/VatNetwork.java b/runtime/src/main/java/org/capnproto/VatNetwork.java index 3f63ad63..1286c71a 100644 --- a/runtime/src/main/java/org/capnproto/VatNetwork.java +++ b/runtime/src/main/java/org/capnproto/VatNetwork.java @@ -2,18 +2,23 @@ import java.util.concurrent.CompletableFuture; -public interface VatNetwork { +public interface VatNetwork +{ + interface Connection { + default OutgoingRpcMessage newOutgoingMessage() { + return newOutgoingMessage(0); + } + OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize); + CompletableFuture receiveIncomingMessage(); + CompletableFuture onDisconnect(); + CompletableFuture shutdown(); + VatId getPeerVatId(); + } - interface Connection { - default OutgoingRpcMessage newOutgoingMessage() { - return newOutgoingMessage(0); - } - OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize); - CompletableFuture receiveIncomingMessage(); - CompletableFuture onDisconnect(); - CompletableFuture shutdown(); - } + CompletableFuture> baseAccept(); - Connection baseConnect(VatId hostId); - CompletableFuture baseAccept(); + //FromPointerReader getVatIdFactory(); + + Connection connect(VatId hostId); } + diff --git a/runtime/src/test/java/org/capnproto/CapabilityTest.java b/runtime/src/test/java/org/capnproto/CapabilityTest.java index 49ba7bcf..3397be4d 100644 --- a/runtime/src/test/java/org/capnproto/CapabilityTest.java +++ b/runtime/src/test/java/org/capnproto/CapabilityTest.java @@ -21,8 +21,10 @@ package org.capnproto; +import org.capnproto.test.Test; + import org.junit.Assert; -import org.junit.Test; +import org.junit.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -33,37 +35,7 @@ class Counter { int value() { return count; } } -class TestInterfaceImpl extends org.capnproto.test.Test.TestInterface.Server { - - final Counter counter; - - TestInterfaceImpl(Counter counter) { - this.counter = counter; - } - - @Override - protected CompletableFuture foo(CallContext ctx) { - this.counter.inc(); - var params = ctx.getParams(); - var result = ctx.getResults(); - Assert.assertEquals(123, params.getI()); - Assert.assertTrue(params.getJ()); - result.setX("foo"); - return READY_NOW; - } - - @Override - protected CompletableFuture baz(CallContext context) { - this.counter.inc(); - var params = context.getParams(); - TestUtil.checkTestMessage(params.getS()); - context.releaseParams(); - Assert.assertThrows(RpcException.class, () -> context.getParams()); - return READY_NOW; - } -} - -class TestExtendsImpl extends org.capnproto.test.Test.TestExtends2.Server { +class TestExtendsImpl extends Test.TestExtends2.Server { final Counter counter; @@ -72,7 +44,7 @@ class TestExtendsImpl extends org.capnproto.test.Test.TestExtends2.Server { } @Override - protected CompletableFuture foo(CallContext context) { + protected CompletableFuture foo(CallContext context) { counter.inc(); var params = context.getParams(); var result = context.getResults(); @@ -83,7 +55,7 @@ protected CompletableFuture foo(CallContext grault(CallContext context) { + protected CompletableFuture grault(CallContext context) { counter.inc(); context.releaseParams(); TestUtil.initTestMessage(context.getResults()); @@ -91,50 +63,25 @@ protected CompletableFuture grault(CallContext getCap(CallContext ctx) { - this.counter.inc(); - var params = ctx.getParams(); - Assert.assertEquals(234, params.getN()); - var cap = params.getInCap(); - ctx.releaseParams(); - - var request = cap.fooRequest(); - var fooParams = request.getParams(); - fooParams.setI(123); - fooParams.setJ(true); - - return request.send().thenAccept(response -> { - Assert.assertEquals("foo", response.getX().toString()); - var result = ctx.getResults(); - result.setS("bar"); - - org.capnproto.test.Test.TestExtends.Server server = new TestExtendsImpl(this.counter); - result.initOutBox().setCap(server); - }); - } + int count = 0; @Override - protected CompletableFuture getAnyCap(CallContext context) { - return super.getAnyCap(context); + protected CompletableFuture getCallSequence(CallContext context) { + var result = context.getResults(); + result.setN(this.count++); + return READY_NOW; } } public class CapabilityTest { - @Test + @org.junit.Test public void testBasic() { var callCount = new Counter(); - var client = new org.capnproto.test.Test.TestInterface.Client( - new TestInterfaceImpl(callCount)); + var client = new Test.TestInterface.Client( + new TestUtil.TestInterfaceImpl(callCount)); var request1 = client.fooRequest(); request1.getParams().setI(123); @@ -155,15 +102,15 @@ public void testBasic() { }); } - @Test + @org.junit.Test public void testInheritance() throws ExecutionException, InterruptedException { var callCount = new Counter(); - var client1 = new org.capnproto.test.Test.TestExtends.Client( + var client1 = new Test.TestExtends.Client( new TestExtendsImpl(callCount)); - org.capnproto.test.Test.TestInterface.Client client2 = client1; - var client = (org.capnproto.test.Test.TestExtends.Client)client2; + Test.TestInterface.Client client2 = client1; + var client = (Test.TestExtends.Client)client2; var request1 = client.fooRequest(); request1.getParams().setI(321); @@ -183,26 +130,26 @@ public void testInheritance() throws ExecutionException, InterruptedException { Assert.assertEquals(2, callCount.value()); } - @Test + @org.junit.Test public void testPipelining() throws ExecutionException, InterruptedException { var callCount = new Counter(); var chainedCallCount = new Counter(); - var client = new org.capnproto.test.Test.TestPipeline.Client( - new TestPipelineImpl(callCount)); + var client = new Test.TestPipeline.Client( + new TestUtil.TestPipelineImpl(callCount)); var request = client.getCapRequest(); var params = request.getParams(); params.setN(234); - params.setInCap(new org.capnproto.test.Test.TestInterface.Client( - new TestInterfaceImpl(chainedCallCount))); + params.setInCap(new Test.TestInterface.Client( + new TestUtil.TestInterfaceImpl(chainedCallCount))); var promise = request.send(); var outbox = promise.getOutBox(); var pipelineRequest = outbox.getCap().fooRequest(); pipelineRequest.getParams().setI(321); var pipelinePromise = pipelineRequest.send(); - var pipelineRequest2 = new org.capnproto.test.Test.TestExtends.Client(promise.getOutBox().getCap()).graultRequest(); + var pipelineRequest2 = new Test.TestExtends.Client(promise.getOutBox().getCap()).graultRequest(); var pipelinePromise2 = pipelineRequest2.send(); // Hmm, we have no means to defer the evaluation of callInternal. The best we can do is @@ -219,7 +166,7 @@ public void testPipelining() throws ExecutionException, InterruptedException { Assert.assertEquals(1, chainedCallCount.value()); } - class TestThisCap extends org.capnproto.test.Test.TestInterface.Server { + class TestThisCap extends Test.TestInterface.Server { Counter counter; @@ -227,29 +174,29 @@ class TestThisCap extends org.capnproto.test.Test.TestInterface.Server { this.counter = counter; } - org.capnproto.test.Test.TestInterface.Client getSelf() { + Test.TestInterface.Client getSelf() { return this.thisCap(); } @Override - protected CompletableFuture bar(CallContext context) { + protected CompletableFuture bar(CallContext context) { this.counter.inc(); return READY_NOW; } } - @Test + @org.junit.Test public void testGenerics() { - var factory = org.capnproto.test.Test.TestGenerics.newFactory(org.capnproto.test.Test.TestAllTypes.factory, AnyPointer.factory); + var factory = Test.TestGenerics.newFactory(Test.TestAllTypes.factory, AnyPointer.factory); } - @Test + @org.junit.Test public void thisCap() { var callCount = new Counter(); var server = new TestThisCap(callCount); - var client = new org.capnproto.test.Test.TestInterface.Client(server); + var client = new Test.TestInterface.Client(server); client.barRequest().send().join(); Assert.assertEquals(1, callCount.value()); diff --git a/runtime/src/test/java/org/capnproto/RpcStateTest.java b/runtime/src/test/java/org/capnproto/RpcStateTest.java index 7f5c6d51..173bdc4a 100644 --- a/runtime/src/test/java/org/capnproto/RpcStateTest.java +++ b/runtime/src/test/java/org/capnproto/RpcStateTest.java @@ -8,8 +8,6 @@ import java.util.ArrayDeque; import java.util.Queue; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; public class RpcStateTest { @@ -23,7 +21,7 @@ public AnyPointer.Reader getBody() { } } - class TestConnection implements VatNetwork.Connection { + class TestConnection implements VatNetwork.Connection { private CompletableFuture nextIncomingMessage = new CompletableFuture<>(); private final CompletableFuture disconnect = new CompletableFuture<>(); @@ -69,6 +67,11 @@ public CompletableFuture shutdown() { this.disconnect.complete(null); return this.disconnect.copy(); } + + @Override + public RpcTwoPartyProtocol.VatId.Reader getPeerVatId() { + return null; + } } TestConnection connection; @@ -80,7 +83,19 @@ public CompletableFuture shutdown() { public void setUp() throws Exception { this.connection = new TestConnection(); this.bootstrapInterface = new Capability.Client(Capability.newNullCap()); - this.rpc = new RpcState(bootstrapInterface, connection, connection.disconnect); + var bootstrapFactory = new BootstrapFactory() { + @Override + public FromPointerReader getVatIdFactory() { + return RpcTwoPartyProtocol.VatId.factory; + } + + @Override + public Capability.Client createFor(RpcTwoPartyProtocol.VatId.Reader clientId) { + return bootstrapInterface; + } + }; + + this.rpc = new RpcState(bootstrapFactory, connection, connection.disconnect); } @After diff --git a/runtime/src/test/java/org/capnproto/TestUtil.java b/runtime/src/test/java/org/capnproto/TestUtil.java index 75f97270..cfda3f23 100644 --- a/runtime/src/test/java/org/capnproto/TestUtil.java +++ b/runtime/src/test/java/org/capnproto/TestUtil.java @@ -1,9 +1,12 @@ package org.capnproto; +import org.capnproto.test.Test; import org.junit.Assert; +import java.util.concurrent.CompletableFuture; + class TestUtil { - static void initTestMessage(org.capnproto.test.Test.TestAllTypes.Builder builder) { + static void initTestMessage(Test.TestAllTypes.Builder builder) { builder.setVoidField(Void.VOID); builder.setBoolField(true); builder.setInt8Field((byte) -123); @@ -12,26 +15,165 @@ static void initTestMessage(org.capnproto.test.Test.TestAllTypes.Builder builder builder.setInt64Field(-123456789012345L); builder.setUInt8Field((byte) 234); builder.setUInt16Field((short) 45678); - builder.setUInt32Field((int) 3456789012l); + builder.setUInt32Field((int) 3456789012L); builder.setUInt64Field(1234567890123456789L); builder.setFloat32Field(1234.5f); builder.setFloat64Field(-123e45); builder.setTextField("foo"); } - static void checkTestMessage(org.capnproto.test.Test.TestAllTypes.Reader reader) { + static void checkTestMessage(Test.TestAllTypes.Reader reader) { Assert.assertEquals(Void.VOID, reader.getVoidField()); Assert.assertTrue(reader.getBoolField()); Assert.assertEquals((byte)-123, reader.getInt8Field()); Assert.assertEquals((short)-12345, reader.getInt16Field()); Assert.assertEquals(-12345678, reader.getInt32Field()); - Assert.assertEquals(-123456789012345l, reader.getInt64Field()); + Assert.assertEquals(-123456789012345L, reader.getInt64Field()); Assert.assertEquals((byte)234, reader.getUInt8Field()); Assert.assertEquals((short)45678, reader.getUInt16Field()); - Assert.assertEquals((int)3456789012l, reader.getUInt32Field()); - Assert.assertEquals(1234567890123456789l, reader.getUInt64Field()); + Assert.assertEquals((int) 3456789012L, reader.getUInt32Field()); + Assert.assertEquals(1234567890123456789L, reader.getUInt64Field()); Assert.assertEquals(null, 1234.5f, reader.getFloat32Field(), 0.1f); Assert.assertEquals(null, -123e45, reader.getFloat64Field(), 0.1f); Assert.assertEquals("foo", reader.getTextField().toString()); } + + static class TestInterfaceImpl extends Test.TestInterface.Server { + + final Counter counter; + + TestInterfaceImpl(Counter counter) { + this.counter = counter; + } + + @Override + protected CompletableFuture foo(CallContext ctx) { + this.counter.inc(); + var params = ctx.getParams(); + var result = ctx.getResults(); + Assert.assertEquals(123, params.getI()); + Assert.assertTrue(params.getJ()); + result.setX("foo"); + return READY_NOW; + } + + @Override + protected CompletableFuture baz(CallContext context) { + this.counter.inc(); + var params = context.getParams(); + checkTestMessage(params.getS()); + context.releaseParams(); + return READY_NOW; + } + } + + static class TestTailCallerImpl extends Test.TestTailCaller.Server { + + private final Counter count; + + public TestTailCallerImpl(Counter count) { + this.count = count; + } + + @Override + protected CompletableFuture foo(CallContext context) { + this.count.inc(); + var params = context.getParams(); + var tailRequest = params.getCallee().fooRequest(); + tailRequest.getParams().setI(params.getI()); + tailRequest.getParams().setT("from TestTailCaller"); + return context.tailCall(tailRequest); + } + + public int getCount() { + return this.count.value(); + } + } + + static class TestMoreStuffImpl extends Test.TestMoreStuff.Server { + + final Counter callCount; + final Counter handleCount; + + public TestMoreStuffImpl(Counter callCount, Counter handleCount) { + this.callCount = callCount; + this.handleCount = handleCount; + } + } + + static class TestTailCalleeImpl extends Test.TestTailCallee.Server { + + private final Counter count; + + public TestTailCalleeImpl(Counter count) { + this.count = count; + } + + @Override + protected CompletableFuture foo(CallContext context) { + this.count.inc(); + + var params = context.getParams(); + var results = context.getResults(); + + results.setI(params.getI()); + results.setT(params.getT()); + results.setC(new TestCallOrderImpl()); + return READY_NOW; + } + } + + static class TestPipelineImpl extends Test.TestPipeline.Server { + + final Counter callCount; + + TestPipelineImpl(Counter callCount) { + this.callCount = callCount; + } + + @Override + protected CompletableFuture getCap(CallContext ctx) { + this.callCount.inc(); + var params = ctx.getParams(); + Assert.assertEquals(234, params.getN()); + var cap = params.getInCap(); + ctx.releaseParams(); + + var request = cap.fooRequest(); + var fooParams = request.getParams(); + fooParams.setI(123); + fooParams.setJ(true); + + return request.send().thenAccept(response -> { + Assert.assertEquals("foo", response.getX().toString()); + var result = ctx.getResults(); + result.setS("bar"); + + Test.TestExtends.Server server = new TestExtendsImpl(this.callCount); + result.initOutBox().setCap(server); + }); + } + + @Override + protected CompletableFuture getAnyCap(CallContext context) { + this.callCount.inc(); + var params = context.getParams(); + Assert.assertEquals(234, params.getN()); + + var cap = params.getInCap(); + context.releaseParams(); + + var request = new Test.TestInterface.Client(cap).fooRequest(); + request.getParams().setI(123); + request.getParams().setJ(true); + + return request.send().thenAccept(response -> { + Assert.assertEquals("foo", response.getX().toString()); + + var result = context.getResults(); + result.setS("bar"); + result.initOutBox().setCap(new TestExtendsImpl(callCount)); + }); + } + } } diff --git a/runtime/src/test/schema/test.capnp b/runtime/src/test/schema/test.capnp index cf824c88..ea500f60 100644 --- a/runtime/src/test/schema/test.capnp +++ b/runtime/src/test/schema/test.capnp @@ -21,6 +21,32 @@ struct TestAllTypes { dataField @13 : Data; } +struct TestSturdyRef { + hostId @0 :TestSturdyRefHostId; + objectId @1 :AnyPointer; +} + +struct TestSturdyRefHostId { + host @0 :Text; +} + +struct TestSturdyRefObjectId { + tag @0 :Tag; + enum Tag { + testInterface @0; + testExtends @1; + testPipeline @2; + testTailCallee @3; + testTailCaller @4; + testMoreStuff @5; + } +} + +struct TestProvisionId {} +struct TestRecipientId {} +struct TestThirdPartyCapId {} +struct TestJoinResult {} + interface TestInterface { foo @0 (i :UInt32, j :Bool) -> (x :Text); bar @1 () -> (); @@ -48,6 +74,76 @@ interface TestPipeline { } } +interface TestCallOrder { + getCallSequence @0 (expected: UInt32) -> (n: UInt32); + # First call returns 0, next returns 1, ... + # + # The input `expected` is ignored but useful for disambiguating debug logs. +} + +interface TestTailCallee { + struct TailResult { + i @0 :UInt32; + t @1 :Text; + c @2 :TestCallOrder; + } + + foo @0 (i :Int32, t :Text) -> TailResult; +} + +interface TestTailCaller { + foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult; +} + +interface TestHandle {} + +interface TestMoreStuff extends(TestCallOrder) { + # Catch-all type that contains lots of testing methods. + + callFoo @0 (cap :TestInterface) -> (s: Text); + # Call `cap.foo()`, check the result, and return "bar". + + callFooWhenResolved @1 (cap :TestInterface) -> (s: Text); + # Like callFoo but waits for `cap` to resolve first. + + neverReturn @2 (cap :TestInterface) -> (capCopy :TestInterface); + # Doesn't return. You should cancel it. + + hold @3 (cap :TestInterface) -> (); + # Returns immediately but holds on to the capability. + + callHeld @4 () -> (s: Text); + # Calls the capability previously held using `hold` (and keeps holding it). + + getHeld @5 () -> (cap :TestInterface); + # Returns the capability previously held using `hold` (and keeps holding it). + + echo @6 (cap :TestCallOrder) -> (cap :TestCallOrder); + # Just returns the input cap. + + expectCancel @7 (cap :TestInterface) -> (); + # evalLater()-loops forever, holding `cap`. Must be canceled. + + methodWithDefaults @8 (a :Text, b :UInt32 = 123, c :Text = "foo") -> (d :Text, e :Text = "bar"); + + methodWithNullDefault @12 (a :Text, b :TestInterface = null); + + getHandle @9 () -> (handle :TestHandle); + # Get a new handle. Tests have an out-of-band way to check the current number of live handles, so + # this can be used to test garbage collection. + + getNull @10 () -> (nullCap :TestMoreStuff); + # Always returns a null capability. + + getEnormousString @11 () -> (str :Text); + # Attempts to return an 100MB string. Should always fail. + + writeToFd @13 (fdCap1 :TestInterface, fdCap2 :TestInterface) + -> (fdCap3 :TestInterface, secondFdPresent :Bool); + # Expects fdCap1 and fdCap2 wrap socket file descriptors. Writes "foo" to the first and "bar" to + # the second. Also creates a socketpair, writes "baz" to one end, and returns the other end. +} + struct TestGenerics(Foo, Bar) { foo @0 :Foo; rev @1 :TestGenerics(Bar, Foo); From 1f004779d4e953555c4144ffab97601fda2cf3cf Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 4 Nov 2020 15:55:02 +0000 Subject: [PATCH 099/246] rpc tests --- .../src/test/java/org/capnproto/RpcTest.java | 376 ++++++++++++++++++ .../src/test/java/org/capnproto/TestUtil.java | 15 + 2 files changed, 391 insertions(+) create mode 100644 runtime/src/test/java/org/capnproto/RpcTest.java diff --git a/runtime/src/test/java/org/capnproto/RpcTest.java b/runtime/src/test/java/org/capnproto/RpcTest.java new file mode 100644 index 00000000..0ea195a8 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/RpcTest.java @@ -0,0 +1,376 @@ +// Copyright (c) 2018 Sandstorm Development Group, Inc. and contributors +// Licensed under the MIT License: +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package org.capnproto; + +import org.capnproto.test.Test; + +import org.junit.Assert; + +import java.util.ArrayDeque; +import java.util.HashMap; +import java.util.Map; +import java.util.Queue; +import java.util.concurrent.CompletableFuture; + +class TestNetwork { + + final Map map = new HashMap<>(); + int received = 0; + + TestNetworkAdapter add(String name) { + return this.map.computeIfAbsent( + name, key -> new TestNetworkAdapter(this, name)); + } + + TestNetworkAdapter find(String name) { + return this.map.get(name); + } +} + +class TestNetworkAdapter + implements VatNetwork { + + @Override + public CompletableFuture> baseAccept() { + return this.accept().thenApply(conn -> conn); + } + + class Connection implements VatNetwork.Connection { + + Throwable networkException; + Connection partner; + final Queue messages = new ArrayDeque<>(); + final Queue> fulfillers = new ArrayDeque<>(); + CompletableFuture fulfillOnEnd; + final boolean isClient; + final Test.TestSturdyRef.Reader peerId; + + Connection(boolean isClient, Test.TestSturdyRef.Reader peerId) { + this.isClient = isClient; + this.peerId = peerId; + } + + void attach(Connection other) { + Assert.assertNull(this.partner); + Assert.assertNull(other.partner); + this.partner = other; + other.partner = this; + } + + TestNetwork getNetwork() { + return network; + } + + @Override + public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { + var message = new MessageBuilder(firstSegmentWordSize); + + return new OutgoingRpcMessage() { + @Override + public AnyPointer.Builder getBody() { + return message.getRoot(AnyPointer.factory); + } + + @Override + public void send() { + if (networkException != null) { + return; + } + + var incomingMessage = new IncomingRpcMessage() { + @Override + public AnyPointer.Reader getBody() { + return message.getRoot(AnyPointer.factory).asReader(); + } + }; + + if (partner == null) { + return; + } + + if (partner.fulfillers.isEmpty()) { + partner.messages.add(incomingMessage); + } + else { + partner.getNetwork().received++; + var front = partner.fulfillers.remove(); + front.complete(incomingMessage); + } + } + + @Override + public int sizeInWords() { + return 0; + } + }; + } + + @Override + public CompletableFuture receiveIncomingMessage() { + if (this.networkException != null) { + return CompletableFuture.failedFuture(this.networkException); + } + + if (this.messages.isEmpty()) { + if (this.fulfillOnEnd != null) { + this.fulfillOnEnd.complete(null); + return CompletableFuture.completedFuture(null); + } + else { + var promise = new CompletableFuture(); + this.fulfillers.add(promise); + return promise.copy(); + } + } + else { + this.getNetwork().received++; + var result = this.messages.remove(); + return CompletableFuture.completedFuture(result); + } + } + + @Override + public CompletableFuture onDisconnect() { + return null; + } + + @Override + public CompletableFuture shutdown() { + if (this.partner == null) { + return CompletableFuture.completedFuture(null); + } + var promise = new CompletableFuture(); + this.partner.fulfillOnEnd = promise; + return promise.copy(); + } + + public Test.TestSturdyRef.Reader getPeerVatId() { + return this.peerId; + } + } + + final TestNetwork network; + private final String self; + int sent = 0; + int received = 0; + Map connections = new HashMap<>(); + Queue> fulfillerQueue = new ArrayDeque<>(); + Queue connectionQueue = new ArrayDeque<>(); + + TestNetworkAdapter(TestNetwork network, String self) { + this.network = network; + this.self = self; + } + + Connection newConnection(boolean isClient, Test.TestSturdyRef.Reader peerId) { + return new Connection(isClient, peerId); + } + + @Override + public VatNetwork.Connection connect(Test.TestSturdyRef.Reader refId) { + var hostId = refId.getHostId().getHost().toString(); + if (hostId.equals(self)) { + return null; + } + + var dst = this.network.find(hostId); + Assert.assertNotNull(dst); + + var connnection = this.connections.get(dst); + if (connnection != null) { + return connnection; + } + + var local = this.newConnection(true, refId); + var remote = dst.newConnection(false, refId); + local.attach(remote); + + this.connections.put(dst, local); + dst.connections.put(this, remote); + + if (dst.fulfillerQueue.isEmpty()) { + dst.fulfillerQueue.add(CompletableFuture.completedFuture(remote)); + } else { + dst.fulfillerQueue.remove().complete(remote); + } + return local; + } + + public CompletableFuture accept() { + if (this.connections.isEmpty()) { + var promise = new CompletableFuture(); + this.fulfillerQueue.add(promise); + return promise.thenApply(conn -> conn); + } + else { + return CompletableFuture.completedFuture(this.connectionQueue.remove()); + } + } +} + +class TestContext { + final TestNetwork network = new TestNetwork(); + final TestNetworkAdapter clientNetwork; + final TestNetworkAdapter serverNetwork; + + final RpcSystem rpcClient; + final RpcSystem rpcServer; + + TestContext(Capability.Client bootstrapInterface) { + this.clientNetwork = this.network.add("client"); + this.serverNetwork = this.network.add("server"); + this.rpcClient = RpcSystem.makeRpcClient(this.clientNetwork); + this.rpcServer = RpcSystem.makeRpcServer(this.serverNetwork, bootstrapInterface); + } + + TestContext(BootstrapFactory bootstrapFactory) { + this.clientNetwork = this.network.add("client"); + this.serverNetwork = this.network.add("server"); + this.rpcClient = RpcSystem.makeRpcClient(this.clientNetwork); + this.rpcServer = RpcSystem.makeRpcServer(this.serverNetwork, bootstrapFactory); + } + + Capability.Client connect(Test.TestSturdyRefObjectId.Tag tag) { + var message = new MessageBuilder(); + var ref = message.initRoot(Test.TestSturdyRef.factory); + var hostId = ref.initHostId(); + hostId.setHost("server"); + ref.getObjectId().initAs(Test.TestSturdyRefObjectId.factory).setTag(tag); + return rpcClient.bootstrap(ref.asReader()); + } +} + +public class RpcTest { + + static BootstrapFactory bootstrapFactory = new BootstrapFactory<>() { + @Override + public FromPointerReader getVatIdFactory() { + return Test.TestSturdyRef.factory; + } + + @Override + public Capability.Client createFor(Test.TestSturdyRef.Reader refId) { + var callCount = new Counter(); + var handleCount = new Counter(); + + var objectId = refId.getObjectId().getAs(Test.TestSturdyRefObjectId.factory); + var tag = objectId.getTag(); + switch (tag) { + case TEST_INTERFACE: + return new Capability.Client(new TestUtil.TestInterfaceImpl(callCount)); + case TEST_EXTENDS: + return new Capability.Client(Capability.newBrokenCap("No TestExtends implemented.")); + case TEST_PIPELINE: + return new Capability.Client(new TestUtil.TestPipelineImpl(callCount)); + case TEST_TAIL_CALLEE: + return new Capability.Client(new TestUtil.TestTailCalleeImpl(callCount)); + case TEST_TAIL_CALLER: + return new Capability.Client(new TestUtil.TestTailCallerImpl(callCount)); + case TEST_MORE_STUFF: + return new Capability.Client(new TestUtil.TestMoreStuffImpl(callCount, handleCount)); + default: + return new Capability.Client(); + } + } + }; + + @org.junit.Test + public void testBasic() { + var context = new TestContext(bootstrapFactory); + var client = new Test.TestInterface.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_INTERFACE)); + var request1 = client.fooRequest(); + request1.getParams().setI(123); + request1.getParams().setJ(true); + var promise1 = request1.send(); + + final var ref = new Object() { + boolean barFailed = false; + }; + var request3 = client.barRequest(); + var promise3 = request3.send().exceptionally(exc -> { + ref.barFailed = true; + return null; + }); + + var request2 = client.bazRequest(); + TestUtil.initTestMessage(request2.getParams().initS()); + var promise2 = request2.send(); + + var response1 = promise1.join(); + Assert.assertEquals("foo", response1.getX().toString()); + + var response2 = promise2.join(); + promise3.join(); + + Assert.assertTrue(ref.barFailed); + } + + @org.junit.Test + public void testPipelining() { + var context = new TestContext(bootstrapFactory); + var client = new Test.TestPipeline.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_PIPELINE)); + + var chainedCallCount = new Counter(); + + var request = client.getCapRequest(); + request.getParams().setN(234); + request.getParams().setInCap(new TestUtil.TestInterfaceImpl(chainedCallCount)); + + var promise = request.send(); + + var pipelineRequest = promise.getOutBox().getCap().fooRequest(); + pipelineRequest.getParams().setI(321); + + var pipelinePromise = pipelineRequest.send(); + + var pipelineRequest2 = new Test.TestExtends.Client(promise.getOutBox().getCap()).graultRequest(); + var pipelinePromise2 = pipelineRequest2.send(); + + promise = null; + + //Assert.assertEquals(0, chainedCallCount.value()); + + var response = pipelinePromise.join(); + Assert.assertEquals("bar", response.getX().toString()); + + var response2 = pipelinePromise2.join(); + TestUtil.checkTestMessage(response2); + + Assert.assertEquals(1, chainedCallCount.value()); + } + + @org.junit.Test + public void testRelease() { + var context = new TestContext(bootstrapFactory); + var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); + + var handle1 = client.getHandleRequest().send().join().getHandle(); + var promise = client.getHandleRequest().send(); + var handle2 = promise.join().getHandle(); + + handle1 = null; + handle2 = null; + + + } +} + diff --git a/runtime/src/test/java/org/capnproto/TestUtil.java b/runtime/src/test/java/org/capnproto/TestUtil.java index cfda3f23..0936a21b 100644 --- a/runtime/src/test/java/org/capnproto/TestUtil.java +++ b/runtime/src/test/java/org/capnproto/TestUtil.java @@ -90,6 +90,15 @@ public int getCount() { } } + static class HandleImpl extends Test.TestHandle.Server { + final Counter count; + + HandleImpl(Counter count) { + this.count = count; + count.inc(); + } + } + static class TestMoreStuffImpl extends Test.TestMoreStuff.Server { final Counter callCount; @@ -99,6 +108,12 @@ public TestMoreStuffImpl(Counter callCount, Counter handleCount) { this.callCount = callCount; this.handleCount = handleCount; } + + @Override + protected CompletableFuture getHandle(CallContext context) { + context.getResults().setHandle(new HandleImpl(this.handleCount)); + return READY_NOW; + } } static class TestTailCalleeImpl extends Test.TestTailCallee.Server { From 7d2e5416032334907c3a341c043e1cc1184833b0 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 5 Nov 2020 14:48:48 +0000 Subject: [PATCH 100/246] fix getNetwork bug, remove unnecessary TwoPartVatNetwork specialisation --- .../main/java/org/capnproto/RpcSystem.java | 7 +++++- .../java/org/capnproto/TwoPartyClient.java | 4 ++-- .../java/org/capnproto/TwoPartyRpcSystem.java | 22 ------------------- .../java/org/capnproto/TwoPartyServer.java | 4 ++-- .../org/capnproto/TwoPartyVatNetwork.java | 6 ++--- .../test/java/org/capnproto/TwoPartyTest.java | 12 +++++----- 6 files changed, 19 insertions(+), 36 deletions(-) delete mode 100644 runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java diff --git a/runtime/src/main/java/org/capnproto/RpcSystem.java b/runtime/src/main/java/org/capnproto/RpcSystem.java index 73cc7d32..9ab49b15 100644 --- a/runtime/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime/src/main/java/org/capnproto/RpcSystem.java @@ -23,6 +23,11 @@ public VatNetwork getNetwork() { return this.network; } + public RpcSystem(VatNetwork network, + Capability.Server bootstrapInterface) { + this(network, new Capability.Client(bootstrapInterface)); + } + public RpcSystem(VatNetwork network, Capability.Client bootstrapInterface) { this(network, new BootstrapFactory() { @@ -78,7 +83,7 @@ public void accept(VatNetwork.Connection connection) { } private CompletableFuture doAcceptLoop() { - return this.getNetwork().baseAccept().thenCompose(connection -> { + return this.network.baseAccept().thenCompose(connection -> { this.accept(connection); return this.doAcceptLoop(); }); diff --git a/runtime/src/main/java/org/capnproto/TwoPartyClient.java b/runtime/src/main/java/org/capnproto/TwoPartyClient.java index 018299db..19eb9704 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyClient.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyClient.java @@ -6,7 +6,7 @@ public class TwoPartyClient { private final TwoPartyVatNetwork network; - private final TwoPartyRpcSystem rpcSystem; + private final RpcSystem rpcSystem; public TwoPartyClient(AsynchronousSocketChannel channel) { this(channel, null); @@ -20,7 +20,7 @@ public TwoPartyClient(AsynchronousSocketChannel channel, Capability.Client bootstrapInterface, RpcTwoPartyProtocol.Side side) { this.network = new TwoPartyVatNetwork(channel, side); - this.rpcSystem = new TwoPartyRpcSystem(network, bootstrapInterface); + this.rpcSystem = new RpcSystem(network, bootstrapInterface); } public Capability.Client bootstrap() { diff --git a/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java b/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java deleted file mode 100644 index 66e7efe7..00000000 --- a/runtime/src/main/java/org/capnproto/TwoPartyRpcSystem.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.capnproto; - -public class TwoPartyRpcSystem - extends RpcSystem { - - private TwoPartyVatNetwork network; - - public TwoPartyRpcSystem(TwoPartyVatNetwork network, Capability.Client bootstrapInterface) { - super(network, bootstrapInterface); - this.network = network; - } - - public TwoPartyRpcSystem(TwoPartyVatNetwork network, Capability.Server bootstrapInterface) { - super(network, new Capability.Client(bootstrapInterface)); - this.network = network; - } - - @Override - public VatNetwork getNetwork() { - return this.network; - } -} diff --git a/runtime/src/main/java/org/capnproto/TwoPartyServer.java b/runtime/src/main/java/org/capnproto/TwoPartyServer.java index 1aac7a5b..1c8840fb 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyServer.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyServer.java @@ -13,13 +13,13 @@ public class TwoPartyServer { private class AcceptedConnection { final AsynchronousSocketChannel channel; final TwoPartyVatNetwork network; - final TwoPartyRpcSystem rpcSystem; + final RpcSystem rpcSystem; private final CompletableFuture messageLoop; AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousSocketChannel channel) { this.channel = channel; this.network = new TwoPartyVatNetwork(channel, RpcTwoPartyProtocol.Side.SERVER); - this.rpcSystem = new TwoPartyRpcSystem(network, bootstrapInterface); + this.rpcSystem = new RpcSystem<>(network, bootstrapInterface); this.messageLoop = this.rpcSystem.getMessageLoop().exceptionally(exc -> { connections.remove(this); return null; diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 3e48db71..68a425bf 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -43,12 +43,12 @@ public void setTap(MessageTap tap) { this.tap = tap; } - public Connection asConnection() { + public Connection asConnection() { return this; } @Override - public Connection connect(RpcTwoPartyProtocol.VatId.Reader vatId) { + public Connection connect(RpcTwoPartyProtocol.VatId.Reader vatId) { return vatId.getSide() != side ? this.asConnection() : null; @@ -60,7 +60,7 @@ public CompletableFuture> accept() return CompletableFuture.completedFuture(this.asConnection()); } else { - // never completes + // never /home/vaci/g/capnproto-java/compilercompletes return new CompletableFuture<>(); } } diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index 12ea1a63..a54af25c 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -105,7 +105,7 @@ public void tearDown() throws Exception { @Test public void testNullCap() throws ExecutionException, InterruptedException { - var server = new TwoPartyRpcSystem(this.serverNetwork, new Capability.Client()); + var server = new RpcSystem<>(this.serverNetwork, new Capability.Client()); var cap = this.client.bootstrap(); var resolved = cap.whenResolved().toCompletableFuture(); resolved.get(); @@ -113,7 +113,7 @@ public void testNullCap() throws ExecutionException, InterruptedException { @Test public void testBasic() throws ExecutionException, InterruptedException, IOException { - var server = new TwoPartyRpcSystem(this.serverNetwork, new TestCap0Impl()); + var server = new RpcSystem<>(this.serverNetwork, new TestCap0Impl()); var demo = new Demo.TestCap0.Client(this.client.bootstrap()); var request = demo.testMethod0Request(); @@ -130,7 +130,7 @@ public void testBasic() throws ExecutionException, InterruptedException, IOExcep @Test public void testBasicCleanup() throws ExecutionException, InterruptedException, TimeoutException { - var server = new TwoPartyRpcSystem(this.serverNetwork, new TestCap0Impl()); + var server = new RpcSystem<>(this.serverNetwork, new TestCap0Impl()); var demo = new Demo.TestCap0.Client(this.client.bootstrap()); var request = demo.testMethod0Request(); var params = request.getParams(); @@ -146,7 +146,7 @@ public void testBasicCleanup() throws ExecutionException, InterruptedException, @Test public void testShutdown() throws InterruptedException, IOException { - var server = new TwoPartyRpcSystem(this.serverNetwork, new TestCap0Impl()); + var server = new RpcSystem<>(this.serverNetwork, new TestCap0Impl()); var demo = new Demo.TestCap0.Client(this.client.bootstrap()); this.clientSocket.shutdownOutput(); serverThread.join(); @@ -163,7 +163,7 @@ public CompletableFuture testMethod1(CallContext(this.serverNetwork, impl); var demoClient = new Demo.TestCap0.Client(this.client.bootstrap()); { @@ -188,7 +188,7 @@ public CompletableFuture testMethod1(CallContext(this.serverNetwork, capServer); var demoClient = new Demo.TestCap0.Client(this.client.bootstrap()); var request = demoClient.testMethod1Request(); var response = request.send(); From e8a118f364ac4a53176ca5218f22364d59d09c3a Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 5 Nov 2020 16:46:09 +0000 Subject: [PATCH 101/246] add overload for messageSizeHint --- .../src/main/java/org/capnproto/RpcState.java | 35 ++++++++----------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 580bdbab..83109886 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -16,6 +16,10 @@ private static int messageSizeHint() { return 1 + RpcProtocol.Message.factory.structSize().total(); } + private static int messageSizeHint(StructFactory factory) { + return messageSizeHint() + factory.structSize().total(); + } + private static int exceptionSizeHint(Throwable exc) { return RpcProtocol.Exception.factory.structSize().total() + exc.getMessage().length(); } @@ -47,8 +51,7 @@ void dispose() { } if (isConnected() && !this.skipFinish) { - var sizeHint = messageSizeHint() - + RpcProtocol.Finish.factory.structSize().total(); + var sizeHint = messageSizeHint(RpcProtocol.Finish.factory); var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().getAs(RpcProtocol.Message.factory).initFinish(); builder.setQuestionId(this.id); @@ -210,7 +213,7 @@ public void dispose() { // Send a message releasing our remote references. if (this.remoteRefCount > 0 && isConnected()) { - int sizeHint = messageSizeHint() + RpcProtocol.Release.factory.structSize().total(); + int sizeHint = messageSizeHint(RpcProtocol.Release.factory); var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initRelease(); builder.setId(importId); @@ -400,8 +403,7 @@ ClientHook restore() { var loop = CompletableFuture.anyOf( getMessageLoop(), promise).thenCompose(x -> promise); - int sizeHint = messageSizeHint() - + RpcProtocol.Bootstrap.factory.structSize().total(); + int sizeHint = messageSizeHint(RpcProtocol.Bootstrap.factory); var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initBootstrap(); builder.setQuestionId(question.getId()); @@ -526,8 +528,7 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo answer.active = true; var capTable = new BuilderCapabilityTable(); - int sizeHint = messageSizeHint() - + RpcProtocol.Return.factory.structSize().total() + int sizeHint = messageSizeHint(RpcProtocol.Return.factory) + RpcProtocol.Payload.factory.structSize().total(); var response = connection.newOutgoingMessage(sizeHint); @@ -799,9 +800,7 @@ private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { return null; } - int sizeHint = messageSizeHint() - + RpcProtocol.Disembargo.factory.structSize().total() - + MESSAGE_TARGET_SIZE_HINT; + int sizeHint = messageSizeHint(RpcProtocol.Disembargo.factory) + MESSAGE_TARGET_SIZE_HINT; var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initDisembargo(); var redirect = rpcTarget.writeTarget(builder.initTarget()); @@ -941,9 +940,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS } // send a Resolve message - int sizeHint = messageSizeHint() - + RpcProtocol.Resolve.factory.structSize().total() - + CAP_DESCRIPTOR_SIZE_HINT; + int sizeHint = messageSizeHint(RpcProtocol.Resolve.factory) + CAP_DESCRIPTOR_SIZE_HINT; var message = connection.newOutgoingMessage(sizeHint); var resolve = message.getBody().initAs(RpcProtocol.Message.factory).initResolve(); resolve.setPromiseId(exportId); @@ -956,9 +953,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS if (exc == null) { return; } - int sizeHint = messageSizeHint() - + RpcProtocol.Resolve.factory.structSize().total() - + exceptionSizeHint(exc); + int sizeHint = messageSizeHint(RpcProtocol.Resolve.factory) + exceptionSizeHint(exc); var message = connection.newOutgoingMessage(sizeHint); var resolve = message.getBody().initAs(RpcProtocol.Message.factory).initResolve(); resolve.setPromiseId(exportId); @@ -1306,9 +1301,8 @@ public AnyPointer.Builder getResults(int sizeHint) { this.response = new LocallyRedirectedRpcResponse(); } else { - sizeHint += messageSizeHint() - + RpcProtocol.Payload.factory.structSize().total() - + RpcProtocol.Return.factory.structSize().total(); + sizeHint += messageSizeHint(RpcProtocol.Return.factory) + + RpcProtocol.Payload.factory.structSize().total(); var message = connection.newOutgoingMessage(sizeHint); this.returnMessage = message.getBody().initAs(RpcProtocol.Message.factory).initReturn(); this.response = new RpcServerResponseImpl(message, returnMessage.getResults()); @@ -1812,8 +1806,7 @@ private ClientHook resolve(ClientHook replacement) { // TODO Flow control if (resolutionType == ResolutionType.REFLECTED && receivedCall && !isDisconnected()) { - int sizeHint = messageSizeHint() - + RpcProtocol.Disembargo.factory.structSize().total(); + int sizeHint = messageSizeHint(RpcProtocol.Disembargo.factory); var message = connection.newOutgoingMessage(sizeHint); var disembargo = message.getBody().initAs(RpcProtocol.Message.factory).initDisembargo(); var redirect = RpcState.this.writeTarget(cap, disembargo.initTarget()); From 850a603877fff35ae63b07b4658e5cb7bab710eb Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 5 Nov 2020 17:01:26 +0000 Subject: [PATCH 102/246] oops, correct assertion of missing question --- runtime/src/main/java/org/capnproto/RpcState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index 83109886..b9657ee3 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -45,7 +45,7 @@ private final class QuestionDisposer { void dispose() { var ref = questions.find(this.id); - if (ref != null) { + if (ref == null) { assert false: "Question ID no longer on table?"; return; } From 95787f1e55353783cfa2befe3f95aa028644161d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 5 Nov 2020 17:34:14 +0000 Subject: [PATCH 103/246] skip non-generic nodes when traversing for generic params Fixes pipeline generation for TestGenericsWrapper2. --- compiler/src/main/cpp/capnpc-java.c++ | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 77123fff..78935e07 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -245,10 +245,12 @@ private: Schema parent = schemaLoader.get(node.getScopeId()); result = getTypeArguments(leaf, parent, kj::str(suffix)); } - auto brandArguments = leaf.getBrandArgumentsAtScope(node.getId()); - auto parameters = node.getParameters(); - for (int ii = 0; ii < parameters.size(); ++ii) { - result.add(typeName(brandArguments[ii], kj::str(suffix)).flatten()); + if (node.getIsGeneric()) { + auto brandArguments = leaf.getBrandArgumentsAtScope(node.getId()); + auto parameters = node.getParameters(); + for (int ii = 0; ii < parameters.size(); ++ii) { + result.add(typeName(brandArguments[ii], kj::str(suffix)).flatten()); + } } return kj::mv(result); } From d2d851d630414097eb003dc1c62fcd144372b430 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 5 Nov 2020 17:57:16 +0000 Subject: [PATCH 104/246] stub out generic pipeline accessors, for now --- compiler/src/main/cpp/capnpc-java.c++ | 30 +++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 78935e07..551c4221 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -1193,12 +1193,17 @@ private: kj::String pipelineType; if (field.getType().asStruct().getProto().getIsGeneric()) { auto typeArgs = getTypeArguments(structSchema, structSchema, kj::str("Reader")); - pipelineType = kj::strTree( - javaFullName(structSchema), ".Pipeline<", - kj::StringTree(KJ_MAP(arg, typeArgs){ - return kj::strTree(arg); - }, ", "), - ">").flatten(); + if (typeArgs.size() > 0) { + pipelineType = kj::strTree( + javaFullName(structSchema), ".Pipeline<", + kj::StringTree(KJ_MAP(arg, typeArgs){ + return kj::strTree(arg); + }, ", "), + ">").flatten(); + } + else { + pipelineType = typeName(field.getType(), kj::str("Pipeline")).flatten(); + } } else { pipelineType = typeName(field.getType(), kj::str("Pipeline")).flatten(); } @@ -1252,11 +1257,14 @@ private: "_initPointerField(", factoryArg, ",", offset, ", 0);\n", spaces(indent), " }\n"), - kj::strTree( - spaces(indent), " default ", pipelineType, " get", titleCase, "() {\n", - spaces(indent), " var pipeline = this.typelessPipeline().getPointerField((short)", offset, ");\n", - spaces(indent), " return () -> pipeline;\n", - spaces(indent), " }\n") + // Pipeline accessors + (field.getType().asStruct().getProto().getIsGeneric() + ? kj::strTree() // No generics for you, sorry. + : kj::strTree( + spaces(indent), " default ", pipelineType, " get", titleCase, "() {\n", + spaces(indent), " var pipeline = this.typelessPipeline().getPointerField((short)", offset, ");\n", + spaces(indent), " return () -> pipeline;\n", + spaces(indent), " }\n")) }; } else if (kind == FieldKind::BLOB) { From 0ce52fe1357ac7308ef57694fd055e05678506e8 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 6 Nov 2020 15:32:20 +0000 Subject: [PATCH 105/246] add resolve test and fix handleResolve bugs --- .../main/java/org/capnproto/Capability.java | 2 +- .../src/main/java/org/capnproto/RpcState.java | 45 +++++++++++++------ .../java/org/capnproto/CapabilityTest.java | 3 +- .../src/test/java/org/capnproto/RpcTest.java | 34 ++++++++++++++ .../src/test/java/org/capnproto/TestUtil.java | 40 +++++++++++++++++ 5 files changed, 108 insertions(+), 16 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 9a45e7d5..ce1b4b1b 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -57,7 +57,7 @@ public interface ClientBase { ClientHook getHook(); - default CompletionStage whenResolved() { + default CompletableFuture whenResolved() { return this.getHook().whenResolved(); } diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime/src/main/java/org/capnproto/RpcState.java index b9657ee3..8f1c3a85 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime/src/main/java/org/capnproto/RpcState.java @@ -434,7 +434,7 @@ private CompletableFuture doMessageLoop() { private void handleMessage(IncomingRpcMessage message) throws RpcException { var reader = message.getBody().getAs(RpcProtocol.Message.factory); - //System.out.println(reader.which()); + //System.out.println(this + ": Received message: " + reader.which()); switch (reader.which()) { case UNIMPLEMENTED: handleUnimplemented(reader.getUnimplemented()); @@ -744,26 +744,44 @@ void handleFinish(RpcProtocol.Finish.Reader finish) { } private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { - var imp = this.imports.find(resolve.getPromiseId()); - if (imp == null) { - return; - } - - assert imp.importClient == null : "Import already resolved."; + ClientHook cap = null; + Throwable exc = null; switch (resolve.which()) { case CAP: - var cap = receiveCap(resolve.getCap(), message.getAttachedFds()); - imp.promise.complete(cap); + cap = receiveCap(resolve.getCap(), message.getAttachedFds()); break; case EXCEPTION: - var exc = RpcException.toException(resolve.getException()); - imp.promise.completeExceptionally(exc); + exc = RpcException.toException(resolve.getException()); break; default: - assert false; + assert false: "Unknown 'Resolve' type."; return; } + + var importId = resolve.getPromiseId(); + var imp = this.imports.find(resolve.getPromiseId()); + if (imp == null) { + return; + } + + if (imp.promise != null) { + assert !imp.promise.isDone(); + + // This import is an unfulfilled promise. + if (exc != null) { + imp.promise.completeExceptionally(exc); + } + else { + imp.promise.complete(cap); + } + return; + } + + // It appears this is a valid entry on the import table, but was not expected to be a + // promise. + assert imp.importClient == null : "Import already resolved."; + } private void handleRelease(RpcProtocol.Release.Reader release) { @@ -898,7 +916,7 @@ private int writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builder de var wrapped = inner.whenMoreResolved(); if (wrapped != null) { // This is a promise. Arrange for the `Resolve` message to be sent later. - export.resolveOp = resolveExportedPromise(export.exportId, wrapped); + export.resolveOp = this.resolveExportedPromise(export.exportId, wrapped); descriptor.setSenderPromise(export.exportId); } else { @@ -916,6 +934,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS resolution = this.getInnermostClient(resolution); var exp = exports.find(exportId); + assert exp != null; exportsByCap.remove(exp.clientHook); exp.clientHook = resolution; diff --git a/runtime/src/test/java/org/capnproto/CapabilityTest.java b/runtime/src/test/java/org/capnproto/CapabilityTest.java index 3397be4d..cdfb2bb6 100644 --- a/runtime/src/test/java/org/capnproto/CapabilityTest.java +++ b/runtime/src/test/java/org/capnproto/CapabilityTest.java @@ -24,14 +24,13 @@ import org.capnproto.test.Test; import org.junit.Assert; -import org.junit.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; class Counter { private int count = 0; - void inc() { count++; } + int inc() { return count++; } int value() { return count; } } diff --git a/runtime/src/test/java/org/capnproto/RpcTest.java b/runtime/src/test/java/org/capnproto/RpcTest.java index 0ea195a8..9345cb95 100644 --- a/runtime/src/test/java/org/capnproto/RpcTest.java +++ b/runtime/src/test/java/org/capnproto/RpcTest.java @@ -369,8 +369,42 @@ public void testRelease() { handle1 = null; handle2 = null; + } + + @org.junit.Test + public void testPromiseResolve() { + var context = new TestContext(bootstrapFactory); + var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); + + var chainedCallCount = new Counter(); + + var request = client.callFooRequest(); + var request2 = client.callFooWhenResolvedRequest(); + + var paf = new CompletableFuture(); + + { + request.getParams().setCap(new Test.TestInterface.Client(paf.copy())); + request2.getParams().setCap(new Test.TestInterface.Client(paf.copy())); + } + + var promise = request.send(); + var promise2 = request2.send(); + + // Make sure getCap() has been called on the server side by sending another call and waiting + // for it. + Assert.assertEquals(2, client.getCallSequenceRequest().send().join().getN()); + //Assert.assertEquals(3, context.restorer.callCount); + + // OK, now fulfill the local promise. + paf.complete(new Test.TestInterface.Client(new TestUtil.TestInterfaceImpl(chainedCallCount))); + // We should now be able to wait for getCap() to finish. + Assert.assertEquals("bar", promise.join().getS().toString()); + Assert.assertEquals("bar", promise2.join().getS().toString()); + //Assert.assertEquals(3, context.restorer.callCount); + Assert.assertEquals(2, chainedCallCount.value()); } } diff --git a/runtime/src/test/java/org/capnproto/TestUtil.java b/runtime/src/test/java/org/capnproto/TestUtil.java index 0936a21b..4f2c8ac8 100644 --- a/runtime/src/test/java/org/capnproto/TestUtil.java +++ b/runtime/src/test/java/org/capnproto/TestUtil.java @@ -114,6 +114,46 @@ protected CompletableFuture getHandle(CallContext getCallSequence(CallContext context) { + var result = context.getResults(); + result.setN(this.callCount.inc()); + return READY_NOW; + } + + @Override + protected CompletableFuture callFoo(CallContext context) { + this.callCount.inc(); + var params = context.getParams(); + var cap = params.getCap(); + var request = cap.fooRequest(); + request.getParams().setI(123); + request.getParams().setJ(true); + + return request.send().thenAccept(response -> { + Assert.assertEquals("foo", response.getX().toString()); + context.getResults().setS("bar"); + }); + } + + @Override + protected CompletableFuture callFooWhenResolved(CallContext context) { + this.callCount.inc(); + var params = context.getParams(); + var cap = params.getCap(); + + return cap.whenResolved().thenCompose(void_ -> { + var request = cap.fooRequest(); + request.getParams().setI(123); + request.getParams().setJ(true); + + return request.send().thenAccept(response -> { + Assert.assertEquals("foo", response.getX().toString()); + context.getResults().setS("bar"); + }); + }); + } } static class TestTailCalleeImpl extends Test.TestTailCallee.Server { From 713f008526e8aedc829c7ab425e7c0c839efc6cd Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 6 Nov 2020 17:37:19 +0000 Subject: [PATCH 106/246] stub out two-party test suite for now --- .../test/java/org/capnproto/TwoPartyTest.java | 5 +- .../test/java/org/capnproto/demo/Demo.java | 1895 ----------------- 2 files changed, 3 insertions(+), 1897 deletions(-) delete mode 100644 runtime/src/test/java/org/capnproto/demo/Demo.java diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index a54af25c..43618f5e 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -1,5 +1,5 @@ package org.capnproto; - +/* import org.capnproto.demo.Demo; import org.junit.After; import org.junit.Assert; @@ -203,4 +203,5 @@ public void testReturnCap() throws ExecutionException, InterruptedException { var cap2 = results.getResult2(); Assert.assertFalse(cap2.isNull()); } -} \ No newline at end of file +} +*/ diff --git a/runtime/src/test/java/org/capnproto/demo/Demo.java b/runtime/src/test/java/org/capnproto/demo/Demo.java deleted file mode 100644 index 492b8827..00000000 --- a/runtime/src/test/java/org/capnproto/demo/Demo.java +++ /dev/null @@ -1,1895 +0,0 @@ -// Generated by Cap'n Proto compiler, DO NOT EDIT -// source: demo.capnp - -package org.capnproto.demo; - -public final class Demo { - public static class TestParams0 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return TestParams0.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getParam0() { - return _getIntField(0); - } - public final void setParam0(int value) { - _setIntField(0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getParam0() { - return _getIntField(0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class TestResults0 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return TestResults0.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getResult0() { - return _getIntField(0); - } - public final void setResult0(int value) { - _setIntField(0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getResult0() { - return _getIntField(0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class TestParams1 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return TestParams1.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasParam0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getParam0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initParam0() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initParam0(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasParam0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getParam0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class TestResults1 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)3); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return TestResults1.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasResult0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getResult0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initResult0() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initResult0(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - public final boolean hasResult1() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.AnyPointer.Builder getResult1() { - return _getPointerField(org.capnproto.AnyPointer.factory, 1); - } - public org.capnproto.AnyPointer.Builder initResult1() { - return _initPointerField(org.capnproto.AnyPointer.factory, 1, 0); - } - public org.capnproto.AnyPointer.Builder initResult1(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 1, size); - } - - public final boolean hasResult2() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.AnyPointer.Builder getResult2() { - return _getPointerField(org.capnproto.AnyPointer.factory, 2); - } - public org.capnproto.AnyPointer.Builder initResult2() { - return _initPointerField(org.capnproto.AnyPointer.factory, 2, 0); - } - public org.capnproto.AnyPointer.Builder initResult2(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 2, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasResult0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getResult0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public boolean hasResult1() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.AnyPointer.Reader getResult1() { - return _getPointerField(org.capnproto.AnyPointer.factory, 1); - } - public boolean hasResult2() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.AnyPointer.Reader getResult2() { - return _getPointerField(org.capnproto.AnyPointer.factory, 2); - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Struct0 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Struct0.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean getF0() { - return _getBooleanField(0); - } - public final void setF0(boolean value) { - _setBooleanField(0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean getF0() { - return _getBooleanField(0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Iface0 { - public static final class Factory extends org.capnproto.Capability.Factory { - public final Client newClient(org.capnproto.ClientHook hook) { - return new Client(hook); - } - } - - public static final Factory factory = new Factory(); - - public static class Client extends org.capnproto.Capability.Client { - public Client() {} - public Client(org.capnproto.ClientHook hook) { super(hook); } - public Client(org.capnproto.Capability.Client cap) { super(cap); } - public Client(Server server) { super(server); } - public Client(java.util.concurrent.CompletionStage promise) { - super(promise); - } - - public org.capnproto.Request method0Request() { - return newCall(Method0Params.factory, Method0Results.factory, 0xac6d126c2fac16ebL, (short)0); - } - public org.capnproto.StreamingRequest method1Request() { - return newStreamingCall(Method1Params.factory, 0xac6d126c2fac16ebL, (short)1); - } - } - - public static abstract class Server extends org.capnproto.Capability.Server { - protected org.capnproto.DispatchCallResult dispatchCall( - long interfaceId, short methodId, - org.capnproto.CallContext context) { - if (interfaceId == 0xac6d126c2fac16ebL) { - return dispatchCallInternal(methodId, context); - } - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("Iface0", interfaceId)); - } - - protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { - switch (methodId) { - case 0: - return org.capnproto.Capability.Server.result ( - this.method0(org.capnproto.Capability.Server.internalGetTypedContext( - Method0Params.factory, Method0Results.factory, context))); - case 1: - return org.capnproto.Capability.Server.streamResult( - this.method1(org.capnproto.Capability.Server.internalGetTypedStreamingContext( - Method1Params.factory, context))); - default: - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("Iface0", 0xac6d126c2fac16ebL, methodId)); - } - } - - protected java.util.concurrent.CompletableFuture method0(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method0", - 0xac6d126c2fac16ebL, (short)0); - } - - protected java.util.concurrent.CompletableFuture method1(org.capnproto.StreamingCallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method1", - 0xac6d126c2fac16ebL, (short)1); - } - - } - - public static class Method0Params { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface0.Method0Params.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method0Results { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface0.Method0Results.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method1Params { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface0.Method1Params.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - - } - - public static class Struct2 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)2); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Struct2.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasF0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getF0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initF0() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initF0(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - public final boolean hasF1i() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.demo.Demo.Iface0.Client getF1i() { - return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 1); - } - public void setF1i(org.capnproto.demo.Demo.Iface0.Client value) { - _setPointerField(org.capnproto.demo.Demo.Iface0.factory, 1, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasF0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getF0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public boolean hasF1i() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.demo.Demo.Iface0.Client getF1i() { - return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 1); - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - public org.capnproto.demo.Demo.Iface0.Client getF1i() { - return new org.capnproto.demo.Demo.Iface0.Client(this.getPointerField((short)1).asCap()); - } - } - } - - public static class TestCap0 { - public static final class Factory extends org.capnproto.Capability.Factory { - public final Client newClient(org.capnproto.ClientHook hook) { - return new Client(hook); - } - } - - public static final Factory factory = new Factory(); - - public static class Client extends org.capnproto.Capability.Client { - public Client() {} - public Client(org.capnproto.ClientHook hook) { super(hook); } - public Client(org.capnproto.Capability.Client cap) { super(cap); } - public Client(Server server) { super(server); } - public Client(java.util.concurrent.CompletionStage promise) { - super(promise); - } - - public org.capnproto.Request testMethod0Request() { - return newCall(org.capnproto.demo.Demo.TestParams0.factory, org.capnproto.demo.Demo.TestResults0.factory, 0x9c0c5ee4bb0cc725L, (short)0); - } - public org.capnproto.Request testMethod1Request() { - return newCall(org.capnproto.demo.Demo.TestParams1.factory, org.capnproto.demo.Demo.TestResults1.factory, 0x9c0c5ee4bb0cc725L, (short)1); - } - } - - public static abstract class Server extends org.capnproto.Capability.Server { - protected org.capnproto.DispatchCallResult dispatchCall( - long interfaceId, short methodId, - org.capnproto.CallContext context) { - if (interfaceId == 0x9c0c5ee4bb0cc725L) { - return dispatchCallInternal(methodId, context); - } - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("TestCap0", interfaceId)); - } - - protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { - switch (methodId) { - case 0: - return org.capnproto.Capability.Server.result ( - this.testMethod0(org.capnproto.Capability.Server.internalGetTypedContext( - org.capnproto.demo.Demo.TestParams0.factory, org.capnproto.demo.Demo.TestResults0.factory, context))); - case 1: - return org.capnproto.Capability.Server.result ( - this.testMethod1(org.capnproto.Capability.Server.internalGetTypedContext( - org.capnproto.demo.Demo.TestParams1.factory, org.capnproto.demo.Demo.TestResults1.factory, context))); - default: - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("TestCap0", 0x9c0c5ee4bb0cc725L, methodId)); - } - } - - protected java.util.concurrent.CompletableFuture testMethod0(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod0", - 0x9c0c5ee4bb0cc725L, (short)0); - } - - protected java.util.concurrent.CompletableFuture testMethod1(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod1", - 0x9c0c5ee4bb0cc725L, (short)1); - } - - } - - - } - - public static class TestCap1 { - public static final class Factory extends org.capnproto.Capability.Factory { - public final Client newClient(org.capnproto.ClientHook hook) { - return new Client(hook); - } - } - - public static final Factory factory = new Factory(); - - public static class Client extends org.capnproto.Capability.Client { - public Client() {} - public Client(org.capnproto.ClientHook hook) { super(hook); } - public Client(org.capnproto.Capability.Client cap) { super(cap); } - public Client(Server server) { super(server); } - public Client(java.util.concurrent.CompletionStage promise) { - super(promise); - } - - } - - public static abstract class Server extends org.capnproto.Capability.Server { - protected org.capnproto.DispatchCallResult dispatchCall( - long interfaceId, short methodId, - org.capnproto.CallContext context) { - if (interfaceId == 0xd88e8bb64ed6f7b1L) { - return dispatchCallInternal(methodId, context); - } - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("TestCap1", interfaceId)); - } - - protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { - switch (methodId) { - default: - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("TestCap1", 0xd88e8bb64ed6f7b1L, methodId)); - } - } - - } - - - } - - public static class Iface1 { - public static final class Factory extends org.capnproto.Capability.Factory { - public final Client newClient(org.capnproto.ClientHook hook) { - return new Client(hook); - } - } - - public static final Factory factory = new Factory(); - - public static class Client extends org.capnproto.Capability.Client { - public Client() {} - public Client(org.capnproto.ClientHook hook) { super(hook); } - public Client(org.capnproto.Capability.Client cap) { super(cap); } - public Client(Server server) { super(server); } - public Client(java.util.concurrent.CompletionStage promise) { - super(promise); - } - - public org.capnproto.Request method0Request() { - return newCall(Method0Params.factory, Method0Results.factory, 0xd52dcf38c9f6f7c0L, (short)0); - } - public org.capnproto.Request method1Request() { - return newCall(Method1Params.factory, Method1Results.factory, 0xd52dcf38c9f6f7c0L, (short)1); - } - } - - public static abstract class Server extends org.capnproto.Capability.Server { - protected org.capnproto.DispatchCallResult dispatchCall( - long interfaceId, short methodId, - org.capnproto.CallContext context) { - if (interfaceId == 0xd52dcf38c9f6f7c0L) { - return dispatchCallInternal(methodId, context); - } - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("Iface1", interfaceId)); - } - - protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { - switch (methodId) { - case 0: - return org.capnproto.Capability.Server.result ( - this.method0(org.capnproto.Capability.Server.internalGetTypedContext( - Method0Params.factory, Method0Results.factory, context))); - case 1: - return org.capnproto.Capability.Server.result ( - this.method1(org.capnproto.Capability.Server.internalGetTypedContext( - Method1Params.factory, Method1Results.factory, context))); - default: - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("Iface1", 0xd52dcf38c9f6f7c0L, methodId)); - } - } - - protected java.util.concurrent.CompletableFuture method0(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method0", - 0xd52dcf38c9f6f7c0L, (short)0); - } - - protected java.util.concurrent.CompletableFuture method1(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method1", - 0xd52dcf38c9f6f7c0L, (short)1); - } - - } - - public static class Struct1 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface1.Struct1.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean getF0() { - return _getBooleanField(0); - } - public final void setF0(boolean value) { - _setBooleanField(0, value); - } - - public final boolean hasF1() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getF1() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initF1() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initF1(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean getF0() { - return _getBooleanField(0); - } - - public boolean hasF1() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getF1() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method0Params { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface1.Method0Params.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method0Results { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)2); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface1.Method0Results.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final org.capnproto.demo.Demo.Struct0.Builder getResult0() { - return _getPointerField(org.capnproto.demo.Demo.Struct0.factory, 0, null, 0); - } - public final void setResult0(org.capnproto.demo.Demo.Struct0.Reader value) { - _setPointerField(org.capnproto.demo.Demo.Struct0.factory,0, value); - } - public final org.capnproto.demo.Demo.Struct0.Builder initResult0() { - return _initPointerField(org.capnproto.demo.Demo.Struct0.factory,0, 0); - } - public final org.capnproto.demo.Demo.Iface1.Struct1.Builder getResult1() { - return _getPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory, 1, null, 0); - } - public final void setResult1(org.capnproto.demo.Demo.Iface1.Struct1.Reader value) { - _setPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory,1, value); - } - public final org.capnproto.demo.Demo.Iface1.Struct1.Builder initResult1() { - return _initPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory,1, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasResult0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.demo.Demo.Struct0.Reader getResult0() { - return _getPointerField(org.capnproto.demo.Demo.Struct0.factory,0,null, 0); - } - - public boolean hasResult1() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.demo.Demo.Iface1.Struct1.Reader getResult1() { - return _getPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory,1,null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method1Params { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface1.Method1Params.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method1Results { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface1.Method1Results.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasResult0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.demo.Demo.Iface0.Client getResult0() { - return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 0); - } - public void setResult0(org.capnproto.demo.Demo.Iface0.Client value) { - _setPointerField(org.capnproto.demo.Demo.Iface0.factory, 0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasResult0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.demo.Demo.Iface0.Client getResult0() { - return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 0); - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - public org.capnproto.demo.Demo.Iface0.Client getResult0() { - return new org.capnproto.demo.Demo.Iface0.Client(this.getPointerField((short)0).asCap()); - } - } - } - - - } - - -public static final class Schemas { -public static final org.capnproto.SegmentReader b_91e1b138de965ab0 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00b0\u005a\u0096\u00de\u0038\u00b1\u00e1\u0091" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0050\u0061\u0072\u0061\u006d\u0073\u0030\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0030\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_a77bdd3c3bd1dcbf = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00bf\u00dc\u00d1\u003b\u003c\u00dd\u007b\u00a7" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0052\u0065\u0073\u0075\u006c\u0074\u0073\u0030" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_b20f33e412339049 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0049\u0090\u0033\u0012\u00e4\u0033\u000f\u00b2" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0050\u0061\u0072\u0061\u006d\u0073\u0031\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0030\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_d1342392ab536963 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0063\u0069\u0053\u00ab\u0092\u0023\u0034\u00d1" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0052\u0065\u0073\u0075\u006c\u0074\u0073\u0031" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0031\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0032\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_b1af51b6aef0e7bc = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00bc\u00e7\u00f0\u00ae\u00b6\u0051\u00af\u00b1" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0053\u0074\u0072\u0075" + - "\u0063\u0074\u0030\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0066\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_ac6d126c2fac16eb = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00eb\u0016\u00ac\u002f\u006c\u0012\u006d\u00ac" + - "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0087\u0000\u0000\u0000" + - "\u007d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004b\u0029\u0076\u00aa\u00ed\u0077\u008d\u00bc" + - "\u003e\u0067\u0084\u00a6\u004a\u00e2\u0044\u00f7" + - "\u0031\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u00f3\u0034\u00d2\u0078\u005b\u00c2\u00c8" + - "\u006e\u00b1\u00c0\u0077\u0033\u009a\u005f\u0099" + - "\u0019\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u006d\u0065\u0074\u0068\u006f\u0064\u0030\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u006d\u0065\u0074\u0068\u006f\u0064\u0031\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); -public static final org.capnproto.SegmentReader b_bc8d77edaa76294b = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u004b\u0029\u0076\u00aa\u00ed\u0077\u008d\u00bc" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0030\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0030\u0024\u0050\u0061\u0072\u0061\u006d" + - "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_f744e24aa684673e = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u003e\u0067\u0084\u00a6\u004a\u00e2\u0044\u00f7" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u005a\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0030\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0030\u0024\u0052\u0065\u0073\u0075\u006c" + - "\u0074\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_c8c25b78d234f324 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0024\u00f3\u0034\u00d2\u0078\u005b\u00c2\u00c8" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0030\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0031\u0024\u0050\u0061\u0072\u0061\u006d" + - "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_a9395663e97ca3af = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00af\u00a3\u007c\u00e9\u0063\u0056\u0039\u00a9" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0053\u0074\u0072\u0075" + - "\u0063\u0074\u0032\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\"\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0066\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0031\u0069\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00eb\u0016\u00ac\u002f\u006c\u0012\u006d\u00ac" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_9c0c5ee4bb0cc725 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0025\u00c7\u000c\u00bb\u00e4\u005e\u000c\u009c" + - "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0087\u0000\u0000\u0000" + - "\u0085\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0043\u0061\u0070\u0030\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b0\u005a\u0096\u00de\u0038\u00b1\u00e1\u0091" + - "\u00bf\u00dc\u00d1\u003b\u003c\u00dd\u007b\u00a7" + - "\u0031\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0090\u0033\u0012\u00e4\u0033\u000f\u00b2" + - "\u0063\u0069\u0053\u00ab\u0092\u0023\u0034\u00d1" + - "\u001d\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0074\u0065\u0073\u0074\u004d\u0065\u0074\u0068" + - "\u006f\u0064\u0030\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u0074\u0065\u0073\u0074\u004d\u0065\u0074\u0068" + - "\u006f\u0064\u0031\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); -public static final org.capnproto.SegmentReader b_d88e8bb64ed6f7b1 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00b1\u00f7\u00d6\u004e\u00b6\u008b\u008e\u00d8" + - "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0043\u0061\u0070\u0031\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); -public static final org.capnproto.SegmentReader b_d52dcf38c9f6f7c0 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00c0\u00f7\u00f6\u00c9\u0038\u00cf\u002d\u00d5" + - "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0039\u0000\u0000\u0000\u0087\u0000\u0000\u0000" + - "\u0089\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0038\u00dd\u00fd\u00fb\u0062\u00a8\u000c\u0080" + - "\u0001\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0053\u0074\u0072\u0075\u0063\u0074\u0031\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d5\u0004\u002e\u0063\u0018\u00ca\u0092\u008f" + - "\u008f\u0083\u0018\u0046\u00fe\u00c4\u0067\u0080" + - "\u0031\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d6\u005a\u00ae\u0003\u0007\u0092\u0089\u00f0" + - "\u0006\u00f5\u0011\u00c3\u00aa\u0015\u006d\u00c3" + - "\u0019\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u006d\u0065\u0074\u0068\u006f\u0064\u0030\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u006d\u0065\u0074\u0068\u006f\u0064\u0031\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); -public static final org.capnproto.SegmentReader b_800ca862fbfddd38 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0038\u00dd\u00fd\u00fb\u0062\u00a8\u000c\u0080" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00c0\u00f7\u00f6\u00c9\u0038\u00cf\u002d\u00d5" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u001a\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u002e\u0053\u0074\u0072\u0075\u0063" + - "\u0074\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0066\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_8f92ca18632e04d5 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00d5\u0004\u002e\u0063\u0018\u00ca\u0092\u008f" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0030\u0024\u0050\u0061\u0072\u0061\u006d" + - "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_8067c4fe4618838f = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u008f\u0083\u0018\u0046\u00fe\u00c4\u0067\u0080" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u005a\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0030\u0024\u0052\u0065\u0073\u0075\u006c" + - "\u0074\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00bc\u00e7\u00f0\u00ae\u00b6\u0051\u00af\u00b1" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0031\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0038\u00dd\u00fd\u00fb\u0062\u00a8\u000c\u0080" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_f089920703ae5ad6 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00d6\u005a\u00ae\u0003\u0007\u0092\u0089\u00f0" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0031\u0024\u0050\u0061\u0072\u0061\u006d" + - "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_c36d15aac311f506 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0006\u00f5\u0011\u00c3\u00aa\u0015\u006d\u00c3" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u005a\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0031\u0024\u0052\u0065\u0073\u0075\u006c" + - "\u0074\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + - "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00eb\u0016\u00ac\u002f\u006c\u0012\u006d\u00ac" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -} -} - From 66fc3613867149cf2b876df38bebfa8352828857 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 6 Nov 2020 17:37:19 +0000 Subject: [PATCH 107/246] stub out two-party test suite for now --- .../test/java/org/capnproto/TwoPartyTest.java | 5 +- .../test/java/org/capnproto/demo/Demo.java | 1895 ----------------- 2 files changed, 3 insertions(+), 1897 deletions(-) delete mode 100644 runtime/src/test/java/org/capnproto/demo/Demo.java diff --git a/runtime/src/test/java/org/capnproto/TwoPartyTest.java b/runtime/src/test/java/org/capnproto/TwoPartyTest.java index a54af25c..43618f5e 100644 --- a/runtime/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime/src/test/java/org/capnproto/TwoPartyTest.java @@ -1,5 +1,5 @@ package org.capnproto; - +/* import org.capnproto.demo.Demo; import org.junit.After; import org.junit.Assert; @@ -203,4 +203,5 @@ public void testReturnCap() throws ExecutionException, InterruptedException { var cap2 = results.getResult2(); Assert.assertFalse(cap2.isNull()); } -} \ No newline at end of file +} +*/ diff --git a/runtime/src/test/java/org/capnproto/demo/Demo.java b/runtime/src/test/java/org/capnproto/demo/Demo.java deleted file mode 100644 index 492b8827..00000000 --- a/runtime/src/test/java/org/capnproto/demo/Demo.java +++ /dev/null @@ -1,1895 +0,0 @@ -// Generated by Cap'n Proto compiler, DO NOT EDIT -// source: demo.capnp - -package org.capnproto.demo; - -public final class Demo { - public static class TestParams0 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return TestParams0.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getParam0() { - return _getIntField(0); - } - public final void setParam0(int value) { - _setIntField(0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getParam0() { - return _getIntField(0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class TestResults0 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return TestResults0.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getResult0() { - return _getIntField(0); - } - public final void setResult0(int value) { - _setIntField(0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getResult0() { - return _getIntField(0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class TestParams1 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return TestParams1.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasParam0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getParam0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initParam0() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initParam0(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasParam0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getParam0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class TestResults1 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)3); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return TestResults1.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasResult0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getResult0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initResult0() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initResult0(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - public final boolean hasResult1() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.AnyPointer.Builder getResult1() { - return _getPointerField(org.capnproto.AnyPointer.factory, 1); - } - public org.capnproto.AnyPointer.Builder initResult1() { - return _initPointerField(org.capnproto.AnyPointer.factory, 1, 0); - } - public org.capnproto.AnyPointer.Builder initResult1(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 1, size); - } - - public final boolean hasResult2() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.AnyPointer.Builder getResult2() { - return _getPointerField(org.capnproto.AnyPointer.factory, 2); - } - public org.capnproto.AnyPointer.Builder initResult2() { - return _initPointerField(org.capnproto.AnyPointer.factory, 2, 0); - } - public org.capnproto.AnyPointer.Builder initResult2(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 2, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasResult0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getResult0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public boolean hasResult1() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.AnyPointer.Reader getResult1() { - return _getPointerField(org.capnproto.AnyPointer.factory, 1); - } - public boolean hasResult2() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.AnyPointer.Reader getResult2() { - return _getPointerField(org.capnproto.AnyPointer.factory, 2); - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Struct0 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Struct0.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean getF0() { - return _getBooleanField(0); - } - public final void setF0(boolean value) { - _setBooleanField(0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean getF0() { - return _getBooleanField(0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Iface0 { - public static final class Factory extends org.capnproto.Capability.Factory { - public final Client newClient(org.capnproto.ClientHook hook) { - return new Client(hook); - } - } - - public static final Factory factory = new Factory(); - - public static class Client extends org.capnproto.Capability.Client { - public Client() {} - public Client(org.capnproto.ClientHook hook) { super(hook); } - public Client(org.capnproto.Capability.Client cap) { super(cap); } - public Client(Server server) { super(server); } - public Client(java.util.concurrent.CompletionStage promise) { - super(promise); - } - - public org.capnproto.Request method0Request() { - return newCall(Method0Params.factory, Method0Results.factory, 0xac6d126c2fac16ebL, (short)0); - } - public org.capnproto.StreamingRequest method1Request() { - return newStreamingCall(Method1Params.factory, 0xac6d126c2fac16ebL, (short)1); - } - } - - public static abstract class Server extends org.capnproto.Capability.Server { - protected org.capnproto.DispatchCallResult dispatchCall( - long interfaceId, short methodId, - org.capnproto.CallContext context) { - if (interfaceId == 0xac6d126c2fac16ebL) { - return dispatchCallInternal(methodId, context); - } - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("Iface0", interfaceId)); - } - - protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { - switch (methodId) { - case 0: - return org.capnproto.Capability.Server.result ( - this.method0(org.capnproto.Capability.Server.internalGetTypedContext( - Method0Params.factory, Method0Results.factory, context))); - case 1: - return org.capnproto.Capability.Server.streamResult( - this.method1(org.capnproto.Capability.Server.internalGetTypedStreamingContext( - Method1Params.factory, context))); - default: - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("Iface0", 0xac6d126c2fac16ebL, methodId)); - } - } - - protected java.util.concurrent.CompletableFuture method0(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method0", - 0xac6d126c2fac16ebL, (short)0); - } - - protected java.util.concurrent.CompletableFuture method1(org.capnproto.StreamingCallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method1", - 0xac6d126c2fac16ebL, (short)1); - } - - } - - public static class Method0Params { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface0.Method0Params.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method0Results { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface0.Method0Results.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method1Params { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface0.Method1Params.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - - } - - public static class Struct2 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)2); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Struct2.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasF0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getF0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initF0() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initF0(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - public final boolean hasF1i() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.demo.Demo.Iface0.Client getF1i() { - return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 1); - } - public void setF1i(org.capnproto.demo.Demo.Iface0.Client value) { - _setPointerField(org.capnproto.demo.Demo.Iface0.factory, 1, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasF0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getF0() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public boolean hasF1i() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.demo.Demo.Iface0.Client getF1i() { - return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 1); - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - public org.capnproto.demo.Demo.Iface0.Client getF1i() { - return new org.capnproto.demo.Demo.Iface0.Client(this.getPointerField((short)1).asCap()); - } - } - } - - public static class TestCap0 { - public static final class Factory extends org.capnproto.Capability.Factory { - public final Client newClient(org.capnproto.ClientHook hook) { - return new Client(hook); - } - } - - public static final Factory factory = new Factory(); - - public static class Client extends org.capnproto.Capability.Client { - public Client() {} - public Client(org.capnproto.ClientHook hook) { super(hook); } - public Client(org.capnproto.Capability.Client cap) { super(cap); } - public Client(Server server) { super(server); } - public Client(java.util.concurrent.CompletionStage promise) { - super(promise); - } - - public org.capnproto.Request testMethod0Request() { - return newCall(org.capnproto.demo.Demo.TestParams0.factory, org.capnproto.demo.Demo.TestResults0.factory, 0x9c0c5ee4bb0cc725L, (short)0); - } - public org.capnproto.Request testMethod1Request() { - return newCall(org.capnproto.demo.Demo.TestParams1.factory, org.capnproto.demo.Demo.TestResults1.factory, 0x9c0c5ee4bb0cc725L, (short)1); - } - } - - public static abstract class Server extends org.capnproto.Capability.Server { - protected org.capnproto.DispatchCallResult dispatchCall( - long interfaceId, short methodId, - org.capnproto.CallContext context) { - if (interfaceId == 0x9c0c5ee4bb0cc725L) { - return dispatchCallInternal(methodId, context); - } - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("TestCap0", interfaceId)); - } - - protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { - switch (methodId) { - case 0: - return org.capnproto.Capability.Server.result ( - this.testMethod0(org.capnproto.Capability.Server.internalGetTypedContext( - org.capnproto.demo.Demo.TestParams0.factory, org.capnproto.demo.Demo.TestResults0.factory, context))); - case 1: - return org.capnproto.Capability.Server.result ( - this.testMethod1(org.capnproto.Capability.Server.internalGetTypedContext( - org.capnproto.demo.Demo.TestParams1.factory, org.capnproto.demo.Demo.TestResults1.factory, context))); - default: - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("TestCap0", 0x9c0c5ee4bb0cc725L, methodId)); - } - } - - protected java.util.concurrent.CompletableFuture testMethod0(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod0", - 0x9c0c5ee4bb0cc725L, (short)0); - } - - protected java.util.concurrent.CompletableFuture testMethod1(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod1", - 0x9c0c5ee4bb0cc725L, (short)1); - } - - } - - - } - - public static class TestCap1 { - public static final class Factory extends org.capnproto.Capability.Factory { - public final Client newClient(org.capnproto.ClientHook hook) { - return new Client(hook); - } - } - - public static final Factory factory = new Factory(); - - public static class Client extends org.capnproto.Capability.Client { - public Client() {} - public Client(org.capnproto.ClientHook hook) { super(hook); } - public Client(org.capnproto.Capability.Client cap) { super(cap); } - public Client(Server server) { super(server); } - public Client(java.util.concurrent.CompletionStage promise) { - super(promise); - } - - } - - public static abstract class Server extends org.capnproto.Capability.Server { - protected org.capnproto.DispatchCallResult dispatchCall( - long interfaceId, short methodId, - org.capnproto.CallContext context) { - if (interfaceId == 0xd88e8bb64ed6f7b1L) { - return dispatchCallInternal(methodId, context); - } - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("TestCap1", interfaceId)); - } - - protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { - switch (methodId) { - default: - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("TestCap1", 0xd88e8bb64ed6f7b1L, methodId)); - } - } - - } - - - } - - public static class Iface1 { - public static final class Factory extends org.capnproto.Capability.Factory { - public final Client newClient(org.capnproto.ClientHook hook) { - return new Client(hook); - } - } - - public static final Factory factory = new Factory(); - - public static class Client extends org.capnproto.Capability.Client { - public Client() {} - public Client(org.capnproto.ClientHook hook) { super(hook); } - public Client(org.capnproto.Capability.Client cap) { super(cap); } - public Client(Server server) { super(server); } - public Client(java.util.concurrent.CompletionStage promise) { - super(promise); - } - - public org.capnproto.Request method0Request() { - return newCall(Method0Params.factory, Method0Results.factory, 0xd52dcf38c9f6f7c0L, (short)0); - } - public org.capnproto.Request method1Request() { - return newCall(Method1Params.factory, Method1Results.factory, 0xd52dcf38c9f6f7c0L, (short)1); - } - } - - public static abstract class Server extends org.capnproto.Capability.Server { - protected org.capnproto.DispatchCallResult dispatchCall( - long interfaceId, short methodId, - org.capnproto.CallContext context) { - if (interfaceId == 0xd52dcf38c9f6f7c0L) { - return dispatchCallInternal(methodId, context); - } - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("Iface1", interfaceId)); - } - - protected org.capnproto.DispatchCallResult dispatchCallInternal(short methodId, org.capnproto.CallContext context) { - switch (methodId) { - case 0: - return org.capnproto.Capability.Server.result ( - this.method0(org.capnproto.Capability.Server.internalGetTypedContext( - Method0Params.factory, Method0Results.factory, context))); - case 1: - return org.capnproto.Capability.Server.result ( - this.method1(org.capnproto.Capability.Server.internalGetTypedContext( - Method1Params.factory, Method1Results.factory, context))); - default: - return org.capnproto.Capability.Server.result( - org.capnproto.Capability.Server.internalUnimplemented("Iface1", 0xd52dcf38c9f6f7c0L, methodId)); - } - } - - protected java.util.concurrent.CompletableFuture method0(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method0", - 0xd52dcf38c9f6f7c0L, (short)0); - } - - protected java.util.concurrent.CompletableFuture method1(org.capnproto.CallContext context) { - return org.capnproto.Capability.Server.internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method1", - 0xd52dcf38c9f6f7c0L, (short)1); - } - - } - - public static class Struct1 { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface1.Struct1.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean getF0() { - return _getBooleanField(0); - } - public final void setF0(boolean value) { - _setBooleanField(0, value); - } - - public final boolean hasF1() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getF1() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initF1() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initF1(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean getF0() { - return _getBooleanField(0); - } - - public boolean hasF1() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getF1() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method0Params { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface1.Method0Params.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method0Results { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)2); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface1.Method0Results.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final org.capnproto.demo.Demo.Struct0.Builder getResult0() { - return _getPointerField(org.capnproto.demo.Demo.Struct0.factory, 0, null, 0); - } - public final void setResult0(org.capnproto.demo.Demo.Struct0.Reader value) { - _setPointerField(org.capnproto.demo.Demo.Struct0.factory,0, value); - } - public final org.capnproto.demo.Demo.Struct0.Builder initResult0() { - return _initPointerField(org.capnproto.demo.Demo.Struct0.factory,0, 0); - } - public final org.capnproto.demo.Demo.Iface1.Struct1.Builder getResult1() { - return _getPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory, 1, null, 0); - } - public final void setResult1(org.capnproto.demo.Demo.Iface1.Struct1.Reader value) { - _setPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory,1, value); - } - public final org.capnproto.demo.Demo.Iface1.Struct1.Builder initResult1() { - return _initPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory,1, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasResult0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.demo.Demo.Struct0.Reader getResult0() { - return _getPointerField(org.capnproto.demo.Demo.Struct0.factory,0,null, 0); - } - - public boolean hasResult1() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.demo.Demo.Iface1.Struct1.Reader getResult1() { - return _getPointerField(org.capnproto.demo.Demo.Iface1.Struct1.factory,1,null, 0); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method1Params { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface1.Method1Params.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - } - } - - public static class Method1Results { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)1); - public static final class Factory - extends org.capnproto.StructFactory - implements org.capnproto.PipelineFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Iface1.Method1Results.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - public Pipeline newPipeline(org.capnproto.RemotePromise promise) { - return new Pipeline(promise); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasResult0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.demo.Demo.Iface0.Client getResult0() { - return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 0); - } - public void setResult0(org.capnproto.demo.Demo.Iface0.Client value) { - _setPointerField(org.capnproto.demo.Demo.Iface0.factory, 0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasResult0() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.demo.Demo.Iface0.Client getResult0() { - return _getPointerField(org.capnproto.demo.Demo.Iface0.factory, 0); - } - } - - public static class Pipeline extends org.capnproto.Pipeline { - public Pipeline(org.capnproto.RemotePromise remotePromise) { - super(org.capnproto.RemotePromise.fromTypeless(factory, remotePromise)); - } - public org.capnproto.demo.Demo.Iface0.Client getResult0() { - return new org.capnproto.demo.Demo.Iface0.Client(this.getPointerField((short)0).asCap()); - } - } - } - - - } - - -public static final class Schemas { -public static final org.capnproto.SegmentReader b_91e1b138de965ab0 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00b0\u005a\u0096\u00de\u0038\u00b1\u00e1\u0091" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0050\u0061\u0072\u0061\u006d\u0073\u0030\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0030\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_a77bdd3c3bd1dcbf = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00bf\u00dc\u00d1\u003b\u003c\u00dd\u007b\u00a7" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0052\u0065\u0073\u0075\u006c\u0074\u0073\u0030" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_b20f33e412339049 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0049\u0090\u0033\u0012\u00e4\u0033\u000f\u00b2" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0050\u0061\u0072\u0061\u006d\u0073\u0031\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0030\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_d1342392ab536963 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0063\u0069\u0053\u00ab\u0092\u0023\u0034\u00d1" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0052\u0065\u0073\u0075\u006c\u0074\u0073\u0031" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0031\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0032\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_b1af51b6aef0e7bc = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00bc\u00e7\u00f0\u00ae\u00b6\u0051\u00af\u00b1" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0053\u0074\u0072\u0075" + - "\u0063\u0074\u0030\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0066\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_ac6d126c2fac16eb = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00eb\u0016\u00ac\u002f\u006c\u0012\u006d\u00ac" + - "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0087\u0000\u0000\u0000" + - "\u007d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004b\u0029\u0076\u00aa\u00ed\u0077\u008d\u00bc" + - "\u003e\u0067\u0084\u00a6\u004a\u00e2\u0044\u00f7" + - "\u0031\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u00f3\u0034\u00d2\u0078\u005b\u00c2\u00c8" + - "\u006e\u00b1\u00c0\u0077\u0033\u009a\u005f\u0099" + - "\u0019\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u006d\u0065\u0074\u0068\u006f\u0064\u0030\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u006d\u0065\u0074\u0068\u006f\u0064\u0031\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); -public static final org.capnproto.SegmentReader b_bc8d77edaa76294b = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u004b\u0029\u0076\u00aa\u00ed\u0077\u008d\u00bc" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0030\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0030\u0024\u0050\u0061\u0072\u0061\u006d" + - "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_f744e24aa684673e = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u003e\u0067\u0084\u00a6\u004a\u00e2\u0044\u00f7" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u005a\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0030\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0030\u0024\u0052\u0065\u0073\u0075\u006c" + - "\u0074\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_c8c25b78d234f324 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0024\u00f3\u0034\u00d2\u0078\u005b\u00c2\u00c8" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0030\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0031\u0024\u0050\u0061\u0072\u0061\u006d" + - "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_a9395663e97ca3af = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00af\u00a3\u007c\u00e9\u0063\u0056\u0039\u00a9" + - "\u0034\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0053\u0074\u0072\u0075" + - "\u0063\u0074\u0032\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\"\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0066\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0031\u0069\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00eb\u0016\u00ac\u002f\u006c\u0012\u006d\u00ac" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_9c0c5ee4bb0cc725 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0025\u00c7\u000c\u00bb\u00e4\u005e\u000c\u009c" + - "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0087\u0000\u0000\u0000" + - "\u0085\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0043\u0061\u0070\u0030\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b0\u005a\u0096\u00de\u0038\u00b1\u00e1\u0091" + - "\u00bf\u00dc\u00d1\u003b\u003c\u00dd\u007b\u00a7" + - "\u0031\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0090\u0033\u0012\u00e4\u0033\u000f\u00b2" + - "\u0063\u0069\u0053\u00ab\u0092\u0023\u0034\u00d1" + - "\u001d\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0074\u0065\u0073\u0074\u004d\u0065\u0074\u0068" + - "\u006f\u0064\u0030\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u0074\u0065\u0073\u0074\u004d\u0065\u0074\u0068" + - "\u006f\u0064\u0031\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); -public static final org.capnproto.SegmentReader b_d88e8bb64ed6f7b1 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00b1\u00f7\u00d6\u004e\u00b6\u008b\u008e\u00d8" + - "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0054\u0065\u0073\u0074" + - "\u0043\u0061\u0070\u0031\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); -public static final org.capnproto.SegmentReader b_d52dcf38c9f6f7c0 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00c0\u00f7\u00f6\u00c9\u0038\u00cf\u002d\u00d5" + - "\u0034\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0042\u0047\u00e8\u0082\u0015\u007a\u0057\u00b6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00da\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0039\u0000\u0000\u0000\u0087\u0000\u0000\u0000" + - "\u0089\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0038\u00dd\u00fd\u00fb\u0062\u00a8\u000c\u0080" + - "\u0001\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0053\u0074\u0072\u0075\u0063\u0074\u0031\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0005\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d5\u0004\u002e\u0063\u0018\u00ca\u0092\u008f" + - "\u008f\u0083\u0018\u0046\u00fe\u00c4\u0067\u0080" + - "\u0031\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0025\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d6\u005a\u00ae\u0003\u0007\u0092\u0089\u00f0" + - "\u0006\u00f5\u0011\u00c3\u00aa\u0015\u006d\u00c3" + - "\u0019\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u006d\u0065\u0074\u0068\u006f\u0064\u0030\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u006d\u0065\u0074\u0068\u006f\u0064\u0031\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); -public static final org.capnproto.SegmentReader b_800ca862fbfddd38 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0038\u00dd\u00fd\u00fb\u0062\u00a8\u000c\u0080" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00c0\u00f7\u00f6\u00c9\u0038\u00cf\u002d\u00d5" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u001a\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u002e\u0053\u0074\u0072\u0075\u0063" + - "\u0074\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0066\u0030\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0031\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_8f92ca18632e04d5 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00d5\u0004\u002e\u0063\u0018\u00ca\u0092\u008f" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0030\u0024\u0050\u0061\u0072\u0061\u006d" + - "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_8067c4fe4618838f = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u008f\u0083\u0018\u0046\u00fe\u00c4\u0067\u0080" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u005a\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0030\u0024\u0052\u0065\u0073\u0075\u006c" + - "\u0074\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00bc\u00e7\u00f0\u00ae\u00b6\u0051\u00af\u00b1" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0031\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0038\u00dd\u00fd\u00fb\u0062\u00a8\u000c\u0080" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_f089920703ae5ad6 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00d6\u005a\u00ae\u0003\u0007\u0092\u0089\u00f0" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0052\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0031\u0024\u0050\u0061\u0072\u0061\u006d" + - "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_c36d15aac311f506 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0006\u00f5\u0011\u00c3\u00aa\u0015\u006d\u00c3" + - "\u003b\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u005a\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u0074\u0065\u0073\u0074" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0064\u0065\u006d\u006f" + - "\u002f\u0064\u0065\u006d\u006f\u002e\u0063\u0061" + - "\u0070\u006e\u0070\u003a\u0049\u0066\u0061\u0063" + - "\u0065\u0031\u002e\u006d\u0065\u0074\u0068\u006f" + - "\u0064\u0031\u0024\u0052\u0065\u0073\u0075\u006c" + - "\u0074\u0073\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0030\u0000" + - "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00eb\u0016\u00ac\u002f\u006c\u0012\u006d\u00ac" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -} -} - From 45d14709077b17a4ef10026ea995547e3dcebc1a Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 7 Nov 2020 15:59:25 +0000 Subject: [PATCH 108/246] make anypipeline.noop public --- runtime/src/main/java/org/capnproto/AnyPointer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 0d5a18bd..7acabbc7 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -161,7 +161,7 @@ public Pipeline typelessPipeline() { return this; } - Pipeline noop() { + public Pipeline noop() { return new Pipeline(this.hook, this.ops.clone()); } From 6b8898c27b23f6c4c49252fa820fc3aa679add7d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 7 Nov 2020 15:57:48 +0000 Subject: [PATCH 109/246] make noop public --- compiler/pom.xml | 10 +++++--- compiler/src/main/cpp/capnpc-java.c++ | 37 +++++++++++++++++++++------ gen | 31 ++++++++++++---------- pom.xml | 1 + runtime/pom.xml | 6 +++++ 5 files changed, 60 insertions(+), 25 deletions(-) diff --git a/compiler/pom.xml b/compiler/pom.xml index 3af6c4d6..df59fe6e 100644 --- a/compiler/pom.xml +++ b/compiler/pom.xml @@ -39,12 +39,13 @@ 4.13.1 test - + @@ -79,7 +80,7 @@ run - + + diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 551c4221..a279a74b 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -198,6 +198,7 @@ private: SchemaLoader schemaLoader; std::unordered_set usedImports; bool hasInterfaces = false; + bool liteMode = false; kj::StringTree javaFullName(Schema schema, kj::Maybe method = nullptr) { auto node = schema.getProto(); @@ -912,8 +913,13 @@ private: spaces(indent), " }\n", "\n"), - // TODO pipelineMethodDecls - kj::strTree() + (hasDiscriminantValue(proto) || liteMode) + ? kj::strTree() + : kj::strTree( + spaces(indent), " default ", titleCase, ".Pipeline get", titleCase, "() {\n", + spaces(indent), " var pipeline = this.typelessPipeline().noop();\n", + spaces(indent), " return () -> pipeline;\n", + spaces(indent), " }\n") }; } } @@ -1087,6 +1093,9 @@ private: }; } else if (kind == FieldKind::INTERFACE) { + if (liteMode) { + return {}; + } auto factoryArg = makeFactoryArg(field.getType()); auto clientType = typeName(field.getType(), kj::str("Client")).flatten(); auto serverType = typeName(field.getType(), kj::str("Server")).flatten(); @@ -1258,7 +1267,7 @@ private: spaces(indent), " }\n"), // Pipeline accessors - (field.getType().asStruct().getProto().getIsGeneric() + ((liteMode || field.getType().asStruct().getProto().getIsGeneric()) ? kj::strTree() // No generics for you, sorry. : kj::strTree( spaces(indent), " default ", pipelineType, " get", titleCase, "() {\n", @@ -1667,11 +1676,14 @@ private: spaces(indent), " _NOT_IN_SCHEMA,\n", spaces(indent), " }\n"), KJ_MAP(n, nestedTypeDecls) { return kj::mv(n); }, - spaces(indent), " public interface Pipeline", readerTypeParams, " extends org.capnproto.Pipeline {\n", - KJ_MAP(f, fieldTexts) { - return kj::mv(f.pipelineMethodDecls); - }, - spaces(indent), " }\n", + (liteMode ? kj::strTree() + : kj::strTree( + spaces(indent), " public interface Pipeline", readerTypeParams, " extends org.capnproto.Pipeline {\n", + KJ_MAP(f, fieldTexts) { + return kj::mv(f.pipelineMethodDecls); + }, + spaces(indent), " }\n") + ), spaces(indent), "}\n"), kj::strTree(), @@ -1703,6 +1715,10 @@ private: InterfaceText makeInterfaceText(kj::StringPtr scope, kj::StringPtr name, InterfaceSchema schema, kj::Array nestedTypeDecls, int indent) { + if (liteMode) { + return {}; + } + auto sp = spaces(indent); auto fullName = kj::str(scope, name); auto methods = KJ_MAP(m, schema.getMethods()) { @@ -2499,6 +2515,11 @@ private: } kj::MainBuilder::Validity run() { + + if (context.getProgramName().endsWith("lite")) { + liteMode = true; + } + ReaderOptions options; options.traversalLimitInWords = 1 << 30; // Don't limit. StreamFdMessageReader reader(STDIN_FILENO, options); diff --git a/gen b/gen index 6fd2d73a..3fd7d3d4 100755 --- a/gen +++ b/gen @@ -5,21 +5,24 @@ set -eux export PATH=/usr/local/bin:/usr/bin:/bin make CXX=g++-8 capnpc-java +cp capnpc-java capnpc-java-lite capnp compile -I./compiler/src/main/schema/ -o/bin/cat ./runtime/src/test/schema/test.capnp > ./runtime/src/test/schema/test.raw capnp compile -I./compiler/src/main/schema/ -oc++ ./runtime/src/test/schema/test.capnp -capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./runtime/src/test/schema/test.capnp -cp ./runtime/src/test/schema/Test.java ./runtime/src/test/java/org/capnproto/test/ - -capnp compile -I./compiler/src/main/schema/ -oc++ ./runtime/src/test/schema/demo.capnp -capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./runtime/src/test/schema/demo.capnp -cp ./runtime/src/test/schema/Demo.java ./runtime/src/test/java/org/capnproto/demo/ - -capnp compile -I./compiler/src/main/schema/ -o/bin/cat ./runtime/src/test/schema/generics.capnp > ./runtime/src/test/schema/generics.raw -capnp compile -I./compiler/src/main/schema/ -oc++ ./runtime/src/test/schema/generics.capnp -capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./runtime/src/test/schema/generics.capnp -cp ./runtime/src/test/schema/TestGenerics.java ./runtime/src/test/java/org/capnproto/demo/ - -capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./examples/src/main/schema/addressbook.capnp -cp ./examples/src/main/schema/Addressbook.java ./examples/src/main/java/org/capnproto/examples/ +capnp compile -I./compiler/src/main/schema/ -o./capnpc-java-lite ./runtime/src/test/schema/test.capnp +cp ./runtime/src/test/schema/Test.java ./runtime/src/test/schema/TestLite.java +capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./runtime/src/test/schema/test.capnp +#cp ./runtime/src/test/schema/Test.java ./runtime/src/test/java/org/capnproto/test/ + +#capnp compile -I./compiler/src/main/schema/ -oc++ ./runtime/src/test/schema/demo.capnp +#capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./runtime/src/test/schema/demo.capnp +#cp ./runtime/src/test/schema/Demo.java ./runtime/src/test/java/org/capnproto/demo/ + +#capnp compile -I./compiler/src/main/schema/ -o/bin/cat ./runtime/src/test/schema/generics.capnp > ./runtime/src/test/schema/generics.raw +#capnp compile -I./compiler/src/main/schema/ -oc++ ./runtime/src/test/schema/generics.capnp +#capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./runtime/src/test/schema/generics.capnp +#cp ./runtime/src/test/schema/TestGenerics.java ./runtime/src/test/java/org/capnproto/demo/ + +#capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./examples/src/main/schema/addressbook.capnp +#cp ./examples/src/main/schema/Addressbook.java ./examples/src/main/java/org/capnproto/examples/ diff --git a/pom.xml b/pom.xml index 83fd696f..e85c105f 100644 --- a/pom.xml +++ b/pom.xml @@ -12,6 +12,7 @@ compiler examples benchmark + compiler-tests diff --git a/runtime/pom.xml b/runtime/pom.xml index 9d50d52a..eb351631 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -44,6 +44,12 @@ 4.13.1 test + + + org.capnproto + compiler + 0.1.6-SNAPSHOT + From 0283fc5c2dffa742b776f6c6233b3a1375c1f2ed Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 7 Nov 2020 16:56:01 +0000 Subject: [PATCH 110/246] add lite mode for compiler --- compiler/src/main/cpp/capnpc-java.c++ | 5 ++++- gen | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index a279a74b..0a770970 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -335,6 +335,9 @@ private: } } case schema::Type::INTERFACE: { + if (liteMode) { + return kj::strTree("org.capnproto.Capability.", suffix); + } auto interfaceSchema = type.asInterface(); if (interfaceSchema.getProto().getIsGeneric()) { auto typeArgs = getTypeArguments(interfaceSchema, interfaceSchema, kj::str(suffix)); @@ -2516,7 +2519,7 @@ private: kj::MainBuilder::Validity run() { - if (context.getProgramName().endsWith("lite")) { + if (::getenv("CAPNP_LITE") != nullptr) { liteMode = true; } diff --git a/gen b/gen index 3fd7d3d4..dad800b5 100755 --- a/gen +++ b/gen @@ -5,11 +5,10 @@ set -eux export PATH=/usr/local/bin:/usr/bin:/bin make CXX=g++-8 capnpc-java -cp capnpc-java capnpc-java-lite capnp compile -I./compiler/src/main/schema/ -o/bin/cat ./runtime/src/test/schema/test.capnp > ./runtime/src/test/schema/test.raw capnp compile -I./compiler/src/main/schema/ -oc++ ./runtime/src/test/schema/test.capnp -capnp compile -I./compiler/src/main/schema/ -o./capnpc-java-lite ./runtime/src/test/schema/test.capnp +env CAPNP_LITE=1 capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./runtime/src/test/schema/test.capnp cp ./runtime/src/test/schema/Test.java ./runtime/src/test/schema/TestLite.java capnp compile -I./compiler/src/main/schema/ -o./capnpc-java ./runtime/src/test/schema/test.capnp #cp ./runtime/src/test/schema/Test.java ./runtime/src/test/java/org/capnproto/test/ From 9e6d495d56b52d4a963ad7afaac37bb233358343 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 8 Nov 2020 13:21:55 +0000 Subject: [PATCH 111/246] add runtime-rpc module and refactor project --- compiler/pom.xml | 9 +- pom.xml | 2 +- runtime-rpc/pom.xml | 228 + .../main/java/org/capnproto/RpcDumper.java | 0 .../src/main/java/org/capnproto/RpcState.java | 80 +- .../main/java/org/capnproto/RpcSystem.java | 0 .../java/org/capnproto/TwoPartyClient.java | 0 .../java/org/capnproto/TwoPartyServer.java | 1 - .../org/capnproto/TwoPartyVatNetwork.java | 1 - .../main/java/org/capnproto/VatNetwork.java | 0 .../src/main/schema/rpc-twoparty.capnp | 173 + runtime-rpc/src/main/schema/rpc.capnp | 1480 ++++++ .../java/org/capnproto/CapabilityTest.java | 8 +- .../test/java/org/capnproto/RpcStateTest.java | 2 +- .../src/test/java/org/capnproto/RpcTest.java | 410 ++ .../src/test/java/org/capnproto/TestUtil.java | 15 +- .../test/java/org/capnproto/TwoPartyTest.java | 9 +- .../src/test/schema/test.capnp | 0 runtime/pom.xml | 6 - .../main/java/org/capnproto/PipelineOp.java | 34 - .../main/java/org/capnproto/RpcException.java | 23 - .../main/java/org/capnproto/RpcProtocol.java | 4304 ----------------- .../org/capnproto/RpcTwoPartyProtocol.java | 662 --- .../src/test/java/org/capnproto/RpcTest.java | 410 -- .../test/java/org/capnproto/demo/demo.capnp | 59 - .../java/org/capnproto/demo/demo.capnp.c++ | 1236 ----- .../test/java/org/capnproto/demo/demo.capnp.h | 2106 -------- .../java/org/capnproto/demo/democap.capnp | 12 - .../java/org/capnproto/demo/democap.capnp.c++ | 190 - .../java/org/capnproto/demo/democap.capnp.h | 216 - .../java/org/capnproto/demo/demoparams.capnp | 25 - 31 files changed, 2384 insertions(+), 9317 deletions(-) create mode 100644 runtime-rpc/pom.xml rename {runtime => runtime-rpc}/src/main/java/org/capnproto/RpcDumper.java (100%) rename {runtime => runtime-rpc}/src/main/java/org/capnproto/RpcState.java (96%) rename {runtime => runtime-rpc}/src/main/java/org/capnproto/RpcSystem.java (100%) rename {runtime => runtime-rpc}/src/main/java/org/capnproto/TwoPartyClient.java (100%) rename {runtime => runtime-rpc}/src/main/java/org/capnproto/TwoPartyServer.java (99%) rename {runtime => runtime-rpc}/src/main/java/org/capnproto/TwoPartyVatNetwork.java (99%) rename {runtime => runtime-rpc}/src/main/java/org/capnproto/VatNetwork.java (100%) create mode 100644 runtime-rpc/src/main/schema/rpc-twoparty.capnp create mode 100644 runtime-rpc/src/main/schema/rpc.capnp rename {runtime => runtime-rpc}/src/test/java/org/capnproto/CapabilityTest.java (98%) rename {runtime => runtime-rpc}/src/test/java/org/capnproto/RpcStateTest.java (98%) create mode 100644 runtime-rpc/src/test/java/org/capnproto/RpcTest.java rename {runtime => runtime-rpc}/src/test/java/org/capnproto/TestUtil.java (96%) rename {runtime => runtime-rpc}/src/test/java/org/capnproto/TwoPartyTest.java (96%) rename {runtime => runtime-rpc}/src/test/schema/test.capnp (100%) delete mode 100644 runtime/src/main/java/org/capnproto/RpcProtocol.java delete mode 100644 runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java delete mode 100644 runtime/src/test/java/org/capnproto/RpcTest.java delete mode 100644 runtime/src/test/java/org/capnproto/demo/demo.capnp delete mode 100644 runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ delete mode 100644 runtime/src/test/java/org/capnproto/demo/demo.capnp.h delete mode 100644 runtime/src/test/java/org/capnproto/demo/democap.capnp delete mode 100644 runtime/src/test/java/org/capnproto/demo/democap.capnp.c++ delete mode 100644 runtime/src/test/java/org/capnproto/demo/democap.capnp.h delete mode 100644 runtime/src/test/java/org/capnproto/demo/demoparams.capnp diff --git a/compiler/pom.xml b/compiler/pom.xml index df59fe6e..3fcafa3a 100644 --- a/compiler/pom.xml +++ b/compiler/pom.xml @@ -39,13 +39,11 @@ 4.13.1 test - @@ -80,7 +78,6 @@ run - - diff --git a/pom.xml b/pom.xml index e85c105f..10d5c2b2 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ compiler examples benchmark - compiler-tests + runtime-rpc diff --git a/runtime-rpc/pom.xml b/runtime-rpc/pom.xml new file mode 100644 index 00000000..29b5bd43 --- /dev/null +++ b/runtime-rpc/pom.xml @@ -0,0 +1,228 @@ + + + 4.0.0 + org.capnproto + runtime-rpc + jar + runtime-rpc + 0.1.6-SNAPSHOT + Cap'n Proto runtime library + + org.capnproto + + https://capnproto.org/ + + + MIT + http://opensource.org/licenses/MIT + repo + + + + git@github.com:capnproto/capnproto-java.git + scm:git@github.com:capnproto/capnproto-java.git + + + + dwrensha + David Renshaw + https://github.com/dwrensha + + + vaci + Vaci Koblizek + https://github.com/vaci + + + + UTF-8 + + + + junit + junit + 4.13.1 + test + + + org.capnproto + runtime + 0.1.6-SNAPSHOT + + + org.capnproto + compiler + 0.1.6-SNAPSHOT + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + -Xlint:unchecked + 14 + 14 + + + + + maven-antrun-plugin + 3.0.0 + + + generate-rpc-sources + generate-sources + + + + + + + + + + + + + + + + + run + + + + generate-rpc-test-sources + generate-test-sources + + + + + + + + + + + + + + + run + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-generated-sources + generate-sources + + add-source + + + + src/main/generated + + + + + add-generated-test-sources + generate-test-sources + + add-test-source + + + + src/test/generated + + + + + + + + + + + release + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + + attach-javadocs + + jar + + + false + + + + + + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.6 + true + + ossrh + https://oss.sonatype.org/ + true + + + + + + + + \ No newline at end of file diff --git a/runtime/src/main/java/org/capnproto/RpcDumper.java b/runtime-rpc/src/main/java/org/capnproto/RpcDumper.java similarity index 100% rename from runtime/src/main/java/org/capnproto/RpcDumper.java rename to runtime-rpc/src/main/java/org/capnproto/RpcDumper.java diff --git a/runtime/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java similarity index 96% rename from runtime/src/main/java/org/capnproto/RpcState.java rename to runtime-rpc/src/main/java/org/capnproto/RpcState.java index 8f1c3a85..0eb4fb57 100644 --- a/runtime/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -346,7 +346,7 @@ CompletableFuture disconnect(Throwable exc) { int sizeHint = messageSizeHint() + exceptionSizeHint(exc); var message = this.connection.newOutgoingMessage(sizeHint); var abort = message.getBody().getAs(RpcProtocol.Message.factory).initAbort(); - RpcException.fromException(exc, abort); + FromException(exc, abort); message.send(); } catch (Throwable abortFailed) { @@ -511,7 +511,7 @@ void handleUnimplemented(RpcProtocol.Message.Reader message) { } void handleAbort(RpcProtocol.Exception.Reader abort) throws RpcException { - throw RpcException.toException(abort); + throw ToException(abort); } void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bootstrap) { @@ -538,7 +538,7 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo var payload = ret.initResults(); var content = payload.getContent().imbue(capTable); var cap = this.bootstrapFactory.createFor(connection.getPeerVatId()); - content.setAsCap(cap); + content.setAs(Capability.factory, cap); var caps = capTable.getTable(); var capHook = caps.length != 0 ? caps[0] @@ -676,7 +676,7 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu assert false: "Tail call `Return` must set `resultsSentElsewhere`, not `exception`."; break; } - question.reject(RpcException.toException(callReturn.getException())); + question.reject(ToException(callReturn.getException())); break; case CANCELED: @@ -752,7 +752,7 @@ private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reade cap = receiveCap(resolve.getCap(), message.getAttachedFds()); break; case EXCEPTION: - exc = RpcException.toException(resolve.getException()); + exc = ToException(resolve.getException()); break; default: assert false: "Unknown 'Resolve' type."; @@ -976,7 +976,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS var message = connection.newOutgoingMessage(sizeHint); var resolve = message.getBody().initAs(RpcProtocol.Message.factory).initResolve(); resolve.setPromiseId(exportId); - RpcException.fromException(exc, resolve.initException()); + FromException(exc, resolve.initException()); message.send(); // TODO disconnect? @@ -1053,7 +1053,7 @@ private ClientHook receiveCap(RpcProtocol.CapDescriptor.Reader descriptor, List< case RECEIVER_ANSWER: var promisedAnswer = descriptor.getReceiverAnswer(); var answer = answers.find(promisedAnswer.getQuestionId()); - var ops = PipelineOp.ToPipelineOps(promisedAnswer); + var ops = ToPipelineOps(promisedAnswer); if (answer == null || !answer.active || answer.pipeline == null || ops == null) { return Capability.newBrokenCap("invalid 'receiverAnswer'"); @@ -1158,7 +1158,7 @@ ClientHook getMessageTarget(RpcProtocol.MessageTarget.Reader target) { RpcException.failed("Pipeline call on a request that returned no capabilities or was already closed.")); } - var ops = PipelineOp.ToPipelineOps(promisedAnswer); + var ops = ToPipelineOps(promisedAnswer); if (ops == null) { return null; } @@ -1404,7 +1404,7 @@ private void sendErrorReturn(Throwable exc) { var builder = message.getBody().initAs(RpcProtocol.Message.factory).initReturn(); builder.setAnswerId(this.answerId); builder.setReleaseParamCaps(false); - RpcException.fromException(exc, builder.initException()); + FromException(exc, builder.initException()); message.send(); } @@ -1891,7 +1891,7 @@ public CompletableFuture whenMoreResolved() { public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { var promisedAnswer = descriptor.initReceiverAnswer(); promisedAnswer.setQuestionId(question.getId()); - PipelineOp.FromPipelineOps(ops, promisedAnswer); + FromPipelineOps(ops, promisedAnswer); return null; } @@ -1899,8 +1899,66 @@ public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, Lis public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { var builder = target.initPromisedAnswer(); builder.setQuestionId(question.getId()); - PipelineOp.FromPipelineOps(ops, builder); + FromPipelineOps(ops, builder); return null; } } + + static void FromPipelineOps(PipelineOp[] ops, RpcProtocol.PromisedAnswer.Builder builder) { + var transforms = builder.initTransform(ops.length); + for (int ii = 0; ii < ops.length; ++ii) { + switch (ops[ii].type) { + case NOOP: + transforms.get(ii).setNoop(null); + break; + case GET_POINTER_FIELD: + transforms.get(ii).setGetPointerField(ops[ii].pointerIndex); + break; + } + } + } + + static PipelineOp[] ToPipelineOps(RpcProtocol.PromisedAnswer.Reader reader) { + var transforms = reader.getTransform(); + var ops = new PipelineOp[transforms.size()]; + for (int ii = 0; ii < ops.length; ++ii) { + var transform = transforms.get(ii); + switch (transform.which()) { + case NOOP: + ops[ii] = PipelineOp.Noop(); // TODO null? + break; + case GET_POINTER_FIELD: + ops[ii] = PipelineOp.PointerField(transform.getGetPointerField()); + break; + default: + // TODO improve error handling here + // Unsupported pipeline ops + return null; + } + } + return ops; + } + + static void FromException(Throwable exc, RpcProtocol.Exception.Builder builder) { + builder.setReason(exc.getMessage()); + builder.setType(RpcProtocol.Exception.Type.FAILED); + } + + static RpcException ToException(RpcProtocol.Exception.Reader reader) { + var type = RpcException.Type.UNKNOWN; + + switch (reader.getType()) { + case UNIMPLEMENTED: + type = RpcException.Type.UNIMPLEMENTED; + break; + case FAILED: + type = RpcException.Type.FAILED; + break; + case DISCONNECTED: + case OVERLOADED: + default: + break; + } + return new RpcException(type, reader.getReason().toString()); + } } diff --git a/runtime/src/main/java/org/capnproto/RpcSystem.java b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java similarity index 100% rename from runtime/src/main/java/org/capnproto/RpcSystem.java rename to runtime-rpc/src/main/java/org/capnproto/RpcSystem.java diff --git a/runtime/src/main/java/org/capnproto/TwoPartyClient.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java similarity index 100% rename from runtime/src/main/java/org/capnproto/TwoPartyClient.java rename to runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java diff --git a/runtime/src/main/java/org/capnproto/TwoPartyServer.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java similarity index 99% rename from runtime/src/main/java/org/capnproto/TwoPartyServer.java rename to runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java index 1c8840fb..5503b0a1 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyServer.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java @@ -6,7 +6,6 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; public class TwoPartyServer { diff --git a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java similarity index 99% rename from runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java rename to runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 68a425bf..2c866069 100644 --- a/runtime/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -4,7 +4,6 @@ import java.util.List; import java.util.concurrent.CompletableFuture; - public class TwoPartyVatNetwork implements VatNetwork, VatNetwork.Connection { diff --git a/runtime/src/main/java/org/capnproto/VatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java similarity index 100% rename from runtime/src/main/java/org/capnproto/VatNetwork.java rename to runtime-rpc/src/main/java/org/capnproto/VatNetwork.java diff --git a/runtime-rpc/src/main/schema/rpc-twoparty.capnp b/runtime-rpc/src/main/schema/rpc-twoparty.capnp new file mode 100644 index 00000000..1d54b470 --- /dev/null +++ b/runtime-rpc/src/main/schema/rpc-twoparty.capnp @@ -0,0 +1,173 @@ +# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors +# Licensed under the MIT License: +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +@0xa184c7885cdaf2a1; +# This file defines the "network-specific parameters" in rpc.capnp to support a network consisting +# of two vats. Each of these vats may in fact be in communication with other vats, but any +# capabilities they forward must be proxied. Thus, to each end of the connection, all capabilities +# received from the other end appear to live in a single vat. +# +# Two notable use cases for this model include: +# - Regular client-server communications, where a remote client machine (perhaps living on an end +# user's personal device) connects to a server. The server may be part of a cluster, and may +# call on other servers in the cluster to help service the user's request. It may even obtain +# capabilities from these other servers which it passes on to the user. To simplify network +# common traversal problems (e.g. if the user is behind a firewall), it is probably desirable to +# multiplex all communications between the server cluster and the client over the original +# connection rather than form new ones. This connection should use the two-party protocol, as +# the client has no interest in knowing about additional servers. +# - Applications running in a sandbox. A supervisor process may execute a confined application +# such that all of the confined app's communications with the outside world must pass through +# the supervisor. In this case, the connection between the confined app and the supervisor might +# as well use the two-party protocol, because the confined app is intentionally prevented from +# talking to any other vat anyway. Any external resources will be proxied through the supervisor, +# and so to the contained app will appear as if they were hosted by the supervisor itself. +# +# Since there are only two vats in this network, there is never a need for three-way introductions, +# so level 3 is free. Moreover, because it is never necessary to form new connections, the +# two-party protocol can be used easily anywhere where a two-way byte stream exists, without regard +# to where that byte stream goes or how it was initiated. This makes the two-party runtime library +# highly reusable. +# +# Joins (level 4) _could_ be needed in cases where one or both vats are participating in other +# networks that use joins. For instance, if Alice and Bob are speaking through the two-party +# protocol, and Bob is also participating on another network, Bob may send Alice two or more +# proxied capabilities which, unbeknownst to Bob at the time, are in fact pointing at the same +# remote object. Alice may then request to join these capabilities, at which point Bob will have +# to forward the join to the other network. Note, however, that if Alice is _not_ participating on +# any other network, then Alice will never need to _receive_ a Join, because Alice would always +# know when two locally-hosted capabilities are the same and would never export a redundant alias +# to Bob. So, Alice can respond to all incoming joins with an error, and only needs to implement +# outgoing joins if she herself desires to use this feature. Also, outgoing joins are relatively +# easy to implement in this scenario. +# +# What all this means is that a level 4 implementation of the confined network is barely more +# complicated than a level 2 implementation. However, such an implementation allows the "client" +# or "confined" app to access the server's/supervisor's network with equal functionality to any +# native participant. In other words, an application which implements only the two-party protocol +# can be paired with a proxy app in order to participate in any network. +# +# So, when implementing Cap'n Proto in a new language, it makes sense to implement only the +# two-party protocol initially, and then pair applications with an appropriate proxy written in +# C++, rather than implement other parameterizations of the RPC protocol directly. + +using Cxx = import "/capnp/c++.capnp"; +$Cxx.namespace("capnp::rpc::twoparty"); + +using Java = import "/capnp/java.capnp"; +$Java.package("org.capnproto"); +$Java.outerClassname("RpcTwoPartyProtocol"); + +# Note: SturdyRef is not specified here. It is up to the application to define semantics of +# SturdyRefs if desired. + +enum Side { + server @0; + # The object lives on the "server" or "supervisor" end of the connection. Only the + # server/supervisor knows how to interpret the ref; to the client, it is opaque. + # + # Note that containers intending to implement strong confinement should rewrite SturdyRefs + # received from the external network before passing them on to the confined app. The confined + # app thus does not ever receive the raw bits of the SturdyRef (which it could perhaps + # maliciously leak), but instead receives only a thing that it can pass back to the container + # later to restore the ref. See: + # http://www.erights.org/elib/capability/dist-confine.html + + client @1; + # The object lives on the "client" or "confined app" end of the connection. Only the client + # knows how to interpret the ref; to the server/supervisor, it is opaque. Most clients do not + # actually know how to persist capabilities at all, so use of this is unusual. +} + +struct VatId { + side @0 :Side; +} + +struct ProvisionId { + # Only used for joins, since three-way introductions never happen on a two-party network. + + joinId @0 :UInt32; + # The ID from `JoinKeyPart`. +} + +struct RecipientId {} +# Never used, because there are only two parties. + +struct ThirdPartyCapId {} +# Never used, because there is no third party. + +struct JoinKeyPart { + # Joins in the two-party case are simplified by a few observations. + # + # First, on a two-party network, a Join only ever makes sense if the receiving end is also + # connected to other networks. A vat which is not connected to any other network can safely + # reject all joins. + # + # Second, since a two-party connection bisects the network -- there can be no other connections + # between the networks at either end of the connection -- if one part of a join crosses the + # connection, then _all_ parts must cross it. Therefore, a vat which is receiving a Join request + # off some other network which needs to be forwarded across the two-party connection can + # collect all the parts on its end and only forward them across the two-party connection when all + # have been received. + # + # For example, imagine that Alice and Bob are vats connected over a two-party connection, and + # each is also connected to other networks. At some point, Alice receives one part of a Join + # request off her network. The request is addressed to a capability that Alice received from + # Bob and is proxying to her other network. Alice goes ahead and responds to the Join part as + # if she hosted the capability locally (this is important so that if not all the Join parts end + # up at Alice, the original sender can detect the failed Join without hanging). As other parts + # trickle in, Alice verifies that each part is addressed to a capability from Bob and continues + # to respond to each one. Once the complete set of join parts is received, Alice checks if they + # were all for the exact same capability. If so, she doesn't need to send anything to Bob at + # all. Otherwise, she collects the set of capabilities (from Bob) to which the join parts were + # addressed and essentially initiates a _new_ Join request on those capabilities to Bob. Alice + # does not forward the Join parts she received herself, but essentially forwards the Join as a + # whole. + # + # On Bob's end, since he knows that Alice will always send all parts of a Join together, he + # simply waits until he's received them all, then performs a join on the respective capabilities + # as if it had been requested locally. + + joinId @0 :UInt32; + # A number identifying this join, chosen by the sender. May be reused once `Finish` messages are + # sent corresponding to all of the `Join` messages. + + partCount @1 :UInt16; + # The number of capabilities to be joined. + + partNum @2 :UInt16; + # Which part this request targets -- a number in the range [0, partCount). +} + +struct JoinResult { + joinId @0 :UInt32; + # Matches `JoinKeyPart`. + + succeeded @1 :Bool; + # All JoinResults in the set will have the same value for `succeeded`. The receiver actually + # implements the join by waiting for all the `JoinKeyParts` and then performing its own join on + # them, then going back and answering all the join requests afterwards. + + cap @2 :AnyPointer; + # One of the JoinResults will have a non-null `cap` which is the joined capability. + # + # TODO(cleanup): Change `AnyPointer` to `Capability` when that is supported. +} diff --git a/runtime-rpc/src/main/schema/rpc.capnp b/runtime-rpc/src/main/schema/rpc.capnp new file mode 100644 index 00000000..9a406dd3 --- /dev/null +++ b/runtime-rpc/src/main/schema/rpc.capnp @@ -0,0 +1,1480 @@ +# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors +# Licensed under the MIT License: +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +@0xb312981b2552a250; +# Recall that Cap'n Proto RPC allows messages to contain references to remote objects that +# implement interfaces. These references are called "capabilities", because they both designate +# the remote object to use and confer permission to use it. +# +# Recall also that Cap'n Proto RPC has the feature that when a method call itself returns a +# capability, the caller can begin calling methods on that capability _before the first call has +# returned_. The caller essentially sends a message saying "Hey server, as soon as you finish +# that previous call, do this with the result!". Cap'n Proto's RPC protocol makes this possible. +# +# The protocol is significantly more complicated than most RPC protocols. However, this is +# implementation complexity that underlies an easy-to-grasp higher-level model of object oriented +# programming. That is, just like TCP is a surprisingly complicated protocol that implements a +# conceptually-simple byte stream abstraction, Cap'n Proto is a surprisingly complicated protocol +# that implements a conceptually-simple object abstraction. +# +# Cap'n Proto RPC is based heavily on CapTP, the object-capability protocol used by the E +# programming language: +# http://www.erights.org/elib/distrib/captp/index.html +# +# Cap'n Proto RPC takes place between "vats". A vat hosts some set of objects and talks to other +# vats through direct bilateral connections. Typically, there is a 1:1 correspondence between vats +# and processes (in the unix sense of the word), although this is not strictly always true (one +# process could run multiple vats, or a distributed virtual vat might live across many processes). +# +# Cap'n Proto does not distinguish between "clients" and "servers" -- this is up to the application. +# Either end of any connection can potentially hold capabilities pointing to the other end, and +# can call methods on those capabilities. In the doc comments below, we use the words "sender" +# and "receiver". These refer to the sender and receiver of an instance of the struct or field +# being documented. Sometimes we refer to a "third-party" that is neither the sender nor the +# receiver. Documentation is generally written from the point of view of the sender. +# +# It is generally up to the vat network implementation to securely verify that connections are made +# to the intended vat as well as to encrypt transmitted data for privacy and integrity. See the +# `VatNetwork` example interface near the end of this file. +# +# When a new connection is formed, the only interesting things that can be done are to send a +# `Bootstrap` (level 0) or `Accept` (level 3) message. +# +# Unless otherwise specified, messages must be delivered to the receiving application in the same +# order in which they were initiated by the sending application. The goal is to support "E-Order", +# which states that two calls made on the same reference must be delivered in the order which they +# were made: +# http://erights.org/elib/concurrency/partial-order.html +# +# Since the full protocol is complicated, we define multiple levels of support that an +# implementation may target. For many applications, level 1 support will be sufficient. +# Comments in this file indicate which level requires the corresponding feature to be +# implemented. +# +# * **Level 0:** The implementation does not support object references. Only the bootstrap interface +# can be called. At this level, the implementation does not support object-oriented protocols and +# is similar in complexity to JSON-RPC or Protobuf services. This level should be considered only +# a temporary stepping-stone toward level 1 as the lack of object references drastically changes +# how protocols are designed. Applications _should not_ attempt to design their protocols around +# the limitations of level 0 implementations. +# +# * **Level 1:** The implementation supports simple bilateral interaction with object references +# and promise pipelining, but interactions between three or more parties are supported only via +# proxying of objects. E.g. if Alice (in Vat A) wants to send Bob (in Vat B) a capability +# pointing to Carol (in Vat C), Alice must create a proxy of Carol within Vat A and send Bob a +# reference to that; Bob cannot form a direct connection to Carol. Level 1 implementations do +# not support checking if two capabilities received from different vats actually point to the +# same object ("join"), although they should be able to do this check on capabilities received +# from the same vat. +# +# * **Level 2:** The implementation supports saving persistent capabilities -- i.e. capabilities +# that remain valid even after disconnect, and can be restored on a future connection. When a +# capability is saved, the requester receives a `SturdyRef`, which is a token that can be used +# to restore the capability later. +# +# * **Level 3:** The implementation supports three-way interactions. That is, if Alice (in Vat A) +# sends Bob (in Vat B) a capability pointing to Carol (in Vat C), then Vat B will automatically +# form a direct connection to Vat C rather than have requests be proxied through Vat A. +# +# * **Level 4:** The entire protocol is implemented, including joins (checking if two capabilities +# are equivalent). +# +# Note that an implementation must also support specific networks (transports), as described in +# the "Network-specific Parameters" section below. An implementation might have different levels +# depending on the network used. +# +# New implementations of Cap'n Proto should start out targeting the simplistic two-party network +# type as defined in `rpc-twoparty.capnp`. With this network type, level 3 is irrelevant and +# levels 2 and 4 are much easier than usual to implement. When such an implementation is paired +# with a container proxy, the contained app effectively gets to make full use of the proxy's +# network at level 4. And since Cap'n Proto IPC is extremely fast, it may never make sense to +# bother implementing any other vat network protocol -- just use the correct container type and get +# it for free. + +using Cxx = import "/capnp/c++.capnp"; +$Cxx.namespace("capnp::rpc"); + +using Java = import "/capnp/java.capnp"; +$Java.package("org.capnproto"); +$Java.outerClassname("RpcProtocol"); + +# ======================================================================================== +# The Four Tables +# +# Cap'n Proto RPC connections are stateful (although an application built on Cap'n Proto could +# export a stateless interface). As in CapTP, for each open connection, a vat maintains four state +# tables: questions, answers, imports, and exports. See the diagram at: +# http://www.erights.org/elib/distrib/captp/4tables.html +# +# The question table corresponds to the other end's answer table, and the imports table corresponds +# to the other end's exports table. +# +# The entries in each table are identified by ID numbers (defined below as 32-bit integers). These +# numbers are always specific to the connection; a newly-established connection starts with no +# valid IDs. Since low-numbered IDs will pack better, it is suggested that IDs be assigned like +# Unix file descriptors -- prefer the lowest-number ID that is currently available. +# +# IDs in the questions/answers tables are chosen by the questioner and generally represent method +# calls that are in progress. +# +# IDs in the imports/exports tables are chosen by the exporter and generally represent objects on +# which methods may be called. Exports may be "settled", meaning the exported object is an actual +# object living in the exporter's vat, or they may be "promises", meaning the exported object is +# the as-yet-unknown result of an ongoing operation and will eventually be resolved to some other +# object once that operation completes. Calls made to a promise will be forwarded to the eventual +# target once it is known. The eventual replacement object does *not* get the same ID as the +# promise, as it may turn out to be an object that is already exported (so already has an ID) or +# may even live in a completely different vat (and so won't get an ID on the same export table +# at all). +# +# IDs can be reused over time. To make this safe, we carefully define the lifetime of IDs. Since +# messages using the ID could be traveling in both directions simultaneously, we must define the +# end of life of each ID _in each direction_. The ID is only safe to reuse once it has been +# released by both sides. +# +# When a Cap'n Proto connection is lost, everything on the four tables is lost. All questions are +# canceled and throw exceptions. All imports become broken (all future calls to them throw +# exceptions). All exports and answers are implicitly released. The only things not lost are +# persistent capabilities (`SturdyRef`s). The application must plan for this and should respond by +# establishing a new connection and restoring from these persistent capabilities. + +using QuestionId = UInt32; +# **(level 0)** +# +# Identifies a question in the sender's question table (which corresponds to the receiver's answer +# table). The questioner (caller) chooses an ID when making a call. The ID remains valid in +# caller -> callee messages until a Finish message is sent, and remains valid in callee -> caller +# messages until a Return message is sent. + +using AnswerId = QuestionId; +# **(level 0)** +# +# Identifies an answer in the sender's answer table (which corresponds to the receiver's question +# table). +# +# AnswerId is physically equivalent to QuestionId, since the question and answer tables correspond, +# but we define a separate type for documentation purposes: we always use the type representing +# the sender's point of view. + +using ExportId = UInt32; +# **(level 1)** +# +# Identifies an exported capability or promise in the sender's export table (which corresponds +# to the receiver's import table). The exporter chooses an ID before sending a capability over the +# wire. If the capability is already in the table, the exporter should reuse the same ID. If the +# ID is a promise (as opposed to a settled capability), this must be indicated at the time the ID +# is introduced (e.g. by using `senderPromise` instead of `senderHosted` in `CapDescriptor`); in +# this case, the importer shall expect a later `Resolve` message that replaces the promise. +# +# ExportId/ImportIds are subject to reference counting. Whenever an `ExportId` is sent over the +# wire (from the exporter to the importer), the export's reference count is incremented (unless +# otherwise specified). The reference count is later decremented by a `Release` message. Since +# the `Release` message can specify an arbitrary number by which to reduce the reference count, the +# importer should usually batch reference decrements and only send a `Release` when it believes the +# reference count has hit zero. Of course, it is possible that a new reference to the export is +# in-flight at the time that the `Release` message is sent, so it is necessary for the exporter to +# keep track of the reference count on its end as well to avoid race conditions. +# +# When a connection is lost, all exports are implicitly released. It is not possible to restore +# a connection state after disconnect (although a transport layer could implement a concept of +# persistent connections if it is transparent to the RPC layer). + +using ImportId = ExportId; +# **(level 1)** +# +# Identifies an imported capability or promise in the sender's import table (which corresponds to +# the receiver's export table). +# +# ImportId is physically equivalent to ExportId, since the export and import tables correspond, +# but we define a separate type for documentation purposes: we always use the type representing +# the sender's point of view. +# +# An `ImportId` remains valid in importer -> exporter messages until the importer has sent +# `Release` messages that (it believes) have reduced the reference count to zero. + +# ======================================================================================== +# Messages + +struct Message { + # An RPC connection is a bi-directional stream of Messages. + + union { + unimplemented @0 :Message; + # The sender previously received this message from the peer but didn't understand it or doesn't + # yet implement the functionality that was requested. So, the sender is echoing the message + # back. In some cases, the receiver may be able to recover from this by pretending the sender + # had taken some appropriate "null" action. + # + # For example, say `resolve` is received by a level 0 implementation (because a previous call + # or return happened to contain a promise). The level 0 implementation will echo it back as + # `unimplemented`. The original sender can then simply release the cap to which the promise + # had resolved, thus avoiding a leak. + # + # For any message type that introduces a question, if the message comes back unimplemented, + # the original sender may simply treat it as if the question failed with an exception. + # + # In cases where there is no sensible way to react to an `unimplemented` message (without + # resource leaks or other serious problems), the connection may need to be aborted. This is + # a gray area; different implementations may take different approaches. + + abort @1 :Exception; + # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g. + # because the sender received an invalid or nonsensical message or because the sender had an + # internal error. The sender will shut down the outgoing half of the connection after `abort` + # and will completely close the connection shortly thereafter (it's up to the sender how much + # of a time buffer they want to offer for the client to receive the `abort` before the + # connection is reset). + + # Level 0 features ----------------------------------------------- + + bootstrap @8 :Bootstrap; # Request the peer's bootstrap interface. + call @2 :Call; # Begin a method call. + return @3 :Return; # Complete a method call. + finish @4 :Finish; # Release a returned answer / cancel a call. + + # Level 1 features ----------------------------------------------- + + resolve @5 :Resolve; # Resolve a previously-sent promise. + release @6 :Release; # Release a capability so that the remote object can be deallocated. + disembargo @13 :Disembargo; # Lift an embargo used to enforce E-order over promise resolution. + + # Level 2 features ----------------------------------------------- + + obsoleteSave @7 :AnyPointer; + # Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced + # by the `Persistent` interface defined in `persistent.capnp`. This operation was never + # implemented. + + obsoleteDelete @9 :AnyPointer; + # Obsolete way to delete a SturdyRef. This operation was never implemented. + + # Level 3 features ----------------------------------------------- + + provide @10 :Provide; # Provide a capability to a third party. + accept @11 :Accept; # Accept a capability provided by a third party. + + # Level 4 features ----------------------------------------------- + + join @12 :Join; # Directly connect to the common root of two or more proxied caps. + } +} + +# Level 0 message types ---------------------------------------------- + +struct Bootstrap { + # **(level 0)** + # + # Get the "bootstrap" interface exported by the remote vat. + # + # For level 0, 1, and 2 implementations, the "bootstrap" interface is simply the main interface + # exported by a vat. If the vat acts as a server fielding connections from clients, then the + # bootstrap interface defines the basic functionality available to a client when it connects. + # The exact interface definition obviously depends on the application. + # + # We call this a "bootstrap" because in an ideal Cap'n Proto world, bootstrap interfaces would + # never be used. In such a world, any time you connect to a new vat, you do so because you + # received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message + # you send is `Accept`, and further communications derive from there. `Bootstrap` is not used. + # + # In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would + # actually return a new Cap'n Proto capability, thus introducing you to the target system via + # level 3 RPC. Applications would receive the capability to talk to DNS in the first place as + # an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary + # connections without ever using `Bootstrap`. + # + # Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to + # require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap + # interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap + # interfaces are used to "bootstrap" from other, non-Cap'n-Proto-based means of service discovery, + # such as legacy DNS. + # + # Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those + # acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a + # `Return` indicating an exception, or should return a dummy capability with no methods. + + questionId @0 :QuestionId; + # A new question ID identifying this request, which will eventually receive a Return message + # containing the restored capability. + + deprecatedObjectId @1 :AnyPointer; + # ** DEPRECATED ** + # + # A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies + # which one to return. If this pointer is null, then the default bootstrap interface is returned. + # + # As of verison 0.5, use of this field is deprecated. If a service wants to export multiple + # bootstrap interfaces, it should instead define a single bootstrap interface that has methods + # that return each of the other interfaces. + # + # **History** + # + # In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`. + # At the time, it was thought that this would eventually serve as the way to restore SturdyRefs + # (level 2). Meanwhile, an application could offer its "main" interface on a well-known + # (non-secret) SturdyRef. + # + # Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only + # used to obtain the main interface. Since most applications had only one main interface that + # they wanted to restore, they tended to designate this with a null `objectId`. + # + # Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting + # multiple main interfaces by allowing them to be exported under string names. In this case, + # `objectId` was a Text value specifying the name. + # + # All of this proved problematic for several reasons: + # + # - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what + # machine to connect to and would be able to immediately restore a SturdyRef on connection. + # However, in practice, the ability to restore SturdyRefs is itself a capability that may + # require going through an authentication process to obtain. Thus, it makes more sense to + # define a "restorer service" as a full Cap'n Proto interface. If this restorer interface is + # offered as the vat's bootstrap interface, then this is equivalent to the old arrangement. + # + # - Overloading "Restore" for the purpose of obtaining well-known capabilities encouraged the + # practice of exporting singleton services with string names. If singleton services are desired, + # it is better to have one main interface that has methods that can be used to obtain each + # service, in order to get all the usual benefits of schemas and type checking. + # + # - Overloading "Restore" also had a security problem: Often, "main" or "well-known" + # capabilities exported by a vat are in fact not public: they are intended to be accessed only + # by clients who are capable of forming a connection to the vat. This can lead to trouble if + # the client itself has other clients and wishes to foward some `Restore` requests from those + # external clients -- it has to be very careful not to allow through `Restore` requests + # addressing the default capability. + # + # For example, consider the case of a sandboxed Sandstorm application and its supervisor. The + # application exports a default capability to its supervisor that provides access to + # functionality that only the supervisor is supposed to access. Meanwhile, though, applications + # may publish other capabilities that may be persistent, in which case the application needs + # to field `Restore` requests that could come from anywhere. These requests of course have to + # pass through the supervisor, as all communications with the outside world must. But, the + # supervisor has to be careful not to honor an external request addressing the application's + # default capability, since this capability is privileged. Unfortunately, the default + # capability cannot be given an unguessable name, because then the supervisor itself would not + # be able to address it! + # + # As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for + # use in restoring SturdyRefs. + # + # Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a + # SturdyRef, but indicated that the client would not restore the ref again in the future. This + # operation was never implemented, so it was removed entirely. If a "delete" operation is desired, + # it should exist as a method on the same interface that handles restoring SturdyRefs. However, + # the utility of such an operation is questionable. You wouldn't be able to rely on it for + # garbage collection since a client could always disappear permanently without remembering to + # delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to + # design systems such that SturdyRefs never represent "owned" pointers. + # + # For example, say a SturdyRef points to an image file hosted on some server. That image file + # should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by + # a user who can delete the image at any time. If the user deletes the image, the SturdyRef + # stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the + # existence of the image in its collection. +} + +struct Call { + # **(level 0)** + # + # Message type initiating a method call on a capability. + + questionId @0 :QuestionId; + # A number, chosen by the caller, that identifies this call in future messages. This number + # must be different from all other calls originating from the same end of the connection (but + # may overlap with question IDs originating from the opposite end). A fine strategy is to use + # sequential question IDs, but the recipient should not assume this. + # + # A question ID can be reused once both: + # - A matching Return has been received from the callee. + # - A matching Finish has been sent from the caller. + + target @1 :MessageTarget; + # The object that should receive this call. + + interfaceId @2 :UInt64; + # The type ID of the interface being called. Each capability may implement multiple interfaces. + + methodId @3 :UInt16; + # The ordinal number of the method to call within the requested interface. + + allowThirdPartyTailCall @8 :Bool = false; + # Indicates whether or not the receiver is allowed to send a `Return` containing + # `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee + # will have to proxy the return in the case of a tail call to a third-party vat. + + params @4 :Payload; + # The call parameters. `params.content` is a struct whose fields correspond to the parameters of + # the method. + + sendResultsTo :union { + # Where should the return message be sent? + + caller @5 :Void; + # Send the return message back to the caller (the usual). + + yourself @6 :Void; + # **(level 1)** + # + # Don't actually return the results to the sender. Instead, hold on to them and await + # instructions from the sender regarding what to do with them. In particular, the sender + # may subsequently send a `Return` for some other call (which the receiver had previously made + # to the sender) with `takeFromOtherQuestion` set. The results from this call are then used + # as the results of the other call. + # + # When `yourself` is used, the receiver must still send a `Return` for the call, but sets the + # field `resultsSentElsewhere` in that `Return` rather than including the results. + # + # This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up + # returning the result of a call from Vat B back to Vat A. + # + # In particular, the most common use case for this feature is when Vat A makes a call to a + # promise in Vat B, and then that promise ends up resolving to a capability back in Vat A. + # Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself` + # in the calls so that the results need not pass back through Vat B. + # + # For example: + # - Alice, in Vat A, calls foo() on Bob in Vat B. + # - Alice makes a pipelined call bar() on the promise returned by foo(). + # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next + # to Alice). + # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'(). + # Notice that bar() and bar'() are travelling in opposite directions on the same network + # link. + # - The `Call` for bar'() has `sendResultsTo` set to `yourself`. + # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results, + # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return, + # as doing so would introduce unnecessary round trip latency. + # - Vat A receives bar'() and delivers it to Carol. + # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` + # set in place of results. + # - Vat A sends a `Finish` for the bar() call to Vat B. + # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'(). + + thirdParty @7 :RecipientId; + # **(level 3)** + # + # The call's result should be returned to a different vat. The receiver (the callee) expects + # to receive an `Accept` message from the indicated vat, and should return the call's result + # to it, rather than to the sender of the `Call`. + # + # This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call` + # messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from + # Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends + # an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C + # also sends a `Return` to Vat B with `resultsSentElsewhere`. + } +} + +struct Return { + # **(level 0)** + # + # Message type sent from callee to caller indicating that the call has completed. + + answerId @0 :AnswerId; + # Equal to the QuestionId of the corresponding `Call` message. + + releaseParamCaps @1 :Bool = true; + # If true, all capabilities that were in the params should be considered released. The sender + # must not send separate `Release` messages for them. Level 0 implementations in particular + # should always set this true. This defaults true because if level 0 implementations forget to + # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget + # to set it to false they'll quickly get errors. + # + # The receiver should act as if the sender had sent a release message with count=1 for each + # CapDescriptor in the original Call message. + + union { + results @2 :Payload; + # The result. + # + # For regular method calls, `results.content` points to the result struct. + # + # For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single + # capability (rather than a struct), and `results.content` is just a capability pointer with + # index 0. A `Finish` is still required in this case. + + exception @3 :Exception; + # Indicates that the call failed and explains why. + + canceled @4 :Void; + # Indicates that the call was canceled due to the caller sending a Finish message + # before the call had completed. + + resultsSentElsewhere @5 :Void; + # This is set when returning from a `Call` that had `sendResultsTo` set to something other + # than `caller`. + # + # It doesn't matter too much when this is sent, as the receiver doesn't need to do anything + # with it, but the C++ implementation appears to wait for the call to finish before sending + # this. + + takeFromOtherQuestion @6 :QuestionId; + # The sender has also sent (before this message) a `Call` with the given question ID and with + # `sendResultsTo.yourself` set, and the results of that other call should be used as the + # results here. `takeFromOtherQuestion` can only used once per question. + + acceptFromThirdParty @7 :ThirdPartyCapId; + # **(level 3)** + # + # The caller should contact a third-party vat to pick up the results. An `Accept` message + # sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`. + # It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set. + } +} + +struct Finish { + # **(level 0)** + # + # Message type sent from the caller to the callee to indicate: + # 1) The questionId will no longer be used in any messages sent by the callee (no further + # pipelined requests). + # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing + # else cares about the result either (e.g. there are no other outstanding calls pipelined on + # the result of this one) then the callee may wish to immediately cancel the operation and + # send back a Return message with "canceled" set. However, implementations are not required + # to support premature cancellation -- instead, the implementation may wait until the call + # actually completes and send a normal `Return` message. + # + # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be + # possible and useful to notify the server that it doesn't need to keep around the response to + # service pipeline requests even though the caller still wants to receive it / hasn't yet + # finished processing it. It could also be useful to notify the server that it need not marshal + # the results because the caller doesn't want them anyway, even if the caller is still sending + # pipelined calls, although this seems less useful (just saving some bytes on the wire). + + questionId @0 :QuestionId; + # ID of the call whose result is to be released. + + releaseResultCaps @1 :Bool = true; + # If true, all capabilities that were in the results should be considered released. The sender + # must not send separate `Release` messages for them. Level 0 implementations in particular + # should always set this true. This defaults true because if level 0 implementations forget to + # set it they'll never notice (just silently leak caps), but if level >=1 implementations forget + # set it false they'll quickly get errors. +} + +# Level 1 message types ---------------------------------------------- + +struct Resolve { + # **(level 1)** + # + # Message type sent to indicate that a previously-sent promise has now been resolved to some other + # object (possibly another promise) -- or broken, or canceled. + # + # Keep in mind that it's possible for a `Resolve` to be sent to a level 0 implementation that + # doesn't implement it. For example, a method call or return might contain a capability in the + # payload. Normally this is fine even if the receiver is level 0, because they will implicitly + # release all such capabilities on return / finish. But if the cap happens to be a promise, then + # a follow-up `Resolve` may be sent regardless of this release. The level 0 receiver will reply + # with an `unimplemented` message, and the sender (of the `Resolve`) can respond to this as if the + # receiver had immediately released any capability to which the promise resolved. + # + # When implementing promise resolution, it's important to understand how embargos work and the + # tricky case of the Tribble 4-way race condition. See the comments for the Disembargo message, + # below. + + promiseId @0 :ExportId; + # The ID of the promise to be resolved. + # + # Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does + # _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver + # will release the export soon after receiving `Resolve`, and the sender will not send this + # `ExportId` again until it has been released and recycled. + # + # When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise, + # this indicates that the sender will follow up at some point with a `Resolve` message. If the + # same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the + # same ID is sent again later _after_ a `Resolve`, it can only be because the export's + # reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore + # this later promise does _not_ correspond to the earlier `Resolve`. + # + # If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve` + # message may or may not still be sent (the `Resolve` may have already been in-flight when + # `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer + # any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which + # the receiver has no knowledge, because it already released it earlier. In this case, the + # receiver should simply release the capability to which the promise resolved. + + union { + cap @1 :CapDescriptor; + # The object to which the promise resolved. + # + # The sender promises that from this point forth, until `promiseId` is released, it shall + # simply forward all messages to the capability designated by `cap`. This is true even if + # `cap` itself happens to designate another promise, and that other promise later resolves -- + # messages sent to `promiseId` shall still go to that other promise, not to its resolution. + # This is important in the case that the receiver of the `Resolve` ends up sending a + # `Disembargo` message towards `promiseId` in order to control message ordering -- that + # `Disembargo` really needs to reflect back to exactly the object designated by `cap` even + # if that object is itself a promise. + + exception @2 :Exception; + # Indicates that the promise was broken. + } +} + +struct Release { + # **(level 1)** + # + # Message type sent to indicate that the sender is done with the given capability and the receiver + # can free resources allocated to it. + + id @0 :ImportId; + # What to release. + + referenceCount @1 :UInt32; + # The amount by which to decrement the reference count. The export is only actually released + # when the reference count reaches zero. +} + +struct Disembargo { + # **(level 1)** + # + # Message sent to indicate that an embargo on a recently-resolved promise may now be lifted. + # + # Embargos are used to enforce E-order in the presence of promise resolution. That is, if an + # application makes two calls foo() and bar() on the same capability reference, in that order, + # the calls should be delivered in the order in which they were made. But if foo() is called + # on a promise, and that promise happens to resolve before bar() is called, then the two calls + # may travel different paths over the network, and thus could arrive in the wrong order. In + # this case, the call to `bar()` must be embargoed, and a `Disembargo` message must be sent along + # the same path as `foo()` to ensure that the `Disembargo` arrives after `foo()`. Once the + # `Disembargo` arrives, `bar()` can then be delivered. + # + # There are two particular cases where embargos are important. Consider object Alice, in Vat A, + # who holds a promise P, pointing towards Vat B, that eventually resolves to Carol. The two + # cases are: + # - Carol lives in Vat A, i.e. next to Alice. In this case, Vat A needs to send a `Disembargo` + # message that echos through Vat B and back, to ensure that all pipelined calls on the promise + # have been delivered. + # - Carol lives in a different Vat C. When the promise resolves, a three-party handoff occurs + # (see `Provide` and `Accept`, which constitute level 3 of the protocol). In this case, we + # piggyback on the state that has already been set up to handle the handoff: the `Accept` + # message (from Vat A to Vat C) is embargoed, as are all pipelined messages sent to it, while + # a `Disembargo` message is sent from Vat A through Vat B to Vat C. See `Accept.embargo` for + # an example. + # + # Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise + # already pointed at), no embargo is needed, because the pipelined calls are delivered over the + # same path as the later direct calls. + # + # Keep in mind that promise resolution happens both in the form of Resolve messages as well as + # Return messages (which resolve PromisedAnswers). Embargos apply in both cases. + # + # An alternative strategy for enforcing E-order over promise resolution could be for Vat A to + # implement the embargo internally. When Vat A is notified of promise resolution, it could + # send a dummy no-op call to promise P and wait for it to complete. Until that call completes, + # all calls to the capability are queued locally. This strategy works, but is pessimistic: + # in the three-party case, it requires an A -> B -> C -> B -> A round trip before calls can start + # being delivered directly to from Vat A to Vat C. The `Disembargo` message allows latency to be + # reduced. (In the two-party loopback case, the `Disembargo` message is just a more explicit way + # of accomplishing the same thing as a no-op call, but isn't any faster.) + # + # *The Tribble 4-way Race Condition* + # + # Any implementation of promise resolution and embargos must be aware of what we call the + # "Tribble 4-way race condition", after Dean Tribble, who explained the problem in a lively + # Friam meeting. + # + # Embargos are designed to work in the case where a two-hop path is being shortened to one hop. + # But sometimes there are more hops. Imagine that Alice has a reference to a remote promise P1 + # that eventually resolves to _another_ remote promise P2 (in a third vat), which _at the same + # time_ happens to resolve to Bob (in a fourth vat). In this case, we're shortening from a 3-hop + # path (with four parties) to a 1-hop path (Alice -> Bob). + # + # Extending the embargo/disembargo protocol to be able to shorted multiple hops at once seems + # difficult. Instead, we make a rule that prevents this case from coming up: + # + # One a promise P has been resolved to a remote object reference R, then all further messages + # received addressed to P will be forwarded strictly to R. Even if it turns out later that R is + # itself a promise, and has resolved to some other object Q, messages sent to P will still be + # forwarded to R, not directly to Q (R will of course further forward the messages to Q). + # + # This rule does not cause a significant performance burden because once P has resolved to R, it + # is expected that people sending messages to P will shortly start sending them to R instead and + # drop P. P is at end-of-life anyway, so it doesn't matter if it ignores chances to further + # optimize its path. + + target @0 :MessageTarget; + # What is to be disembargoed. + + using EmbargoId = UInt32; + # Used in `senderLoopback` and `receiverLoopback`, below. + + context :union { + senderLoopback @1 :EmbargoId; + # The sender is requesting a disembargo on a promise that is known to resolve back to a + # capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls + # on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback` + # set to the same value as `senderLoopback`. This value is chosen by the sender, and since + # it is also consumed be the sender, the sender can use whatever strategy it wants to make sure + # the value is unambiguous. + # + # The receiver must verify that the target capability actually resolves back to the sender's + # vat. Otherwise, the sender has committed a protocol error and should be disconnected. + + receiverLoopback @2 :EmbargoId; + # The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to + # this capability, and that Disembargo is now being echoed back. + + accept @3 :Void; + # **(level 3)** + # + # The sender is requesting a disembargo on a promise that is known to resolve to a third-party + # capability that the sender is currently in the process of accepting (using `Accept`). + # The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The + # receiver should now send a `Disembargo` with `provide` set to the question ID of that + # `Provide` message. + # + # See `Accept.embargo` for an example. + + provide @4 :QuestionId; + # **(level 3)** + # + # The sender is requesting a disembargo on a capability currently being provided to a third + # party. The question ID identifies the `Provide` message previously sent by the sender to + # this capability. On receipt, the receiver (the capability host) shall release the embargo + # on the `Accept` message that it has received from the third party. See `Accept.embargo` for + # an example. + } +} + +# Level 2 message types ---------------------------------------------- + +# See persistent.capnp. + +# Level 3 message types ---------------------------------------------- + +struct Provide { + # **(level 3)** + # + # Message type sent to indicate that the sender wishes to make a particular capability implemented + # by the receiver available to a third party for direct access (without the need for the third + # party to proxy through the sender). + # + # (In CapTP, `Provide` and `Accept` are methods of the global `NonceLocator` object exported by + # every vat. In Cap'n Proto, we bake this into the core protocol.) + + questionId @0 :QuestionId; + # Question ID to be held open until the recipient has received the capability. A result will be + # returned once the third party has successfully received the capability. The sender must at some + # point send a `Finish` message as with any other call, and that message can be used to cancel the + # whole operation. + + target @1 :MessageTarget; + # What is to be provided to the third party. + + recipient @2 :RecipientId; + # Identity of the third party that is expected to pick up the capability. +} + +struct Accept { + # **(level 3)** + # + # Message type sent to pick up a capability hosted by the receiving vat and provided by a third + # party. The third party previously designated the capability using `Provide`. + # + # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`. + + questionId @0 :QuestionId; + # A new question ID identifying this accept message, which will eventually receive a Return + # message containing the provided capability (or the call result in the case of a redirected + # return). + + provision @1 :ProvisionId; + # Identifies the provided object to be picked up. + + embargo @2 :Bool; + # If true, this accept shall be temporarily embargoed. The resulting `Return` will not be sent, + # and any pipelined calls will not be delivered, until the embargo is released. The receiver + # (the capability host) will expect the provider (the vat that sent the `Provide` message) to + # eventually send a `Disembargo` message with the field `context.provide` set to the question ID + # of the original `Provide` message. At that point, the embargo is released and the queued + # messages are delivered. + # + # For example: + # - Alice, in Vat A, holds a promise P, which currently points toward Vat B. + # - Alice calls foo() on P. The `Call` message is sent to Vat B. + # - The promise P in Vat B ends up resolving to Carol, in Vat C. + # - Vat B sends a `Provide` message to Vat C, identifying Vat A as the recipient. + # - Vat B sends a `Resolve` message to Vat A, indicating that the promise has resolved to a + # `ThirdPartyCapId` identifying Carol in Vat C. + # - Vat A sends an `Accept` message to Vat C to pick up the capability. Since Vat A knows that + # it has an outstanding call to the promise, it sets `embargo` to `true` in the `Accept` + # message. + # - Vat A sends a `Disembargo` message to Vat B on promise P, with `context.accept` set. + # - Alice makes a call bar() to promise P, which is now pointing towards Vat C. Alice doesn't + # know anything about the mechanics of promise resolution happening under the hood, but she + # expects that bar() will be delivered after foo() because that is the order in which she + # initiated the calls. + # - Vat A sends the bar() call to Vat C, as a pipelined call on the result of the `Accept` (which + # hasn't returned yet, due to the embargo). Since calls to the newly-accepted capability + # are embargoed, Vat C does not deliver the call yet. + # - At some point, Vat B forwards the foo() call from the beginning of this example on to Vat C. + # - Vat B forwards the `Disembargo` from Vat A on to vat C. It sets `context.provide` to the + # question ID of the `Provide` message it had sent previously. + # - Vat C receives foo() before `Disembargo`, thus allowing it to correctly deliver foo() + # before delivering bar(). + # - Vat C receives `Disembargo` from Vat B. It can now send a `Return` for the `Accept` from + # Vat A, as well as deliver bar(). +} + +# Level 4 message types ---------------------------------------------- + +struct Join { + # **(level 4)** + # + # Message type sent to implement E.join(), which, given a number of capabilities that are + # expected to be equivalent, finds the underlying object upon which they all agree and forms a + # direct connection to it, skipping any proxies that may have been constructed by other vats + # while transmitting the capability. See: + # http://erights.org/elib/equality/index.html + # + # Note that this should only serve to bypass fully-transparent proxies -- proxies that were + # created merely for convenience, without any intention of hiding the underlying object. + # + # For example, say Bob holds two capabilities hosted by Alice and Carol, but he expects that both + # are simply proxies for a capability hosted elsewhere. He then issues a join request, which + # operates as follows: + # - Bob issues Join requests on both Alice and Carol. Each request contains a different piece + # of the JoinKey. + # - Alice is proxying a capability hosted by Dana, so forwards the request to Dana's cap. + # - Dana receives the first request and sees that the JoinKeyPart is one of two. She notes that + # she doesn't have the other part yet, so she records the request and responds with a + # JoinResult. + # - Alice relays the JoinAnswer back to Bob. + # - Carol is also proxying a capability from Dana, and so forwards her Join request to Dana as + # well. + # - Dana receives Carol's request and notes that she now has both parts of a JoinKey. She + # combines them in order to form information needed to form a secure connection to Bob. She + # also responds with another JoinResult. + # - Bob receives the responses from Alice and Carol. He uses the returned JoinResults to + # determine how to connect to Dana and attempts to form the connection. Since Bob and Dana now + # agree on a secret key that neither Alice nor Carol ever saw, this connection can be made + # securely even if Alice or Carol is conspiring against the other. (If Alice and Carol are + # conspiring _together_, they can obviously reproduce the key, but this doesn't matter because + # the whole point of the join is to verify that Alice and Carol agree on what capability they + # are proxying.) + # + # If the two capabilities aren't actually proxies of the same object, then the join requests + # will come back with conflicting `hostId`s and the join will fail before attempting to form any + # connection. + + questionId @0 :QuestionId; + # Question ID used to respond to this Join. (Note that this ID only identifies one part of the + # request for one hop; each part has a different ID and relayed copies of the request have + # (probably) different IDs still.) + # + # The receiver will reply with a `Return` whose `results` is a JoinResult. This `JoinResult` + # is relayed from the joined object's host, possibly with transformation applied as needed + # by the network. + # + # Like any return, the result must be released using a `Finish`. However, this release + # should not occur until the joiner has either successfully connected to the joined object. + # Vats relaying a `Join` message similarly must not release the result they receive until the + # return they relayed back towards the joiner has itself been released. This allows the + # joined object's host to detect when the Join operation is canceled before completing -- if + # it receives a `Finish` for one of the join results before the joiner successfully + # connects. It can then free any resources it had allocated as part of the join. + + target @1 :MessageTarget; + # The capability to join. + + keyPart @2 :JoinKeyPart; + # A part of the join key. These combine to form the complete join key, which is used to establish + # a direct connection. + + # TODO(before implementing): Change this so that multiple parts can be sent in a single Join + # message, so that if multiple join parts are going to cross the same connection they can be sent + # together, so that the receive can potentially optimize its handling of them. In the case where + # all parts are bundled together, should the recipient be expected to simply return a cap, so + # that the caller can immediately start pipelining to it? +} + +# ======================================================================================== +# Common structures used in messages + +struct MessageTarget { + # The target of a `Call` or other messages that target a capability. + + union { + importedCap @0 :ImportId; + # This message is to a capability or promise previously imported by the caller (exported by + # the receiver). + + promisedAnswer @1 :PromisedAnswer; + # This message is to a capability that is expected to be returned by another call that has not + # yet been completed. + # + # At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so + # that initial startup doesn't require a round trip. + } +} + +struct Payload { + # Represents some data structure that might contain capabilities. + + content @0 :AnyPointer; + # Some Cap'n Proto data structure. Capability pointers embedded in this structure index into + # `capTable`. + + capTable @1 :List(CapDescriptor); + # Descriptors corresponding to the cap pointers in `content`. +} + +struct CapDescriptor { + # **(level 1)** + # + # When an application-defined type contains an interface pointer, that pointer contains an index + # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each + # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal + # the CapDescriptor directly to the application, but should instead wrap it in some kind of + # callable object with methods corresponding to the interface that the capability implements. + # + # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the + # description of `ExportId`. + # + # Note that it is currently not possible to include a broken capability in the CapDescriptor + # table. Instead, create a new export (`senderPromise`) for each broken capability and then + # immediately follow the payload-bearing Call or Return message with one Resolve message for each + # broken capability, resolving it to an exception. + + union { + none @0 :Void; + # There is no capability here. This `CapDescriptor` should not appear in the payload content. + # A `none` CapDescriptor can be generated when an application inserts a capability into a + # message and then later changes its mind and removes it -- rewriting all of the other + # capability pointers may be hard, so instead a tombstone is left, similar to the way a removed + # struct or list instance is zeroed out of the message but the space is not reclaimed. + # Hopefully this is unusual. + + senderHosted @1 :ExportId; + # The ID of a capability in the sender's export table (receiver's import table). It may be a + # newly allocated table entry, or an existing entry (increments the reference count). + + senderPromise @2 :ExportId; + # A promise that the sender will resolve later. The sender will send exactly one Resolve + # message at a future point in time to replace this promise. Note that even if the same + # `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of + # them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this + # `CapDescriptor`) may choose not to send the `Resolve` at all. + + receiverHosted @3 :ImportId; + # A capability (or promise) previously exported by the receiver (imported by the sender). + + receiverAnswer @4 :PromisedAnswer; + # A capability expected to be returned in the results of a currently-outstanding call posed + # by the sender. + + thirdPartyHosted @5 :ThirdPartyCapDescriptor; + # **(level 3)** + # + # A capability that lives in neither the sender's nor the receiver's vat. The sender needs + # to form a direct connection to a third party to pick up the capability. + # + # Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its + # `vine` instead. + } + + attachedFd @6 :UInt8 = 0xff; + # If the RPC message in which this CapDescriptor was delivered also had file descriptors + # attached, and `fd` is a valid index into the list of attached file descriptors, then + # that file descriptor should be attached to this capability. If `attachedFd` is out-of-bounds + # for said list, then no FD is attached. + # + # For example, if the RPC message arrived over a Unix socket, then file descriptors may be + # attached by sending an SCM_RIGHTS ancillary message attached to the data bytes making up the + # raw message. Receivers who wish to opt into FD passing should arrange to receive SCM_RIGHTS + # whenever receiving an RPC message. Senders who wish to send FDs need not verify whether the + # receiver knows how to receive them, because the operating system will automatically discard + # ancillary messages like SCM_RIGHTS if the receiver doesn't ask to receive them, including + # automatically closing any FDs. + # + # It is up to the application protocol to define what capabilities are expected to have file + # descriptors attached, and what those FDs mean. But, for example, an application could use this + # to open a file on disk and then transmit the open file descriptor to a sandboxed process that + # does not otherwise have permission to access the filesystem directly. This is usually an + # optimization: the sending process could instead provide an RPC interface supporting all the + # operations needed (such as reading and writing a file), but by passing the file descriptor + # directly, the recipient can often perform operations much more efficiently. Application + # designers are encouraged to provide such RPC interfaces and automatically fall back to them + # when FD passing is not available, so that the application can still work when the parties are + # remote over a network. + # + # An attached FD is most often associated with a `senderHosted` descriptor. It could also make + # sense in the case of `thirdPartyHosted`: in this case, the sender is forwarding the FD that + # they received from the third party, so that the receiver can start using it without first + # interacting with the third party. This is an optional optimization -- the middleman may choose + # not to forward capabilities, in which case the receiver will need to complete the handshake + # with the third party directly before receiving the FD. If an implementation receives a second + # attached FD after having already received one previously (e.g. both in a `thirdPartyHosted` + # CapDescriptor and then later again when receiving the final capability directly from the + # third party), the implementation should discard the later FD and stick with the original. At + # present, there is no known reason why other capability types (e.g. `receiverHosted`) would want + # to carry an attached FD, but we reserve the right to define a meaning for this in the future. + # + # Each file descriptor attached to the message must be used in no more than one CapDescriptor, + # so that the receiver does not need to use dup() or refcounting to handle the possibility of + # multiple capabilities using the same descriptor. If multiple CapDescriptors do point to the + # same FD index, then the receiver can arbitrarily choose which capability ends up having the + # FD attached. + # + # To mitigate DoS attacks, RPC implementations should limit the number of FDs they are willing to + # receive in a single message to a small value. If a message happens to contain more than that, + # the list is truncated. Moreover, in some cases, FD passing needs to be blocked entirely for + # security or implementation reasons, in which case the list may be truncated to zero. Hence, + # `attachedFd` might point past the end of the list, which the implementation should treat as if + # no FD was attached at all. + # + # The type of this field was chosen to be UInt8 because Linux supports sending only a maximum + # of 253 file descriptors in an SCM_RIGHTS message anyway, and CapDescriptor had two bytes of + # padding left -- so after adding this, there is still one byte for a future feature. + # Conveniently, this also means we're able to use 0xff as the default value, which will always + # be out-of-range (of course, the implementation should explicitly enforce that 255 descriptors + # cannot be sent at once, rather than relying on Linux to do so). +} + +struct PromisedAnswer { + # **(mostly level 1)** + # + # Specifies how to derive a promise from an unanswered question, by specifying the path of fields + # to follow from the root of the eventual result struct to get to the desired capability. Used + # to address method calls to a not-yet-returned capability or to pass such a capability as an + # input to some other method call. + # + # Level 0 implementations must support `PromisedAnswer` only for the case where the answer is + # to a `Bootstrap` message. In this case, `path` is always empty since `Bootstrap` always returns + # a raw capability. + + questionId @0 :QuestionId; + # ID of the question (in the sender's question table / receiver's answer table) whose answer is + # expected to contain the capability. + + transform @1 :List(Op); + # Operations / transformations to apply to the result in order to get the capability actually + # being addressed. E.g. if the result is a struct and you want to call a method on a capability + # pointed to by a field of the struct, you need a `getPointerField` op. + + struct Op { + union { + noop @0 :Void; + # Does nothing. This member is mostly defined so that we can make `Op` a union even + # though (as of this writing) only one real operation is defined. + + getPointerField @1 :UInt16; + # Get a pointer field within a struct. The number is an index into the pointer section, NOT + # a field ordinal, so that the receiver does not need to understand the schema. + + # TODO(someday): We could add: + # - For lists, the ability to address every member of the list, or a slice of the list, the + # result of which would be another list. This is useful for implementing the equivalent of + # a SQL table join (not to be confused with the `Join` message type). + # - Maybe some ability to test a union. + # - Probably not a good idea: the ability to specify an arbitrary script to run on the + # result. We could define a little stack-based language where `Op` specifies one + # "instruction" or transformation to apply. Although this is not a good idea + # (over-engineered), any narrower additions to `Op` should be designed as if this + # were the eventual goal. + } + } +} + +struct ThirdPartyCapDescriptor { + # **(level 3)** + # + # Identifies a capability in a third-party vat that the sender wants the receiver to pick up. + + id @0 :ThirdPartyCapId; + # Identifies the third-party host and the specific capability to accept from it. + + vineId @1 :ExportId; + # A proxy for the third-party object exported by the sender. In CapTP terminology this is called + # a "vine", because it is an indirect reference to the third-party object that snakes through the + # sender vat. This serves two purposes: + # + # * Level 1 and 2 implementations that don't understand how to connect to a third party may + # simply send calls to the vine. Such calls will be forwarded to the third-party by the + # sender. + # + # * Level 3 implementations must release the vine only once they have successfully picked up the + # object from the third party. This ensures that the capability is not released by the sender + # prematurely. + # + # The sender will close the `Provide` request that it has sent to the third party as soon as + # it receives either a `Call` or a `Release` message directed at the vine. +} + +struct Exception { + # **(level 0)** + # + # Describes an arbitrary error that prevented an operation (e.g. a call) from completing. + # + # Cap'n Proto exceptions always indicate that something went wrong. In other words, in a fantasy + # world where everything always works as expected, no exceptions would ever be thrown. Clients + # should only ever catch exceptions as a means to implement fault-tolerance, where "fault" can + # mean: + # - Bugs. + # - Invalid input. + # - Configuration errors. + # - Network problems. + # - Insufficient resources. + # - Version skew (unimplemented functionality). + # - Other logistical problems. + # + # Exceptions should NOT be used to flag application-specific conditions that a client is expected + # to handle in an application-specific way. Put another way, in the Cap'n Proto world, + # "checked exceptions" (where an interface explicitly defines the exceptions it throws and + # clients are forced by the type system to handle those exceptions) do NOT make sense. + + reason @0 :Text; + # Human-readable failure description. + + type @3 :Type; + # The type of the error. The purpose of this enum is not to describe the error itself, but + # rather to describe how the client might want to respond to the error. + + enum Type { + failed @0; + # A generic problem occurred, and it is believed that if the operation were repeated without + # any change in the state of the world, the problem would occur again. + # + # A client might respond to this error by logging it for investigation by the developer and/or + # displaying it to the user. + + overloaded @1; + # The request was rejected due to a temporary lack of resources. + # + # Examples include: + # - There's not enough CPU time to keep up with incoming requests, so some are rejected. + # - The server ran out of RAM or disk space during the request. + # - The operation timed out (took significantly longer than it should have). + # + # A client might respond to this error by scheduling to retry the operation much later. The + # client should NOT retry again immediately since this would likely exacerbate the problem. + + disconnected @2; + # The method failed because a connection to some necessary capability was lost. + # + # Examples include: + # - The client introduced the server to a third-party capability, the connection to that third + # party was subsequently lost, and then the client requested that the server use the dead + # capability for something. + # - The client previously requested that the server obtain a capability from some third party. + # The server returned a capability to an object wrapping the third-party capability. Later, + # the server's connection to the third party was lost. + # - The capability has been revoked. Revocation does not necessarily mean that the client is + # no longer authorized to use the capability; it is often used simply as a way to force the + # client to repeat the setup process, perhaps to efficiently move them to a new back-end or + # get them to recognize some other change that has occurred. + # + # A client should normally respond to this error by releasing all capabilities it is currently + # holding related to the one it called and then re-creating them by restoring SturdyRefs and/or + # repeating the method calls used to create them originally. In other words, disconnect and + # start over. This should in turn cause the server to obtain a new copy of the capability that + # it lost, thus making everything work. + # + # If the client receives another `disconnected` error in the process of rebuilding the + # capability and retrying the call, it should treat this as an `overloaded` error: the network + # is currently unreliable, possibly due to load or other temporary issues. + + unimplemented @3; + # The server doesn't implement the requested method. If there is some other method that the + # client could call (perhaps an older and/or slower interface), it should try that instead. + # Otherwise, this should be treated like `failed`. + } + + obsoleteIsCallersFault @1 :Bool; + # OBSOLETE. Ignore. + + obsoleteDurability @2 :UInt16; + # OBSOLETE. See `type` instead. +} + +# ======================================================================================== +# Network-specific Parameters +# +# Some parts of the Cap'n Proto RPC protocol are not specified here because different vat networks +# may wish to use different approaches to solving them. For example, on the public internet, you +# may want to authenticate vats using public-key cryptography, but on a local intranet with trusted +# infrastructure, you may be happy to authenticate based on network address only, or some other +# lightweight mechanism. +# +# To accommodate this, we specify several "parameter" types. Each type is defined here as an +# alias for `AnyPointer`, but a specific network will want to define a specific set of types to use. +# All vats in a vat network must agree on these parameters in order to be able to communicate. +# Inter-network communication can be accomplished through "gateways" that perform translation +# between the primitives used on each network; these gateways may need to be deeply stateful, +# depending on the translations they perform. +# +# For interaction over the global internet between parties with no other prior arrangement, a +# particular set of bindings for these types is defined elsewhere. (TODO(someday): Specify where +# these common definitions live.) +# +# Another common network type is the two-party network, in which one of the parties typically +# interacts with the outside world entirely through the other party. In such a connection between +# Alice and Bob, all objects that exist on Bob's other networks appear to Alice as if they were +# hosted by Bob himself, and similarly all objects on Alice's network (if she even has one) appear +# to Bob as if they were hosted by Alice. This network type is interesting because from the point +# of view of a simple application that communicates with only one other party via the two-party +# protocol, there are no three-party interactions at all, and joins are unusually simple to +# implement, so implementing at level 4 is barely more complicated than implementing at level 1. +# Moreover, if you pair an app implementing the two-party network with a container that implements +# some other network, the app can then participate on the container's network just as if it +# implemented that network directly. The types used by the two-party network are defined in +# `rpc-twoparty.capnp`. +# +# The things that we need to parameterize are: +# - How to store capabilities long-term without holding a connection open (mostly level 2). +# - How to authenticate vats in three-party introductions (level 3). +# - How to implement `Join` (level 4). +# +# Persistent references +# --------------------- +# +# **(mostly level 2)** +# +# We want to allow some capabilities to be stored long-term, even if a connection is lost and later +# recreated. ExportId is a short-term identifier that is specific to a connection, so it doesn't +# help here. We need a way to specify long-term identifiers, as well as a strategy for +# reconnecting to a referenced capability later. +# +# Three-party interactions +# ------------------------ +# +# **(level 3)** +# +# In cases where more than two vats are interacting, we have situations where VatA holds a +# capability hosted by VatB and wants to send that capability to VatC. This can be accomplished +# by VatA proxying requests on the new capability, but doing so has two big problems: +# - It's inefficient, requiring an extra network hop. +# - If VatC receives another capability to the same object from VatD, it is difficult for VatC to +# detect that the two capabilities are really the same and to implement the E "join" operation, +# which is necessary for certain four-or-more-party interactions, such as the escrow pattern. +# See: http://www.erights.org/elib/equality/grant-matcher/index.html +# +# Instead, we want a way for VatC to form a direct, authenticated connection to VatB. +# +# Join +# ---- +# +# **(level 4)** +# +# The `Join` message type and corresponding operation arranges for a direct connection to be formed +# between the joiner and the host of the joined object, and this connection must be authenticated. +# Thus, the details are network-dependent. + +using SturdyRef = AnyPointer; +# **(level 2)** +# +# Identifies a persisted capability that can be restored in the future. How exactly a SturdyRef +# is restored to a live object is specified along with the SturdyRef definition (i.e. not by +# rpc.capnp). +# +# Generally a SturdyRef needs to specify three things: +# - How to reach the vat that can restore the ref (e.g. a hostname or IP address). +# - How to authenticate the vat after connecting (e.g. a public key fingerprint). +# - The identity of a specific object hosted by the vat. Generally, this is an opaque pointer whose +# format is defined by the specific vat -- the client has no need to inspect the object ID. +# It is important that the object ID be unguessable if the object is not public (and objects +# should almost never be public). +# +# The above are only suggestions. Some networks might work differently. For example, a private +# network might employ a special restorer service whose sole purpose is to restore SturdyRefs. +# In this case, the entire contents of SturdyRef might be opaque, because they are intended only +# to be forwarded to the restorer service. + +using ProvisionId = AnyPointer; +# **(level 3)** +# +# The information that must be sent in an `Accept` message to identify the object being accepted. +# +# In a network where each vat has a public/private key pair, this could simply be the public key +# fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used +# in the `Provide` message sent from that provider. + +using RecipientId = AnyPointer; +# **(level 3)** +# +# The information that must be sent in a `Provide` message to identify the recipient of the +# capability. +# +# In a network where each vat has a public/private key pair, this could simply be the public key +# fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`. +# +# As another example, when communicating between processes on the same machine over Unix sockets, +# RecipientId could simply refer to a file descriptor attached to the message via SCM_RIGHTS. +# This file descriptor would be one end of a newly-created socketpair, with the other end having +# been sent to the capability's recipient in ThirdPartyCapId. + +using ThirdPartyCapId = AnyPointer; +# **(level 3)** +# +# The information needed to connect to a third party and accept a capability from it. +# +# In a network where each vat has a public/private key pair, this could be a combination of the +# third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP +# address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent +# to that third party (used to identify which capability to pick up). +# +# As another example, when communicating between processes on the same machine over Unix sockets, +# ThirdPartyCapId could simply refer to a file descriptor attached to the message via SCM_RIGHTS. +# This file descriptor would be one end of a newly-created socketpair, with the other end having +# been sent to the process hosting the capability in RecipientId. + +using JoinKeyPart = AnyPointer; +# **(level 4)** +# +# A piece of a secret key. One piece is sent along each path that is expected to lead to the same +# place. Once the pieces are combined, a direct connection may be formed between the sender and +# the receiver, bypassing any men-in-the-middle along the paths. See the `Join` message type. +# +# The motivation for Joins is discussed under "Supporting Equality" in the "Unibus" protocol +# sketch: http://www.erights.org/elib/distrib/captp/unibus.html +# +# In a network where each vat has a public/private key pair and each vat forms no more than one +# connection to each other vat, Joins will rarely -- perhaps never -- be needed, as objects never +# need to be transparently proxied and references to the same object sent over the same connection +# have the same export ID. Thus, a successful join requires only checking that the two objects +# come from the same connection and have the same ID, and then completes immediately. +# +# However, in networks where two vats may form more than one connection between each other, or +# where proxying of objects occurs, joins are necessary. +# +# Typically, each JoinKeyPart would include a fixed-length data value such that all value parts +# XOR'd together forms a shared secret that can be used to form an encrypted connection between +# the joiner and the joined object's host. Each JoinKeyPart should also include an indication of +# how many parts to expect and a hash of the shared secret (used to match up parts). + +using JoinResult = AnyPointer; +# **(level 4)** +# +# Information returned as the result to a `Join` message, needed by the joiner in order to form a +# direct connection to a joined object. This might simply be the address of the joined object's +# host vat, since the `JoinKey` has already been communicated so the two vats already have a shared +# secret to use to authenticate each other. +# +# The `JoinResult` should also contain information that can be used to detect when the Join +# requests ended up reaching different objects, so that this situation can be detected easily. +# This could be a simple matter of including a sequence number -- if the joiner receives two +# `JoinResult`s with sequence number 0, then they must have come from different objects and the +# whole join is a failure. + +# ======================================================================================== +# Network interface sketch +# +# The interfaces below are meant to be pseudo-code to illustrate how the details of a particular +# vat network might be abstracted away. They are written like Cap'n Proto interfaces, but in +# practice you'd probably define these interfaces manually in the target programming language. A +# Cap'n Proto RPC implementation should be able to use these interfaces without knowing the +# definitions of the various network-specific parameters defined above. + +# interface VatNetwork { +# # Represents a vat network, with the ability to connect to particular vats and receive +# # connections from vats. +# # +# # Note that methods returning a `Connection` may return a pre-existing `Connection`, and the +# # caller is expected to find and share state with existing users of the connection. +# +# # Level 0 features ----------------------------------------------- +# +# connect(vatId :VatId) :Connection; +# # Connect to the given vat. The transport should return a promise that does not +# # resolve until authentication has completed, but allows messages to be pipelined in before +# # that; the transport either queues these messages until authenticated, or sends them encrypted +# # such that only the authentic vat would be able to decrypt them. The latter approach avoids a +# # round trip for authentication. +# +# accept() :Connection; +# # Wait for the next incoming connection and return it. Only connections formed by +# # connect() are returned by this method. +# +# # Level 4 features ----------------------------------------------- +# +# newJoiner(count :UInt32) :NewJoinerResponse; +# # Prepare a new Join operation, which will eventually lead to forming a new direct connection +# # to the host of the joined capability. `count` is the number of capabilities to join. +# +# struct NewJoinerResponse { +# joinKeyParts :List(JoinKeyPart); +# # Key parts to send in Join messages to each capability. +# +# joiner :Joiner; +# # Used to establish the final connection. +# } +# +# interface Joiner { +# addJoinResult(result :JoinResult) :Void; +# # Add a JoinResult received in response to one of the `Join` messages. All `JoinResult`s +# # returned from all paths must be added before trying to connect. +# +# connect() :ConnectionAndProvisionId; +# # Try to form a connection to the joined capability's host, verifying that it has received +# # all of the JoinKeyParts. Once the connection is formed, the caller should send an `Accept` +# # message on it with the specified `ProvisionId` in order to receive the final capability. +# } +# +# acceptConnectionFromJoiner(parts :List(JoinKeyPart), paths :List(VatPath)) +# :ConnectionAndProvisionId; +# # Called on a joined capability's host to receive the connection from the joiner, once all +# # key parts have arrived. The caller should expect to receive an `Accept` message over the +# # connection with the given ProvisionId. +# } +# +# interface Connection { +# # Level 0 features ----------------------------------------------- +# +# send(message :Message) :Void; +# # Send the message. Returns successfully when the message (and all preceding messages) has +# # been acknowledged by the recipient. +# +# receive() :Message; +# # Receive the next message, and acknowledges receipt to the sender. Messages are received in +# # the order in which they are sent. +# +# # Level 3 features ----------------------------------------------- +# +# introduceTo(recipient :Connection) :IntroductionInfo; +# # Call before starting a three-way introduction, assuming a `Provide` message is to be sent on +# # this connection and a `ThirdPartyCapId` is to be sent to `recipient`. +# +# struct IntroductionInfo { +# sendToRecipient :ThirdPartyCapId; +# sendToTarget :RecipientId; +# } +# +# connectToIntroduced(capId :ThirdPartyCapId) :ConnectionAndProvisionId; +# # Given a ThirdPartyCapId received over this connection, connect to the third party. The +# # caller should then send an `Accept` message over the new connection. +# +# acceptIntroducedConnection(recipientId :RecipientId) :Connection; +# # Given a RecipientId received in a `Provide` message on this `Connection`, wait for the +# # recipient to connect, and return the connection formed. Usually, the first message received +# # on the new connection will be an `Accept` message. +# } +# +# struct ConnectionAndProvisionId { +# # **(level 3)** +# +# connection :Connection; +# # Connection on which to issue `Accept` message. +# +# provision :ProvisionId; +# # `ProvisionId` to send in the `Accept` message. +# } diff --git a/runtime/src/test/java/org/capnproto/CapabilityTest.java b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java similarity index 98% rename from runtime/src/test/java/org/capnproto/CapabilityTest.java rename to runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java index cdfb2bb6..bb732bec 100644 --- a/runtime/src/test/java/org/capnproto/CapabilityTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java @@ -1,3 +1,5 @@ +package org.capnproto; + // Copyright (c) 2018 Sandstorm Development Group, Inc. and contributors // Licensed under the MIT License: // @@ -19,8 +21,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package org.capnproto; - +import org.capnproto.AnyPointer; +import org.capnproto.CallContext; +import org.capnproto.Capability; +import org.capnproto.RpcException; import org.capnproto.test.Test; import org.junit.Assert; diff --git a/runtime/src/test/java/org/capnproto/RpcStateTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java similarity index 98% rename from runtime/src/test/java/org/capnproto/RpcStateTest.java rename to runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java index 173bdc4a..35636d13 100644 --- a/runtime/src/test/java/org/capnproto/RpcStateTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java @@ -117,7 +117,7 @@ public void handleUnimplemented() throws RpcException { public void handleAbort() { var msg = new TestMessage(); var builder = msg.builder.getRoot(RpcProtocol.Message.factory); - RpcException.fromException(RpcException.failed("Test abort"), builder.initAbort()); + RpcState.FromException(RpcException.failed("Test abort"), builder.initAbort()); this.connection.setNextIncomingMessage(msg); //Assert.assertThrows(RpcException.class, () -> rpc.handleMessage(msg)); } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java new file mode 100644 index 00000000..609747a5 --- /dev/null +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -0,0 +1,410 @@ +// Copyright (c) 2018 Sandstorm Development Group, Inc. and contributors +// Licensed under the MIT License: +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package org.capnproto; + +import org.capnproto.test.Test; + +import org.junit.Assert; + +import java.util.ArrayDeque; +import java.util.HashMap; +import java.util.Map; +import java.util.Queue; +import java.util.concurrent.CompletableFuture; + +public class RpcTest { + + final class TestNetwork { + + final Map map = new HashMap<>(); + int received = 0; + + TestNetworkAdapter add(String name) { + return this.map.computeIfAbsent( + name, key -> new TestNetworkAdapter(this, name)); + } + + TestNetworkAdapter find(String name) { + return this.map.get(name); + } + } + + final class TestNetworkAdapter + implements VatNetwork { + + @Override + public CompletableFuture> baseAccept() { + return this.accept().thenApply(conn -> conn); + } + + class Connection implements VatNetwork.Connection { + + Throwable networkException; + Connection partner; + final Queue messages = new ArrayDeque<>(); + final Queue> fulfillers = new ArrayDeque<>(); + CompletableFuture fulfillOnEnd; + final boolean isClient; + final Test.TestSturdyRef.Reader peerId; + + Connection(boolean isClient, Test.TestSturdyRef.Reader peerId) { + this.isClient = isClient; + this.peerId = peerId; + } + + void attach(Connection other) { + Assert.assertNull(this.partner); + Assert.assertNull(other.partner); + this.partner = other; + other.partner = this; + } + + TestNetwork getNetwork() { + return network; + } + + @Override + public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { + var message = new MessageBuilder(firstSegmentWordSize); + + return new OutgoingRpcMessage() { + @Override + public AnyPointer.Builder getBody() { + return message.getRoot(AnyPointer.factory); + } + + @Override + public void send() { + if (networkException != null) { + return; + } + + var incomingMessage = new IncomingRpcMessage() { + @Override + public AnyPointer.Reader getBody() { + return message.getRoot(AnyPointer.factory).asReader(); + } + }; + + if (partner == null) { + return; + } + + if (partner.fulfillers.isEmpty()) { + partner.messages.add(incomingMessage); + } + else { + partner.getNetwork().received++; + var front = partner.fulfillers.remove(); + front.complete(incomingMessage); + } + } + + @Override + public int sizeInWords() { + return 0; + } + }; + } + + @Override + public CompletableFuture receiveIncomingMessage() { + if (this.networkException != null) { + return CompletableFuture.failedFuture(this.networkException); + } + + if (this.messages.isEmpty()) { + if (this.fulfillOnEnd != null) { + this.fulfillOnEnd.complete(null); + return CompletableFuture.completedFuture(null); + } + else { + var promise = new CompletableFuture(); + this.fulfillers.add(promise); + return promise.copy(); + } + } + else { + this.getNetwork().received++; + var result = this.messages.remove(); + return CompletableFuture.completedFuture(result); + } + } + + @Override + public CompletableFuture onDisconnect() { + return null; + } + + @Override + public CompletableFuture shutdown() { + if (this.partner == null) { + return CompletableFuture.completedFuture(null); + } + var promise = new CompletableFuture(); + this.partner.fulfillOnEnd = promise; + return promise.copy(); + } + + public Test.TestSturdyRef.Reader getPeerVatId() { + return this.peerId; + } + } + + final TestNetwork network; + private final String self; + int sent = 0; + int received = 0; + Map connections = new HashMap<>(); + Queue> fulfillerQueue = new ArrayDeque<>(); + Queue connectionQueue = new ArrayDeque<>(); + + TestNetworkAdapter(TestNetwork network, String self) { + this.network = network; + this.self = self; + } + + Connection newConnection(boolean isClient, Test.TestSturdyRef.Reader peerId) { + return new Connection(isClient, peerId); + } + + @Override + public VatNetwork.Connection connect(Test.TestSturdyRef.Reader refId) { + var hostId = refId.getHostId().getHost().toString(); + if (hostId.equals(self)) { + return null; + } + + var dst = this.network.find(hostId); + Assert.assertNotNull(dst); + + var connnection = this.connections.get(dst); + if (connnection != null) { + return connnection; + } + + var local = this.newConnection(true, refId); + var remote = dst.newConnection(false, refId); + local.attach(remote); + + this.connections.put(dst, local); + dst.connections.put(this, remote); + + if (dst.fulfillerQueue.isEmpty()) { + dst.fulfillerQueue.add(CompletableFuture.completedFuture(remote)); + } else { + dst.fulfillerQueue.remove().complete(remote); + } + return local; + } + + public CompletableFuture accept() { + if (this.connections.isEmpty()) { + var promise = new CompletableFuture(); + this.fulfillerQueue.add(promise); + return promise.thenApply(conn -> conn); + } + else { + return CompletableFuture.completedFuture(this.connectionQueue.remove()); + } + } + } + + final class TestContext { + final TestNetwork network = new TestNetwork(); + final TestNetworkAdapter clientNetwork; + final TestNetworkAdapter serverNetwork; + + final RpcSystem rpcClient; + final RpcSystem rpcServer; + + TestContext(Capability.Client bootstrapInterface) { + this.clientNetwork = this.network.add("client"); + this.serverNetwork = this.network.add("server"); + this.rpcClient = RpcSystem.makeRpcClient(this.clientNetwork); + this.rpcServer = RpcSystem.makeRpcServer(this.serverNetwork, bootstrapInterface); + } + + TestContext(BootstrapFactory bootstrapFactory) { + this.clientNetwork = this.network.add("client"); + this.serverNetwork = this.network.add("server"); + this.rpcClient = RpcSystem.makeRpcClient(this.clientNetwork); + this.rpcServer = RpcSystem.makeRpcServer(this.serverNetwork, bootstrapFactory); + } + + Capability.Client connect(Test.TestSturdyRefObjectId.Tag tag) { + var message = new MessageBuilder(); + var ref = message.initRoot(Test.TestSturdyRef.factory); + var hostId = ref.initHostId(); + hostId.setHost("server"); + ref.getObjectId().initAs(Test.TestSturdyRefObjectId.factory).setTag(tag); + return rpcClient.bootstrap(ref.asReader()); + } + } + + static BootstrapFactory bootstrapFactory = new BootstrapFactory<>() { + @Override + public FromPointerReader getVatIdFactory() { + return Test.TestSturdyRef.factory; + } + + @Override + public Capability.Client createFor(Test.TestSturdyRef.Reader refId) { + var callCount = new Counter(); + var handleCount = new Counter(); + + var objectId = refId.getObjectId().getAs(Test.TestSturdyRefObjectId.factory); + var tag = objectId.getTag(); + switch (tag) { + case TEST_INTERFACE: + return new Capability.Client(new TestUtil.TestInterfaceImpl(callCount)); + case TEST_EXTENDS: + return new Capability.Client(Capability.newBrokenCap("No TestExtends implemented.")); + case TEST_PIPELINE: + return new Capability.Client(new TestUtil.TestPipelineImpl(callCount)); + case TEST_TAIL_CALLEE: + return new Capability.Client(new TestUtil.TestTailCalleeImpl(callCount)); + case TEST_TAIL_CALLER: + return new Capability.Client(new TestUtil.TestTailCallerImpl(callCount)); + case TEST_MORE_STUFF: + return new Capability.Client(new TestUtil.TestMoreStuffImpl(callCount, handleCount)); + default: + return new Capability.Client(); + } + } + }; + + @org.junit.Test + public void testBasic() { + var context = new TestContext(bootstrapFactory); + var client = new Test.TestInterface.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_INTERFACE)); + var request1 = client.fooRequest(); + request1.getParams().setI(123); + request1.getParams().setJ(true); + var promise1 = request1.send(); + + final var ref = new Object() { + boolean barFailed = false; + }; + var request3 = client.barRequest(); + var promise3 = request3.send().exceptionally(exc -> { + ref.barFailed = true; + return null; + }); + + var request2 = client.bazRequest(); + TestUtil.initTestMessage(request2.getParams().initS()); + var promise2 = request2.send(); + + var response1 = promise1.join(); + Assert.assertEquals("foo", response1.getX().toString()); + + var response2 = promise2.join(); + promise3.join(); + + Assert.assertTrue(ref.barFailed); + } + + @org.junit.Test + public void testPipelining() { + var context = new TestContext(bootstrapFactory); + var client = new Test.TestPipeline.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_PIPELINE)); + + var chainedCallCount = new Counter(); + + var request = client.getCapRequest(); + request.getParams().setN(234); + request.getParams().setInCap(new TestUtil.TestInterfaceImpl(chainedCallCount)); + + var promise = request.send(); + + var pipelineRequest = promise.getOutBox().getCap().fooRequest(); + pipelineRequest.getParams().setI(321); + + var pipelinePromise = pipelineRequest.send(); + + var pipelineRequest2 = new Test.TestExtends.Client(promise.getOutBox().getCap()).graultRequest(); + var pipelinePromise2 = pipelineRequest2.send(); + + promise = null; + + //Assert.assertEquals(0, chainedCallCount.value()); + + var response = pipelinePromise.join(); + Assert.assertEquals("bar", response.getX().toString()); + + var response2 = pipelinePromise2.join(); + TestUtil.checkTestMessage(response2); + + Assert.assertEquals(1, chainedCallCount.value()); + } + + @org.junit.Test + public void testRelease() { + var context = new TestContext(bootstrapFactory); + var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); + + var handle1 = client.getHandleRequest().send().join().getHandle(); + var promise = client.getHandleRequest().send(); + var handle2 = promise.join().getHandle(); + + handle1 = null; + handle2 = null; + } + + @org.junit.Test + public void testPromiseResolve() { + var context = new TestContext(bootstrapFactory); + var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); + + var chainedCallCount = new Counter(); + + var request = client.callFooRequest(); + var request2 = client.callFooWhenResolvedRequest(); + + var paf = new CompletableFuture(); + + { + request.getParams().setCap(new Test.TestInterface.Client(paf.copy())); + request2.getParams().setCap(new Test.TestInterface.Client(paf.copy())); + } + + var promise = request.send(); + var promise2 = request2.send(); + + // Make sure getCap() has been called on the server side by sending another call and waiting + // for it. + Assert.assertEquals(2, client.getCallSequenceRequest().send().join().getN()); + //Assert.assertEquals(3, context.restorer.callCount); + + // OK, now fulfill the local promise. + paf.complete(new Test.TestInterface.Client(new TestUtil.TestInterfaceImpl(chainedCallCount))); + + // We should now be able to wait for getCap() to finish. + Assert.assertEquals("bar", promise.join().getS().toString()); + Assert.assertEquals("bar", promise2.join().getS().toString()); + + //Assert.assertEquals(3, context.restorer.callCount); + Assert.assertEquals(2, chainedCallCount.value()); + } +} + diff --git a/runtime/src/test/java/org/capnproto/TestUtil.java b/runtime-rpc/src/test/java/org/capnproto/TestUtil.java similarity index 96% rename from runtime/src/test/java/org/capnproto/TestUtil.java rename to runtime-rpc/src/test/java/org/capnproto/TestUtil.java index 4f2c8ac8..89a3dbc0 100644 --- a/runtime/src/test/java/org/capnproto/TestUtil.java +++ b/runtime-rpc/src/test/java/org/capnproto/TestUtil.java @@ -1,11 +1,16 @@ package org.capnproto; +import org.capnproto.CallContext; +import org.capnproto.Capability; +import org.capnproto.Void; import org.capnproto.test.Test; import org.junit.Assert; import java.util.concurrent.CompletableFuture; class TestUtil { + + static void initTestMessage(Test.TestAllTypes.Builder builder) { builder.setVoidField(Void.VOID); builder.setBoolField(true); @@ -54,7 +59,7 @@ protected CompletableFuture foo(CallContext baz(CallContext getHandle(CallContext context) { context.getResults().setHandle(new HandleImpl(this.handleCount)); - return READY_NOW; + return Capability.Server.READY_NOW; } @Override protected CompletableFuture getCallSequence(CallContext context) { var result = context.getResults(); result.setN(this.callCount.inc()); - return READY_NOW; + return Capability.Server.READY_NOW; } @Override @@ -174,7 +179,7 @@ protected CompletableFuture foo(CallContext testMethod1(CallContext { try { network.onDisconnect().get(); @@ -75,7 +74,7 @@ private Thread runServer(TwoPartyVatNetwork network) { AsynchronousServerSocketChannel serverSocket; AsynchronousSocketChannel clientSocket; TwoPartyClient client; - TwoPartyVatNetwork serverNetwork; + org.capnproto.TwoPartyVatNetwork serverNetwork; Thread serverThread; @Before @@ -89,7 +88,7 @@ public void setUp() throws Exception { this.client.getNetwork().setTap(new Tap()); var socket = serverSocket.accept().get(); - this.serverNetwork = new TwoPartyVatNetwork(socket, RpcTwoPartyProtocol.Side.SERVER); + this.serverNetwork = new org.capnproto.TwoPartyVatNetwork(socket, RpcTwoPartyProtocol.Side.SERVER); this.serverNetwork.setTap(new Tap()); //this.serverNetwork.dumper.addSchema(Demo.TestCap1); this.serverThread = runServer(this.serverNetwork); diff --git a/runtime/src/test/schema/test.capnp b/runtime-rpc/src/test/schema/test.capnp similarity index 100% rename from runtime/src/test/schema/test.capnp rename to runtime-rpc/src/test/schema/test.capnp diff --git a/runtime/pom.xml b/runtime/pom.xml index eb351631..9d50d52a 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -44,12 +44,6 @@ 4.13.1 test - - - org.capnproto - compiler - 0.1.6-SNAPSHOT - diff --git a/runtime/src/main/java/org/capnproto/PipelineOp.java b/runtime/src/main/java/org/capnproto/PipelineOp.java index e316068c..11d32ca9 100644 --- a/runtime/src/main/java/org/capnproto/PipelineOp.java +++ b/runtime/src/main/java/org/capnproto/PipelineOp.java @@ -25,38 +25,4 @@ static PipelineOp PointerField(short pointerIndex) { return new PipelineOp(Type.GET_POINTER_FIELD, pointerIndex); } - static void FromPipelineOps(PipelineOp[] ops, RpcProtocol.PromisedAnswer.Builder builder) { - var transforms = builder.initTransform(ops.length); - for (int ii = 0; ii < ops.length; ++ii) { - switch (ops[ii].type) { - case NOOP: - transforms.get(ii).setNoop(null); - break; - case GET_POINTER_FIELD: - transforms.get(ii).setGetPointerField(ops[ii].pointerIndex); - break; - } - } - } - - static PipelineOp[] ToPipelineOps(RpcProtocol.PromisedAnswer.Reader reader) { - var transforms = reader.getTransform(); - var ops = new PipelineOp[transforms.size()]; - for (int ii = 0; ii < ops.length; ++ii) { - var transform = transforms.get(ii); - switch (transform.which()) { - case NOOP: - ops[ii] = Noop(); // TODO null? - break; - case GET_POINTER_FIELD: - ops[ii] = PointerField(transform.getGetPointerField()); - break; - default: - // TODO improve error handling here - // Unsupported pipeline ops - return null; - } - } - return ops; - } } diff --git a/runtime/src/main/java/org/capnproto/RpcException.java b/runtime/src/main/java/org/capnproto/RpcException.java index cccc689b..f7482282 100644 --- a/runtime/src/main/java/org/capnproto/RpcException.java +++ b/runtime/src/main/java/org/capnproto/RpcException.java @@ -31,27 +31,4 @@ public static RpcException failed(String message) { public static RpcException disconnected(String message) { return new RpcException(Type.DISCONNECTED, message); } - - static void fromException(Throwable exc, RpcProtocol.Exception.Builder builder) { - builder.setReason(exc.getMessage()); - builder.setType(RpcProtocol.Exception.Type.FAILED); - } - - static RpcException toException(RpcProtocol.Exception.Reader reader) { - var type = RpcException.Type.UNKNOWN; - - switch (reader.getType()) { - case UNIMPLEMENTED: - type = RpcException.Type.UNIMPLEMENTED; - break; - case FAILED: - type = RpcException.Type.FAILED; - break; - case DISCONNECTED: - case OVERLOADED: - default: - break; - } - return new RpcException(type, reader.getReason().toString()); - } } diff --git a/runtime/src/main/java/org/capnproto/RpcProtocol.java b/runtime/src/main/java/org/capnproto/RpcProtocol.java deleted file mode 100644 index 4e25b766..00000000 --- a/runtime/src/main/java/org/capnproto/RpcProtocol.java +++ /dev/null @@ -1,4304 +0,0 @@ -// Generated by Cap'n Proto compiler, DO NOT EDIT -// source: rpc.capnp - -package org.capnproto; - -public final class RpcProtocol { - public static class Message { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Message.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.UNIMPLEMENTED; - case 1 : return Which.ABORT; - case 2 : return Which.CALL; - case 3 : return Which.RETURN; - case 4 : return Which.FINISH; - case 5 : return Which.RESOLVE; - case 6 : return Which.RELEASE; - case 7 : return Which.OBSOLETE_SAVE; - case 8 : return Which.BOOTSTRAP; - case 9 : return Which.OBSOLETE_DELETE; - case 10 : return Which.PROVIDE; - case 11 : return Which.ACCEPT; - case 12 : return Which.JOIN; - case 13 : return Which.DISEMBARGO; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isUnimplemented() { - return which() == Message.Which.UNIMPLEMENTED; - } - public final org.capnproto.RpcProtocol.Message.Builder getUnimplemented() { - assert which() == Message.Which.UNIMPLEMENTED: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Message.factory, 0, null, 0); - } - public final void setUnimplemented(org.capnproto.RpcProtocol.Message.Reader value) { - _setShortField(0, (short)Message.Which.UNIMPLEMENTED.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Message.factory,0, value); - } - public final org.capnproto.RpcProtocol.Message.Builder initUnimplemented() { - _setShortField(0, (short)Message.Which.UNIMPLEMENTED.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Message.factory,0, 0); - } - public final boolean isAbort() { - return which() == Message.Which.ABORT; - } - public final org.capnproto.RpcProtocol.Exception.Builder getAbort() { - assert which() == Message.Which.ABORT: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Exception.factory, 0, null, 0); - } - public final void setAbort(org.capnproto.RpcProtocol.Exception.Reader value) { - _setShortField(0, (short)Message.Which.ABORT.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Exception.factory,0, value); - } - public final org.capnproto.RpcProtocol.Exception.Builder initAbort() { - _setShortField(0, (short)Message.Which.ABORT.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Exception.factory,0, 0); - } - public final boolean isCall() { - return which() == Message.Which.CALL; - } - public final org.capnproto.RpcProtocol.Call.Builder getCall() { - assert which() == Message.Which.CALL: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Call.factory, 0, null, 0); - } - public final void setCall(org.capnproto.RpcProtocol.Call.Reader value) { - _setShortField(0, (short)Message.Which.CALL.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Call.factory,0, value); - } - public final org.capnproto.RpcProtocol.Call.Builder initCall() { - _setShortField(0, (short)Message.Which.CALL.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Call.factory,0, 0); - } - public final boolean isReturn() { - return which() == Message.Which.RETURN; - } - public final org.capnproto.RpcProtocol.Return.Builder getReturn() { - assert which() == Message.Which.RETURN: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Return.factory, 0, null, 0); - } - public final void setReturn(org.capnproto.RpcProtocol.Return.Reader value) { - _setShortField(0, (short)Message.Which.RETURN.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Return.factory,0, value); - } - public final org.capnproto.RpcProtocol.Return.Builder initReturn() { - _setShortField(0, (short)Message.Which.RETURN.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Return.factory,0, 0); - } - public final boolean isFinish() { - return which() == Message.Which.FINISH; - } - public final org.capnproto.RpcProtocol.Finish.Builder getFinish() { - assert which() == Message.Which.FINISH: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Finish.factory, 0, null, 0); - } - public final void setFinish(org.capnproto.RpcProtocol.Finish.Reader value) { - _setShortField(0, (short)Message.Which.FINISH.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Finish.factory,0, value); - } - public final org.capnproto.RpcProtocol.Finish.Builder initFinish() { - _setShortField(0, (short)Message.Which.FINISH.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Finish.factory,0, 0); - } - public final boolean isResolve() { - return which() == Message.Which.RESOLVE; - } - public final org.capnproto.RpcProtocol.Resolve.Builder getResolve() { - assert which() == Message.Which.RESOLVE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Resolve.factory, 0, null, 0); - } - public final void setResolve(org.capnproto.RpcProtocol.Resolve.Reader value) { - _setShortField(0, (short)Message.Which.RESOLVE.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Resolve.factory,0, value); - } - public final org.capnproto.RpcProtocol.Resolve.Builder initResolve() { - _setShortField(0, (short)Message.Which.RESOLVE.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Resolve.factory,0, 0); - } - public final boolean isRelease() { - return which() == Message.Which.RELEASE; - } - public final org.capnproto.RpcProtocol.Release.Builder getRelease() { - assert which() == Message.Which.RELEASE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Release.factory, 0, null, 0); - } - public final void setRelease(org.capnproto.RpcProtocol.Release.Reader value) { - _setShortField(0, (short)Message.Which.RELEASE.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Release.factory,0, value); - } - public final org.capnproto.RpcProtocol.Release.Builder initRelease() { - _setShortField(0, (short)Message.Which.RELEASE.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Release.factory,0, 0); - } - public final boolean isObsoleteSave() { - return which() == Message.Which.OBSOLETE_SAVE; - } - public final boolean hasObsoleteSave() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getObsoleteSave() { - assert which() == Message.Which.OBSOLETE_SAVE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initObsoleteSave() { - _setShortField(0, (short)Message.Which.OBSOLETE_SAVE.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initObsoleteSave(int size) { - _setShortField(0, (short)Message.Which.OBSOLETE_SAVE.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - public final boolean isBootstrap() { - return which() == Message.Which.BOOTSTRAP; - } - public final org.capnproto.RpcProtocol.Bootstrap.Builder getBootstrap() { - assert which() == Message.Which.BOOTSTRAP: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Bootstrap.factory, 0, null, 0); - } - public final void setBootstrap(org.capnproto.RpcProtocol.Bootstrap.Reader value) { - _setShortField(0, (short)Message.Which.BOOTSTRAP.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Bootstrap.factory,0, value); - } - public final org.capnproto.RpcProtocol.Bootstrap.Builder initBootstrap() { - _setShortField(0, (short)Message.Which.BOOTSTRAP.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Bootstrap.factory,0, 0); - } - public final boolean isObsoleteDelete() { - return which() == Message.Which.OBSOLETE_DELETE; - } - public final boolean hasObsoleteDelete() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getObsoleteDelete() { - assert which() == Message.Which.OBSOLETE_DELETE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initObsoleteDelete() { - _setShortField(0, (short)Message.Which.OBSOLETE_DELETE.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initObsoleteDelete(int size) { - _setShortField(0, (short)Message.Which.OBSOLETE_DELETE.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - public final boolean isProvide() { - return which() == Message.Which.PROVIDE; - } - public final org.capnproto.RpcProtocol.Provide.Builder getProvide() { - assert which() == Message.Which.PROVIDE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Provide.factory, 0, null, 0); - } - public final void setProvide(org.capnproto.RpcProtocol.Provide.Reader value) { - _setShortField(0, (short)Message.Which.PROVIDE.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Provide.factory,0, value); - } - public final org.capnproto.RpcProtocol.Provide.Builder initProvide() { - _setShortField(0, (short)Message.Which.PROVIDE.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Provide.factory,0, 0); - } - public final boolean isAccept() { - return which() == Message.Which.ACCEPT; - } - public final org.capnproto.RpcProtocol.Accept.Builder getAccept() { - assert which() == Message.Which.ACCEPT: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Accept.factory, 0, null, 0); - } - public final void setAccept(org.capnproto.RpcProtocol.Accept.Reader value) { - _setShortField(0, (short)Message.Which.ACCEPT.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Accept.factory,0, value); - } - public final org.capnproto.RpcProtocol.Accept.Builder initAccept() { - _setShortField(0, (short)Message.Which.ACCEPT.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Accept.factory,0, 0); - } - public final boolean isJoin() { - return which() == Message.Which.JOIN; - } - public final org.capnproto.RpcProtocol.Join.Builder getJoin() { - assert which() == Message.Which.JOIN: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Join.factory, 0, null, 0); - } - public final void setJoin(org.capnproto.RpcProtocol.Join.Reader value) { - _setShortField(0, (short)Message.Which.JOIN.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Join.factory,0, value); - } - public final org.capnproto.RpcProtocol.Join.Builder initJoin() { - _setShortField(0, (short)Message.Which.JOIN.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Join.factory,0, 0); - } - public final boolean isDisembargo() { - return which() == Message.Which.DISEMBARGO; - } - public final org.capnproto.RpcProtocol.Disembargo.Builder getDisembargo() { - assert which() == Message.Which.DISEMBARGO: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Disembargo.factory, 0, null, 0); - } - public final void setDisembargo(org.capnproto.RpcProtocol.Disembargo.Reader value) { - _setShortField(0, (short)Message.Which.DISEMBARGO.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Disembargo.factory,0, value); - } - public final org.capnproto.RpcProtocol.Disembargo.Builder initDisembargo() { - _setShortField(0, (short)Message.Which.DISEMBARGO.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Disembargo.factory,0, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.UNIMPLEMENTED; - case 1 : return Which.ABORT; - case 2 : return Which.CALL; - case 3 : return Which.RETURN; - case 4 : return Which.FINISH; - case 5 : return Which.RESOLVE; - case 6 : return Which.RELEASE; - case 7 : return Which.OBSOLETE_SAVE; - case 8 : return Which.BOOTSTRAP; - case 9 : return Which.OBSOLETE_DELETE; - case 10 : return Which.PROVIDE; - case 11 : return Which.ACCEPT; - case 12 : return Which.JOIN; - case 13 : return Which.DISEMBARGO; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isUnimplemented() { - return which() == Message.Which.UNIMPLEMENTED; - } - public boolean hasUnimplemented() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Message.Reader getUnimplemented() { - assert which() == Message.Which.UNIMPLEMENTED: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Message.factory,0,null, 0); - } - - public final boolean isAbort() { - return which() == Message.Which.ABORT; - } - public boolean hasAbort() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Exception.Reader getAbort() { - assert which() == Message.Which.ABORT: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Exception.factory,0,null, 0); - } - - public final boolean isCall() { - return which() == Message.Which.CALL; - } - public boolean hasCall() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Call.Reader getCall() { - assert which() == Message.Which.CALL: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Call.factory,0,null, 0); - } - - public final boolean isReturn() { - return which() == Message.Which.RETURN; - } - public boolean hasReturn() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Return.Reader getReturn() { - assert which() == Message.Which.RETURN: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Return.factory,0,null, 0); - } - - public final boolean isFinish() { - return which() == Message.Which.FINISH; - } - public boolean hasFinish() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Finish.Reader getFinish() { - assert which() == Message.Which.FINISH: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Finish.factory,0,null, 0); - } - - public final boolean isResolve() { - return which() == Message.Which.RESOLVE; - } - public boolean hasResolve() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Resolve.Reader getResolve() { - assert which() == Message.Which.RESOLVE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Resolve.factory,0,null, 0); - } - - public final boolean isRelease() { - return which() == Message.Which.RELEASE; - } - public boolean hasRelease() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Release.Reader getRelease() { - assert which() == Message.Which.RELEASE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Release.factory,0,null, 0); - } - - public final boolean isObsoleteSave() { - return which() == Message.Which.OBSOLETE_SAVE; - } - public boolean hasObsoleteSave() { - if (which() != Message.Which.OBSOLETE_SAVE) return false; - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getObsoleteSave() { - assert which() == Message.Which.OBSOLETE_SAVE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public final boolean isBootstrap() { - return which() == Message.Which.BOOTSTRAP; - } - public boolean hasBootstrap() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Bootstrap.Reader getBootstrap() { - assert which() == Message.Which.BOOTSTRAP: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Bootstrap.factory,0,null, 0); - } - - public final boolean isObsoleteDelete() { - return which() == Message.Which.OBSOLETE_DELETE; - } - public boolean hasObsoleteDelete() { - if (which() != Message.Which.OBSOLETE_DELETE) return false; - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getObsoleteDelete() { - assert which() == Message.Which.OBSOLETE_DELETE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public final boolean isProvide() { - return which() == Message.Which.PROVIDE; - } - public boolean hasProvide() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Provide.Reader getProvide() { - assert which() == Message.Which.PROVIDE: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Provide.factory,0,null, 0); - } - - public final boolean isAccept() { - return which() == Message.Which.ACCEPT; - } - public boolean hasAccept() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Accept.Reader getAccept() { - assert which() == Message.Which.ACCEPT: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Accept.factory,0,null, 0); - } - - public final boolean isJoin() { - return which() == Message.Which.JOIN; - } - public boolean hasJoin() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Join.Reader getJoin() { - assert which() == Message.Which.JOIN: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Join.factory,0,null, 0); - } - - public final boolean isDisembargo() { - return which() == Message.Which.DISEMBARGO; - } - public boolean hasDisembargo() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Disembargo.Reader getDisembargo() { - assert which() == Message.Which.DISEMBARGO: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Disembargo.factory,0,null, 0); - } - - } - - public enum Which { - UNIMPLEMENTED, - ABORT, - CALL, - RETURN, - FINISH, - RESOLVE, - RELEASE, - OBSOLETE_SAVE, - BOOTSTRAP, - OBSOLETE_DELETE, - PROVIDE, - ACCEPT, - JOIN, - DISEMBARGO, - _NOT_IN_SCHEMA, - } - } - - - public static class Bootstrap { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Bootstrap.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getQuestionId() { - return _getIntField(0); - } - public final void setQuestionId(int value) { - _setIntField(0, value); - } - - public final boolean hasDeprecatedObjectId() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getDeprecatedObjectId() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initDeprecatedObjectId() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initDeprecatedObjectId(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getQuestionId() { - return _getIntField(0); - } - - public boolean hasDeprecatedObjectId() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getDeprecatedObjectId() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - } - - } - - - public static class Call { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)3); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Call.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getQuestionId() { - return _getIntField(0); - } - public final void setQuestionId(int value) { - _setIntField(0, value); - } - - public final org.capnproto.RpcProtocol.MessageTarget.Builder getTarget() { - return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory, 0, null, 0); - } - public final void setTarget(org.capnproto.RpcProtocol.MessageTarget.Reader value) { - _setPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, value); - } - public final org.capnproto.RpcProtocol.MessageTarget.Builder initTarget() { - return _initPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, 0); - } - public final long getInterfaceId() { - return _getLongField(1); - } - public final void setInterfaceId(long value) { - _setLongField(1, value); - } - - public final short getMethodId() { - return _getShortField(2); - } - public final void setMethodId(short value) { - _setShortField(2, value); - } - - public final org.capnproto.RpcProtocol.Payload.Builder getParams() { - return _getPointerField(org.capnproto.RpcProtocol.Payload.factory, 1, null, 0); - } - public final void setParams(org.capnproto.RpcProtocol.Payload.Reader value) { - _setPointerField(org.capnproto.RpcProtocol.Payload.factory,1, value); - } - public final org.capnproto.RpcProtocol.Payload.Builder initParams() { - return _initPointerField(org.capnproto.RpcProtocol.Payload.factory,1, 0); - } - public final SendResultsTo.Builder getSendResultsTo() { - return new Call.SendResultsTo.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final SendResultsTo.Builder initSendResultsTo() { - _setShortField(3,(short)0); - _clearPointerField(2); - return new Call.SendResultsTo.Builder(segment, data, pointers, dataSize, pointerCount); - } - - public final boolean getAllowThirdPartyTailCall() { - return _getBooleanField(128); - } - public final void setAllowThirdPartyTailCall(boolean value) { - _setBooleanField(128, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getQuestionId() { - return _getIntField(0); - } - - public boolean hasTarget() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.MessageTarget.Reader getTarget() { - return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0,null, 0); - } - - public final long getInterfaceId() { - return _getLongField(1); - } - - public final short getMethodId() { - return _getShortField(2); - } - - public boolean hasParams() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.RpcProtocol.Payload.Reader getParams() { - return _getPointerField(org.capnproto.RpcProtocol.Payload.factory,1,null, 0); - } - - public SendResultsTo.Reader getSendResultsTo() { - return new Call.SendResultsTo.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final boolean getAllowThirdPartyTailCall() { - return _getBooleanField(128); - } - - } - - public static class SendResultsTo { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)3,(short)3); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Call.SendResultsTo.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(3)) { - case 0 : return Which.CALLER; - case 1 : return Which.YOURSELF; - case 2 : return Which.THIRD_PARTY; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isCaller() { - return which() == Call.SendResultsTo.Which.CALLER; - } - public final org.capnproto.Void getCaller() { - assert which() == Call.SendResultsTo.Which.CALLER: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setCaller(org.capnproto.Void value) { - _setShortField(3, (short)Call.SendResultsTo.Which.CALLER.ordinal()); - } - - public final boolean isYourself() { - return which() == Call.SendResultsTo.Which.YOURSELF; - } - public final org.capnproto.Void getYourself() { - assert which() == Call.SendResultsTo.Which.YOURSELF: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setYourself(org.capnproto.Void value) { - _setShortField(3, (short)Call.SendResultsTo.Which.YOURSELF.ordinal()); - } - - public final boolean isThirdParty() { - return which() == Call.SendResultsTo.Which.THIRD_PARTY; - } - public final boolean hasThirdParty() { - return !_pointerFieldIsNull(2); - } - public org.capnproto.AnyPointer.Builder getThirdParty() { - assert which() == Call.SendResultsTo.Which.THIRD_PARTY: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 2); - } - public org.capnproto.AnyPointer.Builder initThirdParty() { - _setShortField(3, (short)Call.SendResultsTo.Which.THIRD_PARTY.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 2, 0); - } - public org.capnproto.AnyPointer.Builder initThirdParty(int size) { - _setShortField(3, (short)Call.SendResultsTo.Which.THIRD_PARTY.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 2, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(3)) { - case 0 : return Which.CALLER; - case 1 : return Which.YOURSELF; - case 2 : return Which.THIRD_PARTY; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isCaller() { - return which() == Call.SendResultsTo.Which.CALLER; - } - public final org.capnproto.Void getCaller() { - assert which() == Call.SendResultsTo.Which.CALLER: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isYourself() { - return which() == Call.SendResultsTo.Which.YOURSELF; - } - public final org.capnproto.Void getYourself() { - assert which() == Call.SendResultsTo.Which.YOURSELF: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isThirdParty() { - return which() == Call.SendResultsTo.Which.THIRD_PARTY; - } - public boolean hasThirdParty() { - if (which() != Call.SendResultsTo.Which.THIRD_PARTY) return false; - return !_pointerFieldIsNull(2); - } - public org.capnproto.AnyPointer.Reader getThirdParty() { - assert which() == Call.SendResultsTo.Which.THIRD_PARTY: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 2); - } - } - - public enum Which { - CALLER, - YOURSELF, - THIRD_PARTY, - _NOT_IN_SCHEMA, - } - } - - - } - - - public static class Return { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)2,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Return.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(3)) { - case 0 : return Which.RESULTS; - case 1 : return Which.EXCEPTION; - case 2 : return Which.CANCELED; - case 3 : return Which.RESULTS_SENT_ELSEWHERE; - case 4 : return Which.TAKE_FROM_OTHER_QUESTION; - case 5 : return Which.ACCEPT_FROM_THIRD_PARTY; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getAnswerId() { - return _getIntField(0); - } - public final void setAnswerId(int value) { - _setIntField(0, value); - } - - public final boolean getReleaseParamCaps() { - return _getBooleanField(32, (boolean)true); - } - public final void setReleaseParamCaps(boolean value) { - _setBooleanField(32, value, (boolean)true); - } - - public final boolean isResults() { - return which() == Return.Which.RESULTS; - } - public final org.capnproto.RpcProtocol.Payload.Builder getResults() { - assert which() == Return.Which.RESULTS: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Payload.factory, 0, null, 0); - } - public final void setResults(org.capnproto.RpcProtocol.Payload.Reader value) { - _setShortField(3, (short)Return.Which.RESULTS.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Payload.factory,0, value); - } - public final org.capnproto.RpcProtocol.Payload.Builder initResults() { - _setShortField(3, (short)Return.Which.RESULTS.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Payload.factory,0, 0); - } - public final boolean isException() { - return which() == Return.Which.EXCEPTION; - } - public final org.capnproto.RpcProtocol.Exception.Builder getException() { - assert which() == Return.Which.EXCEPTION: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Exception.factory, 0, null, 0); - } - public final void setException(org.capnproto.RpcProtocol.Exception.Reader value) { - _setShortField(3, (short)Return.Which.EXCEPTION.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Exception.factory,0, value); - } - public final org.capnproto.RpcProtocol.Exception.Builder initException() { - _setShortField(3, (short)Return.Which.EXCEPTION.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Exception.factory,0, 0); - } - public final boolean isCanceled() { - return which() == Return.Which.CANCELED; - } - public final org.capnproto.Void getCanceled() { - assert which() == Return.Which.CANCELED: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setCanceled(org.capnproto.Void value) { - _setShortField(3, (short)Return.Which.CANCELED.ordinal()); - } - - public final boolean isResultsSentElsewhere() { - return which() == Return.Which.RESULTS_SENT_ELSEWHERE; - } - public final org.capnproto.Void getResultsSentElsewhere() { - assert which() == Return.Which.RESULTS_SENT_ELSEWHERE: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setResultsSentElsewhere(org.capnproto.Void value) { - _setShortField(3, (short)Return.Which.RESULTS_SENT_ELSEWHERE.ordinal()); - } - - public final boolean isTakeFromOtherQuestion() { - return which() == Return.Which.TAKE_FROM_OTHER_QUESTION; - } - public final int getTakeFromOtherQuestion() { - assert which() == Return.Which.TAKE_FROM_OTHER_QUESTION: - "Must check which() before get()ing a union member."; - return _getIntField(2); - } - public final void setTakeFromOtherQuestion(int value) { - _setShortField(3, (short)Return.Which.TAKE_FROM_OTHER_QUESTION.ordinal()); - _setIntField(2, value); - } - - public final boolean isAcceptFromThirdParty() { - return which() == Return.Which.ACCEPT_FROM_THIRD_PARTY; - } - public final boolean hasAcceptFromThirdParty() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getAcceptFromThirdParty() { - assert which() == Return.Which.ACCEPT_FROM_THIRD_PARTY: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initAcceptFromThirdParty() { - _setShortField(3, (short)Return.Which.ACCEPT_FROM_THIRD_PARTY.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initAcceptFromThirdParty(int size) { - _setShortField(3, (short)Return.Which.ACCEPT_FROM_THIRD_PARTY.ordinal()); - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(3)) { - case 0 : return Which.RESULTS; - case 1 : return Which.EXCEPTION; - case 2 : return Which.CANCELED; - case 3 : return Which.RESULTS_SENT_ELSEWHERE; - case 4 : return Which.TAKE_FROM_OTHER_QUESTION; - case 5 : return Which.ACCEPT_FROM_THIRD_PARTY; - default: return Which._NOT_IN_SCHEMA; - } - } - public final int getAnswerId() { - return _getIntField(0); - } - - public final boolean getReleaseParamCaps() { - return _getBooleanField(32, (boolean)true); - } - - public final boolean isResults() { - return which() == Return.Which.RESULTS; - } - public boolean hasResults() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Payload.Reader getResults() { - assert which() == Return.Which.RESULTS: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Payload.factory,0,null, 0); - } - - public final boolean isException() { - return which() == Return.Which.EXCEPTION; - } - public boolean hasException() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Exception.Reader getException() { - assert which() == Return.Which.EXCEPTION: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Exception.factory,0,null, 0); - } - - public final boolean isCanceled() { - return which() == Return.Which.CANCELED; - } - public final org.capnproto.Void getCanceled() { - assert which() == Return.Which.CANCELED: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isResultsSentElsewhere() { - return which() == Return.Which.RESULTS_SENT_ELSEWHERE; - } - public final org.capnproto.Void getResultsSentElsewhere() { - assert which() == Return.Which.RESULTS_SENT_ELSEWHERE: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isTakeFromOtherQuestion() { - return which() == Return.Which.TAKE_FROM_OTHER_QUESTION; - } - public final int getTakeFromOtherQuestion() { - assert which() == Return.Which.TAKE_FROM_OTHER_QUESTION: - "Must check which() before get()ing a union member."; - return _getIntField(2); - } - - public final boolean isAcceptFromThirdParty() { - return which() == Return.Which.ACCEPT_FROM_THIRD_PARTY; - } - public boolean hasAcceptFromThirdParty() { - if (which() != Return.Which.ACCEPT_FROM_THIRD_PARTY) return false; - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getAcceptFromThirdParty() { - assert which() == Return.Which.ACCEPT_FROM_THIRD_PARTY: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - } - - public enum Which { - RESULTS, - EXCEPTION, - CANCELED, - RESULTS_SENT_ELSEWHERE, - TAKE_FROM_OTHER_QUESTION, - ACCEPT_FROM_THIRD_PARTY, - _NOT_IN_SCHEMA, - } - } - - - public static class Finish { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Finish.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getQuestionId() { - return _getIntField(0); - } - public final void setQuestionId(int value) { - _setIntField(0, value); - } - - public final boolean getReleaseResultCaps() { - return _getBooleanField(32, (boolean)true); - } - public final void setReleaseResultCaps(boolean value) { - _setBooleanField(32, value, (boolean)true); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getQuestionId() { - return _getIntField(0); - } - - public final boolean getReleaseResultCaps() { - return _getBooleanField(32, (boolean)true); - } - - } - - } - - - public static class Resolve { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Resolve.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(2)) { - case 0 : return Which.CAP; - case 1 : return Which.EXCEPTION; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getPromiseId() { - return _getIntField(0); - } - public final void setPromiseId(int value) { - _setIntField(0, value); - } - - public final boolean isCap() { - return which() == Resolve.Which.CAP; - } - public final org.capnproto.RpcProtocol.CapDescriptor.Builder getCap() { - assert which() == Resolve.Which.CAP: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.CapDescriptor.factory, 0, null, 0); - } - public final void setCap(org.capnproto.RpcProtocol.CapDescriptor.Reader value) { - _setShortField(2, (short)Resolve.Which.CAP.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.CapDescriptor.factory,0, value); - } - public final org.capnproto.RpcProtocol.CapDescriptor.Builder initCap() { - _setShortField(2, (short)Resolve.Which.CAP.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.CapDescriptor.factory,0, 0); - } - public final boolean isException() { - return which() == Resolve.Which.EXCEPTION; - } - public final org.capnproto.RpcProtocol.Exception.Builder getException() { - assert which() == Resolve.Which.EXCEPTION: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Exception.factory, 0, null, 0); - } - public final void setException(org.capnproto.RpcProtocol.Exception.Reader value) { - _setShortField(2, (short)Resolve.Which.EXCEPTION.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.Exception.factory,0, value); - } - public final org.capnproto.RpcProtocol.Exception.Builder initException() { - _setShortField(2, (short)Resolve.Which.EXCEPTION.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.Exception.factory,0, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(2)) { - case 0 : return Which.CAP; - case 1 : return Which.EXCEPTION; - default: return Which._NOT_IN_SCHEMA; - } - } - public final int getPromiseId() { - return _getIntField(0); - } - - public final boolean isCap() { - return which() == Resolve.Which.CAP; - } - public boolean hasCap() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.CapDescriptor.Reader getCap() { - assert which() == Resolve.Which.CAP: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.CapDescriptor.factory,0,null, 0); - } - - public final boolean isException() { - return which() == Resolve.Which.EXCEPTION; - } - public boolean hasException() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.Exception.Reader getException() { - assert which() == Resolve.Which.EXCEPTION: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.Exception.factory,0,null, 0); - } - - } - - public enum Which { - CAP, - EXCEPTION, - _NOT_IN_SCHEMA, - } - } - - - public static class Release { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Release.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getId() { - return _getIntField(0); - } - public final void setId(int value) { - _setIntField(0, value); - } - - public final int getReferenceCount() { - return _getIntField(1); - } - public final void setReferenceCount(int value) { - _setIntField(1, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getId() { - return _getIntField(0); - } - - public final int getReferenceCount() { - return _getIntField(1); - } - - } - - } - - - public static class Disembargo { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Disembargo.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final org.capnproto.RpcProtocol.MessageTarget.Builder getTarget() { - return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory, 0, null, 0); - } - public final void setTarget(org.capnproto.RpcProtocol.MessageTarget.Reader value) { - _setPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, value); - } - public final org.capnproto.RpcProtocol.MessageTarget.Builder initTarget() { - return _initPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, 0); - } - public final Context.Builder getContext() { - return new Disembargo.Context.Builder(segment, data, pointers, dataSize, pointerCount); - } - public final Context.Builder initContext() { - _setIntField(0,0); - _setShortField(2,(short)0); - return new Disembargo.Context.Builder(segment, data, pointers, dataSize, pointerCount); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasTarget() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.MessageTarget.Reader getTarget() { - return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0,null, 0); - } - - public Context.Reader getContext() { - return new Disembargo.Context.Reader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - public static class Context { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Disembargo.Context.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(2)) { - case 0 : return Which.SENDER_LOOPBACK; - case 1 : return Which.RECEIVER_LOOPBACK; - case 2 : return Which.ACCEPT; - case 3 : return Which.PROVIDE; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isSenderLoopback() { - return which() == Disembargo.Context.Which.SENDER_LOOPBACK; - } - public final int getSenderLoopback() { - assert which() == Disembargo.Context.Which.SENDER_LOOPBACK: - "Must check which() before get()ing a union member."; - return _getIntField(0); - } - public final void setSenderLoopback(int value) { - _setShortField(2, (short)Disembargo.Context.Which.SENDER_LOOPBACK.ordinal()); - _setIntField(0, value); - } - - public final boolean isReceiverLoopback() { - return which() == Disembargo.Context.Which.RECEIVER_LOOPBACK; - } - public final int getReceiverLoopback() { - assert which() == Disembargo.Context.Which.RECEIVER_LOOPBACK: - "Must check which() before get()ing a union member."; - return _getIntField(0); - } - public final void setReceiverLoopback(int value) { - _setShortField(2, (short)Disembargo.Context.Which.RECEIVER_LOOPBACK.ordinal()); - _setIntField(0, value); - } - - public final boolean isAccept() { - return which() == Disembargo.Context.Which.ACCEPT; - } - public final org.capnproto.Void getAccept() { - assert which() == Disembargo.Context.Which.ACCEPT: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setAccept(org.capnproto.Void value) { - _setShortField(2, (short)Disembargo.Context.Which.ACCEPT.ordinal()); - } - - public final boolean isProvide() { - return which() == Disembargo.Context.Which.PROVIDE; - } - public final int getProvide() { - assert which() == Disembargo.Context.Which.PROVIDE: - "Must check which() before get()ing a union member."; - return _getIntField(0); - } - public final void setProvide(int value) { - _setShortField(2, (short)Disembargo.Context.Which.PROVIDE.ordinal()); - _setIntField(0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(2)) { - case 0 : return Which.SENDER_LOOPBACK; - case 1 : return Which.RECEIVER_LOOPBACK; - case 2 : return Which.ACCEPT; - case 3 : return Which.PROVIDE; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isSenderLoopback() { - return which() == Disembargo.Context.Which.SENDER_LOOPBACK; - } - public final int getSenderLoopback() { - assert which() == Disembargo.Context.Which.SENDER_LOOPBACK: - "Must check which() before get()ing a union member."; - return _getIntField(0); - } - - public final boolean isReceiverLoopback() { - return which() == Disembargo.Context.Which.RECEIVER_LOOPBACK; - } - public final int getReceiverLoopback() { - assert which() == Disembargo.Context.Which.RECEIVER_LOOPBACK: - "Must check which() before get()ing a union member."; - return _getIntField(0); - } - - public final boolean isAccept() { - return which() == Disembargo.Context.Which.ACCEPT; - } - public final org.capnproto.Void getAccept() { - assert which() == Disembargo.Context.Which.ACCEPT: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isProvide() { - return which() == Disembargo.Context.Which.PROVIDE; - } - public final int getProvide() { - assert which() == Disembargo.Context.Which.PROVIDE: - "Must check which() before get()ing a union member."; - return _getIntField(0); - } - - } - - public enum Which { - SENDER_LOOPBACK, - RECEIVER_LOOPBACK, - ACCEPT, - PROVIDE, - _NOT_IN_SCHEMA, - } - } - - - } - - - public static class Provide { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Provide.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getQuestionId() { - return _getIntField(0); - } - public final void setQuestionId(int value) { - _setIntField(0, value); - } - - public final org.capnproto.RpcProtocol.MessageTarget.Builder getTarget() { - return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory, 0, null, 0); - } - public final void setTarget(org.capnproto.RpcProtocol.MessageTarget.Reader value) { - _setPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, value); - } - public final org.capnproto.RpcProtocol.MessageTarget.Builder initTarget() { - return _initPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, 0); - } - public final boolean hasRecipient() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.AnyPointer.Builder getRecipient() { - return _getPointerField(org.capnproto.AnyPointer.factory, 1); - } - public org.capnproto.AnyPointer.Builder initRecipient() { - return _initPointerField(org.capnproto.AnyPointer.factory, 1, 0); - } - public org.capnproto.AnyPointer.Builder initRecipient(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 1, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getQuestionId() { - return _getIntField(0); - } - - public boolean hasTarget() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.MessageTarget.Reader getTarget() { - return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0,null, 0); - } - - public boolean hasRecipient() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.AnyPointer.Reader getRecipient() { - return _getPointerField(org.capnproto.AnyPointer.factory, 1); - } - } - - } - - - public static class Accept { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Accept.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getQuestionId() { - return _getIntField(0); - } - public final void setQuestionId(int value) { - _setIntField(0, value); - } - - public final boolean hasProvision() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getProvision() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initProvision() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initProvision(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - public final boolean getEmbargo() { - return _getBooleanField(32); - } - public final void setEmbargo(boolean value) { - _setBooleanField(32, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getQuestionId() { - return _getIntField(0); - } - - public boolean hasProvision() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getProvision() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public final boolean getEmbargo() { - return _getBooleanField(32); - } - - } - - } - - - public static class Join { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)2); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Join.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getQuestionId() { - return _getIntField(0); - } - public final void setQuestionId(int value) { - _setIntField(0, value); - } - - public final org.capnproto.RpcProtocol.MessageTarget.Builder getTarget() { - return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory, 0, null, 0); - } - public final void setTarget(org.capnproto.RpcProtocol.MessageTarget.Reader value) { - _setPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, value); - } - public final org.capnproto.RpcProtocol.MessageTarget.Builder initTarget() { - return _initPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0, 0); - } - public final boolean hasKeyPart() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.AnyPointer.Builder getKeyPart() { - return _getPointerField(org.capnproto.AnyPointer.factory, 1); - } - public org.capnproto.AnyPointer.Builder initKeyPart() { - return _initPointerField(org.capnproto.AnyPointer.factory, 1, 0); - } - public org.capnproto.AnyPointer.Builder initKeyPart(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 1, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getQuestionId() { - return _getIntField(0); - } - - public boolean hasTarget() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.MessageTarget.Reader getTarget() { - return _getPointerField(org.capnproto.RpcProtocol.MessageTarget.factory,0,null, 0); - } - - public boolean hasKeyPart() { - return !_pointerFieldIsNull(1); - } - public org.capnproto.AnyPointer.Reader getKeyPart() { - return _getPointerField(org.capnproto.AnyPointer.factory, 1); - } - } - - } - - - public static class MessageTarget { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return MessageTarget.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(2)) { - case 0 : return Which.IMPORTED_CAP; - case 1 : return Which.PROMISED_ANSWER; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isImportedCap() { - return which() == MessageTarget.Which.IMPORTED_CAP; - } - public final int getImportedCap() { - assert which() == MessageTarget.Which.IMPORTED_CAP: - "Must check which() before get()ing a union member."; - return _getIntField(0); - } - public final void setImportedCap(int value) { - _setShortField(2, (short)MessageTarget.Which.IMPORTED_CAP.ordinal()); - _setIntField(0, value); - } - - public final boolean isPromisedAnswer() { - return which() == MessageTarget.Which.PROMISED_ANSWER; - } - public final org.capnproto.RpcProtocol.PromisedAnswer.Builder getPromisedAnswer() { - assert which() == MessageTarget.Which.PROMISED_ANSWER: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory, 0, null, 0); - } - public final void setPromisedAnswer(org.capnproto.RpcProtocol.PromisedAnswer.Reader value) { - _setShortField(2, (short)MessageTarget.Which.PROMISED_ANSWER.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0, value); - } - public final org.capnproto.RpcProtocol.PromisedAnswer.Builder initPromisedAnswer() { - _setShortField(2, (short)MessageTarget.Which.PROMISED_ANSWER.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0, 0); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(2)) { - case 0 : return Which.IMPORTED_CAP; - case 1 : return Which.PROMISED_ANSWER; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isImportedCap() { - return which() == MessageTarget.Which.IMPORTED_CAP; - } - public final int getImportedCap() { - assert which() == MessageTarget.Which.IMPORTED_CAP: - "Must check which() before get()ing a union member."; - return _getIntField(0); - } - - public final boolean isPromisedAnswer() { - return which() == MessageTarget.Which.PROMISED_ANSWER; - } - public boolean hasPromisedAnswer() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.PromisedAnswer.Reader getPromisedAnswer() { - assert which() == MessageTarget.Which.PROMISED_ANSWER: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0,null, 0); - } - - } - - public enum Which { - IMPORTED_CAP, - PROMISED_ANSWER, - _NOT_IN_SCHEMA, - } - } - - - public static class Payload { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)2); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Payload.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasContent() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getContent() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initContent() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initContent(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - public final boolean hasCapTable() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Builder getCapTable() { - return _getPointerField(org.capnproto.RpcProtocol.CapDescriptor.listFactory, 1, null, 0); - } - public final void setCapTable(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.RpcProtocol.CapDescriptor.listFactory, 1, value); - } - public final org.capnproto.StructList.Builder initCapTable(int size) { - return _initPointerField(org.capnproto.RpcProtocol.CapDescriptor.listFactory, 1, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasContent() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getContent() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public final boolean hasCapTable() { - return !_pointerFieldIsNull(1); - } - public final org.capnproto.StructList.Reader getCapTable() { - return _getPointerField(org.capnproto.RpcProtocol.CapDescriptor.listFactory, 1, null, 0); - } - - } - - } - - - public static class CapDescriptor { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return CapDescriptor.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.NONE; - case 1 : return Which.SENDER_HOSTED; - case 2 : return Which.SENDER_PROMISE; - case 3 : return Which.RECEIVER_HOSTED; - case 4 : return Which.RECEIVER_ANSWER; - case 5 : return Which.THIRD_PARTY_HOSTED; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isNone() { - return which() == CapDescriptor.Which.NONE; - } - public final org.capnproto.Void getNone() { - assert which() == CapDescriptor.Which.NONE: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setNone(org.capnproto.Void value) { - _setShortField(0, (short)CapDescriptor.Which.NONE.ordinal()); - } - - public final boolean isSenderHosted() { - return which() == CapDescriptor.Which.SENDER_HOSTED; - } - public final int getSenderHosted() { - assert which() == CapDescriptor.Which.SENDER_HOSTED: - "Must check which() before get()ing a union member."; - return _getIntField(1); - } - public final void setSenderHosted(int value) { - _setShortField(0, (short)CapDescriptor.Which.SENDER_HOSTED.ordinal()); - _setIntField(1, value); - } - - public final boolean isSenderPromise() { - return which() == CapDescriptor.Which.SENDER_PROMISE; - } - public final int getSenderPromise() { - assert which() == CapDescriptor.Which.SENDER_PROMISE: - "Must check which() before get()ing a union member."; - return _getIntField(1); - } - public final void setSenderPromise(int value) { - _setShortField(0, (short)CapDescriptor.Which.SENDER_PROMISE.ordinal()); - _setIntField(1, value); - } - - public final boolean isReceiverHosted() { - return which() == CapDescriptor.Which.RECEIVER_HOSTED; - } - public final int getReceiverHosted() { - assert which() == CapDescriptor.Which.RECEIVER_HOSTED: - "Must check which() before get()ing a union member."; - return _getIntField(1); - } - public final void setReceiverHosted(int value) { - _setShortField(0, (short)CapDescriptor.Which.RECEIVER_HOSTED.ordinal()); - _setIntField(1, value); - } - - public final boolean isReceiverAnswer() { - return which() == CapDescriptor.Which.RECEIVER_ANSWER; - } - public final org.capnproto.RpcProtocol.PromisedAnswer.Builder getReceiverAnswer() { - assert which() == CapDescriptor.Which.RECEIVER_ANSWER: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory, 0, null, 0); - } - public final void setReceiverAnswer(org.capnproto.RpcProtocol.PromisedAnswer.Reader value) { - _setShortField(0, (short)CapDescriptor.Which.RECEIVER_ANSWER.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0, value); - } - public final org.capnproto.RpcProtocol.PromisedAnswer.Builder initReceiverAnswer() { - _setShortField(0, (short)CapDescriptor.Which.RECEIVER_ANSWER.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0, 0); - } - public final boolean isThirdPartyHosted() { - return which() == CapDescriptor.Which.THIRD_PARTY_HOSTED; - } - public final org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.Builder getThirdPartyHosted() { - assert which() == CapDescriptor.Which.THIRD_PARTY_HOSTED: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.factory, 0, null, 0); - } - public final void setThirdPartyHosted(org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.Reader value) { - _setShortField(0, (short)CapDescriptor.Which.THIRD_PARTY_HOSTED.ordinal()); - _setPointerField(org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.factory,0, value); - } - public final org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.Builder initThirdPartyHosted() { - _setShortField(0, (short)CapDescriptor.Which.THIRD_PARTY_HOSTED.ordinal()); - return _initPointerField(org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.factory,0, 0); - } - public final byte getAttachedFd() { - return _getByteField(2, (byte)-1); - } - public final void setAttachedFd(byte value) { - _setByteField(2, value, (byte)-1); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.NONE; - case 1 : return Which.SENDER_HOSTED; - case 2 : return Which.SENDER_PROMISE; - case 3 : return Which.RECEIVER_HOSTED; - case 4 : return Which.RECEIVER_ANSWER; - case 5 : return Which.THIRD_PARTY_HOSTED; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isNone() { - return which() == CapDescriptor.Which.NONE; - } - public final org.capnproto.Void getNone() { - assert which() == CapDescriptor.Which.NONE: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isSenderHosted() { - return which() == CapDescriptor.Which.SENDER_HOSTED; - } - public final int getSenderHosted() { - assert which() == CapDescriptor.Which.SENDER_HOSTED: - "Must check which() before get()ing a union member."; - return _getIntField(1); - } - - public final boolean isSenderPromise() { - return which() == CapDescriptor.Which.SENDER_PROMISE; - } - public final int getSenderPromise() { - assert which() == CapDescriptor.Which.SENDER_PROMISE: - "Must check which() before get()ing a union member."; - return _getIntField(1); - } - - public final boolean isReceiverHosted() { - return which() == CapDescriptor.Which.RECEIVER_HOSTED; - } - public final int getReceiverHosted() { - assert which() == CapDescriptor.Which.RECEIVER_HOSTED: - "Must check which() before get()ing a union member."; - return _getIntField(1); - } - - public final boolean isReceiverAnswer() { - return which() == CapDescriptor.Which.RECEIVER_ANSWER; - } - public boolean hasReceiverAnswer() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.PromisedAnswer.Reader getReceiverAnswer() { - assert which() == CapDescriptor.Which.RECEIVER_ANSWER: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.factory,0,null, 0); - } - - public final boolean isThirdPartyHosted() { - return which() == CapDescriptor.Which.THIRD_PARTY_HOSTED; - } - public boolean hasThirdPartyHosted() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.Reader getThirdPartyHosted() { - assert which() == CapDescriptor.Which.THIRD_PARTY_HOSTED: - "Must check which() before get()ing a union member."; - return _getPointerField(org.capnproto.RpcProtocol.ThirdPartyCapDescriptor.factory,0,null, 0); - } - - public final byte getAttachedFd() { - return _getByteField(2, (byte)-1); - } - - } - - public enum Which { - NONE, - SENDER_HOSTED, - SENDER_PROMISE, - RECEIVER_HOSTED, - RECEIVER_ANSWER, - THIRD_PARTY_HOSTED, - _NOT_IN_SCHEMA, - } - } - - - public static class PromisedAnswer { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return PromisedAnswer.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getQuestionId() { - return _getIntField(0); - } - public final void setQuestionId(int value) { - _setIntField(0, value); - } - - public final boolean hasTransform() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.StructList.Builder getTransform() { - return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.Op.listFactory, 0, null, 0); - } - public final void setTransform(org.capnproto.StructList.Reader value) { - _setPointerField(org.capnproto.RpcProtocol.PromisedAnswer.Op.listFactory, 0, value); - } - public final org.capnproto.StructList.Builder initTransform(int size) { - return _initPointerField(org.capnproto.RpcProtocol.PromisedAnswer.Op.listFactory, 0, size); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getQuestionId() { - return _getIntField(0); - } - - public final boolean hasTransform() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.StructList.Reader getTransform() { - return _getPointerField(org.capnproto.RpcProtocol.PromisedAnswer.Op.listFactory, 0, null, 0); - } - - } - - public static class Op { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return PromisedAnswer.Op.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.NOOP; - case 1 : return Which.GET_POINTER_FIELD; - default: return Which._NOT_IN_SCHEMA; - } - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean isNoop() { - return which() == PromisedAnswer.Op.Which.NOOP; - } - public final org.capnproto.Void getNoop() { - assert which() == PromisedAnswer.Op.Which.NOOP: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - public final void setNoop(org.capnproto.Void value) { - _setShortField(0, (short)PromisedAnswer.Op.Which.NOOP.ordinal()); - } - - public final boolean isGetPointerField() { - return which() == PromisedAnswer.Op.Which.GET_POINTER_FIELD; - } - public final short getGetPointerField() { - assert which() == PromisedAnswer.Op.Which.GET_POINTER_FIELD: - "Must check which() before get()ing a union member."; - return _getShortField(1); - } - public final void setGetPointerField(short value) { - _setShortField(0, (short)PromisedAnswer.Op.Which.GET_POINTER_FIELD.ordinal()); - _setShortField(1, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public Which which() { - switch(_getShortField(0)) { - case 0 : return Which.NOOP; - case 1 : return Which.GET_POINTER_FIELD; - default: return Which._NOT_IN_SCHEMA; - } - } - public final boolean isNoop() { - return which() == PromisedAnswer.Op.Which.NOOP; - } - public final org.capnproto.Void getNoop() { - assert which() == PromisedAnswer.Op.Which.NOOP: - "Must check which() before get()ing a union member."; - return org.capnproto.Void.VOID; - } - - public final boolean isGetPointerField() { - return which() == PromisedAnswer.Op.Which.GET_POINTER_FIELD; - } - public final short getGetPointerField() { - assert which() == PromisedAnswer.Op.Which.GET_POINTER_FIELD: - "Must check which() before get()ing a union member."; - return _getShortField(1); - } - - } - - public enum Which { - NOOP, - GET_POINTER_FIELD, - _NOT_IN_SCHEMA, - } - } - - - } - - - public static class ThirdPartyCapDescriptor { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return ThirdPartyCapDescriptor.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasId() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getId() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initId() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initId(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - public final int getVineId() { - return _getIntField(0); - } - public final void setVineId(int value) { - _setIntField(0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasId() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getId() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public final int getVineId() { - return _getIntField(0); - } - - } - - } - - - public static class Exception { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return Exception.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final boolean hasReason() { - return !_pointerFieldIsNull(0); - } - public final org.capnproto.Text.Builder getReason() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - public final void setReason(org.capnproto.Text.Reader value) { - _setPointerField(org.capnproto.Text.factory, 0, value); - } - public final void setReason(String value) { - _setPointerField(org.capnproto.Text.factory, 0, new org.capnproto.Text.Reader(value)); - } - public final org.capnproto.Text.Builder initReason(int size) { - return _initPointerField(org.capnproto.Text.factory, 0, size); - } - public final boolean getObsoleteIsCallersFault() { - return _getBooleanField(0); - } - public final void setObsoleteIsCallersFault(boolean value) { - _setBooleanField(0, value); - } - - public final short getObsoleteDurability() { - return _getShortField(1); - } - public final void setObsoleteDurability(short value) { - _setShortField(1, value); - } - - public final org.capnproto.RpcProtocol.Exception.Type getType() { - switch(_getShortField(2)) { - case 0 : return org.capnproto.RpcProtocol.Exception.Type.FAILED; - case 1 : return org.capnproto.RpcProtocol.Exception.Type.OVERLOADED; - case 2 : return org.capnproto.RpcProtocol.Exception.Type.DISCONNECTED; - case 3 : return org.capnproto.RpcProtocol.Exception.Type.UNIMPLEMENTED; - default: return org.capnproto.RpcProtocol.Exception.Type._NOT_IN_SCHEMA; - } - } - public final void setType(org.capnproto.RpcProtocol.Exception.Type value) { - _setShortField(2, (short)value.ordinal()); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public boolean hasReason() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.Text.Reader getReason() { - return _getPointerField(org.capnproto.Text.factory, 0, null, 0, 0); - } - - public final boolean getObsoleteIsCallersFault() { - return _getBooleanField(0); - } - - public final short getObsoleteDurability() { - return _getShortField(1); - } - - public final org.capnproto.RpcProtocol.Exception.Type getType() { - switch(_getShortField(2)) { - case 0 : return org.capnproto.RpcProtocol.Exception.Type.FAILED; - case 1 : return org.capnproto.RpcProtocol.Exception.Type.OVERLOADED; - case 2 : return org.capnproto.RpcProtocol.Exception.Type.DISCONNECTED; - case 3 : return org.capnproto.RpcProtocol.Exception.Type.UNIMPLEMENTED; - default: return org.capnproto.RpcProtocol.Exception.Type._NOT_IN_SCHEMA; - } - } - - } - - public enum Type { - FAILED, - OVERLOADED, - DISCONNECTED, - UNIMPLEMENTED, - _NOT_IN_SCHEMA, - } - - } - - - -public static final class Schemas { -public static final org.capnproto.SegmentReader b_91b79f1f808db032 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0032\u00b0\u008d\u0080\u001f\u009f\u00b7\u0091" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u000e\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0017\u0003\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u004d\u0065" + - "\u0073\u0073\u0061\u0067\u0065\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0038\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0079\u0001\u0000\u0000\u0072\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0078\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0084\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0081\u0001\u0000\u0000\u0032\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u007c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0088\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0085\u0001\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0080\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u008c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0004\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0089\u0001\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0084\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0090\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u00fb\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u008d\u0001\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0088\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0094\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u00fa\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0091\u0001\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u008c\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0098\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0007\u0000\u00f9\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0095\u0001\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0090\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u009c\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0009\u0000\u00f8\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0099\u0001\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0098\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00a4\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u00f7\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00a1\u0001\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00a0\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00ac\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\n\u0000\u00f6\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0009\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00a9\u0001\u0000\u0000\u007a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00a8\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00b4\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000b\u0000\u00f5\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\n\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b1\u0001\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00ac\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00b8\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u000c\u0000\u00f4\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000b\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b5\u0001\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b0\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00bc\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\r\u0000\u00f3\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u000c\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b9\u0001\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b4\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00c0\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0008\u0000\u00f2\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\r\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00bd\u0001\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00bc\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00c8\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0075\u006e\u0069\u006d\u0070\u006c\u0065\u006d" + - "\u0065\u006e\u0074\u0065\u0064\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0032\u00b0\u008d\u0080\u001f\u009f\u00b7\u0091" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0062\u006f\u0072\u0074\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u006c\u006c\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d4\u004c\u009d\u0078\u00ce\u0053\u006a\u0083" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0074\u0075\u0072\u006e\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003a\u0057\u00b3\u003d\u008d\u00b2\u0019\u009e" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0069\u006e\u0069\u0073\u0068\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u000e\u00f8\u00c2\u00b2\u002e\u007d\u00d3" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u006f\u006c\u0076\u0065\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006e\u0008\u0089\u00fa\u0055\u0096\u00c2\u00bb" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u006c\u0065\u0061\u0073\u0065\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0097\u0074\u00d0\u007d\r\u006c\u001a\u00ad" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006f\u0062\u0073\u006f\u006c\u0065\u0074\u0065" + - "\u0053\u0061\u0076\u0065\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0062\u006f\u006f\u0074\u0073\u0074\u0072\u0061" + - "\u0070\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c4\u006e\u0017\u0031\u0080\u00cf\u004c\u00e9" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006f\u0062\u0073\u006f\u006c\u0065\u0074\u0065" + - "\u0044\u0065\u006c\u0065\u0074\u0065\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0072\u006f\u0076\u0069\u0064\u0065\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u005a\u00ac\u00c1\u00fb\u006b\u0004\u006a\u009c" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0063\u0063\u0065\u0070\u0074\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0016\u0040\u0055\u0090\u0062\u00b5\u00c9\u00d4" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006a\u006f\u0069\u006e\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00af\u0001\u00e0\u0090\u0004\u0098\u00e1\u00fb" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0069\u0073\u0065\u006d\u0062\u0061\u0072" + - "\u0067\u006f\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0037\u00bd\u000f\u008b\u0036\u0064\u00f9" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_e94ccf8031176ec4 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00c4\u006e\u0017\u0031\u0080\u00cf\u004c\u00e9" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00c2\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0042\u006f" + - "\u006f\u0074\u0073\u0074\u0072\u0061\u0070\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u009a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0034\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0040\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + - "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0065\u0070\u0072\u0065\u0063\u0061\u0074" + - "\u0065\u0064\u004f\u0062\u006a\u0065\u0063\u0074" + - "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_836a53ce789d4cd4 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00d4\u004c\u009d\u0078\u00ce\u0053\u006a\u0083" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0003\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u009a\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0043\u0061" + - "\u006c\u006c\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u001c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b5\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00c0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00bd\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00c4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c1\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00cc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c9\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00d4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d1\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00cc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00d8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0099\u005f\u00ab\u001a\u00f6\u00b0\u00e8\u00da" + - "\u00d5\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0080\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0008\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c1\u0000\u0000\u0000\u00c2\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00d0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + - "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c1\u00fb\u0013\u0058\u0054\u0014\u00bc\u0095" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u006e\u0074\u0065\u0072\u0066\u0061\u0063" + - "\u0065\u0049\u0064\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006d\u0065\u0074\u0068\u006f\u0064\u0049\u0064" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0061\u0072\u0061\u006d\u0073\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003b\u0074\u0096\u003d\"\u0061\u000e\u009a" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u0065\u006e\u0064\u0052\u0065\u0073\u0075" + - "\u006c\u0074\u0073\u0054\u006f\u0000\u0000\u0000" + - "\u0061\u006c\u006c\u006f\u0077\u0054\u0068\u0069" + - "\u0072\u0064\u0050\u0061\u0072\u0074\u0079\u0054" + - "\u0061\u0069\u006c\u0043\u0061\u006c\u006c\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_dae8b0f61aab5f99 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0099\u005f\u00ab\u001a\u00f6\u00b0\u00e8\u00da" + - "\u0033\u0000\u0000\u0000\u0001\u0000\u0003\u0000" + - "\u00d4\u004c\u009d\u0078\u00ce\u0053\u006a\u0083" + - "\u0003\u0000\u0007\u0000\u0001\u0000\u0003\u0000" + - "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0043\u0061" + - "\u006c\u006c\u002e\u0073\u0065\u006e\u0064\u0052" + - "\u0065\u0073\u0075\u006c\u0074\u0073\u0054\u006f" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u00fd\u00ff\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0050\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\\\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0063\u0061\u006c\u006c\u0065\u0072\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0079\u006f\u0075\u0072\u0073\u0065\u006c\u0066" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0068\u0069\u0072\u0064\u0050\u0061\u0072" + - "\u0074\u0079\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_9e19b28d3db3573a = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u003a\u0057\u00b3\u003d\u008d\u00b2\u0019\u009e" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0006\u0000" + - "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00aa\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u00c7\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0052\u0065" + - "\u0074\u0075\u0072\u006e\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0020\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d1\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00dc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0020\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d9\u0000\u0000\u0000\u008a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00dc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00e8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e5\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00ec\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e9\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00f4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0004\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00f1\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00f0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00fc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00f9\u0000\u0000\u0000\u00aa\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00fc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0008\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u00fb\u00ff\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0005\u0001\u0000\u0000\u00b2\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0007\u0000\u00fa\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0001\u0000\u0000\u00aa\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0014\u0001\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0020\u0001\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0061\u006e\u0073\u0077\u0065\u0072\u0049\u0064" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u006c\u0065\u0061\u0073\u0065\u0050" + - "\u0061\u0072\u0061\u006d\u0043\u0061\u0070\u0073" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0073\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u003b\u0074\u0096\u003d\"\u0061\u000e\u009a" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u0078\u0063\u0065\u0070\u0074\u0069\u006f" + - "\u006e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u006e\u0063\u0065\u006c\u0065\u0064" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0073\u0075\u006c\u0074\u0073\u0053" + - "\u0065\u006e\u0074\u0045\u006c\u0073\u0065\u0077" + - "\u0068\u0065\u0072\u0065\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u006b\u0065\u0046\u0072\u006f\u006d" + - "\u004f\u0074\u0068\u0065\u0072\u0051\u0075\u0065" + - "\u0073\u0074\u0069\u006f\u006e\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0063\u0063\u0065\u0070\u0074\u0046\u0072" + - "\u006f\u006d\u0054\u0068\u0069\u0072\u0064\u0050" + - "\u0061\u0072\u0074\u0079\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_d37d2eb2c2f80e63 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0063\u000e\u00f8\u00c2\u00b2\u002e\u007d\u00d3" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00aa\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0046\u0069" + - "\u006e\u0069\u0073\u0068\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0020\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0092\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0034\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0040\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + - "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u006c\u0065\u0061\u0073\u0065\u0052" + - "\u0065\u0073\u0075\u006c\u0074\u0043\u0061\u0070" + - "\u0073\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_bbc29655fa89086e = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u006e\u0008\u0089\u00fa\u0055\u0096\u00c2\u00bb" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + - "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0052\u0065" + - "\u0073\u006f\u006c\u0076\u0065\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u0000\u0000\u0000\"\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0050\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\\\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0070\u0072\u006f\u006d\u0069\u0073\u0065\u0049" + - "\u0064\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b0\u00b8\u0086\u000b\u00c4\u00dd\u0023\u0085" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u0078\u0063\u0065\u0070\u0074\u0069\u006f" + - "\u006e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_ad1a6c0d7dd07497 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0097\u0074\u00d0\u007d\r\u006c\u001a\u00ad" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0052\u0065" + - "\u006c\u0065\u0061\u0073\u0065\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0038\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0066\u0065\u0072\u0065\u006e\u0063" + - "\u0065\u0043\u006f\u0075\u006e\u0074\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_f964368b0fbd3711 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0011\u0037\u00bd\u000f\u008b\u0036\u0064\u00f9" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ca\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0044\u0069" + - "\u0073\u0065\u006d\u0062\u0061\u0072\u0067\u006f" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u00dd\u005b\u0065\u00df\u00b4\u0062\u00d5" + - "\u002d\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c1\u00fb\u0013\u0058\u0054\u0014\u00bc\u0095" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u006f\u006e\u0074\u0065\u0078\u0074\u0000" + ""); -public static final org.capnproto.SegmentReader b_d562b4df655bdd4d = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u004d\u00dd\u005b\u0065\u00df\u00b4\u0062\u00d5" + - "\u0039\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0011\u0037\u00bd\u000f\u008b\u0036\u0064\u00f9" + - "\u0001\u0000\u0007\u0000\u0001\u0000\u0004\u0000" + - "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\n\u0002\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0044\u0069" + - "\u0073\u0065\u006d\u0062\u0061\u0072\u0067\u006f" + - "\u002e\u0063\u006f\u006e\u0074\u0065\u0078\u0074" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0060\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u006c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0069\u0000\u0000\u0000\u008a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0078\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u00fd\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0075\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u007c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u00fc\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0079\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0080\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0073\u0065\u006e\u0064\u0065\u0072\u004c\u006f" + - "\u006f\u0070\u0062\u0061\u0063\u006b\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0063\u0065\u0069\u0076\u0065\u0072" + - "\u004c\u006f\u006f\u0070\u0062\u0061\u0063\u006b" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0063\u0063\u0065\u0070\u0074\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0072\u006f\u0076\u0069\u0064\u0065\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_9c6a046bfbc1ac5a = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u005a\u00ac\u00c1\u00fb\u006b\u0004\u006a\u009c" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0050\u0072" + - "\u006f\u0076\u0069\u0064\u0065\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0050\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\\\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + - "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c1\u00fb\u0013\u0058\u0054\u0014\u00bc\u0095" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0063\u0069\u0070\u0069\u0065\u006e" + - "\u0074\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_d4c9b56290554016 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0016\u0040\u0055\u0090\u0062\u00b5\u00c9\u00d4" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00aa\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0041\u0063" + - "\u0063\u0065\u0070\u0074\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0058\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0020\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0055\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0050\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\\\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + - "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0072\u006f\u0076\u0069\u0073\u0069\u006f" + - "\u006e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u006d\u0062\u0061\u0072\u0067\u006f\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_fbe1980490e001af = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00af\u0001\u00e0\u0090\u0004\u0098\u00e1\u00fb" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u009a\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u004a\u006f" + - "\u0069\u006e\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0044\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0050\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004d\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0058\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + - "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0061\u0072\u0067\u0065\u0074\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c1\u00fb\u0013\u0058\u0054\u0014\u00bc\u0095" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006b\u0065\u0079\u0050\u0061\u0072\u0074\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_95bc14545813fbc1 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00c1\u00fb\u0013\u0058\u0054\u0014\u00bc\u0095" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + - "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u004d\u0065" + - "\u0073\u0073\u0061\u0067\u0065\u0054\u0061\u0072" + - "\u0067\u0065\u0074\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0062\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00fe\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0030\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u003c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0069\u006d\u0070\u006f\u0072\u0074\u0065\u0064" + - "\u0043\u0061\u0070\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0072\u006f\u006d\u0069\u0073\u0065\u0064" + - "\u0041\u006e\u0073\u0077\u0065\u0072\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00a0\u001c\u006f\u00cd\u00d6\u00b1\u0000\u00d8" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_9a0e61223d96743b = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u003b\u0074\u0096\u003d\"\u0061\u000e\u009a" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0002\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00b2\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0050\u0061" + - "\u0079\u006c\u006f\u0061\u0064\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u004a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0048\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0063\u006f\u006e\u0074\u0065\u006e\u0074\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u0054\u0061\u0062\u006c\u0065" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b0\u00b8\u0086\u000b\u00c4\u00dd\u0023\u0085" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_8523ddc40b86b8b0 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00b0\u00b8\u0086\u000b\u00c4\u00dd\u0023\u0085" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0006\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u008f\u0001\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0043\u0061" + - "\u0070\u0044\u0065\u0073\u0063\u0072\u0069\u0070" + - "\u0074\u006f\u0072\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u001c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b5\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00bc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00fe\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b9\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00b8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00c4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u00fd\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c1\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00cc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u00fc\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c9\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00c8\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00d4\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0004\u0000\u00fb\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d1\u0000\u0000\u0000\u007a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d0\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00dc\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0005\u0000\u00fa\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0005\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00d9\u0000\u0000\u0000\u008a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00dc\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00e8\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0006\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0006\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e5\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00e4\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u00f0\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006e\u006f\u006e\u0065\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u0065\u006e\u0064\u0065\u0072\u0048\u006f" + - "\u0073\u0074\u0065\u0064\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u0065\u006e\u0064\u0065\u0072\u0050\u0072" + - "\u006f\u006d\u0069\u0073\u0065\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0063\u0065\u0069\u0076\u0065\u0072" + - "\u0048\u006f\u0073\u0074\u0065\u0064\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0065\u0063\u0065\u0069\u0076\u0065\u0072" + - "\u0041\u006e\u0073\u0077\u0065\u0072\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u00a0\u001c\u006f\u00cd\u00d6\u00b1\u0000\u00d8" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0068\u0069\u0072\u0064\u0050\u0061\u0072" + - "\u0074\u0079\u0048\u006f\u0073\u0074\u0065\u0064" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u007d\u0002\u00f0\u00e1\u00fd\u0007\u0070\u00d3" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0074\u0074\u0061\u0063\u0068\u0065\u0064" + - "\u0046\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0006\u0000\u00ff\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_d800b1d6cd6f1ca0 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00a0\u001c\u006f\u00cd\u00d6\u00b1\u0000\u00d8" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0039\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0050\u0072" + - "\u006f\u006d\u0069\u0073\u0065\u0064\u0041\u006e" + - "\u0073\u0077\u0065\u0072\u0000\u0000\u0000\u0000" + - "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0081\u0090\u0056\u0015\u0044\u0094\u0016\u00f3" + - "\u0001\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u004f\u0070\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0030\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0071\u0075\u0065\u0073\u0074\u0069\u006f\u006e" + - "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0072\u0061\u006e\u0073\u0066\u006f\u0072" + - "\u006d\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0081\u0090\u0056\u0015\u0044\u0094\u0016\u00f3" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_f316944415569081 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0081\u0090\u0056\u0015\u0044\u0094\u0016\u00f3" + - "\u003d\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00a0\u001c\u006f\u00cd\u00d6\u00b1\u0000\u00d8" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0002\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0002\u0002\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0050\u0072" + - "\u006f\u006d\u0069\u0073\u0065\u0064\u0041\u006e" + - "\u0073\u0077\u0065\u0072\u002e\u004f\u0070\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u00ff\u00ff\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u00fe\u00ff\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0082\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0038\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006e\u006f\u006f\u0070\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0067\u0065\u0074\u0050\u006f\u0069\u006e\u0074" + - "\u0065\u0072\u0046\u0069\u0065\u006c\u0064\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_d37007fde1f0027d = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u007d\u0002\u00f0\u00e1\u00fd\u0007\u0070\u00d3" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0032\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0077\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0054\u0068" + - "\u0069\u0072\u0064\u0050\u0061\u0072\u0074\u0079" + - "\u0043\u0061\u0070\u0044\u0065\u0073\u0063\u0072" + - "\u0069\u0070\u0074\u006f\u0072\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u001a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0024\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0030\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0028\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0034\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0069\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0076\u0069\u006e\u0065\u0049\u0064\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_d625b7063acf691a = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + - "\u002e\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0050\u00a2\u0052\u0025\u001b\u0098\u0012\u00b3" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00c2\u0001\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0017\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u00e7\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0045\u0078" + - "\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0000" + - "\u0004\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0058\u00bd\u004c\u003f\u00e2\u0096\u008c\u00b2" + - "\u0001\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0054\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + - "\u0010\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0061\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\\\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0068\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0065\u0000\u0000\u0000\u00ba\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0068\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0074\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0071\u0000\u0000\u0000\u009a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0080\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u007d\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0078\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0084\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0072\u0065\u0061\u0073\u006f\u006e\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000c\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006f\u0062\u0073\u006f\u006c\u0065\u0074\u0065" + - "\u0049\u0073\u0043\u0061\u006c\u006c\u0065\u0072" + - "\u0073\u0046\u0061\u0075\u006c\u0074\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u006f\u0062\u0073\u006f\u006c\u0065\u0074\u0065" + - "\u0044\u0075\u0072\u0061\u0062\u0069\u006c\u0069" + - "\u0074\u0079\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0074\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + - "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0058\u00bd\u004c\u003f\u00e2\u0096\u008c\u00b2" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_b28c96e23f4cbd58 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0058\u00bd\u004c\u003f\u00e2\u0096\u008c\u00b2" + - "\u0038\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u001a\u0069\u00cf\u003a\u0006\u00b7\u0025\u00d6" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0067\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002e" + - "\u0063\u0061\u0070\u006e\u0070\u003a\u0045\u0078" + - "\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u002e" + - "\u0054\u0079\u0070\u0065\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0010\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0029\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0021\u0000\u0000\u0000\u005a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u001d\u0000\u0000\u0000\u006a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0019\u0000\u0000\u0000\u0072\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0066\u0061\u0069\u006c\u0065\u0064\u0000\u0000" + - "\u006f\u0076\u0065\u0072\u006c\u006f\u0061\u0064" + - "\u0065\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0064\u0069\u0073\u0063\u006f\u006e\u006e\u0065" + - "\u0063\u0074\u0065\u0064\u0000\u0000\u0000\u0000" + - "\u0075\u006e\u0069\u006d\u0070\u006c\u0065\u006d" + - "\u0065\u006e\u0074\u0065\u0064\u0000\u0000\u0000" + ""); -} -} - diff --git a/runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java b/runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java deleted file mode 100644 index 05bdbd10..00000000 --- a/runtime/src/main/java/org/capnproto/RpcTwoPartyProtocol.java +++ /dev/null @@ -1,662 +0,0 @@ -// Generated by Cap'n Proto compiler, DO NOT EDIT -// source: rpc-twoparty.capnp - -package org.capnproto; - -public final class RpcTwoPartyProtocol { - public enum Side { - SERVER, - CLIENT, - _NOT_IN_SCHEMA, - } - - public static class VatId { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return VatId.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final org.capnproto.RpcTwoPartyProtocol.Side getSide() { - switch(_getShortField(0)) { - case 0 : return org.capnproto.RpcTwoPartyProtocol.Side.SERVER; - case 1 : return org.capnproto.RpcTwoPartyProtocol.Side.CLIENT; - default: return org.capnproto.RpcTwoPartyProtocol.Side._NOT_IN_SCHEMA; - } - } - public final void setSide(org.capnproto.RpcTwoPartyProtocol.Side value) { - _setShortField(0, (short)value.ordinal()); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final org.capnproto.RpcTwoPartyProtocol.Side getSide() { - switch(_getShortField(0)) { - case 0 : return org.capnproto.RpcTwoPartyProtocol.Side.SERVER; - case 1 : return org.capnproto.RpcTwoPartyProtocol.Side.CLIENT; - default: return org.capnproto.RpcTwoPartyProtocol.Side._NOT_IN_SCHEMA; - } - } - - } - - } - - - public static class ProvisionId { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return ProvisionId.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getJoinId() { - return _getIntField(0); - } - public final void setJoinId(int value) { - _setIntField(0, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getJoinId() { - return _getIntField(0); - } - - } - - } - - - public static class RecipientId { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return RecipientId.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - } - - - public static class ThirdPartyCapId { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return ThirdPartyCapId.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - } - - } - - - public static class JoinKeyPart { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)0); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return JoinKeyPart.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getJoinId() { - return _getIntField(0); - } - public final void setJoinId(int value) { - _setIntField(0, value); - } - - public final short getPartCount() { - return _getShortField(2); - } - public final void setPartCount(short value) { - _setShortField(2, value); - } - - public final short getPartNum() { - return _getShortField(3); - } - public final void setPartNum(short value) { - _setShortField(3, value); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getJoinId() { - return _getIntField(0); - } - - public final short getPartCount() { - return _getShortField(2); - } - - public final short getPartNum() { - return _getShortField(3); - } - - } - - } - - - public static class JoinResult { - public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)1,(short)1); - public static final class Factory extends org.capnproto.StructFactory { - public Factory() { - } - public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { - return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); - } - public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { - return new Builder(segment, data, pointers, dataSize, pointerCount); - } - public final org.capnproto.StructSize structSize() { - return JoinResult.STRUCT_SIZE; - } - public final Reader asReader(Builder builder) { - return builder.asReader(); - } - } - public static final Factory factory = new Factory(); - public static final org.capnproto.StructList.Factory listFactory = - new org.capnproto.StructList.Factory(factory); - public static final class Builder extends org.capnproto.StructBuilder { - Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ - super(segment, data, pointers, dataSize, pointerCount); - } - public final Reader asReader() { - return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); - } - public final int getJoinId() { - return _getIntField(0); - } - public final void setJoinId(int value) { - _setIntField(0, value); - } - - public final boolean getSucceeded() { - return _getBooleanField(32); - } - public final void setSucceeded(boolean value) { - _setBooleanField(32, value); - } - - public final boolean hasCap() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Builder getCap() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - public org.capnproto.AnyPointer.Builder initCap() { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, 0); - } - public org.capnproto.AnyPointer.Builder initCap(int size) { - return _initPointerField(org.capnproto.AnyPointer.factory, 0, size); - } - - } - - public static final class Reader extends org.capnproto.StructReader { - Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ - super(segment, data, pointers, dataSize, pointerCount, nestingLimit); - } - - public final int getJoinId() { - return _getIntField(0); - } - - public final boolean getSucceeded() { - return _getBooleanField(32); - } - - public boolean hasCap() { - return !_pointerFieldIsNull(0); - } - public org.capnproto.AnyPointer.Reader getCap() { - return _getPointerField(org.capnproto.AnyPointer.factory, 0); - } - } - - } - - - -public static final class Schemas { -public static final org.capnproto.SegmentReader b_9fd69ebc87b9719c = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u009c\u0071\u00b9\u0087\u00bc\u009e\u00d6\u009f" + - "\u0037\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00e2\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u0037\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + - "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + - "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u0053" + - "\u0069\u0064\u0065\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0008\u0000\u0000\u0000\u0001\u0000\u0002\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0011\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0009\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u0065\u0072\u0076\u0065\u0072\u0000\u0000" + - "\u0063\u006c\u0069\u0065\u006e\u0074\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_d20b909fee733a8e = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u008e\u003a\u0073\u00ee\u009f\u0090\u000b\u00d2" + - "\u0037\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u00ea\u0001\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u002d\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + - "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + - "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u0056" + - "\u0061\u0074\u0049\u0064\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u002a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0073\u0069\u0064\u0065\u0000\u0000\u0000\u0000" + - "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u009c\u0071\u00b9\u0087\u00bc\u009e\u00d6\u009f" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_b88d09a9c5f39817 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0017\u0098\u00f3\u00c5\u00a9\u0009\u008d\u00b8" + - "\u0037\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u001a\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u003f\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + - "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + - "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u0050" + - "\u0072\u006f\u0076\u0069\u0073\u0069\u006f\u006e" + - "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u0004\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\r\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0014\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006a\u006f\u0069\u006e\u0049\u0064\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_89f389b6fd4082c1 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00c1\u0082\u0040\u00fd\u00b6\u0089\u00f3\u0089" + - "\u0037\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u001a\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + - "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + - "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u0052" + - "\u0065\u0063\u0069\u0070\u0069\u0065\u006e\u0074" + - "\u0049\u0064\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); -public static final org.capnproto.SegmentReader b_b47f4979672cb59d = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u009d\u00b5\u002c\u0067\u0079\u0049\u007f\u00b4" + - "\u0037\u0000\u0000\u0000\u0001\u0000\u0000\u0000" + - "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u003a\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + - "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + - "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u0054" + - "\u0068\u0069\u0072\u0064\u0050\u0061\u0072\u0074" + - "\u0079\u0043\u0061\u0070\u0049\u0064\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + ""); -public static final org.capnproto.SegmentReader b_95b29059097fca83 = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u0083\u00ca\u007f\u0009\u0059\u0090\u00b2\u0095" + - "\u0037\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + - "\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u001a\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + - "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + - "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u004a" + - "\u006f\u0069\u006e\u004b\u0065\u0079\u0050\u0061" + - "\u0072\u0074\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0003\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0000\u0000\u0000\u0042\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0058\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006a\u006f\u0069\u006e\u0049\u0064\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0061\u0072\u0074\u0043\u006f\u0075\u006e" + - "\u0074\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0070\u0061\u0072\u0074\u004e\u0075\u006d\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -public static final org.capnproto.SegmentReader b_9d263a3630b7ebee = - org.capnproto.GeneratedClassSupport.decodeRawBytes( - "\u0000\u0000\u0000\u0000\u0005\u0000\u0006\u0000" + - "\u00ee\u00eb\u00b7\u0030\u0036\u003a\u0026\u009d" + - "\u0037\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u00a1\u00f2\u00da\\\u0088\u00c7\u0084\u00a1" + - "\u0001\u0000\u0007\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0015\u0000\u0000\u0000\u0012\u0002\u0000\u0000" + - "\u0035\u0000\u0000\u0000\u0007\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0031\u0000\u0000\u0000\u00af\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0072\u0075\u006e\u0074\u0069\u006d\u0065\u002f" + - "\u0073\u0072\u0063\u002f\u006d\u0061\u0069\u006e" + - "\u002f\u006a\u0061\u0076\u0061\u002f\u006f\u0072" + - "\u0067\u002f\u0063\u0061\u0070\u006e\u0070\u0072" + - "\u006f\u0074\u006f\u002f\u0072\u0070\u0063\u002d" + - "\u0074\u0077\u006f\u0070\u0061\u0072\u0074\u0079" + - "\u002e\u0063\u0061\u0070\u006e\u0070\u003a\u004a" + - "\u006f\u0069\u006e\u0052\u0065\u0073\u0075\u006c" + - "\u0074\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000" + - "\u000c\u0000\u0000\u0000\u0003\u0000\u0004\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0045\u0000\u0000\u0000\u003a\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0040\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u004c\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0001\u0000\u0000\u0000\u0020\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0049\u0000\u0000\u0000\u0052\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0048\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0054\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0051\u0000\u0000\u0000\"\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u004c\u0000\u0000\u0000\u0003\u0000\u0001\u0000" + - "\u0058\u0000\u0000\u0000\u0002\u0000\u0001\u0000" + - "\u006a\u006f\u0069\u006e\u0049\u0064\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0073\u0075\u0063\u0063\u0065\u0065\u0064\u0065" + - "\u0064\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0063\u0061\u0070\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + - "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + ""); -} -} - diff --git a/runtime/src/test/java/org/capnproto/RpcTest.java b/runtime/src/test/java/org/capnproto/RpcTest.java deleted file mode 100644 index 9345cb95..00000000 --- a/runtime/src/test/java/org/capnproto/RpcTest.java +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright (c) 2018 Sandstorm Development Group, Inc. and contributors -// Licensed under the MIT License: -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package org.capnproto; - -import org.capnproto.test.Test; - -import org.junit.Assert; - -import java.util.ArrayDeque; -import java.util.HashMap; -import java.util.Map; -import java.util.Queue; -import java.util.concurrent.CompletableFuture; - -class TestNetwork { - - final Map map = new HashMap<>(); - int received = 0; - - TestNetworkAdapter add(String name) { - return this.map.computeIfAbsent( - name, key -> new TestNetworkAdapter(this, name)); - } - - TestNetworkAdapter find(String name) { - return this.map.get(name); - } -} - -class TestNetworkAdapter - implements VatNetwork { - - @Override - public CompletableFuture> baseAccept() { - return this.accept().thenApply(conn -> conn); - } - - class Connection implements VatNetwork.Connection { - - Throwable networkException; - Connection partner; - final Queue messages = new ArrayDeque<>(); - final Queue> fulfillers = new ArrayDeque<>(); - CompletableFuture fulfillOnEnd; - final boolean isClient; - final Test.TestSturdyRef.Reader peerId; - - Connection(boolean isClient, Test.TestSturdyRef.Reader peerId) { - this.isClient = isClient; - this.peerId = peerId; - } - - void attach(Connection other) { - Assert.assertNull(this.partner); - Assert.assertNull(other.partner); - this.partner = other; - other.partner = this; - } - - TestNetwork getNetwork() { - return network; - } - - @Override - public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { - var message = new MessageBuilder(firstSegmentWordSize); - - return new OutgoingRpcMessage() { - @Override - public AnyPointer.Builder getBody() { - return message.getRoot(AnyPointer.factory); - } - - @Override - public void send() { - if (networkException != null) { - return; - } - - var incomingMessage = new IncomingRpcMessage() { - @Override - public AnyPointer.Reader getBody() { - return message.getRoot(AnyPointer.factory).asReader(); - } - }; - - if (partner == null) { - return; - } - - if (partner.fulfillers.isEmpty()) { - partner.messages.add(incomingMessage); - } - else { - partner.getNetwork().received++; - var front = partner.fulfillers.remove(); - front.complete(incomingMessage); - } - } - - @Override - public int sizeInWords() { - return 0; - } - }; - } - - @Override - public CompletableFuture receiveIncomingMessage() { - if (this.networkException != null) { - return CompletableFuture.failedFuture(this.networkException); - } - - if (this.messages.isEmpty()) { - if (this.fulfillOnEnd != null) { - this.fulfillOnEnd.complete(null); - return CompletableFuture.completedFuture(null); - } - else { - var promise = new CompletableFuture(); - this.fulfillers.add(promise); - return promise.copy(); - } - } - else { - this.getNetwork().received++; - var result = this.messages.remove(); - return CompletableFuture.completedFuture(result); - } - } - - @Override - public CompletableFuture onDisconnect() { - return null; - } - - @Override - public CompletableFuture shutdown() { - if (this.partner == null) { - return CompletableFuture.completedFuture(null); - } - var promise = new CompletableFuture(); - this.partner.fulfillOnEnd = promise; - return promise.copy(); - } - - public Test.TestSturdyRef.Reader getPeerVatId() { - return this.peerId; - } - } - - final TestNetwork network; - private final String self; - int sent = 0; - int received = 0; - Map connections = new HashMap<>(); - Queue> fulfillerQueue = new ArrayDeque<>(); - Queue connectionQueue = new ArrayDeque<>(); - - TestNetworkAdapter(TestNetwork network, String self) { - this.network = network; - this.self = self; - } - - Connection newConnection(boolean isClient, Test.TestSturdyRef.Reader peerId) { - return new Connection(isClient, peerId); - } - - @Override - public VatNetwork.Connection connect(Test.TestSturdyRef.Reader refId) { - var hostId = refId.getHostId().getHost().toString(); - if (hostId.equals(self)) { - return null; - } - - var dst = this.network.find(hostId); - Assert.assertNotNull(dst); - - var connnection = this.connections.get(dst); - if (connnection != null) { - return connnection; - } - - var local = this.newConnection(true, refId); - var remote = dst.newConnection(false, refId); - local.attach(remote); - - this.connections.put(dst, local); - dst.connections.put(this, remote); - - if (dst.fulfillerQueue.isEmpty()) { - dst.fulfillerQueue.add(CompletableFuture.completedFuture(remote)); - } else { - dst.fulfillerQueue.remove().complete(remote); - } - return local; - } - - public CompletableFuture accept() { - if (this.connections.isEmpty()) { - var promise = new CompletableFuture(); - this.fulfillerQueue.add(promise); - return promise.thenApply(conn -> conn); - } - else { - return CompletableFuture.completedFuture(this.connectionQueue.remove()); - } - } -} - -class TestContext { - final TestNetwork network = new TestNetwork(); - final TestNetworkAdapter clientNetwork; - final TestNetworkAdapter serverNetwork; - - final RpcSystem rpcClient; - final RpcSystem rpcServer; - - TestContext(Capability.Client bootstrapInterface) { - this.clientNetwork = this.network.add("client"); - this.serverNetwork = this.network.add("server"); - this.rpcClient = RpcSystem.makeRpcClient(this.clientNetwork); - this.rpcServer = RpcSystem.makeRpcServer(this.serverNetwork, bootstrapInterface); - } - - TestContext(BootstrapFactory bootstrapFactory) { - this.clientNetwork = this.network.add("client"); - this.serverNetwork = this.network.add("server"); - this.rpcClient = RpcSystem.makeRpcClient(this.clientNetwork); - this.rpcServer = RpcSystem.makeRpcServer(this.serverNetwork, bootstrapFactory); - } - - Capability.Client connect(Test.TestSturdyRefObjectId.Tag tag) { - var message = new MessageBuilder(); - var ref = message.initRoot(Test.TestSturdyRef.factory); - var hostId = ref.initHostId(); - hostId.setHost("server"); - ref.getObjectId().initAs(Test.TestSturdyRefObjectId.factory).setTag(tag); - return rpcClient.bootstrap(ref.asReader()); - } -} - -public class RpcTest { - - static BootstrapFactory bootstrapFactory = new BootstrapFactory<>() { - @Override - public FromPointerReader getVatIdFactory() { - return Test.TestSturdyRef.factory; - } - - @Override - public Capability.Client createFor(Test.TestSturdyRef.Reader refId) { - var callCount = new Counter(); - var handleCount = new Counter(); - - var objectId = refId.getObjectId().getAs(Test.TestSturdyRefObjectId.factory); - var tag = objectId.getTag(); - switch (tag) { - case TEST_INTERFACE: - return new Capability.Client(new TestUtil.TestInterfaceImpl(callCount)); - case TEST_EXTENDS: - return new Capability.Client(Capability.newBrokenCap("No TestExtends implemented.")); - case TEST_PIPELINE: - return new Capability.Client(new TestUtil.TestPipelineImpl(callCount)); - case TEST_TAIL_CALLEE: - return new Capability.Client(new TestUtil.TestTailCalleeImpl(callCount)); - case TEST_TAIL_CALLER: - return new Capability.Client(new TestUtil.TestTailCallerImpl(callCount)); - case TEST_MORE_STUFF: - return new Capability.Client(new TestUtil.TestMoreStuffImpl(callCount, handleCount)); - default: - return new Capability.Client(); - } - } - }; - - @org.junit.Test - public void testBasic() { - var context = new TestContext(bootstrapFactory); - var client = new Test.TestInterface.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_INTERFACE)); - var request1 = client.fooRequest(); - request1.getParams().setI(123); - request1.getParams().setJ(true); - var promise1 = request1.send(); - - final var ref = new Object() { - boolean barFailed = false; - }; - var request3 = client.barRequest(); - var promise3 = request3.send().exceptionally(exc -> { - ref.barFailed = true; - return null; - }); - - var request2 = client.bazRequest(); - TestUtil.initTestMessage(request2.getParams().initS()); - var promise2 = request2.send(); - - var response1 = promise1.join(); - Assert.assertEquals("foo", response1.getX().toString()); - - var response2 = promise2.join(); - promise3.join(); - - Assert.assertTrue(ref.barFailed); - } - - @org.junit.Test - public void testPipelining() { - var context = new TestContext(bootstrapFactory); - var client = new Test.TestPipeline.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_PIPELINE)); - - var chainedCallCount = new Counter(); - - var request = client.getCapRequest(); - request.getParams().setN(234); - request.getParams().setInCap(new TestUtil.TestInterfaceImpl(chainedCallCount)); - - var promise = request.send(); - - var pipelineRequest = promise.getOutBox().getCap().fooRequest(); - pipelineRequest.getParams().setI(321); - - var pipelinePromise = pipelineRequest.send(); - - var pipelineRequest2 = new Test.TestExtends.Client(promise.getOutBox().getCap()).graultRequest(); - var pipelinePromise2 = pipelineRequest2.send(); - - promise = null; - - //Assert.assertEquals(0, chainedCallCount.value()); - - var response = pipelinePromise.join(); - Assert.assertEquals("bar", response.getX().toString()); - - var response2 = pipelinePromise2.join(); - TestUtil.checkTestMessage(response2); - - Assert.assertEquals(1, chainedCallCount.value()); - } - - @org.junit.Test - public void testRelease() { - var context = new TestContext(bootstrapFactory); - var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); - - var handle1 = client.getHandleRequest().send().join().getHandle(); - var promise = client.getHandleRequest().send(); - var handle2 = promise.join().getHandle(); - - handle1 = null; - handle2 = null; - } - - @org.junit.Test - public void testPromiseResolve() { - var context = new TestContext(bootstrapFactory); - var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); - - var chainedCallCount = new Counter(); - - var request = client.callFooRequest(); - var request2 = client.callFooWhenResolvedRequest(); - - var paf = new CompletableFuture(); - - { - request.getParams().setCap(new Test.TestInterface.Client(paf.copy())); - request2.getParams().setCap(new Test.TestInterface.Client(paf.copy())); - } - - var promise = request.send(); - var promise2 = request2.send(); - - // Make sure getCap() has been called on the server side by sending another call and waiting - // for it. - Assert.assertEquals(2, client.getCallSequenceRequest().send().join().getN()); - //Assert.assertEquals(3, context.restorer.callCount); - - // OK, now fulfill the local promise. - paf.complete(new Test.TestInterface.Client(new TestUtil.TestInterfaceImpl(chainedCallCount))); - - // We should now be able to wait for getCap() to finish. - Assert.assertEquals("bar", promise.join().getS().toString()); - Assert.assertEquals("bar", promise2.join().getS().toString()); - - //Assert.assertEquals(3, context.restorer.callCount); - Assert.assertEquals(2, chainedCallCount.value()); - } -} - diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp b/runtime/src/test/java/org/capnproto/demo/demo.capnp deleted file mode 100644 index efdbc9ee..00000000 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp +++ /dev/null @@ -1,59 +0,0 @@ -@0xb6577a1582e84742; - -using Java = import "/capnp/java.capnp"; -$Java.package("org.capnproto.demo"); -$Java.outerClassname("Demo"); - -struct TestParams0 { - param0 @0 :Int32; -} - -struct TestResults0 { - result0 @0 :Int32; -} - -struct TestParams1 { - param0 @0 :AnyPointer; -} - -struct TestResults1 { - result0 @0 :AnyPointer; - result1 @1 :AnyPointer; - result2 @2 :AnyPointer; -} - -struct Struct0 { - f0 @0 :Bool; -} - -interface Iface0 { - method0 @0 (); - method1 @1 () -> stream; -} - -struct Struct2 { - f0 @0 :AnyPointer; - f1i @1 :Iface0; -} - -interface TestCap0 { - testMethod0 @0 TestParams0 -> TestResults0; - testMethod1 @1 TestParams1 -> TestResults1; -} - -interface TestCap1 { -} - - -interface Iface1 { - - struct Struct1 { - f0 @0 :Bool; - f1 @1 :AnyPointer; - } - - method0 @0 () -> (result0 :Struct0, result1 :Struct1); - method1 @1 () -> (result0: Iface0); -} - - diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ b/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ deleted file mode 100644 index 121e736c..00000000 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp.c++ +++ /dev/null @@ -1,1236 +0,0 @@ -// Generated by Cap'n Proto compiler, DO NOT EDIT -// source: demo.capnp - -#include "demo.capnp.h" - -namespace capnp { -namespace schemas { -static const ::capnp::_::AlignedData<37> b_91e1b138de965ab0 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 176, 90, 150, 222, 56, 177, 225, 145, - 52, 0, 0, 0, 1, 0, 1, 0, - 66, 71, 232, 130, 21, 122, 87, 182, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 2, 2, 0, 0, - 49, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 63, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 84, 101, 115, 116, - 80, 97, 114, 97, 109, 115, 48, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 4, 0, 0, 0, 3, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 58, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 3, 0, 1, 0, - 20, 0, 0, 0, 2, 0, 1, 0, - 112, 97, 114, 97, 109, 48, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_91e1b138de965ab0 = b_91e1b138de965ab0.words; -#if !CAPNP_LITE -static const uint16_t m_91e1b138de965ab0[] = {0}; -static const uint16_t i_91e1b138de965ab0[] = {0}; -const ::capnp::_::RawSchema s_91e1b138de965ab0 = { - 0x91e1b138de965ab0, b_91e1b138de965ab0.words, 37, nullptr, m_91e1b138de965ab0, - 0, 1, i_91e1b138de965ab0, nullptr, nullptr, { &s_91e1b138de965ab0, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<38> b_a77bdd3c3bd1dcbf = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 191, 220, 209, 59, 60, 221, 123, 167, - 52, 0, 0, 0, 1, 0, 1, 0, - 66, 71, 232, 130, 21, 122, 87, 182, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 10, 2, 0, 0, - 53, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 49, 0, 0, 0, 63, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 84, 101, 115, 116, - 82, 101, 115, 117, 108, 116, 115, 48, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 4, 0, 0, 0, 3, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 3, 0, 1, 0, - 20, 0, 0, 0, 2, 0, 1, 0, - 114, 101, 115, 117, 108, 116, 48, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_a77bdd3c3bd1dcbf = b_a77bdd3c3bd1dcbf.words; -#if !CAPNP_LITE -static const uint16_t m_a77bdd3c3bd1dcbf[] = {0}; -static const uint16_t i_a77bdd3c3bd1dcbf[] = {0}; -const ::capnp::_::RawSchema s_a77bdd3c3bd1dcbf = { - 0xa77bdd3c3bd1dcbf, b_a77bdd3c3bd1dcbf.words, 38, nullptr, m_a77bdd3c3bd1dcbf, - 0, 1, i_a77bdd3c3bd1dcbf, nullptr, nullptr, { &s_a77bdd3c3bd1dcbf, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<37> b_b20f33e412339049 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 73, 144, 51, 18, 228, 51, 15, 178, - 52, 0, 0, 0, 1, 0, 0, 0, - 66, 71, 232, 130, 21, 122, 87, 182, - 1, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 2, 2, 0, 0, - 49, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 63, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 84, 101, 115, 116, - 80, 97, 114, 97, 109, 115, 49, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 4, 0, 0, 0, 3, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 58, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 3, 0, 1, 0, - 20, 0, 0, 0, 2, 0, 1, 0, - 112, 97, 114, 97, 109, 48, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_b20f33e412339049 = b_b20f33e412339049.words; -#if !CAPNP_LITE -static const uint16_t m_b20f33e412339049[] = {0}; -static const uint16_t i_b20f33e412339049[] = {0}; -const ::capnp::_::RawSchema s_b20f33e412339049 = { - 0xb20f33e412339049, b_b20f33e412339049.words, 37, nullptr, m_b20f33e412339049, - 0, 1, i_b20f33e412339049, nullptr, nullptr, { &s_b20f33e412339049, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<68> b_d1342392ab536963 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 99, 105, 83, 171, 146, 35, 52, 209, - 52, 0, 0, 0, 1, 0, 0, 0, - 66, 71, 232, 130, 21, 122, 87, 182, - 3, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 10, 2, 0, 0, - 53, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 49, 0, 0, 0, 175, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 84, 101, 115, 116, - 82, 101, 115, 117, 108, 116, 115, 49, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 12, 0, 0, 0, 3, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 69, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 3, 0, 1, 0, - 76, 0, 0, 0, 2, 0, 1, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 73, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 68, 0, 0, 0, 3, 0, 1, 0, - 80, 0, 0, 0, 2, 0, 1, 0, - 2, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 77, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 72, 0, 0, 0, 3, 0, 1, 0, - 84, 0, 0, 0, 2, 0, 1, 0, - 114, 101, 115, 117, 108, 116, 48, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 101, 115, 117, 108, 116, 49, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 101, 115, 117, 108, 116, 50, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_d1342392ab536963 = b_d1342392ab536963.words; -#if !CAPNP_LITE -static const uint16_t m_d1342392ab536963[] = {0, 1, 2}; -static const uint16_t i_d1342392ab536963[] = {0, 1, 2}; -const ::capnp::_::RawSchema s_d1342392ab536963 = { - 0xd1342392ab536963, b_d1342392ab536963.words, 68, nullptr, m_d1342392ab536963, - 0, 3, i_d1342392ab536963, nullptr, nullptr, { &s_d1342392ab536963, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<37> b_b1af51b6aef0e7bc = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 188, 231, 240, 174, 182, 81, 175, 177, - 52, 0, 0, 0, 1, 0, 1, 0, - 66, 71, 232, 130, 21, 122, 87, 182, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 226, 1, 0, 0, - 49, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 63, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 83, 116, 114, 117, - 99, 116, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 4, 0, 0, 0, 3, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 3, 0, 1, 0, - 20, 0, 0, 0, 2, 0, 1, 0, - 102, 48, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_b1af51b6aef0e7bc = b_b1af51b6aef0e7bc.words; -#if !CAPNP_LITE -static const uint16_t m_b1af51b6aef0e7bc[] = {0}; -static const uint16_t i_b1af51b6aef0e7bc[] = {0}; -const ::capnp::_::RawSchema s_b1af51b6aef0e7bc = { - 0xb1af51b6aef0e7bc, b_b1af51b6aef0e7bc.words, 37, nullptr, m_b1af51b6aef0e7bc, - 0, 1, i_b1af51b6aef0e7bc, nullptr, nullptr, { &s_b1af51b6aef0e7bc, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<43> b_ac6d126c2fac16eb = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 235, 22, 172, 47, 108, 18, 109, 172, - 52, 0, 0, 0, 3, 0, 0, 0, - 66, 71, 232, 130, 21, 122, 87, 182, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 218, 1, 0, 0, - 49, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 135, 0, 0, 0, - 125, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 73, 102, 97, 99, - 101, 48, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 8, 0, 0, 0, 3, 0, 5, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 75, 41, 118, 170, 237, 119, 141, 188, - 62, 103, 132, 166, 74, 226, 68, 247, - 49, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 37, 0, 0, 0, 7, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 36, 243, 52, 210, 120, 91, 194, 200, - 110, 177, 192, 119, 51, 154, 95, 153, - 25, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 7, 0, 0, 0, - 109, 101, 116, 104, 111, 100, 48, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 109, 101, 116, 104, 111, 100, 49, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, 1, 0, } -}; -::capnp::word const* const bp_ac6d126c2fac16eb = b_ac6d126c2fac16eb.words; -#if !CAPNP_LITE -static const ::capnp::_::RawSchema* const d_ac6d126c2fac16eb[] = { - &s_995f9a3377c0b16e, - &s_bc8d77edaa76294b, - &s_c8c25b78d234f324, - &s_f744e24aa684673e, -}; -static const uint16_t m_ac6d126c2fac16eb[] = {0, 1}; -const ::capnp::_::RawSchema s_ac6d126c2fac16eb = { - 0xac6d126c2fac16eb, b_ac6d126c2fac16eb.words, 43, d_ac6d126c2fac16eb, m_ac6d126c2fac16eb, - 4, 2, nullptr, nullptr, nullptr, { &s_ac6d126c2fac16eb, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<22> b_bc8d77edaa76294b = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 75, 41, 118, 170, 237, 119, 141, 188, - 59, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 82, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 73, 102, 97, 99, - 101, 48, 46, 109, 101, 116, 104, 111, - 100, 48, 36, 80, 97, 114, 97, 109, - 115, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_bc8d77edaa76294b = b_bc8d77edaa76294b.words; -#if !CAPNP_LITE -const ::capnp::_::RawSchema s_bc8d77edaa76294b = { - 0xbc8d77edaa76294b, b_bc8d77edaa76294b.words, 22, nullptr, nullptr, - 0, 0, nullptr, nullptr, nullptr, { &s_bc8d77edaa76294b, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<22> b_f744e24aa684673e = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 62, 103, 132, 166, 74, 226, 68, 247, - 59, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 90, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 73, 102, 97, 99, - 101, 48, 46, 109, 101, 116, 104, 111, - 100, 48, 36, 82, 101, 115, 117, 108, - 116, 115, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_f744e24aa684673e = b_f744e24aa684673e.words; -#if !CAPNP_LITE -const ::capnp::_::RawSchema s_f744e24aa684673e = { - 0xf744e24aa684673e, b_f744e24aa684673e.words, 22, nullptr, nullptr, - 0, 0, nullptr, nullptr, nullptr, { &s_f744e24aa684673e, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<22> b_c8c25b78d234f324 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 36, 243, 52, 210, 120, 91, 194, 200, - 59, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 82, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 73, 102, 97, 99, - 101, 48, 46, 109, 101, 116, 104, 111, - 100, 49, 36, 80, 97, 114, 97, 109, - 115, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_c8c25b78d234f324 = b_c8c25b78d234f324.words; -#if !CAPNP_LITE -const ::capnp::_::RawSchema s_c8c25b78d234f324 = { - 0xc8c25b78d234f324, b_c8c25b78d234f324.words, 22, nullptr, nullptr, - 0, 0, nullptr, nullptr, nullptr, { &s_c8c25b78d234f324, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<52> b_a9395663e97ca3af = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 175, 163, 124, 233, 99, 86, 57, 169, - 52, 0, 0, 0, 1, 0, 0, 0, - 66, 71, 232, 130, 21, 122, 87, 182, - 2, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 226, 1, 0, 0, - 49, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 119, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 83, 116, 114, 117, - 99, 116, 50, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 8, 0, 0, 0, 3, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 41, 0, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 36, 0, 0, 0, 3, 0, 1, 0, - 48, 0, 0, 0, 2, 0, 1, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 40, 0, 0, 0, 3, 0, 1, 0, - 52, 0, 0, 0, 2, 0, 1, 0, - 102, 48, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 49, 105, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 0, - 235, 22, 172, 47, 108, 18, 109, 172, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_a9395663e97ca3af = b_a9395663e97ca3af.words; -#if !CAPNP_LITE -static const ::capnp::_::RawSchema* const d_a9395663e97ca3af[] = { - &s_ac6d126c2fac16eb, -}; -static const uint16_t m_a9395663e97ca3af[] = {0, 1}; -static const uint16_t i_a9395663e97ca3af[] = {0, 1}; -const ::capnp::_::RawSchema s_a9395663e97ca3af = { - 0xa9395663e97ca3af, b_a9395663e97ca3af.words, 52, d_a9395663e97ca3af, m_a9395663e97ca3af, - 1, 2, i_a9395663e97ca3af, nullptr, nullptr, { &s_a9395663e97ca3af, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<45> b_9c0c5ee4bb0cc725 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 37, 199, 12, 187, 228, 94, 12, 156, - 52, 0, 0, 0, 3, 0, 0, 0, - 66, 71, 232, 130, 21, 122, 87, 182, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 234, 1, 0, 0, - 49, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 135, 0, 0, 0, - 133, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 84, 101, 115, 116, - 67, 97, 112, 48, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 8, 0, 0, 0, 3, 0, 5, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 176, 90, 150, 222, 56, 177, 225, 145, - 191, 220, 209, 59, 60, 221, 123, 167, - 49, 0, 0, 0, 98, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 41, 0, 0, 0, 7, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 73, 144, 51, 18, 228, 51, 15, 178, - 99, 105, 83, 171, 146, 35, 52, 209, - 29, 0, 0, 0, 98, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 7, 0, 0, 0, - 116, 101, 115, 116, 77, 101, 116, 104, - 111, 100, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 116, 101, 115, 116, 77, 101, 116, 104, - 111, 100, 49, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, 1, 0, } -}; -::capnp::word const* const bp_9c0c5ee4bb0cc725 = b_9c0c5ee4bb0cc725.words; -#if !CAPNP_LITE -static const ::capnp::_::RawSchema* const d_9c0c5ee4bb0cc725[] = { - &s_91e1b138de965ab0, - &s_a77bdd3c3bd1dcbf, - &s_b20f33e412339049, - &s_d1342392ab536963, -}; -static const uint16_t m_9c0c5ee4bb0cc725[] = {0, 1}; -const ::capnp::_::RawSchema s_9c0c5ee4bb0cc725 = { - 0x9c0c5ee4bb0cc725, b_9c0c5ee4bb0cc725.words, 45, d_9c0c5ee4bb0cc725, m_9c0c5ee4bb0cc725, - 4, 2, nullptr, nullptr, nullptr, { &s_9c0c5ee4bb0cc725, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<23> b_d88e8bb64ed6f7b1 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 177, 247, 214, 78, 182, 139, 142, 216, - 52, 0, 0, 0, 3, 0, 0, 0, - 66, 71, 232, 130, 21, 122, 87, 182, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 234, 1, 0, 0, - 49, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 7, 0, 0, 0, - 45, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 84, 101, 115, 116, - 67, 97, 112, 49, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 3, 0, 5, 0, - 0, 0, 0, 0, 1, 0, 1, 0, } -}; -::capnp::word const* const bp_d88e8bb64ed6f7b1 = b_d88e8bb64ed6f7b1.words; -#if !CAPNP_LITE -const ::capnp::_::RawSchema s_d88e8bb64ed6f7b1 = { - 0xd88e8bb64ed6f7b1, b_d88e8bb64ed6f7b1.words, 23, nullptr, nullptr, - 0, 0, nullptr, nullptr, nullptr, { &s_d88e8bb64ed6f7b1, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<46> b_d52dcf38c9f6f7c0 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 192, 247, 246, 201, 56, 207, 45, 213, - 52, 0, 0, 0, 3, 0, 0, 0, - 66, 71, 232, 130, 21, 122, 87, 182, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 218, 1, 0, 0, - 49, 0, 0, 0, 23, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 57, 0, 0, 0, 135, 0, 0, 0, - 137, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 73, 102, 97, 99, - 101, 49, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 1, 0, 1, 0, - 56, 221, 253, 251, 98, 168, 12, 128, - 1, 0, 0, 0, 66, 0, 0, 0, - 83, 116, 114, 117, 99, 116, 49, 0, - 8, 0, 0, 0, 3, 0, 5, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 213, 4, 46, 99, 24, 202, 146, 143, - 143, 131, 24, 70, 254, 196, 103, 128, - 49, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 37, 0, 0, 0, 7, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 214, 90, 174, 3, 7, 146, 137, 240, - 6, 245, 17, 195, 170, 21, 109, 195, - 25, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 7, 0, 0, 0, - 109, 101, 116, 104, 111, 100, 48, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 109, 101, 116, 104, 111, 100, 49, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, 1, 0, } -}; -::capnp::word const* const bp_d52dcf38c9f6f7c0 = b_d52dcf38c9f6f7c0.words; -#if !CAPNP_LITE -static const ::capnp::_::RawSchema* const d_d52dcf38c9f6f7c0[] = { - &s_8067c4fe4618838f, - &s_8f92ca18632e04d5, - &s_c36d15aac311f506, - &s_f089920703ae5ad6, -}; -static const uint16_t m_d52dcf38c9f6f7c0[] = {0, 1}; -const ::capnp::_::RawSchema s_d52dcf38c9f6f7c0 = { - 0xd52dcf38c9f6f7c0, b_d52dcf38c9f6f7c0.words, 46, d_d52dcf38c9f6f7c0, m_d52dcf38c9f6f7c0, - 4, 2, nullptr, nullptr, nullptr, { &s_d52dcf38c9f6f7c0, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<53> b_800ca862fbfddd38 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 56, 221, 253, 251, 98, 168, 12, 128, - 59, 0, 0, 0, 1, 0, 1, 0, - 192, 247, 246, 201, 56, 207, 45, 213, - 1, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 26, 2, 0, 0, - 53, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 49, 0, 0, 0, 119, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 73, 102, 97, 99, - 101, 49, 46, 83, 116, 114, 117, 99, - 116, 49, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 8, 0, 0, 0, 3, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 41, 0, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 36, 0, 0, 0, 3, 0, 1, 0, - 48, 0, 0, 0, 2, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 40, 0, 0, 0, 3, 0, 1, 0, - 52, 0, 0, 0, 2, 0, 1, 0, - 102, 48, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 102, 49, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_800ca862fbfddd38 = b_800ca862fbfddd38.words; -#if !CAPNP_LITE -static const uint16_t m_800ca862fbfddd38[] = {0, 1}; -static const uint16_t i_800ca862fbfddd38[] = {0, 1}; -const ::capnp::_::RawSchema s_800ca862fbfddd38 = { - 0x800ca862fbfddd38, b_800ca862fbfddd38.words, 53, nullptr, m_800ca862fbfddd38, - 0, 2, i_800ca862fbfddd38, nullptr, nullptr, { &s_800ca862fbfddd38, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<22> b_8f92ca18632e04d5 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 213, 4, 46, 99, 24, 202, 146, 143, - 59, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 82, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 73, 102, 97, 99, - 101, 49, 46, 109, 101, 116, 104, 111, - 100, 48, 36, 80, 97, 114, 97, 109, - 115, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_8f92ca18632e04d5 = b_8f92ca18632e04d5.words; -#if !CAPNP_LITE -const ::capnp::_::RawSchema s_8f92ca18632e04d5 = { - 0x8f92ca18632e04d5, b_8f92ca18632e04d5.words, 22, nullptr, nullptr, - 0, 0, nullptr, nullptr, nullptr, { &s_8f92ca18632e04d5, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<53> b_8067c4fe4618838f = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 143, 131, 24, 70, 254, 196, 103, 128, - 59, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 2, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 90, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 49, 0, 0, 0, 119, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 73, 102, 97, 99, - 101, 49, 46, 109, 101, 116, 104, 111, - 100, 48, 36, 82, 101, 115, 117, 108, - 116, 115, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 3, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 41, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 36, 0, 0, 0, 3, 0, 1, 0, - 48, 0, 0, 0, 2, 0, 1, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 40, 0, 0, 0, 3, 0, 1, 0, - 52, 0, 0, 0, 2, 0, 1, 0, - 114, 101, 115, 117, 108, 116, 48, 0, - 16, 0, 0, 0, 0, 0, 0, 0, - 188, 231, 240, 174, 182, 81, 175, 177, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 101, 115, 117, 108, 116, 49, 0, - 16, 0, 0, 0, 0, 0, 0, 0, - 56, 221, 253, 251, 98, 168, 12, 128, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_8067c4fe4618838f = b_8067c4fe4618838f.words; -#if !CAPNP_LITE -static const ::capnp::_::RawSchema* const d_8067c4fe4618838f[] = { - &s_800ca862fbfddd38, - &s_b1af51b6aef0e7bc, -}; -static const uint16_t m_8067c4fe4618838f[] = {0, 1}; -static const uint16_t i_8067c4fe4618838f[] = {0, 1}; -const ::capnp::_::RawSchema s_8067c4fe4618838f = { - 0x8067c4fe4618838f, b_8067c4fe4618838f.words, 53, d_8067c4fe4618838f, m_8067c4fe4618838f, - 2, 2, i_8067c4fe4618838f, nullptr, nullptr, { &s_8067c4fe4618838f, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<22> b_f089920703ae5ad6 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 214, 90, 174, 3, 7, 146, 137, 240, - 59, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 82, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 73, 102, 97, 99, - 101, 49, 46, 109, 101, 116, 104, 111, - 100, 49, 36, 80, 97, 114, 97, 109, - 115, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_f089920703ae5ad6 = b_f089920703ae5ad6.words; -#if !CAPNP_LITE -const ::capnp::_::RawSchema s_f089920703ae5ad6 = { - 0xf089920703ae5ad6, b_f089920703ae5ad6.words, 22, nullptr, nullptr, - 0, 0, nullptr, nullptr, nullptr, { &s_f089920703ae5ad6, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<38> b_c36d15aac311f506 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 6, 245, 17, 195, 170, 21, 109, 195, - 59, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 90, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 49, 0, 0, 0, 63, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 114, 117, 110, 116, 105, 109, 101, 47, - 115, 114, 99, 47, 116, 101, 115, 116, - 47, 106, 97, 118, 97, 47, 111, 114, - 103, 47, 99, 97, 112, 110, 112, 114, - 111, 116, 111, 47, 100, 101, 109, 111, - 47, 100, 101, 109, 111, 46, 99, 97, - 112, 110, 112, 58, 73, 102, 97, 99, - 101, 49, 46, 109, 101, 116, 104, 111, - 100, 49, 36, 82, 101, 115, 117, 108, - 116, 115, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 3, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 3, 0, 1, 0, - 20, 0, 0, 0, 2, 0, 1, 0, - 114, 101, 115, 117, 108, 116, 48, 0, - 17, 0, 0, 0, 0, 0, 0, 0, - 235, 22, 172, 47, 108, 18, 109, 172, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, } -}; -::capnp::word const* const bp_c36d15aac311f506 = b_c36d15aac311f506.words; -#if !CAPNP_LITE -static const ::capnp::_::RawSchema* const d_c36d15aac311f506[] = { - &s_ac6d126c2fac16eb, -}; -static const uint16_t m_c36d15aac311f506[] = {0}; -static const uint16_t i_c36d15aac311f506[] = {0}; -const ::capnp::_::RawSchema s_c36d15aac311f506 = { - 0xc36d15aac311f506, b_c36d15aac311f506.words, 38, d_c36d15aac311f506, m_c36d15aac311f506, - 1, 1, i_c36d15aac311f506, nullptr, nullptr, { &s_c36d15aac311f506, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -} // namespace schemas -} // namespace capnp - -// ======================================================================================= - - -// TestParams0 -constexpr uint16_t TestParams0::_capnpPrivate::dataWordSize; -constexpr uint16_t TestParams0::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind TestParams0::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* TestParams0::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// TestResults0 -constexpr uint16_t TestResults0::_capnpPrivate::dataWordSize; -constexpr uint16_t TestResults0::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind TestResults0::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* TestResults0::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// TestParams1 -constexpr uint16_t TestParams1::_capnpPrivate::dataWordSize; -constexpr uint16_t TestParams1::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind TestParams1::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* TestParams1::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// TestResults1 -constexpr uint16_t TestResults1::_capnpPrivate::dataWordSize; -constexpr uint16_t TestResults1::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind TestResults1::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* TestResults1::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// Struct0 -constexpr uint16_t Struct0::_capnpPrivate::dataWordSize; -constexpr uint16_t Struct0::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind Struct0::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Struct0::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -#if !CAPNP_LITE -::capnp::Request< ::Iface0::Method0Params, ::Iface0::Method0Results> -Iface0::Client::method0Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { - return newCall< ::Iface0::Method0Params, ::Iface0::Method0Results>( - 0xac6d126c2fac16ebull, 0, sizeHint); -} -::kj::Promise Iface0::Server::method0(Method0Context) { - return ::capnp::Capability::Server::internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method0", - 0xac6d126c2fac16ebull, 0); -} -::capnp::StreamingRequest< ::Iface0::Method1Params> -Iface0::Client::method1Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { - return newStreamingCall< ::Iface0::Method1Params>( - 0xac6d126c2fac16ebull, 1, sizeHint); -} -::kj::Promise Iface0::Server::method1(Method1Context) { - return ::capnp::Capability::Server::internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", "method1", - 0xac6d126c2fac16ebull, 1); -} -::capnp::Capability::Server::DispatchCallResult Iface0::Server::dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (interfaceId) { - case 0xac6d126c2fac16ebull: - return dispatchCallInternal(methodId, context); - default: - return internalUnimplemented("runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", interfaceId); - } -} -::capnp::Capability::Server::DispatchCallResult Iface0::Server::dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (methodId) { - case 0: - return { - method0(::capnp::Capability::Server::internalGetTypedContext< - ::Iface0::Method0Params, ::Iface0::Method0Results>(context)), - false - }; - case 1: - return { - kj::evalNow([&]() { - return method1(::capnp::Capability::Server::internalGetTypedStreamingContext< - ::Iface0::Method1Params>(context)); - }), - true - }; - default: - (void)context; - return ::capnp::Capability::Server::internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface0", - 0xac6d126c2fac16ebull, methodId); - } -} -#endif // !CAPNP_LITE - -// Iface0 -#if !CAPNP_LITE -constexpr ::capnp::Kind Iface0::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Iface0::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// Iface0::Method0Params -constexpr uint16_t Iface0::Method0Params::_capnpPrivate::dataWordSize; -constexpr uint16_t Iface0::Method0Params::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind Iface0::Method0Params::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Iface0::Method0Params::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// Iface0::Method0Results -constexpr uint16_t Iface0::Method0Results::_capnpPrivate::dataWordSize; -constexpr uint16_t Iface0::Method0Results::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind Iface0::Method0Results::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Iface0::Method0Results::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// Iface0::Method1Params -constexpr uint16_t Iface0::Method1Params::_capnpPrivate::dataWordSize; -constexpr uint16_t Iface0::Method1Params::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind Iface0::Method1Params::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Iface0::Method1Params::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// Struct2 -constexpr uint16_t Struct2::_capnpPrivate::dataWordSize; -constexpr uint16_t Struct2::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind Struct2::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Struct2::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -#if !CAPNP_LITE -::capnp::Request< ::TestParams0, ::TestResults0> -TestCap0::Client::testMethod0Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { - return newCall< ::TestParams0, ::TestResults0>( - 0x9c0c5ee4bb0cc725ull, 0, sizeHint); -} -::kj::Promise TestCap0::Server::testMethod0(TestMethod0Context) { - return ::capnp::Capability::Server::internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod0", - 0x9c0c5ee4bb0cc725ull, 0); -} -::capnp::Request< ::TestParams1, ::TestResults1> -TestCap0::Client::testMethod1Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { - return newCall< ::TestParams1, ::TestResults1>( - 0x9c0c5ee4bb0cc725ull, 1, sizeHint); -} -::kj::Promise TestCap0::Server::testMethod1(TestMethod1Context) { - return ::capnp::Capability::Server::internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", "testMethod1", - 0x9c0c5ee4bb0cc725ull, 1); -} -::capnp::Capability::Server::DispatchCallResult TestCap0::Server::dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (interfaceId) { - case 0x9c0c5ee4bb0cc725ull: - return dispatchCallInternal(methodId, context); - default: - return internalUnimplemented("runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", interfaceId); - } -} -::capnp::Capability::Server::DispatchCallResult TestCap0::Server::dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (methodId) { - case 0: - return { - testMethod0(::capnp::Capability::Server::internalGetTypedContext< - ::TestParams0, ::TestResults0>(context)), - false - }; - case 1: - return { - testMethod1(::capnp::Capability::Server::internalGetTypedContext< - ::TestParams1, ::TestResults1>(context)), - false - }; - default: - (void)context; - return ::capnp::Capability::Server::internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap0", - 0x9c0c5ee4bb0cc725ull, methodId); - } -} -#endif // !CAPNP_LITE - -// TestCap0 -#if !CAPNP_LITE -constexpr ::capnp::Kind TestCap0::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* TestCap0::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -#if !CAPNP_LITE -::capnp::Capability::Server::DispatchCallResult TestCap1::Server::dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (interfaceId) { - case 0xd88e8bb64ed6f7b1ull: - return dispatchCallInternal(methodId, context); - default: - return internalUnimplemented("runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap1", interfaceId); - } -} -::capnp::Capability::Server::DispatchCallResult TestCap1::Server::dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (methodId) { - default: - (void)context; - return ::capnp::Capability::Server::internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:TestCap1", - 0xd88e8bb64ed6f7b1ull, methodId); - } -} -#endif // !CAPNP_LITE - -// TestCap1 -#if !CAPNP_LITE -constexpr ::capnp::Kind TestCap1::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* TestCap1::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -#if !CAPNP_LITE -::capnp::Request< ::Iface1::Method0Params, ::Iface1::Method0Results> -Iface1::Client::method0Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { - return newCall< ::Iface1::Method0Params, ::Iface1::Method0Results>( - 0xd52dcf38c9f6f7c0ull, 0, sizeHint); -} -::kj::Promise Iface1::Server::method0(Method0Context) { - return ::capnp::Capability::Server::internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method0", - 0xd52dcf38c9f6f7c0ull, 0); -} -::capnp::Request< ::Iface1::Method1Params, ::Iface1::Method1Results> -Iface1::Client::method1Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { - return newCall< ::Iface1::Method1Params, ::Iface1::Method1Results>( - 0xd52dcf38c9f6f7c0ull, 1, sizeHint); -} -::kj::Promise Iface1::Server::method1(Method1Context) { - return ::capnp::Capability::Server::internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", "method1", - 0xd52dcf38c9f6f7c0ull, 1); -} -::capnp::Capability::Server::DispatchCallResult Iface1::Server::dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (interfaceId) { - case 0xd52dcf38c9f6f7c0ull: - return dispatchCallInternal(methodId, context); - default: - return internalUnimplemented("runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", interfaceId); - } -} -::capnp::Capability::Server::DispatchCallResult Iface1::Server::dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (methodId) { - case 0: - return { - method0(::capnp::Capability::Server::internalGetTypedContext< - ::Iface1::Method0Params, ::Iface1::Method0Results>(context)), - false - }; - case 1: - return { - method1(::capnp::Capability::Server::internalGetTypedContext< - ::Iface1::Method1Params, ::Iface1::Method1Results>(context)), - false - }; - default: - (void)context; - return ::capnp::Capability::Server::internalUnimplemented( - "runtime/src/test/java/org/capnproto/demo/demo.capnp:Iface1", - 0xd52dcf38c9f6f7c0ull, methodId); - } -} -#endif // !CAPNP_LITE - -// Iface1 -#if !CAPNP_LITE -constexpr ::capnp::Kind Iface1::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Iface1::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// Iface1::Struct1 -constexpr uint16_t Iface1::Struct1::_capnpPrivate::dataWordSize; -constexpr uint16_t Iface1::Struct1::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind Iface1::Struct1::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Iface1::Struct1::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// Iface1::Method0Params -constexpr uint16_t Iface1::Method0Params::_capnpPrivate::dataWordSize; -constexpr uint16_t Iface1::Method0Params::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind Iface1::Method0Params::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Iface1::Method0Params::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// Iface1::Method0Results -constexpr uint16_t Iface1::Method0Results::_capnpPrivate::dataWordSize; -constexpr uint16_t Iface1::Method0Results::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind Iface1::Method0Results::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Iface1::Method0Results::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// Iface1::Method1Params -constexpr uint16_t Iface1::Method1Params::_capnpPrivate::dataWordSize; -constexpr uint16_t Iface1::Method1Params::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind Iface1::Method1Params::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Iface1::Method1Params::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -// Iface1::Method1Results -constexpr uint16_t Iface1::Method1Results::_capnpPrivate::dataWordSize; -constexpr uint16_t Iface1::Method1Results::_capnpPrivate::pointerCount; -#if !CAPNP_LITE -constexpr ::capnp::Kind Iface1::Method1Results::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* Iface1::Method1Results::_capnpPrivate::schema; -#endif // !CAPNP_LITE - - - diff --git a/runtime/src/test/java/org/capnproto/demo/demo.capnp.h b/runtime/src/test/java/org/capnproto/demo/demo.capnp.h deleted file mode 100644 index bdcd8bc5..00000000 --- a/runtime/src/test/java/org/capnproto/demo/demo.capnp.h +++ /dev/null @@ -1,2106 +0,0 @@ -// Generated by Cap'n Proto compiler, DO NOT EDIT -// source: demo.capnp - -#pragma once - -#include -#include -#if !CAPNP_LITE -#include -#endif // !CAPNP_LITE - -#if CAPNP_VERSION != 8000 -#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." -#endif - - -namespace capnp { -namespace schemas { - -CAPNP_DECLARE_SCHEMA(91e1b138de965ab0); -CAPNP_DECLARE_SCHEMA(a77bdd3c3bd1dcbf); -CAPNP_DECLARE_SCHEMA(b20f33e412339049); -CAPNP_DECLARE_SCHEMA(d1342392ab536963); -CAPNP_DECLARE_SCHEMA(b1af51b6aef0e7bc); -CAPNP_DECLARE_SCHEMA(ac6d126c2fac16eb); -CAPNP_DECLARE_SCHEMA(bc8d77edaa76294b); -CAPNP_DECLARE_SCHEMA(f744e24aa684673e); -CAPNP_DECLARE_SCHEMA(c8c25b78d234f324); -CAPNP_DECLARE_SCHEMA(a9395663e97ca3af); -CAPNP_DECLARE_SCHEMA(9c0c5ee4bb0cc725); -CAPNP_DECLARE_SCHEMA(d88e8bb64ed6f7b1); -CAPNP_DECLARE_SCHEMA(d52dcf38c9f6f7c0); -CAPNP_DECLARE_SCHEMA(800ca862fbfddd38); -CAPNP_DECLARE_SCHEMA(8f92ca18632e04d5); -CAPNP_DECLARE_SCHEMA(8067c4fe4618838f); -CAPNP_DECLARE_SCHEMA(f089920703ae5ad6); -CAPNP_DECLARE_SCHEMA(c36d15aac311f506); - -} // namespace schemas -} // namespace capnp - - -struct TestParams0 { - TestParams0() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(91e1b138de965ab0, 1, 0) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct TestResults0 { - TestResults0() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(a77bdd3c3bd1dcbf, 1, 0) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct TestParams1 { - TestParams1() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(b20f33e412339049, 0, 1) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct TestResults1 { - TestResults1() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(d1342392ab536963, 0, 3) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct Struct0 { - Struct0() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(b1af51b6aef0e7bc, 1, 0) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct Iface0 { - Iface0() = delete; - -#if !CAPNP_LITE - class Client; - class Server; -#endif // !CAPNP_LITE - - struct Method0Params; - struct Method0Results; - struct Method1Params; - - #if !CAPNP_LITE - struct _capnpPrivate { - CAPNP_DECLARE_INTERFACE_HEADER(ac6d126c2fac16eb) - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - }; - #endif // !CAPNP_LITE -}; - -struct Iface0::Method0Params { - Method0Params() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(bc8d77edaa76294b, 0, 0) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct Iface0::Method0Results { - Method0Results() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(f744e24aa684673e, 0, 0) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct Iface0::Method1Params { - Method1Params() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(c8c25b78d234f324, 0, 0) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct Struct2 { - Struct2() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(a9395663e97ca3af, 0, 2) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct TestCap0 { - TestCap0() = delete; - -#if !CAPNP_LITE - class Client; - class Server; -#endif // !CAPNP_LITE - - - #if !CAPNP_LITE - struct _capnpPrivate { - CAPNP_DECLARE_INTERFACE_HEADER(9c0c5ee4bb0cc725) - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - }; - #endif // !CAPNP_LITE -}; - -struct TestCap1 { - TestCap1() = delete; - -#if !CAPNP_LITE - class Client; - class Server; -#endif // !CAPNP_LITE - - - #if !CAPNP_LITE - struct _capnpPrivate { - CAPNP_DECLARE_INTERFACE_HEADER(d88e8bb64ed6f7b1) - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - }; - #endif // !CAPNP_LITE -}; - -struct Iface1 { - Iface1() = delete; - -#if !CAPNP_LITE - class Client; - class Server; -#endif // !CAPNP_LITE - - struct Struct1; - struct Method0Params; - struct Method0Results; - struct Method1Params; - struct Method1Results; - - #if !CAPNP_LITE - struct _capnpPrivate { - CAPNP_DECLARE_INTERFACE_HEADER(d52dcf38c9f6f7c0) - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - }; - #endif // !CAPNP_LITE -}; - -struct Iface1::Struct1 { - Struct1() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(800ca862fbfddd38, 1, 1) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct Iface1::Method0Params { - Method0Params() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(8f92ca18632e04d5, 0, 0) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct Iface1::Method0Results { - Method0Results() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(8067c4fe4618838f, 0, 2) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct Iface1::Method1Params { - Method1Params() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(f089920703ae5ad6, 0, 0) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -struct Iface1::Method1Results { - Method1Results() = delete; - - class Reader; - class Builder; - class Pipeline; - - struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(c36d15aac311f506, 0, 1) - #if !CAPNP_LITE - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - #endif // !CAPNP_LITE - }; -}; - -// ======================================================================================= - -class TestParams0::Reader { -public: - typedef TestParams0 Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - - inline ::int32_t getParam0() const; - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class TestParams0::Builder { -public: - typedef TestParams0 Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - - inline ::int32_t getParam0(); - inline void setParam0( ::int32_t value); - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class TestParams0::Pipeline { -public: - typedef TestParams0 Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -class TestResults0::Reader { -public: - typedef TestResults0 Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - - inline ::int32_t getResult0() const; - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class TestResults0::Builder { -public: - typedef TestResults0 Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - - inline ::int32_t getResult0(); - inline void setResult0( ::int32_t value); - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class TestResults0::Pipeline { -public: - typedef TestResults0 Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -class TestParams1::Reader { -public: - typedef TestParams1 Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - - inline bool hasParam0() const; - inline ::capnp::AnyPointer::Reader getParam0() const; - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class TestParams1::Builder { -public: - typedef TestParams1 Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - - inline bool hasParam0(); - inline ::capnp::AnyPointer::Builder getParam0(); - inline ::capnp::AnyPointer::Builder initParam0(); - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class TestParams1::Pipeline { -public: - typedef TestParams1 Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -class TestResults1::Reader { -public: - typedef TestResults1 Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - - inline bool hasResult0() const; - inline ::capnp::AnyPointer::Reader getResult0() const; - - inline bool hasResult1() const; - inline ::capnp::AnyPointer::Reader getResult1() const; - - inline bool hasResult2() const; - inline ::capnp::AnyPointer::Reader getResult2() const; - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class TestResults1::Builder { -public: - typedef TestResults1 Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - - inline bool hasResult0(); - inline ::capnp::AnyPointer::Builder getResult0(); - inline ::capnp::AnyPointer::Builder initResult0(); - - inline bool hasResult1(); - inline ::capnp::AnyPointer::Builder getResult1(); - inline ::capnp::AnyPointer::Builder initResult1(); - - inline bool hasResult2(); - inline ::capnp::AnyPointer::Builder getResult2(); - inline ::capnp::AnyPointer::Builder initResult2(); - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class TestResults1::Pipeline { -public: - typedef TestResults1 Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -class Struct0::Reader { -public: - typedef Struct0 Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - - inline bool getF0() const; - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class Struct0::Builder { -public: - typedef Struct0 Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - - inline bool getF0(); - inline void setF0(bool value); - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class Struct0::Pipeline { -public: - typedef Struct0 Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -#if !CAPNP_LITE -class Iface0::Client - : public virtual ::capnp::Capability::Client { -public: - typedef Iface0 Calls; - typedef Iface0 Reads; - - Client(decltype(nullptr)); - explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); - template ()>> - Client(::kj::Own<_t>&& server); - template ()>> - Client(::kj::Promise<_t>&& promise); - Client(::kj::Exception&& exception); - Client(Client&) = default; - Client(Client&&) = default; - Client& operator=(Client& other); - Client& operator=(Client&& other); - - ::capnp::Request< ::Iface0::Method0Params, ::Iface0::Method0Results> method0Request( - ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); - ::capnp::StreamingRequest< ::Iface0::Method1Params> method1Request( - ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); - -protected: - Client() = default; -}; - -class Iface0::Server - : public virtual ::capnp::Capability::Server { -public: - typedef Iface0 Serves; - - ::capnp::Capability::Server::DispatchCallResult dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) - override; - -protected: - typedef ::Iface0::Method0Params Method0Params; - typedef ::Iface0::Method0Results Method0Results; - typedef ::capnp::CallContext Method0Context; - virtual ::kj::Promise method0(Method0Context context); - typedef ::Iface0::Method1Params Method1Params; - typedef ::capnp::StreamingCallContext Method1Context; - virtual ::kj::Promise method1(Method1Context context); - - inline ::Iface0::Client thisCap() { - return ::capnp::Capability::Server::thisCap() - .template castAs< ::Iface0>(); - } - - ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); -}; -#endif // !CAPNP_LITE - -class Iface0::Method0Params::Reader { -public: - typedef Method0Params Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class Iface0::Method0Params::Builder { -public: - typedef Method0Params Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class Iface0::Method0Params::Pipeline { -public: - typedef Method0Params Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -class Iface0::Method0Results::Reader { -public: - typedef Method0Results Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class Iface0::Method0Results::Builder { -public: - typedef Method0Results Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class Iface0::Method0Results::Pipeline { -public: - typedef Method0Results Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -class Iface0::Method1Params::Reader { -public: - typedef Method1Params Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class Iface0::Method1Params::Builder { -public: - typedef Method1Params Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class Iface0::Method1Params::Pipeline { -public: - typedef Method1Params Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -class Struct2::Reader { -public: - typedef Struct2 Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - - inline bool hasF0() const; - inline ::capnp::AnyPointer::Reader getF0() const; - - inline bool hasF1i() const; -#if !CAPNP_LITE - inline ::Iface0::Client getF1i() const; -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class Struct2::Builder { -public: - typedef Struct2 Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - - inline bool hasF0(); - inline ::capnp::AnyPointer::Builder getF0(); - inline ::capnp::AnyPointer::Builder initF0(); - - inline bool hasF1i(); -#if !CAPNP_LITE - inline ::Iface0::Client getF1i(); - inline void setF1i( ::Iface0::Client&& value); - inline void setF1i( ::Iface0::Client& value); - inline void adoptF1i(::capnp::Orphan< ::Iface0>&& value); - inline ::capnp::Orphan< ::Iface0> disownF1i(); -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class Struct2::Pipeline { -public: - typedef Struct2 Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - - inline ::Iface0::Client getF1i(); -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -#if !CAPNP_LITE -class TestCap0::Client - : public virtual ::capnp::Capability::Client { -public: - typedef TestCap0 Calls; - typedef TestCap0 Reads; - - Client(decltype(nullptr)); - explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); - template ()>> - Client(::kj::Own<_t>&& server); - template ()>> - Client(::kj::Promise<_t>&& promise); - Client(::kj::Exception&& exception); - Client(Client&) = default; - Client(Client&&) = default; - Client& operator=(Client& other); - Client& operator=(Client&& other); - - ::capnp::Request< ::TestParams0, ::TestResults0> testMethod0Request( - ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); - ::capnp::Request< ::TestParams1, ::TestResults1> testMethod1Request( - ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); - -protected: - Client() = default; -}; - -class TestCap0::Server - : public virtual ::capnp::Capability::Server { -public: - typedef TestCap0 Serves; - - ::capnp::Capability::Server::DispatchCallResult dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) - override; - -protected: - typedef ::capnp::CallContext< ::TestParams0, ::TestResults0> TestMethod0Context; - virtual ::kj::Promise testMethod0(TestMethod0Context context); - typedef ::capnp::CallContext< ::TestParams1, ::TestResults1> TestMethod1Context; - virtual ::kj::Promise testMethod1(TestMethod1Context context); - - inline ::TestCap0::Client thisCap() { - return ::capnp::Capability::Server::thisCap() - .template castAs< ::TestCap0>(); - } - - ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); -}; -#endif // !CAPNP_LITE - -#if !CAPNP_LITE -class TestCap1::Client - : public virtual ::capnp::Capability::Client { -public: - typedef TestCap1 Calls; - typedef TestCap1 Reads; - - Client(decltype(nullptr)); - explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); - template ()>> - Client(::kj::Own<_t>&& server); - template ()>> - Client(::kj::Promise<_t>&& promise); - Client(::kj::Exception&& exception); - Client(Client&) = default; - Client(Client&&) = default; - Client& operator=(Client& other); - Client& operator=(Client&& other); - - -protected: - Client() = default; -}; - -class TestCap1::Server - : public virtual ::capnp::Capability::Server { -public: - typedef TestCap1 Serves; - - ::capnp::Capability::Server::DispatchCallResult dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) - override; - -protected: - - inline ::TestCap1::Client thisCap() { - return ::capnp::Capability::Server::thisCap() - .template castAs< ::TestCap1>(); - } - - ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); -}; -#endif // !CAPNP_LITE - -#if !CAPNP_LITE -class Iface1::Client - : public virtual ::capnp::Capability::Client { -public: - typedef Iface1 Calls; - typedef Iface1 Reads; - - Client(decltype(nullptr)); - explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); - template ()>> - Client(::kj::Own<_t>&& server); - template ()>> - Client(::kj::Promise<_t>&& promise); - Client(::kj::Exception&& exception); - Client(Client&) = default; - Client(Client&&) = default; - Client& operator=(Client& other); - Client& operator=(Client&& other); - - ::capnp::Request< ::Iface1::Method0Params, ::Iface1::Method0Results> method0Request( - ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); - ::capnp::Request< ::Iface1::Method1Params, ::Iface1::Method1Results> method1Request( - ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); - -protected: - Client() = default; -}; - -class Iface1::Server - : public virtual ::capnp::Capability::Server { -public: - typedef Iface1 Serves; - - ::capnp::Capability::Server::DispatchCallResult dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) - override; - -protected: - typedef ::Iface1::Method0Params Method0Params; - typedef ::Iface1::Method0Results Method0Results; - typedef ::capnp::CallContext Method0Context; - virtual ::kj::Promise method0(Method0Context context); - typedef ::Iface1::Method1Params Method1Params; - typedef ::Iface1::Method1Results Method1Results; - typedef ::capnp::CallContext Method1Context; - virtual ::kj::Promise method1(Method1Context context); - - inline ::Iface1::Client thisCap() { - return ::capnp::Capability::Server::thisCap() - .template castAs< ::Iface1>(); - } - - ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); -}; -#endif // !CAPNP_LITE - -class Iface1::Struct1::Reader { -public: - typedef Struct1 Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - - inline bool getF0() const; - - inline bool hasF1() const; - inline ::capnp::AnyPointer::Reader getF1() const; - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class Iface1::Struct1::Builder { -public: - typedef Struct1 Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - - inline bool getF0(); - inline void setF0(bool value); - - inline bool hasF1(); - inline ::capnp::AnyPointer::Builder getF1(); - inline ::capnp::AnyPointer::Builder initF1(); - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class Iface1::Struct1::Pipeline { -public: - typedef Struct1 Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -class Iface1::Method0Params::Reader { -public: - typedef Method0Params Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class Iface1::Method0Params::Builder { -public: - typedef Method0Params Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class Iface1::Method0Params::Pipeline { -public: - typedef Method0Params Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -class Iface1::Method0Results::Reader { -public: - typedef Method0Results Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - - inline bool hasResult0() const; - inline ::Struct0::Reader getResult0() const; - - inline bool hasResult1() const; - inline ::Iface1::Struct1::Reader getResult1() const; - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class Iface1::Method0Results::Builder { -public: - typedef Method0Results Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - - inline bool hasResult0(); - inline ::Struct0::Builder getResult0(); - inline void setResult0( ::Struct0::Reader value); - inline ::Struct0::Builder initResult0(); - inline void adoptResult0(::capnp::Orphan< ::Struct0>&& value); - inline ::capnp::Orphan< ::Struct0> disownResult0(); - - inline bool hasResult1(); - inline ::Iface1::Struct1::Builder getResult1(); - inline void setResult1( ::Iface1::Struct1::Reader value); - inline ::Iface1::Struct1::Builder initResult1(); - inline void adoptResult1(::capnp::Orphan< ::Iface1::Struct1>&& value); - inline ::capnp::Orphan< ::Iface1::Struct1> disownResult1(); - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class Iface1::Method0Results::Pipeline { -public: - typedef Method0Results Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - - inline ::Struct0::Pipeline getResult0(); - inline ::Iface1::Struct1::Pipeline getResult1(); -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -class Iface1::Method1Params::Reader { -public: - typedef Method1Params Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class Iface1::Method1Params::Builder { -public: - typedef Method1Params Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class Iface1::Method1Params::Pipeline { -public: - typedef Method1Params Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -class Iface1::Method1Results::Reader { -public: - typedef Method1Results Reads; - - Reader() = default; - inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} - - inline ::capnp::MessageSize totalSize() const { - return _reader.totalSize().asPublic(); - } - -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { - return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); - } -#endif // !CAPNP_LITE - - inline bool hasResult0() const; -#if !CAPNP_LITE - inline ::Iface0::Client getResult0() const; -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructReader _reader; - template - friend struct ::capnp::ToDynamic_; - template - friend struct ::capnp::_::PointerHelpers; - template - friend struct ::capnp::List; - friend class ::capnp::MessageBuilder; - friend class ::capnp::Orphanage; -}; - -class Iface1::Method1Results::Builder { -public: - typedef Method1Results Builds; - - Builder() = delete; // Deleted to discourage incorrect usage. - // You can explicitly initialize to nullptr instead. - inline Builder(decltype(nullptr)) {} - inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} - inline operator Reader() const { return Reader(_builder.asReader()); } - inline Reader asReader() const { return *this; } - - inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } -#if !CAPNP_LITE - inline ::kj::StringTree toString() const { return asReader().toString(); } -#endif // !CAPNP_LITE - - inline bool hasResult0(); -#if !CAPNP_LITE - inline ::Iface0::Client getResult0(); - inline void setResult0( ::Iface0::Client&& value); - inline void setResult0( ::Iface0::Client& value); - inline void adoptResult0(::capnp::Orphan< ::Iface0>&& value); - inline ::capnp::Orphan< ::Iface0> disownResult0(); -#endif // !CAPNP_LITE - -private: - ::capnp::_::StructBuilder _builder; - template - friend struct ::capnp::ToDynamic_; - friend class ::capnp::Orphanage; - template - friend struct ::capnp::_::PointerHelpers; -}; - -#if !CAPNP_LITE -class Iface1::Method1Results::Pipeline { -public: - typedef Method1Results Pipelines; - - inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} - inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) - : _typeless(kj::mv(typeless)) {} - - inline ::Iface0::Client getResult0(); -private: - ::capnp::AnyPointer::Pipeline _typeless; - friend class ::capnp::PipelineHook; - template - friend struct ::capnp::ToDynamic_; -}; -#endif // !CAPNP_LITE - -// ======================================================================================= - -inline ::int32_t TestParams0::Reader::getParam0() const { - return _reader.getDataField< ::int32_t>( - ::capnp::bounded<0>() * ::capnp::ELEMENTS); -} - -inline ::int32_t TestParams0::Builder::getParam0() { - return _builder.getDataField< ::int32_t>( - ::capnp::bounded<0>() * ::capnp::ELEMENTS); -} -inline void TestParams0::Builder::setParam0( ::int32_t value) { - _builder.setDataField< ::int32_t>( - ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); -} - -inline ::int32_t TestResults0::Reader::getResult0() const { - return _reader.getDataField< ::int32_t>( - ::capnp::bounded<0>() * ::capnp::ELEMENTS); -} - -inline ::int32_t TestResults0::Builder::getResult0() { - return _builder.getDataField< ::int32_t>( - ::capnp::bounded<0>() * ::capnp::ELEMENTS); -} -inline void TestResults0::Builder::setResult0( ::int32_t value) { - _builder.setDataField< ::int32_t>( - ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); -} - -inline bool TestParams1::Reader::hasParam0() const { - return !_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline bool TestParams1::Builder::hasParam0() { - return !_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline ::capnp::AnyPointer::Reader TestParams1::Reader::getParam0() const { - return ::capnp::AnyPointer::Reader(_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder TestParams1::Builder::getParam0() { - return ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder TestParams1::Builder::initParam0() { - auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); - result.clear(); - return result; -} - -inline bool TestResults1::Reader::hasResult0() const { - return !_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline bool TestResults1::Builder::hasResult0() { - return !_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline ::capnp::AnyPointer::Reader TestResults1::Reader::getResult0() const { - return ::capnp::AnyPointer::Reader(_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder TestResults1::Builder::getResult0() { - return ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder TestResults1::Builder::initResult0() { - auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); - result.clear(); - return result; -} - -inline bool TestResults1::Reader::hasResult1() const { - return !_reader.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); -} -inline bool TestResults1::Builder::hasResult1() { - return !_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); -} -inline ::capnp::AnyPointer::Reader TestResults1::Reader::getResult1() const { - return ::capnp::AnyPointer::Reader(_reader.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder TestResults1::Builder::getResult1() { - return ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder TestResults1::Builder::initResult1() { - auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); - result.clear(); - return result; -} - -inline bool TestResults1::Reader::hasResult2() const { - return !_reader.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); -} -inline bool TestResults1::Builder::hasResult2() { - return !_builder.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS).isNull(); -} -inline ::capnp::AnyPointer::Reader TestResults1::Reader::getResult2() const { - return ::capnp::AnyPointer::Reader(_reader.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder TestResults1::Builder::getResult2() { - return ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder TestResults1::Builder::initResult2() { - auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<2>() * ::capnp::POINTERS)); - result.clear(); - return result; -} - -inline bool Struct0::Reader::getF0() const { - return _reader.getDataField( - ::capnp::bounded<0>() * ::capnp::ELEMENTS); -} - -inline bool Struct0::Builder::getF0() { - return _builder.getDataField( - ::capnp::bounded<0>() * ::capnp::ELEMENTS); -} -inline void Struct0::Builder::setF0(bool value) { - _builder.setDataField( - ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); -} - -#if !CAPNP_LITE -inline Iface0::Client::Client(decltype(nullptr)) - : ::capnp::Capability::Client(nullptr) {} -inline Iface0::Client::Client( - ::kj::Own< ::capnp::ClientHook>&& hook) - : ::capnp::Capability::Client(::kj::mv(hook)) {} -template -inline Iface0::Client::Client(::kj::Own<_t>&& server) - : ::capnp::Capability::Client(::kj::mv(server)) {} -template -inline Iface0::Client::Client(::kj::Promise<_t>&& promise) - : ::capnp::Capability::Client(::kj::mv(promise)) {} -inline Iface0::Client::Client(::kj::Exception&& exception) - : ::capnp::Capability::Client(::kj::mv(exception)) {} -inline ::Iface0::Client& Iface0::Client::operator=(Client& other) { - ::capnp::Capability::Client::operator=(other); - return *this; -} -inline ::Iface0::Client& Iface0::Client::operator=(Client&& other) { - ::capnp::Capability::Client::operator=(kj::mv(other)); - return *this; -} - -#endif // !CAPNP_LITE -inline bool Struct2::Reader::hasF0() const { - return !_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline bool Struct2::Builder::hasF0() { - return !_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline ::capnp::AnyPointer::Reader Struct2::Reader::getF0() const { - return ::capnp::AnyPointer::Reader(_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder Struct2::Builder::getF0() { - return ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder Struct2::Builder::initF0() { - auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); - result.clear(); - return result; -} - -inline bool Struct2::Reader::hasF1i() const { - return !_reader.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); -} -inline bool Struct2::Builder::hasF1i() { - return !_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); -} -#if !CAPNP_LITE -inline ::Iface0::Client Struct2::Reader::getF1i() const { - return ::capnp::_::PointerHelpers< ::Iface0>::get(_reader.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -inline ::Iface0::Client Struct2::Builder::getF1i() { - return ::capnp::_::PointerHelpers< ::Iface0>::get(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -inline ::Iface0::Client Struct2::Pipeline::getF1i() { - return ::Iface0::Client(_typeless.getPointerField(1).asCap()); -} -inline void Struct2::Builder::setF1i( ::Iface0::Client&& cap) { - ::capnp::_::PointerHelpers< ::Iface0>::set(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(cap)); -} -inline void Struct2::Builder::setF1i( ::Iface0::Client& cap) { - ::capnp::_::PointerHelpers< ::Iface0>::set(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS), cap); -} -inline void Struct2::Builder::adoptF1i( - ::capnp::Orphan< ::Iface0>&& value) { - ::capnp::_::PointerHelpers< ::Iface0>::adopt(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); -} -inline ::capnp::Orphan< ::Iface0> Struct2::Builder::disownF1i() { - return ::capnp::_::PointerHelpers< ::Iface0>::disown(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -#endif // !CAPNP_LITE - -#if !CAPNP_LITE -inline TestCap0::Client::Client(decltype(nullptr)) - : ::capnp::Capability::Client(nullptr) {} -inline TestCap0::Client::Client( - ::kj::Own< ::capnp::ClientHook>&& hook) - : ::capnp::Capability::Client(::kj::mv(hook)) {} -template -inline TestCap0::Client::Client(::kj::Own<_t>&& server) - : ::capnp::Capability::Client(::kj::mv(server)) {} -template -inline TestCap0::Client::Client(::kj::Promise<_t>&& promise) - : ::capnp::Capability::Client(::kj::mv(promise)) {} -inline TestCap0::Client::Client(::kj::Exception&& exception) - : ::capnp::Capability::Client(::kj::mv(exception)) {} -inline ::TestCap0::Client& TestCap0::Client::operator=(Client& other) { - ::capnp::Capability::Client::operator=(other); - return *this; -} -inline ::TestCap0::Client& TestCap0::Client::operator=(Client&& other) { - ::capnp::Capability::Client::operator=(kj::mv(other)); - return *this; -} - -#endif // !CAPNP_LITE -#if !CAPNP_LITE -inline TestCap1::Client::Client(decltype(nullptr)) - : ::capnp::Capability::Client(nullptr) {} -inline TestCap1::Client::Client( - ::kj::Own< ::capnp::ClientHook>&& hook) - : ::capnp::Capability::Client(::kj::mv(hook)) {} -template -inline TestCap1::Client::Client(::kj::Own<_t>&& server) - : ::capnp::Capability::Client(::kj::mv(server)) {} -template -inline TestCap1::Client::Client(::kj::Promise<_t>&& promise) - : ::capnp::Capability::Client(::kj::mv(promise)) {} -inline TestCap1::Client::Client(::kj::Exception&& exception) - : ::capnp::Capability::Client(::kj::mv(exception)) {} -inline ::TestCap1::Client& TestCap1::Client::operator=(Client& other) { - ::capnp::Capability::Client::operator=(other); - return *this; -} -inline ::TestCap1::Client& TestCap1::Client::operator=(Client&& other) { - ::capnp::Capability::Client::operator=(kj::mv(other)); - return *this; -} - -#endif // !CAPNP_LITE -#if !CAPNP_LITE -inline Iface1::Client::Client(decltype(nullptr)) - : ::capnp::Capability::Client(nullptr) {} -inline Iface1::Client::Client( - ::kj::Own< ::capnp::ClientHook>&& hook) - : ::capnp::Capability::Client(::kj::mv(hook)) {} -template -inline Iface1::Client::Client(::kj::Own<_t>&& server) - : ::capnp::Capability::Client(::kj::mv(server)) {} -template -inline Iface1::Client::Client(::kj::Promise<_t>&& promise) - : ::capnp::Capability::Client(::kj::mv(promise)) {} -inline Iface1::Client::Client(::kj::Exception&& exception) - : ::capnp::Capability::Client(::kj::mv(exception)) {} -inline ::Iface1::Client& Iface1::Client::operator=(Client& other) { - ::capnp::Capability::Client::operator=(other); - return *this; -} -inline ::Iface1::Client& Iface1::Client::operator=(Client&& other) { - ::capnp::Capability::Client::operator=(kj::mv(other)); - return *this; -} - -#endif // !CAPNP_LITE -inline bool Iface1::Struct1::Reader::getF0() const { - return _reader.getDataField( - ::capnp::bounded<0>() * ::capnp::ELEMENTS); -} - -inline bool Iface1::Struct1::Builder::getF0() { - return _builder.getDataField( - ::capnp::bounded<0>() * ::capnp::ELEMENTS); -} -inline void Iface1::Struct1::Builder::setF0(bool value) { - _builder.setDataField( - ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); -} - -inline bool Iface1::Struct1::Reader::hasF1() const { - return !_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline bool Iface1::Struct1::Builder::hasF1() { - return !_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline ::capnp::AnyPointer::Reader Iface1::Struct1::Reader::getF1() const { - return ::capnp::AnyPointer::Reader(_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder Iface1::Struct1::Builder::getF1() { - return ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::capnp::AnyPointer::Builder Iface1::Struct1::Builder::initF1() { - auto result = ::capnp::AnyPointer::Builder(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); - result.clear(); - return result; -} - -inline bool Iface1::Method0Results::Reader::hasResult0() const { - return !_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline bool Iface1::Method0Results::Builder::hasResult0() { - return !_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline ::Struct0::Reader Iface1::Method0Results::Reader::getResult0() const { - return ::capnp::_::PointerHelpers< ::Struct0>::get(_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::Struct0::Builder Iface1::Method0Results::Builder::getResult0() { - return ::capnp::_::PointerHelpers< ::Struct0>::get(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -#if !CAPNP_LITE -inline ::Struct0::Pipeline Iface1::Method0Results::Pipeline::getResult0() { - return ::Struct0::Pipeline(_typeless.getPointerField(0)); -} -#endif // !CAPNP_LITE -inline void Iface1::Method0Results::Builder::setResult0( ::Struct0::Reader value) { - ::capnp::_::PointerHelpers< ::Struct0>::set(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS), value); -} -inline ::Struct0::Builder Iface1::Method0Results::Builder::initResult0() { - return ::capnp::_::PointerHelpers< ::Struct0>::init(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline void Iface1::Method0Results::Builder::adoptResult0( - ::capnp::Orphan< ::Struct0>&& value) { - ::capnp::_::PointerHelpers< ::Struct0>::adopt(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); -} -inline ::capnp::Orphan< ::Struct0> Iface1::Method0Results::Builder::disownResult0() { - return ::capnp::_::PointerHelpers< ::Struct0>::disown(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} - -inline bool Iface1::Method0Results::Reader::hasResult1() const { - return !_reader.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); -} -inline bool Iface1::Method0Results::Builder::hasResult1() { - return !_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); -} -inline ::Iface1::Struct1::Reader Iface1::Method0Results::Reader::getResult1() const { - return ::capnp::_::PointerHelpers< ::Iface1::Struct1>::get(_reader.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -inline ::Iface1::Struct1::Builder Iface1::Method0Results::Builder::getResult1() { - return ::capnp::_::PointerHelpers< ::Iface1::Struct1>::get(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -#if !CAPNP_LITE -inline ::Iface1::Struct1::Pipeline Iface1::Method0Results::Pipeline::getResult1() { - return ::Iface1::Struct1::Pipeline(_typeless.getPointerField(1)); -} -#endif // !CAPNP_LITE -inline void Iface1::Method0Results::Builder::setResult1( ::Iface1::Struct1::Reader value) { - ::capnp::_::PointerHelpers< ::Iface1::Struct1>::set(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS), value); -} -inline ::Iface1::Struct1::Builder Iface1::Method0Results::Builder::initResult1() { - return ::capnp::_::PointerHelpers< ::Iface1::Struct1>::init(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} -inline void Iface1::Method0Results::Builder::adoptResult1( - ::capnp::Orphan< ::Iface1::Struct1>&& value) { - ::capnp::_::PointerHelpers< ::Iface1::Struct1>::adopt(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); -} -inline ::capnp::Orphan< ::Iface1::Struct1> Iface1::Method0Results::Builder::disownResult1() { - return ::capnp::_::PointerHelpers< ::Iface1::Struct1>::disown(_builder.getPointerField( - ::capnp::bounded<1>() * ::capnp::POINTERS)); -} - -inline bool Iface1::Method1Results::Reader::hasResult0() const { - return !_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -inline bool Iface1::Method1Results::Builder::hasResult0() { - return !_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); -} -#if !CAPNP_LITE -inline ::Iface0::Client Iface1::Method1Results::Reader::getResult0() const { - return ::capnp::_::PointerHelpers< ::Iface0>::get(_reader.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::Iface0::Client Iface1::Method1Results::Builder::getResult0() { - return ::capnp::_::PointerHelpers< ::Iface0>::get(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -inline ::Iface0::Client Iface1::Method1Results::Pipeline::getResult0() { - return ::Iface0::Client(_typeless.getPointerField(0).asCap()); -} -inline void Iface1::Method1Results::Builder::setResult0( ::Iface0::Client&& cap) { - ::capnp::_::PointerHelpers< ::Iface0>::set(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(cap)); -} -inline void Iface1::Method1Results::Builder::setResult0( ::Iface0::Client& cap) { - ::capnp::_::PointerHelpers< ::Iface0>::set(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS), cap); -} -inline void Iface1::Method1Results::Builder::adoptResult0( - ::capnp::Orphan< ::Iface0>&& value) { - ::capnp::_::PointerHelpers< ::Iface0>::adopt(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); -} -inline ::capnp::Orphan< ::Iface0> Iface1::Method1Results::Builder::disownResult0() { - return ::capnp::_::PointerHelpers< ::Iface0>::disown(_builder.getPointerField( - ::capnp::bounded<0>() * ::capnp::POINTERS)); -} -#endif // !CAPNP_LITE - - diff --git a/runtime/src/test/java/org/capnproto/demo/democap.capnp b/runtime/src/test/java/org/capnproto/demo/democap.capnp deleted file mode 100644 index a1954467..00000000 --- a/runtime/src/test/java/org/capnproto/demo/democap.capnp +++ /dev/null @@ -1,12 +0,0 @@ -@0xf29f4ba3b0a5a945; - -using Params = import "demoparams.capnp"; - -interface TestCap0 { - testMethod0 @0 Params.TestParams0 -> Params.TestResults0; - testMethod1 @1 Params.TestParams1 -> Params.TestResults1; -} - -interface TestCap1 { -} - diff --git a/runtime/src/test/java/org/capnproto/demo/democap.capnp.c++ b/runtime/src/test/java/org/capnproto/demo/democap.capnp.c++ deleted file mode 100644 index bcdec32c..00000000 --- a/runtime/src/test/java/org/capnproto/demo/democap.capnp.c++ +++ /dev/null @@ -1,190 +0,0 @@ -// Generated by Cap'n Proto compiler, DO NOT EDIT -// source: democap.capnp - -#include "democap.capnp.h" - -namespace capnp { -namespace schemas { -static const ::capnp::_::AlignedData<40> b_a65f4a3d7f622e6b = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 107, 46, 98, 127, 61, 74, 95, 166, - 14, 0, 0, 0, 3, 0, 0, 0, - 69, 169, 165, 176, 163, 75, 159, 242, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 186, 0, 0, 0, - 29, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 25, 0, 0, 0, 135, 0, 0, 0, - 113, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 100, 101, 109, 111, 99, 97, 112, 46, - 99, 97, 112, 110, 112, 58, 84, 101, - 115, 116, 67, 97, 112, 48, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 8, 0, 0, 0, 3, 0, 5, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 18, 240, 128, 209, 172, 180, 1, 179, - 129, 40, 181, 33, 84, 46, 164, 150, - 49, 0, 0, 0, 98, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 41, 0, 0, 0, 7, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 87, 9, 34, 182, 168, 99, 3, 225, - 62, 219, 93, 212, 228, 46, 133, 153, - 29, 0, 0, 0, 98, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 7, 0, 0, 0, - 116, 101, 115, 116, 77, 101, 116, 104, - 111, 100, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 116, 101, 115, 116, 77, 101, 116, 104, - 111, 100, 49, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 1, 0, 1, 0, } -}; -::capnp::word const* const bp_a65f4a3d7f622e6b = b_a65f4a3d7f622e6b.words; -#if !CAPNP_LITE -static const ::capnp::_::RawSchema* const d_a65f4a3d7f622e6b[] = { - &s_96a42e5421b52881, - &s_99852ee4d45ddb3e, - &s_b301b4acd180f012, - &s_e10363a8b6220957, -}; -static const uint16_t m_a65f4a3d7f622e6b[] = {0, 1}; -const ::capnp::_::RawSchema s_a65f4a3d7f622e6b = { - 0xa65f4a3d7f622e6b, b_a65f4a3d7f622e6b.words, 40, d_a65f4a3d7f622e6b, m_a65f4a3d7f622e6b, - 4, 2, nullptr, nullptr, nullptr, { &s_a65f4a3d7f622e6b, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<18> b_81da3f8f6079c216 = { - { 0, 0, 0, 0, 5, 0, 6, 0, - 22, 194, 121, 96, 143, 63, 218, 129, - 14, 0, 0, 0, 3, 0, 0, 0, - 69, 169, 165, 176, 163, 75, 159, 242, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 186, 0, 0, 0, - 29, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 25, 0, 0, 0, 7, 0, 0, 0, - 25, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 100, 101, 109, 111, 99, 97, 112, 46, - 99, 97, 112, 110, 112, 58, 84, 101, - 115, 116, 67, 97, 112, 49, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 3, 0, 5, 0, - 0, 0, 0, 0, 1, 0, 1, 0, } -}; -::capnp::word const* const bp_81da3f8f6079c216 = b_81da3f8f6079c216.words; -#if !CAPNP_LITE -const ::capnp::_::RawSchema s_81da3f8f6079c216 = { - 0x81da3f8f6079c216, b_81da3f8f6079c216.words, 18, nullptr, nullptr, - 0, 0, nullptr, nullptr, nullptr, { &s_81da3f8f6079c216, nullptr, nullptr, 0, 0, nullptr } -}; -#endif // !CAPNP_LITE -} // namespace schemas -} // namespace capnp - -// ======================================================================================= - - -#if !CAPNP_LITE -::capnp::Request< ::TestParams0, ::TestResults0> -TestCap0::Client::testMethod0Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { - return newCall< ::TestParams0, ::TestResults0>( - 0xa65f4a3d7f622e6bull, 0, sizeHint); -} -::kj::Promise TestCap0::Server::testMethod0(TestMethod0Context) { - return ::capnp::Capability::Server::internalUnimplemented( - "democap.capnp:TestCap0", "testMethod0", - 0xa65f4a3d7f622e6bull, 0); -} -::capnp::Request< ::TestParams1, ::TestResults1> -TestCap0::Client::testMethod1Request(::kj::Maybe< ::capnp::MessageSize> sizeHint) { - return newCall< ::TestParams1, ::TestResults1>( - 0xa65f4a3d7f622e6bull, 1, sizeHint); -} -::kj::Promise TestCap0::Server::testMethod1(TestMethod1Context) { - return ::capnp::Capability::Server::internalUnimplemented( - "democap.capnp:TestCap0", "testMethod1", - 0xa65f4a3d7f622e6bull, 1); -} -::capnp::Capability::Server::DispatchCallResult TestCap0::Server::dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (interfaceId) { - case 0xa65f4a3d7f622e6bull: - return dispatchCallInternal(methodId, context); - default: - return internalUnimplemented("democap.capnp:TestCap0", interfaceId); - } -} -::capnp::Capability::Server::DispatchCallResult TestCap0::Server::dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (methodId) { - case 0: - return { - testMethod0(::capnp::Capability::Server::internalGetTypedContext< - ::TestParams0, ::TestResults0>(context)), - false - }; - case 1: - return { - testMethod1(::capnp::Capability::Server::internalGetTypedContext< - ::TestParams1, ::TestResults1>(context)), - false - }; - default: - (void)context; - return ::capnp::Capability::Server::internalUnimplemented( - "democap.capnp:TestCap0", - 0xa65f4a3d7f622e6bull, methodId); - } -} -#endif // !CAPNP_LITE - -// TestCap0 -#if !CAPNP_LITE -constexpr ::capnp::Kind TestCap0::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* TestCap0::_capnpPrivate::schema; -#endif // !CAPNP_LITE - -#if !CAPNP_LITE -::capnp::Capability::Server::DispatchCallResult TestCap1::Server::dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (interfaceId) { - case 0x81da3f8f6079c216ull: - return dispatchCallInternal(methodId, context); - default: - return internalUnimplemented("democap.capnp:TestCap1", interfaceId); - } -} -::capnp::Capability::Server::DispatchCallResult TestCap1::Server::dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { - switch (methodId) { - default: - (void)context; - return ::capnp::Capability::Server::internalUnimplemented( - "democap.capnp:TestCap1", - 0x81da3f8f6079c216ull, methodId); - } -} -#endif // !CAPNP_LITE - -// TestCap1 -#if !CAPNP_LITE -constexpr ::capnp::Kind TestCap1::_capnpPrivate::kind; -constexpr ::capnp::_::RawSchema const* TestCap1::_capnpPrivate::schema; -#endif // !CAPNP_LITE - - - diff --git a/runtime/src/test/java/org/capnproto/demo/democap.capnp.h b/runtime/src/test/java/org/capnproto/demo/democap.capnp.h deleted file mode 100644 index b60b09e1..00000000 --- a/runtime/src/test/java/org/capnproto/demo/democap.capnp.h +++ /dev/null @@ -1,216 +0,0 @@ -// Generated by Cap'n Proto compiler, DO NOT EDIT -// source: democap.capnp - -#pragma once - -#include -#include -#if !CAPNP_LITE -#include -#endif // !CAPNP_LITE - -#if CAPNP_VERSION != 8000 -#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." -#endif - -#include "demoparams.capnp.h" - -namespace capnp { -namespace schemas { - -CAPNP_DECLARE_SCHEMA(a65f4a3d7f622e6b); -CAPNP_DECLARE_SCHEMA(81da3f8f6079c216); - -} // namespace schemas -} // namespace capnp - - -struct TestCap0 { - TestCap0() = delete; - -#if !CAPNP_LITE - class Client; - class Server; -#endif // !CAPNP_LITE - - - #if !CAPNP_LITE - struct _capnpPrivate { - CAPNP_DECLARE_INTERFACE_HEADER(a65f4a3d7f622e6b) - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - }; - #endif // !CAPNP_LITE -}; - -struct TestCap1 { - TestCap1() = delete; - -#if !CAPNP_LITE - class Client; - class Server; -#endif // !CAPNP_LITE - - - #if !CAPNP_LITE - struct _capnpPrivate { - CAPNP_DECLARE_INTERFACE_HEADER(81da3f8f6079c216) - static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } - }; - #endif // !CAPNP_LITE -}; - -// ======================================================================================= - -#if !CAPNP_LITE -class TestCap0::Client - : public virtual ::capnp::Capability::Client { -public: - typedef TestCap0 Calls; - typedef TestCap0 Reads; - - Client(decltype(nullptr)); - explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); - template ()>> - Client(::kj::Own<_t>&& server); - template ()>> - Client(::kj::Promise<_t>&& promise); - Client(::kj::Exception&& exception); - Client(Client&) = default; - Client(Client&&) = default; - Client& operator=(Client& other); - Client& operator=(Client&& other); - - ::capnp::Request< ::TestParams0, ::TestResults0> testMethod0Request( - ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); - ::capnp::Request< ::TestParams1, ::TestResults1> testMethod1Request( - ::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr); - -protected: - Client() = default; -}; - -class TestCap0::Server - : public virtual ::capnp::Capability::Server { -public: - typedef TestCap0 Serves; - - ::capnp::Capability::Server::DispatchCallResult dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) - override; - -protected: - typedef ::capnp::CallContext< ::TestParams0, ::TestResults0> TestMethod0Context; - virtual ::kj::Promise testMethod0(TestMethod0Context context); - typedef ::capnp::CallContext< ::TestParams1, ::TestResults1> TestMethod1Context; - virtual ::kj::Promise testMethod1(TestMethod1Context context); - - inline ::TestCap0::Client thisCap() { - return ::capnp::Capability::Server::thisCap() - .template castAs< ::TestCap0>(); - } - - ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); -}; -#endif // !CAPNP_LITE - -#if !CAPNP_LITE -class TestCap1::Client - : public virtual ::capnp::Capability::Client { -public: - typedef TestCap1 Calls; - typedef TestCap1 Reads; - - Client(decltype(nullptr)); - explicit Client(::kj::Own< ::capnp::ClientHook>&& hook); - template ()>> - Client(::kj::Own<_t>&& server); - template ()>> - Client(::kj::Promise<_t>&& promise); - Client(::kj::Exception&& exception); - Client(Client&) = default; - Client(Client&&) = default; - Client& operator=(Client& other); - Client& operator=(Client&& other); - - -protected: - Client() = default; -}; - -class TestCap1::Server - : public virtual ::capnp::Capability::Server { -public: - typedef TestCap1 Serves; - - ::capnp::Capability::Server::DispatchCallResult dispatchCall( - uint64_t interfaceId, uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) - override; - -protected: - - inline ::TestCap1::Client thisCap() { - return ::capnp::Capability::Server::thisCap() - .template castAs< ::TestCap1>(); - } - - ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( - uint16_t methodId, - ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); -}; -#endif // !CAPNP_LITE - -// ======================================================================================= - -#if !CAPNP_LITE -inline TestCap0::Client::Client(decltype(nullptr)) - : ::capnp::Capability::Client(nullptr) {} -inline TestCap0::Client::Client( - ::kj::Own< ::capnp::ClientHook>&& hook) - : ::capnp::Capability::Client(::kj::mv(hook)) {} -template -inline TestCap0::Client::Client(::kj::Own<_t>&& server) - : ::capnp::Capability::Client(::kj::mv(server)) {} -template -inline TestCap0::Client::Client(::kj::Promise<_t>&& promise) - : ::capnp::Capability::Client(::kj::mv(promise)) {} -inline TestCap0::Client::Client(::kj::Exception&& exception) - : ::capnp::Capability::Client(::kj::mv(exception)) {} -inline ::TestCap0::Client& TestCap0::Client::operator=(Client& other) { - ::capnp::Capability::Client::operator=(other); - return *this; -} -inline ::TestCap0::Client& TestCap0::Client::operator=(Client&& other) { - ::capnp::Capability::Client::operator=(kj::mv(other)); - return *this; -} - -#endif // !CAPNP_LITE -#if !CAPNP_LITE -inline TestCap1::Client::Client(decltype(nullptr)) - : ::capnp::Capability::Client(nullptr) {} -inline TestCap1::Client::Client( - ::kj::Own< ::capnp::ClientHook>&& hook) - : ::capnp::Capability::Client(::kj::mv(hook)) {} -template -inline TestCap1::Client::Client(::kj::Own<_t>&& server) - : ::capnp::Capability::Client(::kj::mv(server)) {} -template -inline TestCap1::Client::Client(::kj::Promise<_t>&& promise) - : ::capnp::Capability::Client(::kj::mv(promise)) {} -inline TestCap1::Client::Client(::kj::Exception&& exception) - : ::capnp::Capability::Client(::kj::mv(exception)) {} -inline ::TestCap1::Client& TestCap1::Client::operator=(Client& other) { - ::capnp::Capability::Client::operator=(other); - return *this; -} -inline ::TestCap1::Client& TestCap1::Client::operator=(Client&& other) { - ::capnp::Capability::Client::operator=(kj::mv(other)); - return *this; -} - -#endif // !CAPNP_LITE - diff --git a/runtime/src/test/java/org/capnproto/demo/demoparams.capnp b/runtime/src/test/java/org/capnproto/demo/demoparams.capnp deleted file mode 100644 index 560cad41..00000000 --- a/runtime/src/test/java/org/capnproto/demo/demoparams.capnp +++ /dev/null @@ -1,25 +0,0 @@ -@0x91b57797d64253c4; - -using Java = import "/capnp/java.capnp"; -$Java.package("org.capnproto.demo"); -$Java.outerClassname("Demo"); - -struct TestParams0 { - param0 @0 :Int32; -} - -struct TestResults0 { - result0 @0 :Int32; -} - -struct TestParams1 { - param0 @0 :AnyPointer; -} - -struct TestResults1 { - result0 @0 :AnyPointer; - result1 @1 :AnyPointer; - result2 @2 :AnyPointer; -} - - From 8457c38623f5660d0d63a5ce2a4a0ce3325d9723 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 8 Nov 2020 21:08:19 +0000 Subject: [PATCH 112/246] fix null exportId bug --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 0eb4fb57..4791c87d 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -870,7 +870,9 @@ private int[] writeDescriptors(ClientHook[] capTable, RpcProtocol.Payload.Builde } var exportId = writeDescriptor(cap, capTableBuilder.get(ii), fds); - exports.add(exportId); + if (exportId != null) { + exports.add(exportId); + } } return exports.stream() @@ -878,7 +880,7 @@ private int[] writeDescriptors(ClientHook[] capTable, RpcProtocol.Payload.Builde .toArray(); } - private int writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builder descriptor, List fds) { + private Integer writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builder descriptor, List fds) { ClientHook inner = cap; for (;;) { var resolved = inner.getResolved(); From 7b79ab8ab27b19fd97d86a23464c0119f0e1193d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 16:18:17 +0000 Subject: [PATCH 113/246] avoid TestUtil name clash --- .../java/org/capnproto/CapabilityTest.java | 16 +++++++-------- .../src/test/java/org/capnproto/RpcTest.java | 20 +++++++++---------- .../{TestUtil.java => RpcTestUtil.java} | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) rename runtime-rpc/src/test/java/org/capnproto/{TestUtil.java => RpcTestUtil.java} (99%) diff --git a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java index bb732bec..e4677644 100644 --- a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java @@ -25,7 +25,7 @@ import org.capnproto.CallContext; import org.capnproto.Capability; import org.capnproto.RpcException; -import org.capnproto.test.Test; +import org.capnproto.rpctest.Test; import org.junit.Assert; @@ -61,7 +61,7 @@ protected CompletableFuture foo(CallContext grault(CallContext context) { counter.inc(); context.releaseParams(); - TestUtil.initTestMessage(context.getResults()); + RpcTestUtil.initTestMessage(context.getResults()); return CompletableFuture.completedFuture(null); } } @@ -84,7 +84,7 @@ public class CapabilityTest { public void testBasic() { var callCount = new Counter(); var client = new Test.TestInterface.Client( - new TestUtil.TestInterfaceImpl(callCount)); + new RpcTestUtil.TestInterfaceImpl(callCount)); var request1 = client.fooRequest(); request1.getParams().setI(123); @@ -92,7 +92,7 @@ public void testBasic() { var promise1 = request1.send(); var request2 = client.bazRequest(); - TestUtil.initTestMessage(request2.getParams().initS()); + RpcTestUtil.initTestMessage(request2.getParams().initS()); var promise2 = request2.send(); boolean barFailed = false; @@ -126,7 +126,7 @@ public void testInheritance() throws ExecutionException, InterruptedException { //Assert.assertEquals(0, callCount.value()); var response2 = promise2.get(); - TestUtil.checkTestMessage(response2); + RpcTestUtil.checkTestMessage(response2); var response1 = promise1.get(); Assert.assertEquals("bar", response1.getX().toString()); @@ -139,13 +139,13 @@ public void testPipelining() throws ExecutionException, InterruptedException { var chainedCallCount = new Counter(); var client = new Test.TestPipeline.Client( - new TestUtil.TestPipelineImpl(callCount)); + new RpcTestUtil.TestPipelineImpl(callCount)); var request = client.getCapRequest(); var params = request.getParams(); params.setN(234); params.setInCap(new Test.TestInterface.Client( - new TestUtil.TestInterfaceImpl(chainedCallCount))); + new RpcTestUtil.TestInterfaceImpl(chainedCallCount))); var promise = request.send(); var outbox = promise.getOutBox(); @@ -164,7 +164,7 @@ public void testPipelining() throws ExecutionException, InterruptedException { var response = pipelinePromise.get(); Assert.assertEquals("bar", response.getX().toString()); var response2 = pipelinePromise2.get(); - TestUtil.checkTestMessage(response2); + RpcTestUtil.checkTestMessage(response2); Assert.assertEquals(3, callCount.value()); Assert.assertEquals(1, chainedCallCount.value()); } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 609747a5..0e73711c 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -21,7 +21,7 @@ package org.capnproto; -import org.capnproto.test.Test; +import org.capnproto.rpctest.Test; import org.junit.Assert; @@ -276,17 +276,17 @@ public Capability.Client createFor(Test.TestSturdyRef.Reader refId) { var tag = objectId.getTag(); switch (tag) { case TEST_INTERFACE: - return new Capability.Client(new TestUtil.TestInterfaceImpl(callCount)); + return new Capability.Client(new RpcTestUtil.TestInterfaceImpl(callCount)); case TEST_EXTENDS: return new Capability.Client(Capability.newBrokenCap("No TestExtends implemented.")); case TEST_PIPELINE: - return new Capability.Client(new TestUtil.TestPipelineImpl(callCount)); + return new Capability.Client(new RpcTestUtil.TestPipelineImpl(callCount)); case TEST_TAIL_CALLEE: - return new Capability.Client(new TestUtil.TestTailCalleeImpl(callCount)); + return new Capability.Client(new RpcTestUtil.TestTailCalleeImpl(callCount)); case TEST_TAIL_CALLER: - return new Capability.Client(new TestUtil.TestTailCallerImpl(callCount)); + return new Capability.Client(new RpcTestUtil.TestTailCallerImpl(callCount)); case TEST_MORE_STUFF: - return new Capability.Client(new TestUtil.TestMoreStuffImpl(callCount, handleCount)); + return new Capability.Client(new RpcTestUtil.TestMoreStuffImpl(callCount, handleCount)); default: return new Capability.Client(); } @@ -312,7 +312,7 @@ public void testBasic() { }); var request2 = client.bazRequest(); - TestUtil.initTestMessage(request2.getParams().initS()); + RpcTestUtil.initTestMessage(request2.getParams().initS()); var promise2 = request2.send(); var response1 = promise1.join(); @@ -333,7 +333,7 @@ public void testPipelining() { var request = client.getCapRequest(); request.getParams().setN(234); - request.getParams().setInCap(new TestUtil.TestInterfaceImpl(chainedCallCount)); + request.getParams().setInCap(new RpcTestUtil.TestInterfaceImpl(chainedCallCount)); var promise = request.send(); @@ -353,7 +353,7 @@ public void testPipelining() { Assert.assertEquals("bar", response.getX().toString()); var response2 = pipelinePromise2.join(); - TestUtil.checkTestMessage(response2); + RpcTestUtil.checkTestMessage(response2); Assert.assertEquals(1, chainedCallCount.value()); } @@ -397,7 +397,7 @@ public void testPromiseResolve() { //Assert.assertEquals(3, context.restorer.callCount); // OK, now fulfill the local promise. - paf.complete(new Test.TestInterface.Client(new TestUtil.TestInterfaceImpl(chainedCallCount))); + paf.complete(new Test.TestInterface.Client(new RpcTestUtil.TestInterfaceImpl(chainedCallCount))); // We should now be able to wait for getCap() to finish. Assert.assertEquals("bar", promise.join().getS().toString()); diff --git a/runtime-rpc/src/test/java/org/capnproto/TestUtil.java b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java similarity index 99% rename from runtime-rpc/src/test/java/org/capnproto/TestUtil.java rename to runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java index 89a3dbc0..5bc80aa5 100644 --- a/runtime-rpc/src/test/java/org/capnproto/TestUtil.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java @@ -3,12 +3,12 @@ import org.capnproto.CallContext; import org.capnproto.Capability; import org.capnproto.Void; -import org.capnproto.test.Test; +import org.capnproto.rpctest.Test; import org.junit.Assert; import java.util.concurrent.CompletableFuture; -class TestUtil { +class RpcTestUtil { static void initTestMessage(Test.TestAllTypes.Builder builder) { From f640a8ffd4cfc5e395a2fa74acf0d67e0fa5391a Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 17:29:00 +0000 Subject: [PATCH 114/246] allow copyPointer to copy capabilities --- runtime/src/main/java/org/capnproto/WireHelpers.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 5cd6311f..782744d1 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -1127,6 +1127,7 @@ static SegmentBuilder copyPointer(SegmentBuilder dstSegment, CapTableBuilder dst resolved.segment.arena.checkReadLimit(StructPointer.wordSize(resolved.ref)); return setStructPointer(dstSegment, dstCapTable, dstOffset, new StructReader(resolved.segment, + srcCapTable, resolved.ptr * Constants.BYTES_PER_WORD, resolved.ptr + StructPointer.dataSize(resolved.ref), StructPointer.dataSize(resolved.ref) * Constants.BITS_PER_WORD, @@ -1196,7 +1197,14 @@ static SegmentBuilder copyPointer(SegmentBuilder dstSegment, CapTableBuilder dst case WirePointer.FAR : throw new DecodeException("Unexpected FAR pointer."); case WirePointer.OTHER : - throw new RuntimeException("copyPointer is unimplemented for OTHER pointers"); + if (WirePointer.isCapability(srcRef)) { + var cap = readCapabilityPointer(srcSegment, srcCapTable, srcOffset, 0); + setCapabilityPointer(dstSegment, dstCapTable, dstOffset, cap); + return dstSegment; + } + else { + throw new RuntimeException("copyPointer is unimplemented for OTHER pointers"); + } } throw new RuntimeException("unreachable"); } From cee3aa79aea73ce3f7617e5f66d984793ae0adbb Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 17:33:20 +0000 Subject: [PATCH 115/246] set AnyPointer from AnyPointer --- .../test/java/org/capnproto/EncodingTest.java | 13 ++++++++ .../src/main/java/org/capnproto/RpcState.java | 33 ++++++++++++++++++- .../main/java/org/capnproto/AnyPointer.java | 12 +++++++ 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/compiler/src/test/java/org/capnproto/EncodingTest.java b/compiler/src/test/java/org/capnproto/EncodingTest.java index fde64a16..f4c48a32 100644 --- a/compiler/src/test/java/org/capnproto/EncodingTest.java +++ b/compiler/src/test/java/org/capnproto/EncodingTest.java @@ -844,6 +844,19 @@ public void testSetWithCaveats() { Assert.assertEquals(listReader.get(0).getInt8Field(), 11); TestUtil.checkTestMessage(listReader.get(1)); } + + @org.junit.Test + public void testCopyAnyPointer() { + MessageBuilder message1 = new MessageBuilder(); + Test.TestAllTypes.Builder root1 = message1.initRoot(Test.TestAllTypes.factory); + TestUtil.initTestMessage(root1); + + MessageBuilder message2 = new MessageBuilder(); + AnyPointer.Builder root2 = message2.initRoot(AnyPointer.factory); + root2.set(message1.getRoot(AnyPointer.factory).asReader()); + + TestUtil.checkTestMessage(root2.getAs(Test.TestAllTypes.factory)); + } } diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 4791c87d..28a13152 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1353,7 +1353,38 @@ public CompletableFuture onTailCall() { @Override public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { - return null; + assert this.response == null: "Can't call tailCall() after initializing the results struct."; + + if (request.getBrand() == RpcState.this && !this.redirectResults) { + // The tail call is headed towards the peer that called us in the first place, so we can + // optimize out the return trip. + + var tailInfo = ((RpcRequest)request).tailSend(); + if (tailInfo != null) { + if (isFirstResponder()) { + if (isConnected()) { + var message = connection.newOutgoingMessage( + messageSizeHint() + + RpcProtocol.Return.factory.structSize().total()); + var builder = message.getBody().initAs(RpcProtocol.Message.factory).initReturn(); + builder.setAnswerId(this.answerId); + builder.setReleaseParamCaps(false); + builder.setTakeFromOtherQuestion(tailInfo.questionId); + message.send(); + } + + cleanupAnswerTable(null, false); + } + return new ClientHook.VoidPromiseAndPipeline(tailInfo.promise, tailInfo.pipeline); + } + } + + // Just forward to another local call + var promise = request.send(); + var voidPromise = promise.thenAccept(results -> { + getResults(0).set(results); + }); + return new ClientHook.VoidPromiseAndPipeline(voidPromise, promise.pipeline().hook); } private RpcResponse consumeRedirectedResponse() { diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 7acabbc7..c4d23121 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -128,6 +128,18 @@ public final void setAs(SetPointerBuilder factory, U reader) { factory.setPointerBuilder(this.segment, this.capTable, this.pointer, reader); } + public void set(AnyPointer.Reader reader) { + if (reader.isNull()) { + WireHelpers.zeroObject(this.segment, this.capTable, this.pointer); + WireHelpers.zeroPointerAndFars(this.segment, this.pointer); + } + else { + WireHelpers.copyPointer( + this.segment, this.capTable, this.pointer, + reader.segment, reader.capTable, reader.pointer, reader.nestingLimit); + } + } + final void setAsCap(Capability.Client cap) { WireHelpers.setCapabilityPointer(this.segment, capTable, this.pointer, cap.getHook()); } From f2df5c2191555b8315527fb2b22f1326c2aaa0f7 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 5 Nov 2020 14:05:12 +0000 Subject: [PATCH 116/246] implement rpc tail calls --- .../src/main/java/org/capnproto/RpcState.java | 47 +++++++++++-------- .../src/test/java/org/capnproto/RpcTest.java | 25 ++++++++++ .../java/org/capnproto/CallContextHook.java | 3 +- .../main/java/org/capnproto/Capability.java | 46 ++++++++++-------- .../java/org/capnproto/RemotePromise.java | 9 ++-- 5 files changed, 86 insertions(+), 44 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 28a13152..369cbb61 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -168,7 +168,7 @@ final class Answer { final int answerId; boolean active = false; PipelineHook pipeline; - CompletionStage redirectedResults; + CompletableFuture redirectedResults; RpcCallContext callContext; int[] resultExports; @@ -599,24 +599,26 @@ void handleCall(IncomingRpcMessage message, RpcProtocol.Call.Reader call) { } var pap = startCall(call.getInterfaceId(), call.getMethodId(), cap, context); + { var answer = answers.find(answerId); assert answer != null; answer.pipeline = pap.pipeline; if (redirectResults) { - answer.redirectedResults = pap.promise.thenApply(x -> { - return context.consumeRedirectedResponse(); - }); + answer.redirectedResults = pap.promise.thenApply( + void_ -> context.consumeRedirectedResponse()); // TODO cancellation deferral } else { - pap.promise.thenAccept(x -> { - context.sendReturn(); - }).exceptionally(exc -> { - context.sendErrorReturn(exc); - // TODO wait on the cancellation... - return null; + pap.promise.whenComplete((void_, exc) -> { + if (exc == null) { + context.sendReturn(); + } + else { + context.sendErrorReturn(exc); + // TODO wait on the cancellation... + } }); } } @@ -628,7 +630,6 @@ private ClientHook.VoidPromiseAndPipeline startCall(long interfaceId, short meth } void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callReturn) { - var question = questions.find(callReturn.getAnswerId()); if (question == null) { assert false: "Invalid question ID in Return message."; @@ -703,7 +704,7 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu assert false: "`Return.takeFromOtherQuestion` referenced a call that did not use `sendResultsTo.yourself`."; break; } - question.response = answer.redirectedResults.toCompletableFuture(); + question.response = answer.redirectedResults; answer.redirectedResults = null; break; @@ -1230,7 +1231,7 @@ class RpcServerResponseImpl implements RpcServerResponse { @Override public AnyPointer.Builder getResultsBuilder() { - return payload.getContent().imbue(capTable); + return this.payload.getContent().imbue(capTable); } int[] send() { @@ -1284,7 +1285,7 @@ private final class RpcCallContext implements CallContextHook { private RpcProtocol.Return.Builder returnMessage; private boolean redirectResults = false; private boolean responseSent = false; - private CompletableFuture tailCallPipelineFuture; + private CompletableFuture tailCallPipeline; private boolean cancelRequested = false; private boolean cancelAllowed = false; @@ -1336,10 +1337,10 @@ public AnyPointer.Builder getResults(int sizeHint) { @Override public CompletableFuture tailCall(RequestHook request) { var result = this.directTailCall(request); - if (this.tailCallPipelineFuture != null) { - this.tailCallPipelineFuture.complete(result.pipeline); + if (this.tailCallPipeline != null) { + this.tailCallPipeline.complete(new AnyPointer.Pipeline(result.pipeline)); } - return result.promise.toCompletableFuture().copy(); + return result.promise.copy(); } @Override @@ -1347,8 +1348,10 @@ public void allowCancellation() { } @Override - public CompletableFuture onTailCall() { - return null; + public CompletableFuture onTailCall() { + assert this.tailCallPipeline == null: "Called onTailCall twice?"; + this.tailCallPipeline = new CompletableFuture<>(); + return this.tailCallPipeline.copy(); } @Override @@ -1441,7 +1444,7 @@ private void sendErrorReturn(Throwable exc) { message.send(); } - cleanupAnswerTable(new int[0], false); + cleanupAnswerTable(null, false); } private boolean isFirstResponder() { @@ -1453,6 +1456,10 @@ private boolean isFirstResponder() { } private void cleanupAnswerTable(int[] resultExports, boolean shouldFreePipeline) { + if (resultExports == null) { + resultExports = new int[0]; + } + if (this.cancelRequested) { assert resultExports.length == 0; answers.erase(this.answerId); diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 0e73711c..9fe93cfe 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -406,5 +406,30 @@ public void testPromiseResolve() { //Assert.assertEquals(3, context.restorer.callCount); Assert.assertEquals(2, chainedCallCount.value()); } + + @org.junit.Test + public void testTailCall() { + var context = new TestContext(bootstrapFactory); + var caller = new Test.TestTailCaller.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_TAIL_CALLER)); + + var calleeCallCount = new Counter(); + var callee = new Test.TestTailCallee.Client(new RpcTestUtil.TestTailCalleeImpl(calleeCallCount)); + var request = caller.fooRequest(); + request.getParams().setI(456); + request.getParams().setCallee(callee); + + var promise = request.send(); + var dependentCall0 = promise.getC().getCallSequenceRequest().send(); + var response = promise.join(); + Assert.assertEquals(456, response.getI()); + + var dependentCall1 = promise.getC().getCallSequenceRequest().send(); + Assert.assertEquals(0, dependentCall0.join().getN()); + Assert.assertEquals(1, dependentCall1.join().getN()); + + var dependentCall2 = response.getC().getCallSequenceRequest().send(); + Assert.assertEquals(2, dependentCall2.join().getN()); + Assert.assertEquals(1, calleeCallCount.value()); + } } diff --git a/runtime/src/main/java/org/capnproto/CallContextHook.java b/runtime/src/main/java/org/capnproto/CallContextHook.java index 461db7cb..9b00255c 100644 --- a/runtime/src/main/java/org/capnproto/CallContextHook.java +++ b/runtime/src/main/java/org/capnproto/CallContextHook.java @@ -3,6 +3,7 @@ import java.util.concurrent.CompletableFuture; public interface CallContextHook { + AnyPointer.Reader getParams(); void releaseParams(); @@ -17,7 +18,7 @@ default AnyPointer.Builder getResults() { void allowCancellation(); - CompletableFuture onTailCall(); + CompletableFuture onTailCall(); ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request); } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index ce1b4b1b..cfb9f686 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -185,17 +185,16 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } var promise = this.whenResolved().thenCompose( - x -> this.callInternal(interfaceId, methodId, ctx)); + void_ -> this.callInternal(interfaceId, methodId, ctx)); - CompletableFuture pipelinePromise = promise.thenApply(x -> { + + var pipelinePromise = promise.thenApply(x -> { ctx.releaseParams(); - return new LocalPipeline(ctx); + return (PipelineHook)new LocalPipeline(ctx); }); - var tailCall = ctx.onTailCall(); - if (tailCall != null) { - pipelinePromise = tailCall.applyToEither(pipelinePromise, pipeline -> pipeline); - } + var tailCall = ctx.onTailCall().thenApply(pipeline -> pipeline.hook); + pipelinePromise = tailCall.applyToEither(pipelinePromise, pipeline -> pipeline); return new VoidPromiseAndPipeline( promise, @@ -213,7 +212,7 @@ public CompletableFuture whenMoreResolved() { return CompletableFuture.completedFuture(this.resolved); } else if (this.resolveTask != null) { - return this.resolveTask.thenApply(x -> this.resolved); + return this.resolveTask.thenApply(void_ -> this.resolved); } else { return null; @@ -335,7 +334,7 @@ private static class LocalRequest implements RequestHook { final MessageBuilder message = new MessageBuilder(); final long interfaceId; final short methodId; - ClientHook client; + final ClientHook client; LocalRequest(long interfaceId, short methodId, ClientHook client) { this.interfaceId = interfaceId; @@ -371,6 +370,7 @@ public Object getBrand() { } private static final class LocalPipeline implements PipelineHook { + private final CallContextHook ctx; private final AnyPointer.Reader results; @@ -396,7 +396,8 @@ private static final class LocalResponse implements ResponseHook { private static class LocalCallContext implements CallContextHook { - final CompletableFuture cancelAllowed; + final CompletableFuture cancelAllowed; + CompletableFuture tailCallPipeline; MessageBuilder request; Response response; AnyPointer.Builder responseBuilder; @@ -404,7 +405,7 @@ private static class LocalCallContext implements CallContextHook { LocalCallContext(MessageBuilder request, ClientHook clientRef, - CompletableFuture cancelAllowed) { + CompletableFuture cancelAllowed) { this.request = request; this.clientRef = clientRef; this.cancelAllowed = cancelAllowed; @@ -412,7 +413,7 @@ private static class LocalCallContext implements CallContextHook { @Override public AnyPointer.Reader getParams() { - return request.getRoot(AnyPointer.factory).asReader(); + return this.request.getRoot(AnyPointer.factory).asReader(); } @Override @@ -437,20 +438,27 @@ public void allowCancellation() { @Override public CompletableFuture tailCall(RequestHook request) { - // TODO implement tailCall - return null; + var result = this.directTailCall(request); + if (this.tailCallPipeline != null) { + this.tailCallPipeline.complete(new AnyPointer.Pipeline(result.pipeline)); + } + return result.promise; } @Override - public CompletableFuture onTailCall() { - // TODO implement onTailCall - return null; + public CompletableFuture onTailCall() { + this.tailCallPipeline = new CompletableFuture<>(); + return this.tailCallPipeline.copy(); } @Override public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { - // TODO implement directTailCall - return null; + assert this.response == null: "Can't call tailCall() after initializing the results struct."; + var promise = request.send(); + var voidPromise = promise._getResponse().thenAccept(tailResponse -> { + this.response = tailResponse; + }); + return new ClientHook.VoidPromiseAndPipeline(voidPromise, promise.pipeline().hook); } } diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index 9b60a341..0bbdc06e 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -20,14 +20,15 @@ public RemotePromise(FromPointerReader factory, public RemotePromise(CompletableFuture> promise, AnyPointer.Pipeline pipeline) { - super(promise.thenApply(response -> { - //System.out.println("Got a response for remote promise " + promise.toString()); - return response.getResults(); - })); + super(promise.thenApply(response -> response.getResults())); this.response = promise; this.pipeline = pipeline; } + CompletableFuture> _getResponse() { + return this.response; + } + public AnyPointer.Pipeline pipeline() { return this.pipeline; } From e04adc90b637c7440c728fb7b4a219b4cf085036 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 8 Nov 2020 19:45:47 +0000 Subject: [PATCH 117/246] embargo test and tribble --- .../src/main/java/org/capnproto/RpcState.java | 79 +++++++++++++------ .../src/test/java/org/capnproto/RpcTest.java | 41 ++++++++++ .../test/java/org/capnproto/RpcTestUtil.java | 15 +++- 3 files changed, 108 insertions(+), 27 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 369cbb61..7a1f52fb 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1041,19 +1041,18 @@ private ClientHook receiveCap(RpcProtocol.CapDescriptor.Reader descriptor, List< case SENDER_PROMISE: return importCap(descriptor.getSenderPromise(), true, fd); - case RECEIVER_HOSTED: + case RECEIVER_HOSTED: { var exp = exports.find(descriptor.getReceiverHosted()); if (exp == null) { return Capability.newBrokenCap("invalid 'receiverHosted' export ID"); - } - if (exp.clientHook.getBrand() == this) { - // TODO Tribble 4-way race! + } else if (exp.clientHook.getBrand() == this) { + return new TribbleRaceBlocker(exp.clientHook); + } else { return exp.clientHook; } + } - return exp.clientHook; - - case RECEIVER_ANSWER: + case RECEIVER_ANSWER: { var promisedAnswer = descriptor.getReceiverAnswer(); var answer = answers.find(promisedAnswer.getQuestionId()); var ops = ToPipelineOps(promisedAnswer); @@ -1065,14 +1064,12 @@ private ClientHook receiveCap(RpcProtocol.CapDescriptor.Reader descriptor, List< var result = answer.pipeline.getPipelinedCap(ops); if (result == null) { return Capability.newBrokenCap("Unrecognised pipeline ops"); - } - - if (result.getBrand() == this) { - // TODO Tribble 4-way race! + } else if (result.getBrand() == this) { + return new TribbleRaceBlocker(result); + } else { return result; } - - return result; + } case THIRD_PARTY_HOSTED: return Capability.newBrokenCap("Third party caps not supported"); @@ -1579,15 +1576,15 @@ public Request newCall(long interfaceId, short methodId) { } @Override - public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { - return null; + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { + return this.callNoIntercept(interfaceId, methodId, ctx); } - public VoidPromiseAndPipeline callNoIntercept(long interfaceId, short methodId, CallContextHook context) { - var params = context.getParams(); + public VoidPromiseAndPipeline callNoIntercept(long interfaceId, short methodId, CallContextHook ctx) { + var params = ctx.getParams(); var request = newCallNoIntercept(interfaceId, methodId); - context.allowCancellation(); - return context.directTailCall(request.getHook()); + ctx.allowCancellation(); + return ctx.directTailCall(request.getHook()); } @Override @@ -1760,11 +1757,6 @@ public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { return null; } - @Override - public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { - return null; - } - @Override public CompletableFuture whenMoreResolved() { return null; @@ -2001,4 +1993,43 @@ static RpcException ToException(RpcProtocol.Exception.Reader reader) { } return new RpcException(type, reader.getReason().toString()); } + + class TribbleRaceBlocker implements ClientHook { + + final ClientHook inner; + + TribbleRaceBlocker(ClientHook inner) { + this.inner = inner; + } + + @Override + public Request newCall(long interfaceId, short methodId) { + return this.inner.newCall(interfaceId, methodId); + } + + @Override + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { + return this.inner.call(interfaceId, methodId, ctx); + } + + @Override + public ClientHook getResolved() { + return null; + } + + @Override + public CompletableFuture whenMoreResolved() { + return null; + } + + @Override + public Object getBrand() { + return null; + } + + @Override + public Integer getFd() { + return this.inner.getFd(); + } + } } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 9fe93cfe..df8fa0fa 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -431,5 +431,46 @@ public void testTailCall() { Assert.assertEquals(2, dependentCall2.join().getN()); Assert.assertEquals(1, calleeCallCount.value()); } + + static CompletableFuture getCallSequence( + Test.TestCallOrder.Client client, int expected) { + var req = client.getCallSequenceRequest(); + req.getParams().setExpected(expected); + return req.send(); + } + + @org.junit.Test + public void testEmbargo() { + var context = new TestContext(bootstrapFactory); + var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); + + var cap = new Test.TestCallOrder.Client(new TestCallOrderImpl()); + var earlyCall = client.getCallSequenceRequest().send(); + + var echoRequest = client.echoRequest(); + echoRequest.getParams().setCap(cap); + var echo = echoRequest.send(); + + var pipeline = echo.getCap(); + var call0 = getCallSequence(pipeline, 0); + var call1 = getCallSequence(pipeline, 1); + + earlyCall.join(); + + var call2 = getCallSequence(pipeline, 2); + + var resolved = echo.join().getCap(); + + var call3 = getCallSequence(pipeline, 3); + var call4 = getCallSequence(pipeline, 4); + var call5 = getCallSequence(pipeline, 5); + + Assert.assertEquals(0, call0.join().getN()); + Assert.assertEquals(1, call1.join().getN()); + Assert.assertEquals(2, call2.join().getN()); + Assert.assertEquals(3, call3.join().getN()); + Assert.assertEquals(4, call4.join().getN()); + Assert.assertEquals(5, call5.join().getN()); + } } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java index 5bc80aa5..5fc00723 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java @@ -114,17 +114,26 @@ public TestMoreStuffImpl(Counter callCount, Counter handleCount) { this.handleCount = handleCount; } + @Override + protected CompletableFuture echo(CallContext context) { + this.callCount.inc(); + var params = context.getParams(); + var result = context.getResults(); + result.setCap(params.getCap()); + return READY_NOW; + } + @Override protected CompletableFuture getHandle(CallContext context) { context.getResults().setHandle(new HandleImpl(this.handleCount)); - return Capability.Server.READY_NOW; + return READY_NOW; } @Override protected CompletableFuture getCallSequence(CallContext context) { var result = context.getResults(); result.setN(this.callCount.inc()); - return Capability.Server.READY_NOW; + return READY_NOW; } @Override @@ -179,7 +188,7 @@ protected CompletableFuture foo(CallContext Date: Mon, 9 Nov 2020 15:43:23 +0000 Subject: [PATCH 118/246] add AnyStruct --- compiler/pom.xml | 4 +- compiler/src/main/cpp/capnpc-java.c++ | 26 +++++---- .../test/java/org/capnproto/EncodingTest.java | 8 +++ compiler/src/test/schema/test.capnp | 6 ++ .../main/java/org/capnproto/AnyStruct.java | 56 +++++++++++++++++++ 5 files changed, 87 insertions(+), 13 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/AnyStruct.java diff --git a/compiler/pom.xml b/compiler/pom.xml index 3fcafa3a..43fb798e 100644 --- a/compiler/pom.xml +++ b/compiler/pom.xml @@ -83,13 +83,13 @@ generate-test-sources - + - + diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 0a770970..54744aef 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -412,6 +412,8 @@ private: switch (type.whichAnyPointerKind()) { case schema::Type::AnyPointer::Unconstrained::CAPABILITY: return kj::strTree("org.capnproto.Capability.", suffix); + case schema::Type::AnyPointer::Unconstrained::STRUCT: + return kj::strTree("org.capnproto.AnyStruct.", suffix); default: return kj::strTree("org.capnproto.AnyPointer.", suffix); } @@ -775,8 +777,10 @@ private: } else { switch (type.whichAnyPointerKind()) { - case schema::Type::AnyPointer::Unconstrained::CAPABILITY: - return kj::str("org.capnproto.Capability.factory"); + case schema::Type::AnyPointer::Unconstrained::CAPABILITY: + return kj::str("org.capnproto.Capability.factory"); + case schema::Type::AnyPointer::Unconstrained::STRUCT: + return kj::str("org.capnproto.AnyStruct.factory"); default: return kj::str("org.capnproto.AnyPointer.factory"); } @@ -1035,7 +1039,7 @@ private: kind = FieldKind::ANY_POINTER; break; case schema::Type::AnyPointer::Unconstrained::STRUCT: - kind = FieldKind::STRUCT; + kind = FieldKind::ANY_POINTER; break; case schema::Type::AnyPointer::Unconstrained::LIST: kind = FieldKind::LIST; @@ -1967,14 +1971,14 @@ private: } if (resultProto.getIsGeneric()) { - auto resultFactoryArgs = getFactoryArguments(resultSchema, paramSchema); - resultFactory = resultFactoryArgs.size() == 0 - ? kj::str(shortResultType, ".factory") - : kj::strTree("newFactory(", - kj::StringTree(KJ_MAP(arg, resultFactoryArgs) { - return kj::strTree(arg); - }, ", "), - ")").flatten(); + auto resultFactoryArgs = getFactoryArguments(resultSchema, paramSchema); + resultFactory = resultFactoryArgs.size() == 0 + ? kj::str(shortResultType, ".factory") + : kj::strTree("newFactory(", + kj::StringTree(KJ_MAP(arg, resultFactoryArgs) { + return kj::strTree(arg); + }, ", "), + ")").flatten(); } auto paramBuilder = kj::str(shortParamType, ".Builder"); diff --git a/compiler/src/test/java/org/capnproto/EncodingTest.java b/compiler/src/test/java/org/capnproto/EncodingTest.java index f4c48a32..18b9344c 100644 --- a/compiler/src/test/java/org/capnproto/EncodingTest.java +++ b/compiler/src/test/java/org/capnproto/EncodingTest.java @@ -1,5 +1,6 @@ package org.capnproto.test; +import org.capnproto.test.Test; import org.capnproto.*; import org.capnproto.Void; import org.junit.Assert; @@ -845,6 +846,13 @@ public void testSetWithCaveats() { TestUtil.checkTestMessage(listReader.get(1)); } + @org.junit.Test + public void testAnyStruct() { + MessageBuilder builder = new MessageBuilder(); + var root = builder.initRoot(Test.TestAnyOthers.factory); + var anyStruct = root.initAnyStructField(); + } + @org.junit.Test public void testCopyAnyPointer() { MessageBuilder message1 = new MessageBuilder(); diff --git a/compiler/src/test/schema/test.capnp b/compiler/src/test/schema/test.capnp index af2f92da..c0332cd9 100644 --- a/compiler/src/test/schema/test.capnp +++ b/compiler/src/test/schema/test.capnp @@ -148,6 +148,12 @@ struct TestAnyPointer { # in the struct. } +struct TestAnyOthers { + anyStructField @0 :AnyStruct; + #anyListField @1 :AnyPointer; # not currently implemented + #capabilityField @2 :Capability; +} + struct TestOutOfOrder { foo @3 :Text; bar @2 :Text; diff --git a/runtime/src/main/java/org/capnproto/AnyStruct.java b/runtime/src/main/java/org/capnproto/AnyStruct.java new file mode 100644 index 00000000..0e7a4a31 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/AnyStruct.java @@ -0,0 +1,56 @@ +package org.capnproto; + +public class AnyStruct { + + public static final org.capnproto.StructSize STRUCT_SIZE = new org.capnproto.StructSize((short)0,(short)0); + + public static final class Factory extends org.capnproto.StructFactory { + public Factory() { + } + public final Reader constructReader(org.capnproto.SegmentReader segment, int data,int pointers, int dataSize, short pointerCount, int nestingLimit) { + return new Reader(segment,data,pointers,dataSize,pointerCount,nestingLimit); + } + public final Builder constructBuilder(org.capnproto.SegmentBuilder segment, int data,int pointers, int dataSize, short pointerCount) { + return new Builder(segment, data, pointers, dataSize, pointerCount); + } + public final org.capnproto.StructSize structSize() { + return AnyStruct.STRUCT_SIZE; + } + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + } + + public static final Factory factory = new Factory(); + + public static final org.capnproto.StructList.Factory listFactory = + new org.capnproto.StructList.Factory<>(factory); + + public static final class Builder extends org.capnproto.StructBuilder { + Builder(org.capnproto.SegmentBuilder segment, int data, int pointers,int dataSize, short pointerCount){ + super(segment, data, pointers, dataSize, pointerCount); + } + public final Reader asReader() { + return new Reader(segment, data, pointers, dataSize, pointerCount, 0x7fffffff); + } + + public final T initAs(StructBuilder.Factory factory) { + return factory.constructBuilder(this.segment, this.capTable, this.data, this.pointers, this.dataSize, this.pointerCount); + } + + public final T setAs(StructBuilder.Factory factory) { + return factory.constructBuilder(this.segment, this.capTable, this.data, this.pointers, this.dataSize, this.pointerCount); + } + + } + + public static final class Reader extends org.capnproto.StructReader { + Reader(org.capnproto.SegmentReader segment, int data, int pointers,int dataSize, short pointerCount, int nestingLimit){ + super(segment, data, pointers, dataSize, pointerCount, nestingLimit); + } + + public final T getAs(StructReader.Factory factory) { + return factory.constructReader(this.segment, this.capTable, this.data, this.pointers, this.dataSize, this.pointerCount, this.nestingLimit); + } + } +} From ce8ecc534940ffa1a33176361f93b61b3a3271a8 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 19:36:52 +0000 Subject: [PATCH 119/246] bump travis to jdk14 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fef94bd9..90f84275 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,8 @@ install: - cd ../ jdk: - - oraclejdk8 - - openjdk8 + - oraclejdk14 + - openjdk14 script: - make CC=gcc-7 CXX=g++-7 - mvn compile From 1e7b03d3f1025c50d8d8d489a22c8287d688af32 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 19:41:05 +0000 Subject: [PATCH 120/246] point readme to our travis badge --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a9c3fad..bc8fa077 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # capnproto-java: Cap'n Proto for Java -[![Build Status](https://travis-ci.org/capnproto/capnproto-java.svg?branch=master)](https://travis-ci.org/capnproto/capnproto-java) +[![Build Status](https://travis-ci.org/vaci/capnproto-java-rpc.svg?branch=master)](https://travis-ci.org/vaci/capnproto-java-rpc) [Cap'n Proto](http://capnproto.org) is an extremely efficient protocol for sharing data and capabilities, and capnproto-java is a pure Java implementation. [Read more here.](https://dwrensha.github.io/capnproto-java/index.html) + +This repository clone adds an implementation of the RPC framework for Java. From 40aebeeceeef70a2f7673141b536c68fc088cf7f Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 20:30:23 +0000 Subject: [PATCH 121/246] Move compiler test package to correct directory --- compiler/src/test/java/org/capnproto/{ => test}/EncodingTest.java | 0 compiler/src/test/java/org/capnproto/{ => test}/TestUtil.java | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename compiler/src/test/java/org/capnproto/{ => test}/EncodingTest.java (100%) rename compiler/src/test/java/org/capnproto/{ => test}/TestUtil.java (100%) diff --git a/compiler/src/test/java/org/capnproto/EncodingTest.java b/compiler/src/test/java/org/capnproto/test/EncodingTest.java similarity index 100% rename from compiler/src/test/java/org/capnproto/EncodingTest.java rename to compiler/src/test/java/org/capnproto/test/EncodingTest.java diff --git a/compiler/src/test/java/org/capnproto/TestUtil.java b/compiler/src/test/java/org/capnproto/test/TestUtil.java similarity index 100% rename from compiler/src/test/java/org/capnproto/TestUtil.java rename to compiler/src/test/java/org/capnproto/test/TestUtil.java From 0ff819702de4513486a562b1b5ddaba9039e1613 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 15:09:32 +0000 Subject: [PATCH 122/246] avoid test package name clash --- runtime-rpc/pom.xml | 4 ++-- runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java | 4 ---- runtime-rpc/src/test/schema/test.capnp | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/runtime-rpc/pom.xml b/runtime-rpc/pom.xml index 29b5bd43..c45f31f2 100644 --- a/runtime-rpc/pom.xml +++ b/runtime-rpc/pom.xml @@ -111,13 +111,13 @@ generate-test-sources - + - + diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java index 5fc00723..2770c930 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java @@ -1,8 +1,5 @@ package org.capnproto; -import org.capnproto.CallContext; -import org.capnproto.Capability; -import org.capnproto.Void; import org.capnproto.rpctest.Test; import org.junit.Assert; @@ -10,7 +7,6 @@ class RpcTestUtil { - static void initTestMessage(Test.TestAllTypes.Builder builder) { builder.setVoidField(Void.VOID); builder.setBoolField(true); diff --git a/runtime-rpc/src/test/schema/test.capnp b/runtime-rpc/src/test/schema/test.capnp index ea500f60..fff9a0cf 100644 --- a/runtime-rpc/src/test/schema/test.capnp +++ b/runtime-rpc/src/test/schema/test.capnp @@ -1,7 +1,7 @@ @0xb365fb00cc89383b; using Java = import "/capnp/java.capnp"; -$Java.package("org.capnproto.test"); +$Java.package("org.capnproto.rpctest"); $Java.outerClassname("Test"); struct TestAllTypes { From b1be88d3c9749a44deb07641dc05255d71298cec Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 21:25:19 +0000 Subject: [PATCH 123/246] bump capnproto C++ runtime to version 0,8.0 in travis CI --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 90f84275..2241357a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,9 @@ addons: - g++-7 install: - - curl -O https://capnproto.org/capnproto-c++-0.7.0.tar.gz - - tar zxf capnproto-c++-0.7.0.tar.gz - - cd capnproto-c++-0.7.0 + - curl -O https://capnproto.org/capnproto-c++-0.8.0.tar.gz + - tar zxf capnproto-c++-0.8.0.tar.gz + - cd capnproto-c++-0.8.0 - ./configure --prefix=$HOME CC=gcc-7 CXX=g++-7 - make -j3 - make install From f05c994c0629dba22ea65b2fa92bd04323647a40 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 21:28:03 +0000 Subject: [PATCH 124/246] correct module description --- runtime-rpc/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime-rpc/pom.xml b/runtime-rpc/pom.xml index c45f31f2..9b4f4634 100644 --- a/runtime-rpc/pom.xml +++ b/runtime-rpc/pom.xml @@ -6,7 +6,7 @@ jar runtime-rpc 0.1.6-SNAPSHOT - Cap'n Proto runtime library + Cap'n Proto RPC runtime library org.capnproto From c30dba3e9fc6658d344065d45421f8a5bf2b69ab Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 21:28:43 +0000 Subject: [PATCH 125/246] add callBrokenPromise test --- .../src/test/java/org/capnproto/RpcTest.java | 33 +++++++++++++++++++ .../test/java/org/capnproto/RpcTestUtil.java | 33 +++++++++++++++++-- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index df8fa0fa..4fcbac68 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -30,6 +30,8 @@ import java.util.Map; import java.util.Queue; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.atomic.AtomicBoolean; public class RpcTest { @@ -472,5 +474,36 @@ public void testEmbargo() { Assert.assertEquals(4, call4.join().getN()); Assert.assertEquals(5, call5.join().getN()); } + + @org.junit.Test + public void testCallBrokenPromise() throws ExecutionException, InterruptedException { + var context = new TestContext(bootstrapFactory); + var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); + + var paf = new CompletableFuture(); + + { + var req = client.holdRequest(); + req.getParams().setCap(new Test.TestInterface.Client(paf)); + req.send().join(); + } + + AtomicBoolean returned = new AtomicBoolean(false); + + var req = client.callHeldRequest().send().exceptionallyCompose(exc -> { + returned.set(true); + return CompletableFuture.failedFuture(exc); + }).thenAccept(results -> { + returned.set(true); + }); + + Assert.assertFalse(returned.get()); + + paf.completeExceptionally(new Exception("foo")); + Assert.assertTrue(returned.get()); + + // Verify that we are still connected + getCallSequence(client, 1).get(); + } } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java index 2770c930..73e1d45a 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java @@ -102,8 +102,9 @@ static class HandleImpl extends Test.TestHandle.Server { static class TestMoreStuffImpl extends Test.TestMoreStuff.Server { - final Counter callCount; - final Counter handleCount; + private final Counter callCount; + private final Counter handleCount; + private Test.TestInterface.Client clientToHold; public TestMoreStuffImpl(Counter callCount, Counter handleCount) { this.callCount = callCount; @@ -164,6 +165,34 @@ protected CompletableFuture callFooWhenResolved(CallContext hold(CallContext context) { + this.callCount.inc(); + var params = context.getParams(); + this.clientToHold = params.getCap(); + return READY_NOW; + } + + @Override + protected CompletableFuture callHeld(CallContext context) { + this.callCount.inc(); + var request = this.clientToHold.fooRequest(); + request.getParams().setI(123); + request.getParams().setJ(true); + return request.send().thenAccept(response -> { + Assert.assertEquals("foo", response.getX().toString()); + context.getResults().setS("bar"); + }); + } + + @Override + protected CompletableFuture getHeld(CallContext context) { + this.callCount.inc(); + var result = context.getResults(); + result.setCap(this.clientToHold); + return READY_NOW; + } } static class TestTailCalleeImpl extends Test.TestTailCallee.Server { From dcd9eb37c7cd4886ed68aff81ede5405891bf67d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 21:43:32 +0000 Subject: [PATCH 126/246] add override to set clients from completablefutures --- compiler/src/main/cpp/capnpc-java.c++ | 5 ++++- runtime-rpc/src/test/java/org/capnproto/RpcTest.java | 2 +- runtime/src/main/java/org/capnproto/Capability.java | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 54744aef..5226bc4e 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -1137,6 +1137,9 @@ private: spaces(indent), " }\n", spaces(indent), " public void set", titleCase, "(", serverType, " value) {\n", spaces(indent), " this.set", titleCase, "(new ", clientType, "(value));\n", + spaces(indent), " }\n", + spaces(indent), " public void set", titleCase, "(java.util.concurrent.CompletableFuture value) {\n", + spaces(indent), " this.set", titleCase, "(new ", clientType, "(value));\n", spaces(indent), " }\n" ), @@ -1825,7 +1828,7 @@ private: sp, " public Client(org.capnproto.ClientHook hook) { super(hook); }\n", sp, " public Client(org.capnproto.Capability.Client cap) { super(cap); }\n", sp, " public Client(Server server) { super(server); }\n", - sp, " public Client(java.util.concurrent.CompletionStage promise) {\n", + sp, " public Client(java.util.concurrent.CompletionStage promise) {\n", sp, " super(promise);\n", sp, " }\n", sp, " public static final class Methods {\n", diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 4fcbac68..4c8faa93 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -484,7 +484,7 @@ public void testCallBrokenPromise() throws ExecutionException, InterruptedExcept { var req = client.holdRequest(); - req.getParams().setCap(new Test.TestInterface.Client(paf)); + req.getParams().setCap(paf); req.send().join(); } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index cfb9f686..75bb9869 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -117,9 +117,9 @@ public Client(ClientHook hook) { this.hook = hook; } - public Client(CompletionStage promise) { + public Client(CompletionStage promise) { this(Capability.newLocalPromiseClient( - promise.thenApply(client -> client.getHook()))); + promise.thenApply(Client::getHook))); } public Client(Throwable exc) { From f3bb329e9608aae1b7f55da8ab2b5432ea316b8e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 10 Nov 2020 11:34:26 +0000 Subject: [PATCH 127/246] generalise AnyPointer setAs AnyPointer --- .../java/org/capnproto/test/EncodingTest.java | 4 +-- .../src/main/java/org/capnproto/RpcState.java | 2 +- .../main/java/org/capnproto/AnyPointer.java | 28 ++++++++----------- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/compiler/src/test/java/org/capnproto/test/EncodingTest.java b/compiler/src/test/java/org/capnproto/test/EncodingTest.java index 18b9344c..60c35eba 100644 --- a/compiler/src/test/java/org/capnproto/test/EncodingTest.java +++ b/compiler/src/test/java/org/capnproto/test/EncodingTest.java @@ -861,10 +861,8 @@ public void testCopyAnyPointer() { MessageBuilder message2 = new MessageBuilder(); AnyPointer.Builder root2 = message2.initRoot(AnyPointer.factory); - root2.set(message1.getRoot(AnyPointer.factory).asReader()); + root2.setAs(AnyPointer.factory, message1.getRoot(AnyPointer.factory).asReader()); TestUtil.checkTestMessage(root2.getAs(Test.TestAllTypes.factory)); } } - - diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 7a1f52fb..63da907f 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1382,7 +1382,7 @@ public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { // Just forward to another local call var promise = request.send(); var voidPromise = promise.thenAccept(results -> { - getResults(0).set(results); + getResults(0).setAs(AnyPointer.factory, results); }); return new ClientHook.VoidPromiseAndPipeline(voidPromise, promise.pipeline().hook); } diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index c4d23121..a15f68cc 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -23,7 +23,8 @@ public final class AnyPointer { public static final class Factory - implements PointerFactory { + implements PointerFactory, + SetPointerBuilder { public final Reader fromPointerReader(SegmentReader segment, CapTableReader capTable, int pointer, int nestingLimit) { return new Reader(segment, capTable, pointer, nestingLimit); } @@ -35,6 +36,15 @@ public final Builder initFromPointerBuilder(SegmentBuilder segment, CapTableBuil result.clear(); return result; } + public void setPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, Reader value) { + if (value.isNull()) { + WireHelpers.zeroObject(segment, capTable, pointer); + WireHelpers.zeroPointerAndFars(segment, pointer); + } + else { + WireHelpers.copyPointer(segment, capTable, pointer, value.segment, value.capTable, value.pointer, value.nestingLimit); + } + } } public static final Factory factory = new Factory(); @@ -128,22 +138,6 @@ public final void setAs(SetPointerBuilder factory, U reader) { factory.setPointerBuilder(this.segment, this.capTable, this.pointer, reader); } - public void set(AnyPointer.Reader reader) { - if (reader.isNull()) { - WireHelpers.zeroObject(this.segment, this.capTable, this.pointer); - WireHelpers.zeroPointerAndFars(this.segment, this.pointer); - } - else { - WireHelpers.copyPointer( - this.segment, this.capTable, this.pointer, - reader.segment, reader.capTable, reader.pointer, reader.nestingLimit); - } - } - - final void setAsCap(Capability.Client cap) { - WireHelpers.setCapabilityPointer(this.segment, capTable, this.pointer, cap.getHook()); - } - public final Reader asReader() { return new Reader(segment, this.capTable, pointer, java.lang.Integer.MAX_VALUE); } From cd8e096f3f7cde8aa3234dda6e59ab7a20932d2a Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 10 Nov 2020 12:07:37 +0000 Subject: [PATCH 128/246] small tidy of RpcState --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 63da907f..dabc299f 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1380,11 +1380,11 @@ public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { } // Just forward to another local call - var promise = request.send(); - var voidPromise = promise.thenAccept(results -> { + var response = request.send(); + var promise = response.thenAccept(results -> { getResults(0).setAs(AnyPointer.factory, results); }); - return new ClientHook.VoidPromiseAndPipeline(voidPromise, promise.pipeline().hook); + return new ClientHook.VoidPromiseAndPipeline(promise, response.pipeline().hook); } private RpcResponse consumeRedirectedResponse() { From d526eca4b9175ec1e2b89746b995b56b13723722 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 12 Nov 2020 20:12:10 +0000 Subject: [PATCH 129/246] resolve PromiseClient requests in order --- .../src/main/java/org/capnproto/RpcState.java | 53 ++++++------------- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index dabc299f..b7c5e961 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1500,63 +1500,42 @@ enum PipelineState { private class RpcPipeline implements PipelineHook { private final Question question; - private PipelineState state = PipelineState.WAITING; - private RpcResponse resolved; - private Throwable broken; final HashMap, ClientHook> clientMap = new HashMap<>(); final CompletableFuture redirectLater; - final CompletableFuture resolveSelf; RpcPipeline(Question question, CompletableFuture redirectLater) { this.question = question; this.redirectLater = redirectLater; - this.resolveSelf = this.redirectLater - .thenAccept(response -> { - this.state = PipelineState.RESOLVED; - this.resolved = response; - }) - .exceptionally(exc -> { - this.state = PipelineState.BROKEN; - this.broken = exc; - return null; - }); } RpcPipeline(Question question) { + this(question, null); // never resolves - this.question = question; - this.redirectLater = null; - this.resolveSelf = null; } @Override public ClientHook getPipelinedCap(PipelineOp[] ops) { + // We differ from the C++ implementation here. + // Previously, we would just store and return the resolved client, but this + // could cause tail calls to execute out of order. + // So instead we always chain resolution on the redirectLater promise, which + // ensures that each call initiated from this PromiseClient is executed in order. + // TODO avoid conversion to/from ArrayList? var key = new ArrayList<>(Arrays.asList(ops)); - var hook = this.clientMap.computeIfAbsent(key, k -> { - switch (state) { - case WAITING: { - var pipelineClient = new PipelineClient(this.question, ops); - if (this.redirectLater == null) { - // This pipeline will never get redirected, so just return the PipelineClient. - return pipelineClient; - } - - var resolutionPromise = this.redirectLater.thenApply( - response -> response.getResults().getPipelinedCap(ops)); - return new PromiseClient(pipelineClient, resolutionPromise, null); - } - - case RESOLVED: - return resolved.getResults().getPipelinedCap(ops); - - default: - return Capability.newBrokenCap(broken); + return this.clientMap.computeIfAbsent(key, k -> { + var pipelineClient = new PipelineClient(this.question, ops); + if (this.redirectLater == null) { + // This pipeline will never get redirected, so just return the PipelineClient. + return pipelineClient; } + + var resolutionPromise = this.redirectLater.thenApply( + response -> response.getResults().getPipelinedCap(ops)); + return new PromiseClient(pipelineClient, resolutionPromise, null); }); - return hook; } } From ce9e1689cb35ce19d9ec73de6e6cb4a66c552e33 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 12 Nov 2020 20:34:48 +0000 Subject: [PATCH 130/246] dont aggressively clean up answer pipelines --- .../src/main/java/org/capnproto/RpcState.java | 32 +++++-------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index b7c5e961..cf754b13 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -307,11 +307,6 @@ CompletableFuture disconnect(Throwable exc) { List> resolveOpsToRelease = new ArrayList<>(); for (var answer : answers) { - if (answer.pipeline != null) { - pipelinesToRelease.add(answer.pipeline); - answer.pipeline = null; - } - if (answer.redirectedResults != null) { tailCallsToRelease.add(answer.redirectedResults); answer.redirectedResults = null; @@ -548,6 +543,7 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo response.setFds(List.of()); answer.resultExports = writeDescriptors(caps, payload, fds); + assert answer.pipeline == null; answer.pipeline = ops -> ops.length == 0 ? capHook : Capability.newBrokenCap("Invalid pipeline transform."); @@ -603,6 +599,7 @@ void handleCall(IncomingRpcMessage message, RpcProtocol.Call.Reader call) { { var answer = answers.find(answerId); assert answer != null; + assert answer.pipeline == null; answer.pipeline = pap.pipeline; if (redirectResults) { @@ -728,7 +725,6 @@ void handleFinish(RpcProtocol.Finish.Reader finish) { : null; answer.resultExports = null; - answer.pipeline = null; // If the call isn't actually done yet, cancel it. Otherwise, we can go ahead and erase the // question from the table. @@ -1373,7 +1369,7 @@ public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { message.send(); } - cleanupAnswerTable(null, false); + cleanupAnswerTable(null); } return new ClientHook.VoidPromiseAndPipeline(tailInfo.promise, tailInfo.pipeline); } @@ -1412,7 +1408,7 @@ private void sendReturn() { this.returnMessage.setAnswerId(this.answerId); this.returnMessage.setReleaseParamCaps(false); - var exports = new int[0]; + int[] exports = null; try { exports = ((RpcServerResponseImpl) response).send(); } catch (Throwable exc) { @@ -1420,9 +1416,7 @@ private void sendReturn() { sendErrorReturn(exc); } - // If no caps in the results, the pipeline is irrelevant. - boolean shouldFreePipeline = exports.length == 0; - cleanupAnswerTable(exports, shouldFreePipeline); + cleanupAnswerTable(exports); } private void sendErrorReturn(Throwable exc) { @@ -1441,7 +1435,7 @@ private void sendErrorReturn(Throwable exc) { message.send(); } - cleanupAnswerTable(null, false); + cleanupAnswerTable(null); } private boolean isFirstResponder() { @@ -1452,25 +1446,15 @@ private boolean isFirstResponder() { return true; } - private void cleanupAnswerTable(int[] resultExports, boolean shouldFreePipeline) { - if (resultExports == null) { - resultExports = new int[0]; - } - + private void cleanupAnswerTable(int[] resultExports) { if (this.cancelRequested) { - assert resultExports.length == 0; + assert resultExports == null || resultExports.length == 0; answers.erase(this.answerId); - return; } else { var answer = answers.find(answerId); answer.callContext = null; answer.resultExports = resultExports; - - if (shouldFreePipeline) { - assert resultExports.length == 0; - answer.pipeline = null; - } } } From c8c8c8a0854df1b3fec246f4c3e39bc8bb1bf863 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 12 Nov 2020 20:36:53 +0000 Subject: [PATCH 131/246] just catch Exception when failing to send abort --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index cf754b13..68d7a1b3 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -306,7 +306,7 @@ CompletableFuture disconnect(Throwable exc) { List> tailCallsToRelease = new ArrayList<>(); List> resolveOpsToRelease = new ArrayList<>(); - for (var answer : answers) { + for (var answer: answers) { if (answer.redirectedResults != null) { tailCallsToRelease.add(answer.redirectedResults); answer.redirectedResults = null; @@ -317,7 +317,7 @@ CompletableFuture disconnect(Throwable exc) { } } - for (var export : exports) { + for (var export: exports) { clientsToRelease.add(export.clientHook); resolveOpsToRelease.add(export.resolveOp); export.clientHook = null; @@ -325,13 +325,13 @@ CompletableFuture disconnect(Throwable exc) { export.refcount = 0; } - for (var imp : imports) { + for (var imp: imports) { if (imp.promise != null) { imp.promise.completeExceptionally(networkExc); } } - for (var embargo : embargos) { + for (var embargo: embargos) { if (embargo.disembargo != null) { embargo.disembargo.completeExceptionally(networkExc); } @@ -344,7 +344,7 @@ CompletableFuture disconnect(Throwable exc) { FromException(exc, abort); message.send(); } - catch (Throwable abortFailed) { + catch (Exception ignored) { } var onShutdown = this.connection.shutdown().handle((x, ioExc) -> { From af47f1a8259ae76b19addc7cde9e05e55c7b0bcb Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 12 Nov 2020 20:40:18 +0000 Subject: [PATCH 132/246] simplify iteration of (weak) question table --- .../src/main/java/org/capnproto/RpcState.java | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 68d7a1b3..c364b344 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -117,7 +117,7 @@ void setSkipFinish(boolean value) { } } - class QuestionExportTable implements Iterable { + class QuestionExportTable { private final HashMap> slots = new HashMap<>(); private final Queue freeIds = new PriorityQueue<>(); private int max = 0; @@ -146,20 +146,12 @@ public Question next() { return value; } - @Override - public Iterator iterator() { - return this.slots.values() - .stream() - .map(Reference::get) - .filter(Objects::nonNull) - .iterator(); - } - - @Override public void forEach(Consumer action) { - var iter = this.iterator(); - while (iter.hasNext()) { - action.accept(iter.next()); + for (var entry: this.slots.values()) { + var question = entry.get(); + if (question != null) { + action.accept(question); + } } } } @@ -297,9 +289,7 @@ CompletableFuture disconnect(Throwable exc) { var networkExc = RpcException.disconnected(exc.getMessage()); // All current questions complete with exceptions. - for (var question: questions) { - question.reject(networkExc); - } + questions.forEach(question -> question.reject(networkExc)); List pipelinesToRelease = new ArrayList<>(); List clientsToRelease = new ArrayList<>(); From 2ddc8e1d79ddf9ea249e1a777bb587184da9cc8e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 12 Nov 2020 21:23:08 +0000 Subject: [PATCH 133/246] run the message loop asynchronously --- .../src/main/java/org/capnproto/RpcState.java | 39 +++++++++++-------- .../org/capnproto/TwoPartyVatNetwork.java | 6 +-- .../test/java/org/capnproto/RpcStateTest.java | 1 - 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index c364b344..d95e5cf0 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -260,7 +260,8 @@ Embargo newExportable(int id) { private final CompletableFuture onDisconnect; private Throwable disconnected = null; private CompletableFuture messageReady = CompletableFuture.completedFuture(null); - private final CompletableFuture messageLoop; + private final CompletableFuture messageLoop = new CompletableFuture<>(); + // completes when the message loop exits private final ReferenceQueue questionRefs = new ReferenceQueue<>(); private final ReferenceQueue importRefs = new ReferenceQueue<>(); @@ -270,7 +271,7 @@ Embargo newExportable(int id) { this.bootstrapFactory = bootstrapFactory; this.connection = connection; this.onDisconnect = onDisconnect; - this.messageLoop = this.doMessageLoop(); + startMessageLoop(); } public CompletableFuture getMessageLoop() { @@ -397,24 +398,30 @@ ClientHook restore() { return pipeline.getPipelinedCap(new PipelineOp[0]); } - private CompletableFuture doMessageLoop() { + private void startMessageLoop() { if (isDisconnected()) { - return CompletableFuture.failedFuture(this.disconnected); + this.messageLoop.completeExceptionally(this.disconnected); + return; } - return connection.receiveIncomingMessage().thenCompose(message -> { - try { - this.handleMessage(message); - } catch (Exception rpcExc) { - // either we received an Abort message from peer - // or internal RpcState is bad. - return this.disconnect(rpcExc); - } - this.cleanupImports(); - this.cleanupQuestions(); - return this.doMessageLoop(); + var messageReader = this.connection.receiveIncomingMessage() + .thenAccept(message -> { + if (message == null) { + this.messageLoop.complete(null); + return; + } + try { + this.handleMessage(message); + } catch (Exception rpcExc) { + // either we received an Abort message from peer + // or internal RpcState is bad. + this.disconnect(rpcExc); + } + this.cleanupImports(); + this.cleanupQuestions(); + }); - }).exceptionallyCompose(exc -> this.disconnect(exc)); + messageReader.thenRunAsync(this::startMessageLoop); } private void handleMessage(IncomingRpcMessage message) throws RpcException { diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 2c866069..1576aa65 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -77,11 +77,7 @@ public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { public CompletableFuture receiveIncomingMessage() { var message = Serialize.readAsync(channel) .thenApply(reader -> (IncomingRpcMessage) new IncomingMessage(reader)) - .whenComplete((msg, exc) -> { - if (exc != null) { - this.peerDisconnected.complete(null); - } - }); + .exceptionally(exc -> null); // send to message tap if (this.tap != null) { diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java index 35636d13..7cb49596 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java @@ -110,7 +110,6 @@ public void handleUnimplemented() throws RpcException { var msg = new TestMessage(); msg.builder.getRoot(RpcProtocol.Message.factory).initUnimplemented(); this.connection.setNextIncomingMessage(msg); - Assert.assertFalse(sent.isEmpty()); } @Test From 4e9e7f4068cc0233af2e2e208d46ce85d5731fce Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 6 Nov 2020 17:36:21 +0000 Subject: [PATCH 134/246] cancellation --- .../src/main/java/org/capnproto/RpcState.java | 172 +++++++++++------- .../src/test/java/org/capnproto/RpcTest.java | 31 ++++ .../test/java/org/capnproto/RpcTestUtil.java | 48 ++++- .../main/java/org/capnproto/CallContext.java | 2 +- .../main/java/org/capnproto/Capability.java | 23 ++- .../capnproto/CompletableFutureWrapper.java | 9 +- .../main/java/org/capnproto/PipelineHook.java | 6 +- .../java/org/capnproto/RemotePromise.java | 11 +- .../main/java/org/capnproto/RpcException.java | 8 +- 9 files changed, 224 insertions(+), 86 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index d95e5cf0..49ab7db5 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1,6 +1,8 @@ package org.capnproto; import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; @@ -43,13 +45,7 @@ private final class QuestionDisposer { this.id = id; } - void dispose() { - var ref = questions.find(this.id); - if (ref == null) { - assert false: "Question ID no longer on table?"; - return; - } - + void finish() { if (isConnected() && !this.skipFinish) { var sizeHint = messageSizeHint(RpcProtocol.Finish.factory); var message = connection.newOutgoingMessage(sizeHint); @@ -58,12 +54,18 @@ void dispose() { builder.setReleaseResultCaps(this.isAwaitingReturn); message.send(); } + this.skipFinish = true; + } + + void dispose() { + this.finish(); // Check if the question has returned and, if so, remove it from the table. // Remove question ID from the table. Must do this *after* sending `Finish` to ensure that // the ID is not re-allocated before the `Finish` message can be sent. - assert !this.isAwaitingReturn; - questions.erase(id); + if (!this.isAwaitingReturn) { + questions.erase(this.id); + } } } @@ -115,6 +117,10 @@ void answer(RpcResponse response) { void setSkipFinish(boolean value) { this.disposer.skipFinish = value; } + + public void finish() { + this.disposer.finish(); + } } class QuestionExportTable { @@ -514,7 +520,7 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo final var answerId = bootstrap.getQuestionId(); var answer = answers.put(answerId); if (answer.active) { - assert false: "questionId is already in use: " + answerId; + assert false: "bootstrap questionId is already in use: " + answerId; return; } answer.active = true; @@ -574,10 +580,9 @@ void handleCall(IncomingRpcMessage message, RpcProtocol.Call.Reader call) { var payload = call.getParams(); var capTableArray = receiveCaps(payload.getCapTable(), message.getAttachedFds()); var answerId = call.getQuestionId(); - var cancel = new CompletableFuture(); var context = new RpcCallContext( answerId, message, capTableArray, - payload.getContent(), redirectResults, cancel, + payload.getContent(), redirectResults, call.getInterfaceId(), call.getMethodId()); { @@ -593,28 +598,35 @@ void handleCall(IncomingRpcMessage message, RpcProtocol.Call.Reader call) { var pap = startCall(call.getInterfaceId(), call.getMethodId(), cap, context); + // Things may have changed -- in particular if startCall() immediately called + // context->directTailCall(). + { var answer = answers.find(answerId); assert answer != null; assert answer.pipeline == null; answer.pipeline = pap.pipeline; + var callReady = pap.promise; + if (redirectResults) { - answer.redirectedResults = pap.promise.thenApply( - void_ -> context.consumeRedirectedResponse()); - // TODO cancellation deferral + answer.redirectedResults = callReady.thenApply(void_ -> + context.consumeRedirectedResponse()); } else { - pap.promise.whenComplete((void_, exc) -> { + callReady.whenComplete((void_, exc) -> { if (exc == null) { context.sendReturn(); } else { context.sendErrorReturn(exc); - // TODO wait on the cancellation... } }); } + + context.whenCancelled().thenRun(() -> { + callReady.cancel(false); + }); } } @@ -636,10 +648,10 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu } question.setAwaitingReturn(false); - var exportsToRelease = new int[0]; + int[] exportsToRelease = null; if (callReturn.getReleaseParamCaps()) { exportsToRelease = question.paramExports; - question.paramExports = new int[0]; + question.paramExports = null; } if (callReturn.isTakeFromOtherQuestion()) { @@ -647,8 +659,9 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu if (answer != null) { answer.redirectedResults = null; } - //this.questions.erase(callReturn.getAnswerId()); - this.releaseExports(exportsToRelease); + if (exportsToRelease != null) { + this.releaseExports(exportsToRelease); + } return; } @@ -661,8 +674,7 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu var payload = callReturn.getResults(); var capTable = receiveCaps(payload.getCapTable(), message.getAttachedFds()); - // TODO question, message unused in RpcResponseImpl - var response = new RpcResponseImpl(question, message, capTable, payload.getContent()); + var response = new RpcResponseImpl(capTable, payload.getContent()); question.answer(response); break; @@ -707,7 +719,9 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu break; } - this.releaseExports(exportsToRelease); + if (exportsToRelease != null) { + this.releaseExports(exportsToRelease); + } } void handleFinish(RpcProtocol.Finish.Reader finish) { @@ -734,7 +748,9 @@ void handleFinish(RpcProtocol.Finish.Reader finish) { answers.erase(questionId); } - this.releaseExports(exportsToRelease); + if (exportsToRelease != null) { + this.releaseExports(exportsToRelease); + } } private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { @@ -760,14 +776,14 @@ private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reade } if (imp.promise != null) { - assert !imp.promise.isDone(); - // This import is an unfulfilled promise. - if (exc != null) { - imp.promise.completeExceptionally(exc); + + assert !imp.promise.isDone(); + if (exc == null) { + imp.promise.complete(cap); } else { - imp.promise.complete(cap); + imp.promise.completeExceptionally(exc); } return; } @@ -980,7 +996,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS } void releaseExports(int[] exports) { - for (var exportId : exports) { + for (var exportId: exports) { this.releaseExport(exportId, 1); } } @@ -1190,16 +1206,11 @@ interface RpcServerResponse { } class RpcResponseImpl implements RpcResponse { - private final Question question; - private final IncomingRpcMessage message; + private final AnyPointer.Reader results; - RpcResponseImpl(Question question, - IncomingRpcMessage message, - List capTable, + RpcResponseImpl(List capTable, AnyPointer.Reader results) { - this.question = question; - this.message = message; this.results = results.imbue(new ReaderCapabilityTable(capTable)); } @@ -1280,11 +1291,10 @@ private final class RpcCallContext implements CallContextHook { private boolean cancelRequested = false; private boolean cancelAllowed = false; - private final CompletableFuture whenCancelled; + private final CompletableFuture canceller = new CompletableFuture<>(); RpcCallContext(int answerId, IncomingRpcMessage request, List capTable, AnyPointer.Reader params, boolean redirectResults, - CompletableFuture whenCancelled, long interfaceId, short methodId) { this.answerId = answerId; this.interfaceId = interfaceId; @@ -1292,7 +1302,6 @@ private final class RpcCallContext implements CallContextHook { this.request = request; this.params = params.imbue(new ReaderCapabilityTable(capTable)); this.redirectResults = redirectResults; - this.whenCancelled = whenCancelled; } @Override @@ -1335,6 +1344,12 @@ public CompletableFuture tailCall(RequestHook request) { @Override public void allowCancellation() { + boolean previouslyRequestedButNotAllowed = (this.cancelAllowed == false && this.cancelRequested == true); + this.cancelAllowed = true; + + if (previouslyRequestedButNotAllowed) { + this.canceller.complete(null); + } } @Override @@ -1380,7 +1395,7 @@ public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { return new ClientHook.VoidPromiseAndPipeline(promise, response.pipeline().hook); } - private RpcResponse consumeRedirectedResponse() { + RpcResponse consumeRedirectedResponse() { assert this.redirectResults; if (this.response == null) { @@ -1446,16 +1461,19 @@ private boolean isFirstResponder() { private void cleanupAnswerTable(int[] resultExports) { if (this.cancelRequested) { assert resultExports == null || resultExports.length == 0; + // Already received `Finish` so it's our job to erase the table entry. We shouldn't have + // sent results if canceled, so we shouldn't have an export list to deal with. answers.erase(this.answerId); } else { + // We just have to null out callContext and set the exports. var answer = answers.find(answerId); answer.callContext = null; answer.resultExports = resultExports; } } - public void requestCancel() { + void requestCancel() { // Hints that the caller wishes to cancel this call. At the next time when cancellation is // deemed safe, the RpcCallContext shall send a canceled Return -- or if it never becomes // safe, the RpcCallContext will send a normal return when the call completes. Either way @@ -1468,9 +1486,15 @@ public void requestCancel() { if (previouslyAllowedButNotRequested) { // We just set CANCEL_REQUESTED, and CANCEL_ALLOWED was already set previously. Initiate // the cancellation. - this.whenCancelled.complete(null); + this.canceller.complete(null); } - // TODO do we care about cancelRequested if further completions are effectively ignored? + } + + /** Completed by the call context when a cancellation has been + * requested and cancellation is allowed + */ + CompletableFuture whenCancelled() { + return this.canceller; } } @@ -1544,6 +1568,7 @@ public VoidPromiseAndPipeline callNoIntercept(long interfaceId, short methodId, var params = ctx.getParams(); var request = newCallNoIntercept(interfaceId, methodId); ctx.allowCancellation(); + ctx.releaseParams(); return ctx.directTailCall(request.getHook()); } @@ -1606,7 +1631,6 @@ public RemotePromise send() { if (redirect != null) { var redirected = redirect.newCall( this.callBuilder.getInterfaceId(), this.callBuilder.getMethodId()); - //replacement.params = paramsBuilder; var replacement = new AnyPointer.Request(paramsBuilder, redirected.getHook()); return replacement.send(); } @@ -1619,12 +1643,7 @@ public RemotePromise send() { var appPromise = question.response.thenApply( hook -> new Response<>(hook.getResults(), hook)); - // complete when either the message loop completes (exceptionally) or - // the appPromise is fulfilled - var loop = CompletableFuture.anyOf( - getMessageLoop(), appPromise).thenCompose(x -> appPromise); - - return new RemotePromise<>(loop, new AnyPointer.Pipeline(pipeline)); + return new RemotePromise<>(appPromise, new AnyPointer.Pipeline(pipeline)); } @Override @@ -1759,7 +1778,6 @@ private class PromiseClient extends RpcClient { private final ClientHook cap; private final Integer importId; - private final CompletableFuture promise; private boolean receivedCall = false; private ResolutionType resolutionType = ResolutionType.UNRESOLVED; @@ -1768,7 +1786,14 @@ private class PromiseClient extends RpcClient { Integer importId) { this.cap = initial; this.importId = importId; - this.promise = eventual.thenApply(resolution -> resolve(resolution)); + eventual.whenComplete((resolution, exc) -> { + if (exc != null) { + resolve(Capability.newBrokenCap(exc)); + } + else { + resolve(resolution); + } + }); } public boolean isResolved() { @@ -1932,25 +1957,32 @@ static PipelineOp[] ToPipelineOps(RpcProtocol.PromisedAnswer.Reader reader) { } static void FromException(Throwable exc, RpcProtocol.Exception.Builder builder) { - builder.setReason(exc.getMessage()); - builder.setType(RpcProtocol.Exception.Type.FAILED); + var type = RpcProtocol.Exception.Type.FAILED; + if (exc instanceof RpcException) { + var rpcExc = (RpcException) exc; + type = switch (rpcExc.getType()) { + case FAILED -> RpcProtocol.Exception.Type.FAILED; + case OVERLOADED -> RpcProtocol.Exception.Type.OVERLOADED; + case DISCONNECTED -> RpcProtocol.Exception.Type.DISCONNECTED; + case UNIMPLEMENTED -> RpcProtocol.Exception.Type.UNIMPLEMENTED; + default -> RpcProtocol.Exception.Type.FAILED; + }; + } + builder.setType(type); + + var writer = new StringWriter(); + exc.printStackTrace(new PrintWriter(writer)); + builder.setReason(writer.toString()); } static RpcException ToException(RpcProtocol.Exception.Reader reader) { - var type = RpcException.Type.UNKNOWN; - - switch (reader.getType()) { - case UNIMPLEMENTED: - type = RpcException.Type.UNIMPLEMENTED; - break; - case FAILED: - type = RpcException.Type.FAILED; - break; - case DISCONNECTED: - case OVERLOADED: - default: - break; - } + var type = switch (reader.getType()) { + case FAILED -> RpcException.Type.FAILED; + case OVERLOADED -> RpcException.Type.OVERLOADED; + case DISCONNECTED -> RpcException.Type.DISCONNECTED; + case UNIMPLEMENTED -> RpcException.Type.UNIMPLEMENTED; + default -> RpcException.Type.FAILED; + }; return new RpcException(type, reader.getReason().toString()); } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 4c8faa93..f0a3ae43 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -25,11 +25,15 @@ import org.junit.Assert; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; import java.util.ArrayDeque; import java.util.HashMap; import java.util.Map; import java.util.Queue; +import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; @@ -505,5 +509,32 @@ public void testCallBrokenPromise() throws ExecutionException, InterruptedExcept // Verify that we are still connected getCallSequence(client, 1).get(); } + + @org.junit.Test + public void testCallCancel() { + var context = new TestContext(bootstrapFactory); + var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); + + var request = client.expectCancelRequest(); + var cap = new RpcTestUtil.TestCapDestructor(); + request.getParams().setCap(cap); + + // auto-close the request without waiting for a response, triggering a cancellation request. + try (var response = request.send()) { + response.thenRun(() -> Assert.fail("Never completing call returned?")); + } + catch (CompletionException exc) { + Assert.assertTrue(exc instanceof CompletionException); + Assert.assertNotNull(exc.getCause()); + Assert.assertTrue(exc.getCause() instanceof RpcException); + Assert.assertTrue(((RpcException)exc.getCause()).getType() == RpcException.Type.FAILED); + } + catch (Exception exc) { + Assert.fail(exc.toString()); + } + + // check that the connection is still open + getCallSequence(client, 1); + } } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java index 73e1d45a..14f5c281 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java @@ -3,7 +3,11 @@ import org.capnproto.rpctest.Test; import org.junit.Assert; +import java.awt.desktop.SystemEventListener; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; class RpcTestUtil { @@ -110,7 +114,7 @@ public TestMoreStuffImpl(Counter callCount, Counter handleCount) { this.callCount = callCount; this.handleCount = handleCount; } - + @Override protected CompletableFuture echo(CallContext context) { this.callCount.inc(); @@ -120,6 +124,17 @@ protected CompletableFuture echo(CallContext expectCancel(CallContext context) { + var cap = context.getParams().getCap(); + context.allowCancellation(); + return new CompletableFuture().whenComplete((void_, exc) -> { + if (exc != null) { + System.out.println("expectCancel completed exceptionally: " + exc.getMessage()); + } + }); // never completes, just await doom... + } + @Override protected CompletableFuture getHandle(CallContext context) { context.getResults().setHandle(new HandleImpl(this.handleCount)); @@ -193,6 +208,18 @@ protected CompletableFuture getHeld(CallContext neverReturn(CallContext context) { + this.callCount.inc(); + var cap = context.getParams().getCap(); + context.getResults().setCapCopy(cap); + context.allowCancellation(); + return new CompletableFuture<>().thenAccept(void_ -> { + // Ensure that the cap is used inside the lambda. + System.out.println(cap); + }); + } } static class TestTailCalleeImpl extends Test.TestTailCallee.Server { @@ -262,12 +289,23 @@ protected CompletableFuture getAnyCap(CallContext { - Assert.assertEquals("foo", response.getX().toString()); + Assert.assertEquals("foo", response.getX().toString()); - var result = context.getResults(); - result.setS("bar"); - result.initOutBox().setCap(new TestExtendsImpl(callCount)); + var result = context.getResults(); + result.setS("bar"); + result.initOutBox().setCap(new TestExtendsImpl(callCount)); }); } } + + static class TestCapDestructor extends Test.TestInterface.Server { + private final Counter dummy = new Counter(); + private final TestInterfaceImpl impl = new TestInterfaceImpl(dummy); + + @Override + protected CompletableFuture foo(CallContext context) { + return this.impl.foo(context); + } + } } + diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java index 553d4a7e..5f955d31 100644 --- a/runtime/src/main/java/org/capnproto/CallContext.java +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -2,7 +2,7 @@ import java.util.concurrent.CompletableFuture; -public class CallContext { +public final class CallContext { private final FromPointerReader params; private final FromPointerBuilder results; diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 75bb9869..821960d8 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -344,14 +344,18 @@ private static class LocalRequest implements RequestHook { @Override public RemotePromise send() { - var cancelPaf = new CompletableFuture(); - var context = new LocalCallContext(message, client, cancelPaf); + var cancel = new CompletableFuture(); + var context = new LocalCallContext(message, client, cancel); var promiseAndPipeline = client.call(interfaceId, methodId, context); var promise = promiseAndPipeline.promise.thenApply(x -> { context.getResults(); // force allocation return context.response; }); + cancel.whenComplete((void_, exc) -> { + promiseAndPipeline.promise.cancel(false); + }); + assert promiseAndPipeline.pipeline != null; return new RemotePromise<>(promise, new AnyPointer.Pipeline(promiseAndPipeline.pipeline)); } @@ -383,6 +387,11 @@ private static final class LocalPipeline implements PipelineHook { public final ClientHook getPipelinedCap(PipelineOp[] ops) { return this.results.getPipelinedCap(ops); } + + @Override + public void close() { + this.ctx.allowCancellation(); + } } private static final class LocalResponse implements ResponseHook { @@ -532,6 +541,16 @@ public final ClientHook getPipelinedCap(PipelineOp[] ops) { : new QueuedClient(this.promise.thenApply( pipeline -> pipeline.getPipelinedCap(ops))); } + + @Override + public void close() { + if (this.redirect != null) { + this.redirect.close(); + } + else { + this.promise.cancel(false); + } + } } // A ClientHook which simply queues calls while waiting for a ClientHook to which to forward them. diff --git a/runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java b/runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java index 09401ae2..bfe3ed44 100644 --- a/runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java +++ b/runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java @@ -5,8 +5,10 @@ public class CompletableFutureWrapper extends CompletableFuture { + private final CompletableFuture other; + public CompletableFutureWrapper(CompletionStage other) { - other.toCompletableFuture().whenComplete((value, exc) -> { + this.other = other.toCompletableFuture().whenComplete((value, exc) -> { if (exc == null) { this.complete(value); } @@ -15,4 +17,9 @@ public CompletableFutureWrapper(CompletionStage other) { } }); } + + @Override + public boolean cancel(boolean mayInterruptIfRunning) { + return this.other.cancel(mayInterruptIfRunning); + } } \ No newline at end of file diff --git a/runtime/src/main/java/org/capnproto/PipelineHook.java b/runtime/src/main/java/org/capnproto/PipelineHook.java index e42a5db8..274117ee 100644 --- a/runtime/src/main/java/org/capnproto/PipelineHook.java +++ b/runtime/src/main/java/org/capnproto/PipelineHook.java @@ -1,6 +1,6 @@ package org.capnproto; -public interface PipelineHook { +public interface PipelineHook extends AutoCloseable { ClientHook getPipelinedCap(PipelineOp[] ops); @@ -12,4 +12,8 @@ public ClientHook getPipelinedCap(PipelineOp[] ops) { } }; } + + @Override + default void close() { + } } diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index 0bbdc06e..86bd8efb 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -3,7 +3,8 @@ import java.util.concurrent.CompletableFuture; public class RemotePromise - extends CompletableFutureWrapper { + extends CompletableFutureWrapper + implements AutoCloseable { private final CompletableFuture> response; private final AnyPointer.Pipeline pipeline; @@ -20,11 +21,17 @@ public RemotePromise(FromPointerReader factory, public RemotePromise(CompletableFuture> promise, AnyPointer.Pipeline pipeline) { - super(promise.thenApply(response -> response.getResults())); + super(promise.thenApply(Response::getResults)); this.response = promise; this.pipeline = pipeline; } + @Override + public void close() throws Exception { + this.pipeline.hook.close(); + this.join(); + } + CompletableFuture> _getResponse() { return this.response; } diff --git a/runtime/src/main/java/org/capnproto/RpcException.java b/runtime/src/main/java/org/capnproto/RpcException.java index f7482282..5f0184af 100644 --- a/runtime/src/main/java/org/capnproto/RpcException.java +++ b/runtime/src/main/java/org/capnproto/RpcException.java @@ -3,13 +3,13 @@ public final class RpcException extends java.lang.Exception { public enum Type { - UNKNOWN, - UNIMPLEMENTED, FAILED, - DISCONNECTED + OVERLOADED, + DISCONNECTED, + UNIMPLEMENTED } - private Type type; + private final Type type; public RpcException(Type type, String message) { super(message); From 69a045deec25654181f02d6cf770349caf199416 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 12 Nov 2020 22:13:48 +0000 Subject: [PATCH 135/246] make requests autoclosable and cleanup disconnection --- .../src/main/java/org/capnproto/RpcState.java | 82 +++++--- .../main/java/org/capnproto/RpcSystem.java | 24 ++- .../java/org/capnproto/TwoPartyClient.java | 10 +- .../org/capnproto/TwoPartyVatNetwork.java | 27 ++- .../main/java/org/capnproto/VatNetwork.java | 8 +- .../test/java/org/capnproto/RpcStateTest.java | 90 ++++---- .../src/test/java/org/capnproto/RpcTest.java | 13 +- .../test/java/org/capnproto/TwoPartyTest.java | 196 +++++++++++------- .../main/java/org/capnproto/Capability.java | 16 +- .../main/java/org/capnproto/PipelineHook.java | 7 +- 10 files changed, 277 insertions(+), 196 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 49ab7db5..537328fb 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -3,7 +3,6 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; -import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.*; @@ -35,6 +34,16 @@ private static int exceptionSizeHint(Throwable exc) { = RpcProtocol.CapDescriptor.factory.structSize().total() + RpcProtocol.PromisedAnswer.factory.structSize().total(); + static class DisconnectInfo { + + final CompletableFuture shutdownPromise; + // Task which is working on sending an abort message and cleanly ending the connection. + + DisconnectInfo(CompletableFuture shutdownPromise) { + this.shutdownPromise = shutdownPromise; + } + } + private final class QuestionDisposer { final int id; @@ -224,7 +233,6 @@ public void dispose() { final static class Embargo { final int id; final CompletableFuture disembargo = new CompletableFuture<>(); - Embargo(int id) { this.id = id; } @@ -263,7 +271,7 @@ Embargo newExportable(int id) { private final Map exportsByCap = new HashMap<>(); private final BootstrapFactory bootstrapFactory; private final VatNetwork.Connection connection; - private final CompletableFuture onDisconnect; + private final CompletableFuture disconnectFulfiller; private Throwable disconnected = null; private CompletableFuture messageReady = CompletableFuture.completedFuture(null); private final CompletableFuture messageLoop = new CompletableFuture<>(); @@ -273,10 +281,10 @@ Embargo newExportable(int id) { RpcState(BootstrapFactory bootstrapFactory, VatNetwork.Connection connection, - CompletableFuture onDisconnect) { + CompletableFuture disconnectFulfiller) { this.bootstrapFactory = bootstrapFactory; this.connection = connection; - this.onDisconnect = onDisconnect; + this.disconnectFulfiller = disconnectFulfiller; startMessageLoop(); } @@ -284,13 +292,10 @@ public CompletableFuture getMessageLoop() { return this.messageLoop; } - public CompletableFuture onDisconnect() { - return this.messageLoop; - } - - CompletableFuture disconnect(Throwable exc) { + void disconnect(Throwable exc) { if (isDisconnected()) { - return CompletableFuture.failedFuture(this.disconnected); + // Already disconnected. + return; } var networkExc = RpcException.disconnected(exc.getMessage()); @@ -334,6 +339,7 @@ CompletableFuture disconnect(Throwable exc) { } } + // Send an abort message, but ignore failure. try { int sizeHint = messageSizeHint() + exceptionSizeHint(exc); var message = this.connection.newOutgoingMessage(sizeHint); @@ -344,25 +350,31 @@ CompletableFuture disconnect(Throwable exc) { catch (Exception ignored) { } - var onShutdown = this.connection.shutdown().handle((x, ioExc) -> { - if (ioExc == null) { - return CompletableFuture.completedFuture(null); - } + var shutdownPromise = this.connection.shutdown() + .exceptionallyCompose(ioExc -> { - // TODO IOException? assert !(ioExc instanceof IOException); if (ioExc instanceof RpcException) { var rpcExc = (RpcException)exc; + + // Don't report disconnects as an error if (rpcExc.getType() == RpcException.Type.DISCONNECTED) { return CompletableFuture.completedFuture(null); } } + return CompletableFuture.failedFuture(ioExc); }); this.disconnected = networkExc; - return onShutdown.thenCompose(x -> CompletableFuture.failedFuture(networkExc)); + this.disconnectFulfiller.complete(new DisconnectInfo(shutdownPromise)); + + for (var pipeline: pipelinesToRelease) { + if (pipeline instanceof RpcState.RpcPipeline) { + ((RpcPipeline) pipeline).redirectLater.completeExceptionally(networkExc); + } + } } final boolean isDisconnected() { @@ -389,12 +401,7 @@ private void evalLast(Callable func) { ClientHook restore() { var question = questions.next(); question.setAwaitingReturn(true); - - // Run the message loop until the boostrap promise is resolved. var promise = new CompletableFuture(); - var loop = CompletableFuture.anyOf( - getMessageLoop(), promise).thenCompose(x -> promise); - int sizeHint = messageSizeHint(RpcProtocol.Bootstrap.factory); var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initBootstrap(); @@ -413,6 +420,7 @@ private void startMessageLoop() { var messageReader = this.connection.receiveIncomingMessage() .thenAccept(message -> { if (message == null) { + this.disconnect(RpcException.disconnected("Peer disconnected")); this.messageLoop.complete(null); return; } @@ -423,11 +431,12 @@ private void startMessageLoop() { // or internal RpcState is bad. this.disconnect(rpcExc); } - this.cleanupImports(); - this.cleanupQuestions(); }); - messageReader.thenRunAsync(this::startMessageLoop); + messageReader.thenRunAsync(this::startMessageLoop).exceptionallyCompose(exc -> { + assert exc == null: "Exception in startMessageLoop!"; + return CompletableFuture.failedFuture(exc); + }); } private void handleMessage(IncomingRpcMessage message) throws RpcException { @@ -470,6 +479,9 @@ private void handleMessage(IncomingRpcMessage message) throws RpcException { } break; } + + this.cleanupImports(); + this.cleanupQuestions(); } void handleUnimplemented(RpcProtocol.Message.Reader message) { @@ -1427,7 +1439,6 @@ private void sendReturn() { this.responseSent = false; sendErrorReturn(exc); } - cleanupAnswerTable(exports); } @@ -1512,6 +1523,7 @@ private class RpcPipeline implements PipelineHook { RpcPipeline(Question question, CompletableFuture redirectLater) { this.question = question; + assert redirectLater != null; this.redirectLater = redirectLater; } @@ -1542,6 +1554,11 @@ public ClientHook getPipelinedCap(PipelineOp[] ops) { return new PromiseClient(pipelineClient, resolutionPromise, null); }); } + + @Override + public void close() { + this.question.finish(); + } } abstract class RpcClient implements ClientHook { @@ -1787,11 +1804,11 @@ private class PromiseClient extends RpcClient { this.cap = initial; this.importId = importId; eventual.whenComplete((resolution, exc) -> { - if (exc != null) { - resolve(Capability.newBrokenCap(exc)); + if (exc == null) { + resolve(resolution); } else { - resolve(resolution); + resolve(Capability.newBrokenCap(exc)); } }); } @@ -1842,6 +1859,10 @@ private ClientHook resolve(ClientHook replacement) { // TODO Flow control if (resolutionType == ResolutionType.REFLECTED && receivedCall && !isDisconnected()) { + // The new capability is hosted locally, not on the remote machine. And, we had made calls + // to the promise. We need to make sure those calls echo back to us before we allow new + // calls to go directly to the local capability, so we need to set a local embargo and send + // a `Disembargo` to echo through the peer. int sizeHint = messageSizeHint(RpcProtocol.Disembargo.factory); var message = connection.newOutgoingMessage(sizeHint); var disembargo = message.getBody().initAs(RpcProtocol.Message.factory).initDisembargo(); @@ -1852,7 +1873,8 @@ private ClientHook resolve(ClientHook replacement) { disembargo.getContext().setSenderLoopback(embargo.id); final ClientHook finalReplacement = replacement; - var embargoPromise = embargo.disembargo.thenApply(x -> finalReplacement); + var embargoPromise = embargo.disembargo.thenApply( + void_ -> finalReplacement); replacement = Capability.newLocalPromiseClient(embargoPromise); message.send(); } diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java index 9ab49b15..e7c5b0cd 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java @@ -1,5 +1,6 @@ package org.capnproto; +import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.concurrent.CompletableFuture; @@ -68,14 +69,21 @@ else if (this.bootstrapFactory != null) { } RpcState getConnectionState(VatNetwork.Connection connection) { - - var onDisconnect = new CompletableFuture>() - .thenAccept(lostConnection -> { - this.connections.remove(lostConnection); - }); - - return connections.computeIfAbsent(connection, key -> - new RpcState(this.bootstrapFactory, connection, onDisconnect)); + var state = this.connections.get(connection); + if (state == null) { + var onDisconnect = new CompletableFuture() + .whenComplete((info, exc) -> { + this.connections.remove(connection); + try { + connection.close(); + } catch (IOException ignored) { + } + }); + + state = new RpcState<>(this.bootstrapFactory, connection, onDisconnect); + this.connections.put(connection, state); + } + return state; } public void accept(VatNetwork.Connection connection) { diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java index 19eb9704..d6056c65 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java @@ -20,7 +20,7 @@ public TwoPartyClient(AsynchronousSocketChannel channel, Capability.Client bootstrapInterface, RpcTwoPartyProtocol.Side side) { this.network = new TwoPartyVatNetwork(channel, side); - this.rpcSystem = new RpcSystem(network, bootstrapInterface); + this.rpcSystem = new RpcSystem<>(network, bootstrapInterface); } public Capability.Client bootstrap() { @@ -31,12 +31,4 @@ public Capability.Client bootstrap() { : RpcTwoPartyProtocol.Side.CLIENT); return rpcSystem.bootstrap(vatId.asReader()); } - - public TwoPartyVatNetwork getNetwork() { - return this.network; - } - - public CompletableFuture onDisconnect() { - return this.network.onDisconnect(); - } } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 1576aa65..7929286a 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -1,5 +1,6 @@ package org.capnproto; +import java.io.IOException; import java.nio.channels.AsynchronousSocketChannel; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -18,7 +19,7 @@ public interface MessageTap { } private CompletableFuture previousWrite = CompletableFuture.completedFuture(null); - private final CompletableFuture peerDisconnected = new CompletableFuture<>(); + private final CompletableFuture disconnectPromise = new CompletableFuture<>(); private final AsynchronousSocketChannel channel; private final RpcTwoPartyProtocol.Side side; private final MessageBuilder peerVatId = new MessageBuilder(4); @@ -34,6 +35,12 @@ public TwoPartyVatNetwork(AsynchronousSocketChannel channel, RpcTwoPartyProtocol : RpcTwoPartyProtocol.Side.CLIENT); } + @Override + public void close() throws IOException { + this.channel.close(); + this.disconnectPromise.complete(null); + } + public RpcTwoPartyProtocol.Side getSide() { return side; } @@ -46,6 +53,10 @@ public Connection asConnection() { return this; } + public CompletableFuture onDisconnect() { + return this.disconnectPromise.copy(); + } + @Override public Connection connect(RpcTwoPartyProtocol.VatId.Reader vatId) { return vatId.getSide() != side @@ -59,7 +70,7 @@ public CompletableFuture> accept() return CompletableFuture.completedFuture(this.asConnection()); } else { - // never /home/vaci/g/capnproto-java/compilercompletes + // never completes return new CompletableFuture<>(); } } @@ -97,20 +108,20 @@ public CompletableFuture receiveIncomingMessage() { return message; } - @Override - public CompletableFuture onDisconnect() { - return this.peerDisconnected.copy(); - } - @Override public CompletableFuture shutdown() { - return this.previousWrite.whenComplete((x, exc) -> { + assert this.previousWrite != null: "Already shut down"; + + var result = this.previousWrite.thenRun(() -> { try { this.channel.shutdownOutput(); } catch (Exception ioExc) { } }); + + this.previousWrite = null; + return result; } final class OutgoingMessage implements OutgoingRpcMessage { diff --git a/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java index 1286c71a..5660d6c9 100644 --- a/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java @@ -1,24 +1,22 @@ package org.capnproto; +import java.io.IOException; import java.util.concurrent.CompletableFuture; public interface VatNetwork { - interface Connection { + interface Connection extends AutoCloseable { default OutgoingRpcMessage newOutgoingMessage() { return newOutgoingMessage(0); } OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize); CompletableFuture receiveIncomingMessage(); - CompletableFuture onDisconnect(); CompletableFuture shutdown(); VatId getPeerVatId(); + void close() throws IOException; } CompletableFuture> baseAccept(); - - //FromPointerReader getVatIdFactory(); - Connection connect(VatId hostId); } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java index 7cb49596..6a2f4756 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java @@ -5,30 +5,17 @@ import org.junit.Before; import org.junit.Test; +import java.io.IOException; import java.util.ArrayDeque; import java.util.Queue; import java.util.concurrent.CompletableFuture; public class RpcStateTest { - class TestMessage implements IncomingRpcMessage { - - MessageBuilder builder = new MessageBuilder(); - - @Override - public AnyPointer.Reader getBody() { - return builder.getRoot(AnyPointer.factory).asReader(); - } - } - class TestConnection implements VatNetwork.Connection { private CompletableFuture nextIncomingMessage = new CompletableFuture<>(); - private final CompletableFuture disconnect = new CompletableFuture<>(); - - public void setNextIncomingMessage(IncomingRpcMessage message) { - this.nextIncomingMessage.complete(message); - } + private final CompletableFuture disconnect = new CompletableFuture<>(); @Override public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { @@ -43,6 +30,19 @@ public AnyPointer.Builder getBody() { @Override public void send() { sent.add(this); + var msg = new IncomingRpcMessage() { + @Override + public AnyPointer.Reader getBody() { + return message.getRoot(AnyPointer.factory).asReader(); + } + }; + + if (nextIncomingMessage.isDone()) { + nextIncomingMessage = CompletableFuture.completedFuture(msg); + } + else { + nextIncomingMessage.complete(msg); + } } @Override @@ -54,24 +54,23 @@ public int sizeInWords() { @Override public CompletableFuture receiveIncomingMessage() { - return this.nextIncomingMessage; - } - - @Override - public CompletableFuture onDisconnect() { - return this.disconnect.copy(); + return this.nextIncomingMessage; } @Override public CompletableFuture shutdown() { this.disconnect.complete(null); - return this.disconnect.copy(); + return this.disconnect.thenRun(() -> {}); } @Override public RpcTwoPartyProtocol.VatId.Reader getPeerVatId() { return null; } + + @Override + public void close() { + } } TestConnection connection; @@ -80,7 +79,7 @@ public RpcTwoPartyProtocol.VatId.Reader getPeerVatId() { final Queue sent = new ArrayDeque<>(); @Before - public void setUp() throws Exception { + public void setUp() { this.connection = new TestConnection(); this.bootstrapInterface = new Capability.Client(Capability.newNullCap()); var bootstrapFactory = new BootstrapFactory() { @@ -95,45 +94,50 @@ public Capability.Client createFor(RpcTwoPartyProtocol.VatId.Reader clientId) { } }; - this.rpc = new RpcState(bootstrapFactory, connection, connection.disconnect); + this.rpc = new RpcState<>(bootstrapFactory, connection, connection.disconnect); } @After - public void tearDown() throws Exception { + public void tearDown() { this.connection = null; this.rpc = null; this.sent.clear(); } - +/* @Test - public void handleUnimplemented() throws RpcException { - var msg = new TestMessage(); - msg.builder.getRoot(RpcProtocol.Message.factory).initUnimplemented(); - this.connection.setNextIncomingMessage(msg); + public void handleUnimplemented() { + var msg = this.connection.newOutgoingMessage(0); + var root = msg.getBody().initAs(RpcProtocol.Message.factory).initUnimplemented(); + var resolve = root.initResolve(); + RpcState.FromException(new Exception("foo"), resolve.initException()); + msg.send(); + Assert.assertFalse(sent.isEmpty()); } - +*/ @Test public void handleAbort() { - var msg = new TestMessage(); - var builder = msg.builder.getRoot(RpcProtocol.Message.factory); + var msg = this.connection.newOutgoingMessage(0); + var builder = msg.getBody().initAs(RpcProtocol.Message.factory); RpcState.FromException(RpcException.failed("Test abort"), builder.initAbort()); - this.connection.setNextIncomingMessage(msg); - //Assert.assertThrows(RpcException.class, () -> rpc.handleMessage(msg)); + msg.send(); } @Test - public void handleBootstrap() throws RpcException { - var msg = new TestMessage(); - var bootstrap = msg.builder.getRoot(RpcProtocol.Message.factory).initBootstrap(); + public void handleBootstrap() { + var msg = this.connection.newOutgoingMessage(0); + var bootstrap = msg.getBody().initAs(RpcProtocol.Message.factory).initBootstrap(); bootstrap.setQuestionId(0); - this.connection.setNextIncomingMessage(msg); - Assert.assertFalse(sent.isEmpty()); - var reply = sent.remove(); + msg.send(); + Assert.assertEquals(2, sent.size()); + + sent.remove(); // bootstrap + var reply = sent.remove(); // return + var rpcMsg = reply.getBody().getAs(RpcProtocol.Message.factory); - Assert.assertEquals(rpcMsg.which(), RpcProtocol.Message.Which.RETURN); + Assert.assertEquals(RpcProtocol.Message.Which.RETURN, rpcMsg.which()); var ret = rpcMsg.getReturn(); Assert.assertEquals(ret.getAnswerId(), 0); - Assert.assertEquals(ret.which(), RpcProtocol.Return.Which.RESULTS); + Assert.assertEquals(RpcProtocol.Return.Which.RESULTS, ret.which()); var results = ret.getResults(); Assert.assertEquals(results.getCapTable().size(), 1); // got a capability! Assert.assertTrue(results.hasContent()); diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index f0a3ae43..89b918dc 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -25,13 +25,10 @@ import org.junit.Assert; -import java.lang.ref.ReferenceQueue; -import java.lang.ref.WeakReference; import java.util.ArrayDeque; import java.util.HashMap; import java.util.Map; import java.util.Queue; -import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutionException; @@ -156,11 +153,6 @@ public CompletableFuture receiveIncomingMessage() { } } - @Override - public CompletableFuture onDisconnect() { - return null; - } - @Override public CompletableFuture shutdown() { if (this.partner == null) { @@ -174,6 +166,10 @@ public CompletableFuture shutdown() { public Test.TestSturdyRef.Reader getPeerVatId() { return this.peerId; } + + @Override + public void close() { + } } final TestNetwork network; @@ -430,6 +426,7 @@ public void testTailCall() { Assert.assertEquals(456, response.getI()); var dependentCall1 = promise.getC().getCallSequenceRequest().send(); + Assert.assertEquals(0, dependentCall0.join().getN()); Assert.assertEquals(1, dependentCall1.join().getN()); diff --git a/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java b/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java index 222007c7..0102c0a9 100644 --- a/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java @@ -1,60 +1,15 @@ package org.capnproto; -/* -import org.capnproto.demo.Demo; +import org.capnproto.rpctest.*; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Test; +import org.junit.function.ThrowingRunnable; import java.io.IOException; import java.nio.channels.AsynchronousServerSocketChannel; import java.nio.channels.AsynchronousSocketChannel; -import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; - -class TestCap0Impl extends Demo.TestCap0.Server { - - final Demo.TestCap1.Client testCap1a = new Demo.TestCap1.Client(new TestCap1Impl()); - final Demo.TestCap1.Client testCap1b = new Demo.TestCap1.Client(new TestCap1Impl()); - - public CompletableFuture testMethod0(CallContext ctx) { - var params = ctx.getParams(); - var results = ctx.getResults(); - results.setResult0(params.getParam0()); - ctx.releaseParams(); - return CompletableFuture.completedFuture(null); - } - - public CompletableFuture testMethod1(CallContext ctx) { - var params = ctx.getParams(); - var results = ctx.getResults(); - var res0 = results.getResult0(); - res0.setAs(Demo.TestCap1.factory, testCap1a); - var res1 = results.getResult1(); - res1.setAs(Demo.TestCap1.factory, testCap1b); - var res2 = results.getResult2(); - res2.setAs(Demo.TestCap1.factory, testCap1b); - return CompletableFuture.completedFuture(null); - } -} - -class TestCap1Impl extends Demo.TestCap1.Server { -} - -class Tap implements org.capnproto.TwoPartyVatNetwork.MessageTap { - - final RpcDumper dumper = new RpcDumper(); - - @Override - public void incoming(IncomingRpcMessage message, RpcTwoPartyProtocol.Side side) { - var text = this.dumper.dump(message.getBody().getAs(RpcProtocol.Message.factory), side); - if (text.length() > 0) { - System.out.println(text); - } - } -} public class TwoPartyTest { @@ -73,7 +28,8 @@ private Thread runServer(org.capnproto.TwoPartyVatNetwork network) { return thread; } - AsynchronousServerSocketChannel serverSocket; + AsynchronousServerSocketChannel serverAcceptSocket; + AsynchronousSocketChannel serverSocket; AsynchronousSocketChannel clientSocket; TwoPartyClient client; org.capnproto.TwoPartyVatNetwork serverNetwork; @@ -81,17 +37,17 @@ private Thread runServer(org.capnproto.TwoPartyVatNetwork network) { @Before public void setUp() throws Exception { - this.serverSocket = AsynchronousServerSocketChannel.open(); - this.serverSocket.bind(null); + this.serverAcceptSocket = AsynchronousServerSocketChannel.open(); + this.serverAcceptSocket.bind(null); this.clientSocket = AsynchronousSocketChannel.open(); - this.clientSocket.connect(this.serverSocket.getLocalAddress()).get(); + this.clientSocket.connect(this.serverAcceptSocket.getLocalAddress()).get(); this.client = new TwoPartyClient(clientSocket); - this.client.getNetwork().setTap(new Tap()); + //this.client.getNetwork().setTap(new Tap()); - var socket = serverSocket.accept().get(); - this.serverNetwork = new org.capnproto.TwoPartyVatNetwork(socket, RpcTwoPartyProtocol.Side.SERVER); - this.serverNetwork.setTap(new Tap()); + this.serverSocket = serverAcceptSocket.accept().get(); + this.serverNetwork = new org.capnproto.TwoPartyVatNetwork(this.serverSocket, RpcTwoPartyProtocol.Side.SERVER); + //this.serverNetwork.setTap(new Tap()); //this.serverNetwork.dumper.addSchema(Demo.TestCap1); this.serverThread = runServer(this.serverNetwork); } @@ -100,36 +56,128 @@ public void setUp() throws Exception { public void tearDown() throws Exception { this.clientSocket.close(); this.serverSocket.close(); + this.serverAcceptSocket.close(); this.serverThread.join(); this.client = null; } - @Test + @org.junit.Test public void testNullCap() throws ExecutionException, InterruptedException { var server = new RpcSystem<>(this.serverNetwork, new Capability.Client()); var cap = this.client.bootstrap(); - var resolved = cap.whenResolved().toCompletableFuture(); + var resolved = cap.whenResolved(); resolved.get(); } - @Test - public void testBasic() throws ExecutionException, InterruptedException, IOException { - var server = new RpcSystem<>(this.serverNetwork, new TestCap0Impl()); + @org.junit.Test + public void testBasic() throws InterruptedException, IOException { - var demo = new Demo.TestCap0.Client(this.client.bootstrap()); - var request = demo.testMethod0Request(); - var params = request.getParams(); - params.setParam0(4321); - var response = request.send(); - response.get(); - Assert.assertTrue(response.isDone()); - var results = response.get(); - Assert.assertEquals(params.getParam0(), results.getResult0()); + var callCount = new Counter(); + var server = new RpcSystem<>(this.serverNetwork, new RpcTestUtil.TestInterfaceImpl(callCount)); + + var client = new Test.TestInterface.Client(this.client.bootstrap()); + var request1 = client.fooRequest(); + request1.getParams().setI(123); + request1.getParams().setJ(true); + + var promise1 = request1.send(); + + var request2 = client.bazRequest(); + RpcTestUtil.initTestMessage(request2.getParams().initS()); + var promise2 = request2.send(); + + boolean barFailed = false; + var request3 = client.barRequest(); + var promise3 = request3.send() + .thenAccept(results -> Assert.fail("Expected bar() to fail")) + .exceptionally(exc -> null); + + var response1 = promise1.join(); + Assert.assertEquals("foo", response1.getX().toString()); + + promise2.join(); + promise3.join(); + + Assert.assertEquals(2, callCount.value()); this.clientSocket.shutdownOutput(); serverThread.join(); } - @Test + @org.junit.Test + public void testDisconnect() throws IOException { + this.serverSocket.shutdownOutput(); + this.serverNetwork.close(); + this.serverNetwork.onDisconnect().join(); + } + + @org.junit.Test + public void testPipelining() throws IOException { + var callCount = new Counter(); + var chainedCallCount = new Counter(); + + var server = new RpcSystem<>(this.serverNetwork, new RpcTestUtil.TestPipelineImpl(callCount)); + var client = new Test.TestPipeline.Client(this.client.bootstrap()); + + { + var request = client.getCapRequest(); + request.getParams().setN(234); + request.getParams().setInCap(new RpcTestUtil.TestInterfaceImpl(chainedCallCount)); + + var promise = request.send(); + + var pipelineRequest = promise.getOutBox().getCap().fooRequest(); + pipelineRequest.getParams().setI(321); + + var pipelinePromise = pipelineRequest.send(); + + var pipelineRequest2 = new Test.TestExtends.Client(promise.getOutBox().getCap()).graultRequest(); + var pipelinePromise2 = pipelineRequest2.send(); + + promise = null; + + //Assert.assertEquals(0, chainedCallCount.value()); + + var response = pipelinePromise.join(); + Assert.assertEquals("bar", response.getX().toString()); + + var response2 = pipelinePromise2.join(); + RpcTestUtil.checkTestMessage(response2); + + Assert.assertEquals(1, chainedCallCount.value()); + } + + /* + // disconnect the server + //this.serverSocket.shutdownOutput(); + this.serverNetwork.close(); + this.serverNetwork.onDisconnect().join(); + + { + // Use the now-broken capability. + var request = client.getCapRequest(); + request.getParams().setN(234); + request.getParams().setInCap(new RpcTestUtil.TestInterfaceImpl(chainedCallCount)); + + var promise = request.send(); + + var pipelineRequest = promise.getOutBox().getCap().fooRequest(); + pipelineRequest.getParams().setI(321); + var pipelinePromise = pipelineRequest.send(); + + var pipelineRequest2 = new Test.TestExtends.Client(promise.getOutBox().getCap()).graultRequest(); + var pipelinePromise2 = pipelineRequest2.send(); + + Assert.assertThrows(Exception.class, () -> pipelinePromise.join()); + Assert.assertThrows(Exception.class, () -> pipelinePromise2.join()); + + Assert.assertEquals(3, callCount.value()); + Assert.assertEquals(1, chainedCallCount.value()); + } + + */ + } +/* + @org.junit.Test public void testBasicCleanup() throws ExecutionException, InterruptedException, TimeoutException { var server = new RpcSystem<>(this.serverNetwork, new TestCap0Impl()); var demo = new Demo.TestCap0.Client(this.client.bootstrap()); @@ -145,7 +193,7 @@ public void testBasicCleanup() throws ExecutionException, InterruptedException, demo = null; } - @Test + @org.junit.Test public void testShutdown() throws InterruptedException, IOException { var server = new RpcSystem<>(this.serverNetwork, new TestCap0Impl()); var demo = new Demo.TestCap0.Client(this.client.bootstrap()); @@ -153,7 +201,7 @@ public void testShutdown() throws InterruptedException, IOException { serverThread.join(); } - @Test + @org.junit.Test public void testCallThrows() throws ExecutionException, InterruptedException { var impl = new Demo.TestCap0.Server() { public CompletableFuture testMethod0(CallContext ctx) { @@ -185,7 +233,7 @@ public CompletableFuture testMethod1(CallContext resolveTask; + private CompletableFuture resolveTask; private ClientHook resolved; private boolean blocked = false; private final CapabilityServerSetBase capServerSet; @@ -162,11 +162,16 @@ private final class LocalClient implements ClientHook { LocalClient(CapabilityServerSetBase capServerSet) { Server.this.hook = this; this.capServerSet = capServerSet; + startResolveTask(); + } - var resolver = shortenPath(); - this.resolveTask = resolver != null - ? resolver.thenAccept(client -> this.resolved = client.getHook()) - : null; + private void startResolveTask() { + var resolveTask = shortenPath(); + if (resolveTask != null) { + this.resolveTask = resolveTask.thenAccept(cap -> { + this.resolved = cap.getHook(); + }); + } } @Override @@ -209,6 +214,7 @@ public ClientHook getResolved() { @Override public CompletableFuture whenMoreResolved() { if (this.resolved != null) { + System.out.println("Local client resolved! " + this.toString()); return CompletableFuture.completedFuture(this.resolved); } else if (this.resolveTask != null) { diff --git a/runtime/src/main/java/org/capnproto/PipelineHook.java b/runtime/src/main/java/org/capnproto/PipelineHook.java index 274117ee..32ff23f2 100644 --- a/runtime/src/main/java/org/capnproto/PipelineHook.java +++ b/runtime/src/main/java/org/capnproto/PipelineHook.java @@ -5,12 +5,7 @@ public interface PipelineHook extends AutoCloseable { ClientHook getPipelinedCap(PipelineOp[] ops); static PipelineHook newBrokenPipeline(Throwable exc) { - return new PipelineHook() { - @Override - public ClientHook getPipelinedCap(PipelineOp[] ops) { - return Capability.newBrokenCap(exc); - } - }; + return ops -> Capability.newBrokenCap(exc); } @Override From c0a57d304f1ec34cc7093fb6f5a7b0e4b5ed8a80 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 13 Nov 2020 08:10:59 +0000 Subject: [PATCH 136/246] merge resolveTask into constructor --- runtime/src/main/java/org/capnproto/Capability.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index d05c464b..ae2c57f7 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -162,10 +162,6 @@ private final class LocalClient implements ClientHook { LocalClient(CapabilityServerSetBase capServerSet) { Server.this.hook = this; this.capServerSet = capServerSet; - startResolveTask(); - } - - private void startResolveTask() { var resolveTask = shortenPath(); if (resolveTask != null) { this.resolveTask = resolveTask.thenAccept(cap -> { @@ -214,7 +210,6 @@ public ClientHook getResolved() { @Override public CompletableFuture whenMoreResolved() { if (this.resolved != null) { - System.out.println("Local client resolved! " + this.toString()); return CompletableFuture.completedFuture(this.resolved); } else if (this.resolveTask != null) { From 37aa04b2623073615dc19a6e4096f630a866ec0f Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 13 Nov 2020 08:36:23 +0000 Subject: [PATCH 137/246] allow network to use bytechannels --- .../src/main/java/org/capnproto/TwoPartyVatNetwork.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 7929286a..b8a2c122 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -1,6 +1,7 @@ package org.capnproto; import java.io.IOException; +import java.nio.channels.AsynchronousByteChannel; import java.nio.channels.AsynchronousSocketChannel; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -20,13 +21,13 @@ public interface MessageTap { private CompletableFuture previousWrite = CompletableFuture.completedFuture(null); private final CompletableFuture disconnectPromise = new CompletableFuture<>(); - private final AsynchronousSocketChannel channel; + private final AsynchronousByteChannel channel; private final RpcTwoPartyProtocol.Side side; private final MessageBuilder peerVatId = new MessageBuilder(4); private boolean accepted; private MessageTap tap; - public TwoPartyVatNetwork(AsynchronousSocketChannel channel, RpcTwoPartyProtocol.Side side) { + public TwoPartyVatNetwork(AsynchronousByteChannel channel, RpcTwoPartyProtocol.Side side) { this.channel = channel; this.side = side; this.peerVatId.initRoot(RpcTwoPartyProtocol.VatId.factory).setSide( @@ -114,7 +115,9 @@ public CompletableFuture shutdown() { var result = this.previousWrite.thenRun(() -> { try { - this.channel.shutdownOutput(); + if (this.channel instanceof AsynchronousSocketChannel) { + ((AsynchronousSocketChannel)this.channel).shutdownOutput(); + } } catch (Exception ioExc) { } From ad17a4c14816c0134cdf2270facd3bbb1468c8fc Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 13 Nov 2020 17:57:49 +0000 Subject: [PATCH 138/246] refactor connection and disconnection --- .../src/main/java/org/capnproto/RpcState.java | 18 ++- .../main/java/org/capnproto/RpcSystem.java | 66 +++------ .../java/org/capnproto/TwoPartyClient.java | 12 +- .../java/org/capnproto/TwoPartyServer.java | 115 +++++----------- .../org/capnproto/TwoPartyVatNetwork.java | 15 ++- .../main/java/org/capnproto/VatNetwork.java | 2 +- .../test/java/org/capnproto/TwoPartyTest.java | 125 +++++++++--------- .../main/java/org/capnproto/AnyPointer.java | 5 + .../main/java/org/capnproto/Capability.java | 8 +- .../src/main/java/org/capnproto/Pipeline.java | 5 + .../main/java/org/capnproto/PipelineHook.java | 9 +- .../java/org/capnproto/RemotePromise.java | 4 +- 12 files changed, 161 insertions(+), 223 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 537328fb..aa221a4e 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -5,9 +5,11 @@ import java.io.StringWriter; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; +import java.nio.channels.ClosedChannelException; import java.util.*; import java.util.concurrent.Callable; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; import java.util.concurrent.CompletionStage; import java.util.function.Consumer; @@ -288,7 +290,7 @@ Embargo newExportable(int id) { startMessageLoop(); } - public CompletableFuture getMessageLoop() { + CompletableFuture onDisconnection() { return this.messageLoop; } @@ -363,6 +365,12 @@ void disconnect(Throwable exc) { return CompletableFuture.completedFuture(null); } } + else if (ioExc instanceof CompletionException) { + var compExc = (CompletionException)ioExc; + if (compExc.getCause() instanceof ClosedChannelException) { + return CompletableFuture.completedFuture(null); + } + } return CompletableFuture.failedFuture(ioExc); }); @@ -371,9 +379,7 @@ void disconnect(Throwable exc) { this.disconnectFulfiller.complete(new DisconnectInfo(shutdownPromise)); for (var pipeline: pipelinesToRelease) { - if (pipeline instanceof RpcState.RpcPipeline) { - ((RpcPipeline) pipeline).redirectLater.completeExceptionally(networkExc); - } + pipeline.cancel(networkExc); } } @@ -1556,8 +1562,8 @@ public ClientHook getPipelinedCap(PipelineOp[] ops) { } @Override - public void close() { - this.question.finish(); + public void cancel(Throwable exc) { + this.question.reject(exc); } } diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java index e7c5b0cd..2dda98d5 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java @@ -1,27 +1,21 @@ package org.capnproto; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; public class RpcSystem { private final VatNetwork network; private final BootstrapFactory bootstrapFactory; - private final Map, RpcState> connections = new HashMap<>(); - private final CompletableFuture messageLoop; - private final CompletableFuture acceptLoop; + private final Map, RpcState> connections = new ConcurrentHashMap<>(); public RpcSystem(VatNetwork network) { - this.network = network; - this.bootstrapFactory = null; - this.acceptLoop = new CompletableFuture<>(); - this.messageLoop = doMessageLoop(); - } - - public VatNetwork getNetwork() { - return this.network; + this(network, (BootstrapFactory)null); } public RpcSystem(VatNetwork network, @@ -49,8 +43,7 @@ public RpcSystem(VatNetwork network, BootstrapFactory bootstrapFactory) { this.network = network; this.bootstrapFactory = bootstrapFactory; - this.acceptLoop = doAcceptLoop(); - this.messageLoop = doMessageLoop(); + this.startAcceptLoop(); } public Capability.Client bootstrap(VatId vatId) { @@ -68,21 +61,19 @@ else if (this.bootstrapFactory != null) { } } + public VatNetwork getNetwork() { + return this.network; + } + RpcState getConnectionState(VatNetwork.Connection connection) { - var state = this.connections.get(connection); - if (state == null) { - var onDisconnect = new CompletableFuture() - .whenComplete((info, exc) -> { + var state = this.connections.computeIfAbsent(connection, conn -> { + var onDisconnect = new CompletableFuture(); + onDisconnect.thenCompose(info -> { this.connections.remove(connection); - try { - connection.close(); - } catch (IOException ignored) { - } + return info.shutdownPromise.thenRun(() -> connection.close()); }); - - state = new RpcState<>(this.bootstrapFactory, connection, onDisconnect); - this.connections.put(connection, state); - } + return new RpcState<>(this.bootstrapFactory, conn, onDisconnect); + }); return state; } @@ -90,27 +81,10 @@ public void accept(VatNetwork.Connection connection) { getConnectionState(connection); } - private CompletableFuture doAcceptLoop() { - return this.network.baseAccept().thenCompose(connection -> { - this.accept(connection); - return this.doAcceptLoop(); - }); - } - - private CompletableFuture doMessageLoop() { - var accept = this.getAcceptLoop(); - for (var conn: this.connections.values()) { - accept = accept.acceptEither(conn.getMessageLoop(), x -> {}); - } - return accept.thenCompose(x -> this.doMessageLoop()); - } - - public CompletableFuture getMessageLoop() { - return this.messageLoop; - } - - private CompletableFuture getAcceptLoop() { - return this.acceptLoop; + private void startAcceptLoop() { + this.network.baseAccept() + .thenAccept(this::accept) + .thenRunAsync(this::startAcceptLoop); } public static diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java index d6056c65..f42f5b2c 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java @@ -1,6 +1,6 @@ package org.capnproto; -import java.nio.channels.AsynchronousSocketChannel; +import java.nio.channels.AsynchronousByteChannel; import java.util.concurrent.CompletableFuture; public class TwoPartyClient { @@ -8,15 +8,15 @@ public class TwoPartyClient { private final TwoPartyVatNetwork network; private final RpcSystem rpcSystem; - public TwoPartyClient(AsynchronousSocketChannel channel) { + public TwoPartyClient(AsynchronousByteChannel channel) { this(channel, null); } - public TwoPartyClient(AsynchronousSocketChannel channel, Capability.Client bootstrapInterface) { + public TwoPartyClient(AsynchronousByteChannel channel, Capability.Client bootstrapInterface) { this(channel, bootstrapInterface, RpcTwoPartyProtocol.Side.CLIENT); } - public TwoPartyClient(AsynchronousSocketChannel channel, + public TwoPartyClient(AsynchronousByteChannel channel, Capability.Client bootstrapInterface, RpcTwoPartyProtocol.Side side) { this.network = new TwoPartyVatNetwork(channel, side); @@ -31,4 +31,8 @@ public Capability.Client bootstrap() { : RpcTwoPartyProtocol.Side.CLIENT); return rpcSystem.bootstrap(vatId.asReader()); } + + CompletableFuture onDisconnect() { + return this.network.onDisconnect(); + } } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java index 5503b0a1..b51b7526 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java @@ -10,135 +10,80 @@ public class TwoPartyServer { private class AcceptedConnection { - final AsynchronousSocketChannel channel; + final AsynchronousSocketChannel connection; final TwoPartyVatNetwork network; final RpcSystem rpcSystem; - private final CompletableFuture messageLoop; - AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousSocketChannel channel) { - this.channel = channel; - this.network = new TwoPartyVatNetwork(channel, RpcTwoPartyProtocol.Side.SERVER); + AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousSocketChannel connection) { + this.connection = connection; + this.network = new TwoPartyVatNetwork(this.connection, RpcTwoPartyProtocol.Side.SERVER); this.rpcSystem = new RpcSystem<>(network, bootstrapInterface); - this.messageLoop = this.rpcSystem.getMessageLoop().exceptionally(exc -> { - connections.remove(this); - return null; - }); - } - - public CompletableFuture getMessageLoop() { - return this.messageLoop; } } class ConnectionReceiver { - AsynchronousServerSocketChannel listener; - final CompletableFuture messageLoop; - public ConnectionReceiver(AsynchronousServerSocketChannel listener) { - this.listener = listener; - this.messageLoop = doMessageLoop(); - } + final AsynchronousServerSocketChannel listener; - public CompletableFuture getMessageLoop() { - return this.messageLoop; + ConnectionReceiver(AsynchronousServerSocketChannel listener) { + this.listener = listener; } - private CompletableFuture doMessageLoop() { - final var accepted = new CompletableFuture(); - listener.accept(null, new CompletionHandler<>() { - + CompletableFuture accept() { + CompletableFuture result = new CompletableFuture<>(); + this.listener.accept(null, new CompletionHandler<>() { @Override public void completed(AsynchronousSocketChannel channel, Object attachment) { - accepted.complete(channel); + result.complete(channel); } @Override public void failed(Throwable exc, Object attachment) { - accepted.completeExceptionally(exc); + result.completeExceptionally(exc); } }); - return accepted.thenCompose(channel -> CompletableFuture.allOf( - accept(channel), - doMessageLoop())); + return result.copy(); } } private final Capability.Client bootstrapInterface; private final List connections = new ArrayList<>(); - private final List listeners = new ArrayList<>(); - private final CompletableFuture messageLoop; public TwoPartyServer(Capability.Client bootstrapInterface) { this.bootstrapInterface = bootstrapInterface; - this.messageLoop = doMessageLoop(); } public TwoPartyServer(Capability.Server bootstrapServer) { this(new Capability.Client(bootstrapServer)); } - private CompletableFuture getMessageLoop() { - return this.messageLoop; - } - - public CompletableFuture drain() { - CompletableFuture done = new CompletableFuture<>(); - for (var conn: this.connections) { - done = CompletableFuture.allOf(done, conn.getMessageLoop()); - } - return done; - } - - private CompletableFuture accept(AsynchronousSocketChannel channel) { + public void accept(AsynchronousSocketChannel channel) { var connection = new AcceptedConnection(this.bootstrapInterface, channel); this.connections.add(connection); - return connection.network.onDisconnect().whenComplete((x, exc) -> { + connection.network.onDisconnect().whenComplete((x, exc) -> { this.connections.remove(connection); }); } -/* - private final CompletableFuture acceptLoop(AsynchronousServerSocketChannel listener) { - final var accepted = new CompletableFuture(); - listener.accept(null, new CompletionHandler<>() { - - @Override - public void completed(AsynchronousSocketChannel channel, Object attachment) { - accepted.complete(channel); - } - - @Override - public void failed(Throwable exc, Object attachment) { - accepted.completeExceptionally(exc); - } - }); - return accepted.thenCompose(channel -> CompletableFuture.anyOf( - accept(channel), - acceptLoop(listener))); + + public CompletableFuture listen(AsynchronousServerSocketChannel listener) { + return this.listen(wrapListenSocket(listener)); } -*/ - public CompletableFuture listen(AsynchronousServerSocketChannel listener) { - var receiver = new ConnectionReceiver(listener); - this.listeners.add(receiver); - return receiver.getMessageLoop(); + + CompletableFuture listen(ConnectionReceiver listener) { + return listener.accept().thenCompose(channel -> { + this.accept(channel); + return this.listen(listener); + }); } - private CompletableFuture doMessageLoop() { - var done = new CompletableFuture<>(); + CompletableFuture drain() { + CompletableFuture loop = CompletableFuture.completedFuture(null); for (var conn: this.connections) { - done = CompletableFuture.anyOf(done, conn.getMessageLoop()); + loop = CompletableFuture.allOf(loop, conn.network.onDisconnect()); } - for (var listener: this.listeners) { - done = CompletableFuture.anyOf(done, listener.getMessageLoop()); - } - return done.thenCompose(x -> doMessageLoop()); + return loop; } - /* - public CompletableFuture runOnce() { - var done = new CompletableFuture<>(); - for (var conn: connections) { - done = CompletableFuture.anyOf(done, conn.runOnce()); - } - return done; + ConnectionReceiver wrapListenSocket(AsynchronousServerSocketChannel channel) { + return new ConnectionReceiver(channel); } - */ } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index b8a2c122..40b4ba16 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -37,9 +37,14 @@ public TwoPartyVatNetwork(AsynchronousByteChannel channel, RpcTwoPartyProtocol.S } @Override - public void close() throws IOException { - this.channel.close(); - this.disconnectPromise.complete(null); + public void close() { + try { + this.channel.close(); + this.disconnectPromise.complete(null); + } + catch (Exception exc) { + this.disconnectPromise.completeExceptionally(exc); + } } public RpcTwoPartyProtocol.Side getSide() { @@ -113,13 +118,13 @@ public CompletableFuture receiveIncomingMessage() { public CompletableFuture shutdown() { assert this.previousWrite != null: "Already shut down"; - var result = this.previousWrite.thenRun(() -> { + var result = this.previousWrite.whenComplete((void_, exc) -> { try { if (this.channel instanceof AsynchronousSocketChannel) { ((AsynchronousSocketChannel)this.channel).shutdownOutput(); } } - catch (Exception ioExc) { + catch (Exception ignored) { } }); diff --git a/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java index 5660d6c9..4204b788 100644 --- a/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java @@ -13,7 +13,7 @@ default OutgoingRpcMessage newOutgoingMessage() { CompletableFuture receiveIncomingMessage(); CompletableFuture shutdown(); VatId getPeerVatId(); - void close() throws IOException; + void close(); } CompletableFuture> baseAccept(); diff --git a/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java b/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java index 0102c0a9..fa92cd5e 100644 --- a/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java @@ -4,78 +4,78 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.function.ThrowingRunnable; import java.io.IOException; +import java.nio.channels.AsynchronousByteChannel; import java.nio.channels.AsynchronousServerSocketChannel; import java.nio.channels.AsynchronousSocketChannel; import java.util.concurrent.ExecutionException; +import java.util.function.Consumer; public class TwoPartyTest { - private Thread runServer(org.capnproto.TwoPartyVatNetwork network) { - var thread = new Thread(() -> { - try { - network.onDisconnect().get(); - } catch (InterruptedException e) { - e.printStackTrace(); - } catch (ExecutionException e) { - e.printStackTrace(); - } - }, "Server"); + static final class PipeThread { + Thread thread; + AsynchronousByteChannel channel; + + static PipeThread newPipeThread(Consumer startFunc) throws Exception { + var pipeThread = new PipeThread(); + var serverAcceptSocket = AsynchronousServerSocketChannel.open(); + serverAcceptSocket.bind(null); + var clientSocket = AsynchronousSocketChannel.open(); + + pipeThread.thread = new Thread(() -> { + try { + var serverSocket = serverAcceptSocket.accept().get(); + startFunc.accept(serverSocket); + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + }); + pipeThread.thread.start(); + pipeThread.thread.setName("TwoPartyTest server"); + + clientSocket.connect(serverAcceptSocket.getLocalAddress()).get(); + pipeThread.channel = clientSocket; + return pipeThread; + } + } - thread.start(); - return thread; + PipeThread runServer(Capability.Server bootstrapInterface) throws Exception { + return runServer(new Capability.Client(bootstrapInterface)); } - AsynchronousServerSocketChannel serverAcceptSocket; - AsynchronousSocketChannel serverSocket; - AsynchronousSocketChannel clientSocket; - TwoPartyClient client; - org.capnproto.TwoPartyVatNetwork serverNetwork; - Thread serverThread; + PipeThread runServer(Capability.Client bootstrapInterface) throws Exception { + return PipeThread.newPipeThread(channel -> { + var network = new TwoPartyVatNetwork(channel, RpcTwoPartyProtocol.Side.SERVER); + var system = new RpcSystem<>(network, bootstrapInterface); + network.onDisconnect().join(); + }); + } @Before - public void setUp() throws Exception { - this.serverAcceptSocket = AsynchronousServerSocketChannel.open(); - this.serverAcceptSocket.bind(null); - - this.clientSocket = AsynchronousSocketChannel.open(); - this.clientSocket.connect(this.serverAcceptSocket.getLocalAddress()).get(); - this.client = new TwoPartyClient(clientSocket); - //this.client.getNetwork().setTap(new Tap()); - - this.serverSocket = serverAcceptSocket.accept().get(); - this.serverNetwork = new org.capnproto.TwoPartyVatNetwork(this.serverSocket, RpcTwoPartyProtocol.Side.SERVER); - //this.serverNetwork.setTap(new Tap()); - //this.serverNetwork.dumper.addSchema(Demo.TestCap1); - this.serverThread = runServer(this.serverNetwork); + public void setUp() { } @After - public void tearDown() throws Exception { - this.clientSocket.close(); - this.serverSocket.close(); - this.serverAcceptSocket.close(); - this.serverThread.join(); - this.client = null; + public void tearDown() { } @org.junit.Test - public void testNullCap() throws ExecutionException, InterruptedException { - var server = new RpcSystem<>(this.serverNetwork, new Capability.Client()); - var cap = this.client.bootstrap(); - var resolved = cap.whenResolved(); + public void testNullCap() throws Exception { + var pipe = runServer(new Capability.Client()); + var rpcClient = new TwoPartyClient(pipe.channel); + var client = rpcClient.bootstrap(); + var resolved = client.whenResolved(); resolved.get(); } @org.junit.Test - public void testBasic() throws InterruptedException, IOException { - + public void testBasic() throws Exception { var callCount = new Counter(); - var server = new RpcSystem<>(this.serverNetwork, new RpcTestUtil.TestInterfaceImpl(callCount)); - - var client = new Test.TestInterface.Client(this.client.bootstrap()); + var pipe = runServer(new RpcTestUtil.TestInterfaceImpl(callCount)); + var rpcClient = new TwoPartyClient(pipe.channel); + var client = new Test.TestInterface.Client(rpcClient.bootstrap()); var request1 = client.fooRequest(); request1.getParams().setI(123); request1.getParams().setJ(true); @@ -99,24 +99,22 @@ public void testBasic() throws InterruptedException, IOException { promise3.join(); Assert.assertEquals(2, callCount.value()); - this.clientSocket.shutdownOutput(); - serverThread.join(); } @org.junit.Test public void testDisconnect() throws IOException { - this.serverSocket.shutdownOutput(); - this.serverNetwork.close(); - this.serverNetwork.onDisconnect().join(); + //this.serverSocket.shutdownOutput(); + //this.serverNetwork.close(); + //this.serverNetwork.onDisconnect().join(); } @org.junit.Test - public void testPipelining() throws IOException { + public void testPipelining() throws Exception { var callCount = new Counter(); var chainedCallCount = new Counter(); - - var server = new RpcSystem<>(this.serverNetwork, new RpcTestUtil.TestPipelineImpl(callCount)); - var client = new Test.TestPipeline.Client(this.client.bootstrap()); + var pipe = runServer(new RpcTestUtil.TestPipelineImpl(callCount)); + var rpcClient = new TwoPartyClient(pipe.channel); + var client = new Test.TestPipeline.Client(rpcClient.bootstrap()); { var request = client.getCapRequest(); @@ -146,11 +144,9 @@ public void testPipelining() throws IOException { Assert.assertEquals(1, chainedCallCount.value()); } - /* - // disconnect the server - //this.serverSocket.shutdownOutput(); - this.serverNetwork.close(); - this.serverNetwork.onDisconnect().join(); + // disconnect the client + ((AsynchronousSocketChannel)pipe.channel).shutdownOutput(); + rpcClient.onDisconnect().join(); { // Use the now-broken capability. @@ -173,8 +169,11 @@ public void testPipelining() throws IOException { Assert.assertEquals(3, callCount.value()); Assert.assertEquals(1, chainedCallCount.value()); } + } + + @org.junit.Test + public void testAbort() { - */ } /* @org.junit.Test diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index a15f68cc..63d5ca43 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -167,6 +167,11 @@ public Pipeline typelessPipeline() { return this; } + @Override + public void cancel(Throwable exc) { + this.hook.cancel(exc); + } + public Pipeline noop() { return new Pipeline(this.hook, this.ops.clone()); } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index ae2c57f7..61bbaa7d 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -388,11 +388,6 @@ private static final class LocalPipeline implements PipelineHook { public final ClientHook getPipelinedCap(PipelineOp[] ops) { return this.results.getPipelinedCap(ops); } - - @Override - public void close() { - this.ctx.allowCancellation(); - } } private static final class LocalResponse implements ResponseHook { @@ -542,7 +537,7 @@ public final ClientHook getPipelinedCap(PipelineOp[] ops) { : new QueuedClient(this.promise.thenApply( pipeline -> pipeline.getPipelinedCap(ops))); } - +/* @Override public void close() { if (this.redirect != null) { @@ -552,6 +547,7 @@ public void close() { this.promise.cancel(false); } } + */ } // A ClientHook which simply queues calls while waiting for a ClientHook to which to forward them. diff --git a/runtime/src/main/java/org/capnproto/Pipeline.java b/runtime/src/main/java/org/capnproto/Pipeline.java index 1cfe25e1..df9ad683 100644 --- a/runtime/src/main/java/org/capnproto/Pipeline.java +++ b/runtime/src/main/java/org/capnproto/Pipeline.java @@ -1,5 +1,10 @@ package org.capnproto; public interface Pipeline { + AnyPointer.Pipeline typelessPipeline(); + + default void cancel(Throwable exc) { + this.typelessPipeline().cancel(exc); + } } diff --git a/runtime/src/main/java/org/capnproto/PipelineHook.java b/runtime/src/main/java/org/capnproto/PipelineHook.java index 32ff23f2..1298ab1a 100644 --- a/runtime/src/main/java/org/capnproto/PipelineHook.java +++ b/runtime/src/main/java/org/capnproto/PipelineHook.java @@ -1,14 +1,13 @@ package org.capnproto; -public interface PipelineHook extends AutoCloseable { +public interface PipelineHook { ClientHook getPipelinedCap(PipelineOp[] ops); - static PipelineHook newBrokenPipeline(Throwable exc) { - return ops -> Capability.newBrokenCap(exc); + default void cancel(Throwable exc) { } - @Override - default void close() { + static PipelineHook newBrokenPipeline(Throwable exc) { + return ops -> Capability.newBrokenCap(exc); } } diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index 86bd8efb..6ea45030 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -27,8 +27,8 @@ public RemotePromise(CompletableFuture> promise, } @Override - public void close() throws Exception { - this.pipeline.hook.close(); + public void close() { + this.pipeline.cancel(RpcException.failed("Cancelled")); this.join(); } From c2423d453e7f62a6be9e32edd107476bf6ea7510 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 16 Nov 2020 10:39:05 +0000 Subject: [PATCH 139/246] improve question lifecycle handling A specialised export table was a bad idea. Stick more closely to C++ implentation of QuestionRef. --- .../src/main/java/org/capnproto/RpcState.java | 236 +++++++++--------- .../src/test/java/org/capnproto/RpcTest.java | 3 + 2 files changed, 116 insertions(+), 123 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index aa221a4e..f739710f 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -11,7 +11,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.CompletionStage; -import java.util.function.Consumer; final class RpcState { @@ -46,14 +45,20 @@ static class DisconnectInfo { } } - private final class QuestionDisposer { + private final class Question { final int id; boolean skipFinish; boolean isAwaitingReturn; + int[] paramExports = new int[0]; + boolean isTailCall = false; + QuestionRef selfRef; + private final WeakReference disposer; - QuestionDisposer(int id) { + Question(int id) { this.id = id; + this.selfRef = new QuestionRef(this.id);; + this.disposer = new QuestionDisposer(this.selfRef); } void finish() { @@ -66,109 +71,62 @@ void finish() { message.send(); } this.skipFinish = true; - } - - void dispose() { - this.finish(); // Check if the question has returned and, if so, remove it from the table. // Remove question ID from the table. Must do this *after* sending `Finish` to ensure that // the ID is not re-allocated before the `Finish` message can be sent. if (!this.isAwaitingReturn) { - questions.erase(this.id); + questions.erase(this.id, this); } } } - private final class QuestionRef extends WeakReference { - private final QuestionDisposer disposer; - - QuestionRef(Question question, ReferenceQueue queue) { - super(question, queue); - this.disposer = question.disposer; - } - - void dispose() { - this.disposer.dispose(); - } - } - - private class Question { + /** + * A reference to an entry on the question table. + */ + private final class QuestionRef { + private final int questionId; CompletableFuture response = new CompletableFuture<>(); - int[] paramExports = new int[0]; - private final QuestionDisposer disposer; - boolean isTailCall = false; - - Question(int id) { - this.disposer = new QuestionDisposer(id); - } - int getId() { - return this.disposer.id; + QuestionRef(int questionId) { + this.questionId = questionId; } - boolean isAwaitingReturn() { - return this.disposer.isAwaitingReturn; - } - - public void setAwaitingReturn(boolean value) { - this.disposer.isAwaitingReturn = value; - } - - void reject(Throwable exc) { + void fulfill(Throwable exc) { this.response.completeExceptionally(exc); + this.finish(); } - void answer(RpcResponse response) { + void fulfill(RpcResponse response) { this.response.complete(response); + this.finish(); } - void setSkipFinish(boolean value) { - this.disposer.skipFinish = value; - } - - public void finish() { - this.disposer.finish(); + private void finish() { + // We no longer need access to the questionRef in order to complete it. + // Dropping the selfRef releases the question for disposal once all other + // references are gone. + var question = questions.find(this.questionId); + if (question != null) { + question.selfRef = null; + } } } - class QuestionExportTable { - private final HashMap> slots = new HashMap<>(); - private final Queue freeIds = new PriorityQueue<>(); - private int max = 0; + private final class QuestionDisposer extends WeakReference { + private final int questionId; - public Question find(int id) { - var ref = this.slots.get(id); - return ref == null ? null : ref.get(); - } - - public Question erase(int id) { - var value = this.slots.get(id); - if (value != null) { - freeIds.add(id); - this.slots.remove(id); - return value.get(); - } else { - return null; - } + QuestionDisposer(QuestionRef questionRef) { + super(questionRef, questionRefs); + this.questionId = questionRef.questionId; } - public Question next() { - int id = freeIds.isEmpty() ? max++ : freeIds.remove(); - var value = new Question(id); - var prev = slots.put(id, new QuestionRef(value, questionRefs)); - assert prev == null; - return value; - } - - public void forEach(Consumer action) { - for (var entry: this.slots.values()) { - var question = entry.get(); - if (question != null) { - action.accept(question); - } + void dispose() { + var question = questions.find(this.questionId); + if (question != null) { + question.finish(); } } } @@ -247,7 +205,12 @@ Export newExportable(int id) { } }; - private final QuestionExportTable questions = new QuestionExportTable(); + private final ExportTable questions = new ExportTable<>() { + @Override + Question newExportable(int id) { + return new Question(id); + } + }; private final ImportTable answers = new ImportTable<>() { @Override @@ -278,7 +241,7 @@ Embargo newExportable(int id) { private CompletableFuture messageReady = CompletableFuture.completedFuture(null); private final CompletableFuture messageLoop = new CompletableFuture<>(); // completes when the message loop exits - private final ReferenceQueue questionRefs = new ReferenceQueue<>(); + private final ReferenceQueue questionRefs = new ReferenceQueue<>(); private final ReferenceQueue importRefs = new ReferenceQueue<>(); RpcState(BootstrapFactory bootstrapFactory, @@ -303,7 +266,12 @@ void disconnect(Throwable exc) { var networkExc = RpcException.disconnected(exc.getMessage()); // All current questions complete with exceptions. - questions.forEach(question -> question.reject(networkExc)); + for (var question: questions) { + var questionRef = question.selfRef; + if (questionRef != null) { + questionRef.fulfill(networkExc); + } + } List pipelinesToRelease = new ArrayList<>(); List clientsToRelease = new ArrayList<>(); @@ -406,14 +374,17 @@ private void evalLast(Callable func) { ClientHook restore() { var question = questions.next(); - question.setAwaitingReturn(true); + question.isAwaitingReturn = true; + var questionRef = question.selfRef; var promise = new CompletableFuture(); + var pipeline = new RpcPipeline(questionRef, promise); + int sizeHint = messageSizeHint(RpcProtocol.Bootstrap.factory); var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initBootstrap(); - builder.setQuestionId(question.getId()); + builder.setQuestionId(question.id); message.send(); - var pipeline = new RpcPipeline(question, promise); + return pipeline.getPipelinedCap(new PipelineOp[0]); } @@ -440,7 +411,8 @@ private void startMessageLoop() { }); messageReader.thenRunAsync(this::startMessageLoop).exceptionallyCompose(exc -> { - assert exc == null: "Exception in startMessageLoop!"; + //System.out.println("Exception in startMessageLoop!"); + //exc.printStackTrace(); return CompletableFuture.failedFuture(exc); }); } @@ -660,11 +632,11 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu return; } - if (!question.isAwaitingReturn()) { + if (!question.isAwaitingReturn) { assert false: "Duplicate Return"; return; } - question.setAwaitingReturn(false); + question.isAwaitingReturn = false; int[] exportsToRelease = null; if (callReturn.getReleaseParamCaps()) { @@ -672,11 +644,21 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu question.paramExports = null; } - if (callReturn.isTakeFromOtherQuestion()) { - var answer = this.answers.find(callReturn.getTakeFromOtherQuestion()); - if (answer != null) { - answer.redirectedResults = null; + var questionRef = question.selfRef; + if (questionRef == null) { + if (callReturn.isTakeFromOtherQuestion()) { + var answer = this.answers.find(callReturn.getTakeFromOtherQuestion()); + if (answer != null) { + answer.redirectedResults = null; + } } + + // Looks like this question was canceled earlier, so `Finish` was already sent, with + // `releaseResultCaps` set true so that we don't have to release them here. We can go + // ahead and delete it from the table. + // TODO Should we do this? + questions.erase(callReturn.getAnswerId(), question); + if (exportsToRelease != null) { this.releaseExports(exportsToRelease); } @@ -692,8 +674,8 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu var payload = callReturn.getResults(); var capTable = receiveCaps(payload.getCapTable(), message.getAttachedFds()); - var response = new RpcResponseImpl(capTable, payload.getContent()); - question.answer(response); + var response = new RpcResponseImpl(questionRef, message, capTable, payload.getContent()); + questionRef.fulfill(response); break; case EXCEPTION: @@ -701,7 +683,7 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu assert false: "Tail call `Return` must set `resultsSentElsewhere`, not `exception`."; break; } - question.reject(ToException(callReturn.getException())); + questionRef.fulfill(ToException(callReturn.getException())); break; case CANCELED: @@ -714,7 +696,7 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu break; } // Tail calls are fulfilled with a null pointer. - question.answer(() -> null); + questionRef.fulfill(() -> null); break; case TAKE_FROM_OTHER_QUESTION: @@ -728,7 +710,7 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu assert false: "`Return.takeFromOtherQuestion` referenced a call that did not use `sendResultsTo.yourself`."; break; } - question.response = answer.redirectedResults; + questionRef.response = answer.redirectedResults; answer.redirectedResults = null; break; @@ -1225,10 +1207,16 @@ interface RpcServerResponse { class RpcResponseImpl implements RpcResponse { + private final IncomingRpcMessage message; + private final QuestionRef questionRef; private final AnyPointer.Reader results; - RpcResponseImpl(List capTable, + RpcResponseImpl(QuestionRef questionRef, + IncomingRpcMessage message, + List capTable, AnyPointer.Reader results) { + this.questionRef = questionRef; + this.message = message; this.results = results.imbue(new ReaderCapabilityTable(capTable)); } @@ -1521,20 +1509,20 @@ enum PipelineState { private class RpcPipeline implements PipelineHook { - private final Question question; + private final QuestionRef questionRef; final HashMap, ClientHook> clientMap = new HashMap<>(); final CompletableFuture redirectLater; - RpcPipeline(Question question, + RpcPipeline(QuestionRef questionRef, CompletableFuture redirectLater) { - this.question = question; + this.questionRef = questionRef; assert redirectLater != null; this.redirectLater = redirectLater; } - RpcPipeline(Question question) { - this(question, null); + RpcPipeline(QuestionRef questionRef) { + this(questionRef, null); // never resolves } @@ -1549,7 +1537,7 @@ public ClientHook getPipelinedCap(PipelineOp[] ops) { // TODO avoid conversion to/from ArrayList? var key = new ArrayList<>(Arrays.asList(ops)); return this.clientMap.computeIfAbsent(key, k -> { - var pipelineClient = new PipelineClient(this.question, ops); + var pipelineClient = new PipelineClient(this.questionRef, ops); if (this.redirectLater == null) { // This pipeline will never get redirected, so just return the PipelineClient. return pipelineClient; @@ -1563,7 +1551,7 @@ public ClientHook getPipelinedCap(PipelineOp[] ops) { @Override public void cancel(Throwable exc) { - this.question.reject(exc); + this.questionRef.fulfill(exc); } } @@ -1658,12 +1646,12 @@ public RemotePromise send() { return replacement.send(); } - final var question = sendInternal(false); + final var questionRef = sendInternal(false); // The pipeline must get notified of resolution before the app does to maintain ordering. - var pipeline = new RpcPipeline(question, question.response); + var pipeline = new RpcPipeline(questionRef, questionRef.response); - var appPromise = question.response.thenApply( + var appPromise = questionRef.response.thenApply( hook -> new Response<>(hook.getResults(), hook)); return new RemotePromise<>(appPromise, new AnyPointer.Pipeline(pipeline)); @@ -1675,28 +1663,30 @@ public CompletionStage sendStreaming() { return send(); } - Question sendInternal(boolean isTailCall) { + QuestionRef sendInternal(boolean isTailCall) { // TODO refactor var fds = List.of(); var exports = writeDescriptors(capTable.getTable(), callBuilder.getParams(), fds); message.setFds(fds); var question = questions.next(); - question.setAwaitingReturn(true); + question.isAwaitingReturn = true; question.isTailCall = isTailCall; question.paramExports = exports; - callBuilder.setQuestionId(question.getId()); + var questionRef = question.selfRef; + + callBuilder.setQuestionId(question.id); if (isTailCall) { callBuilder.getSendResultsTo().getYourself(); } try { message.send(); } catch (Exception exc) { - question.setAwaitingReturn(false); - question.setSkipFinish(true); - question.reject(exc); + question.isAwaitingReturn = false; + question.skipFinish = true; + questionRef.fulfill(exc); } - return question; + return questionRef; } @Override @@ -1781,11 +1771,11 @@ private void cleanupImports() { private void cleanupQuestions() { while (true) { - var ref = (QuestionRef)this.questionRefs.poll(); - if (ref == null) { + var disposer = (QuestionDisposer)this.questionRefs.poll(); + if (disposer == null) { break; } - ref.dispose(); + disposer.dispose(); } } @@ -1914,11 +1904,11 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext private class PipelineClient extends RpcClient { - private final Question question; + private final QuestionRef questionRef; private final PipelineOp[] ops; - PipelineClient(Question question, PipelineOp[] ops) { - this.question = question; + PipelineClient(QuestionRef questionRef, PipelineOp[] ops) { + this.questionRef = questionRef; this.ops = ops; } @@ -1935,7 +1925,7 @@ public CompletableFuture whenMoreResolved() { @Override public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { var promisedAnswer = descriptor.initReceiverAnswer(); - promisedAnswer.setQuestionId(question.getId()); + promisedAnswer.setQuestionId(questionRef.questionId); FromPipelineOps(ops, promisedAnswer); return null; } @@ -1943,7 +1933,7 @@ public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, Lis @Override public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { var builder = target.initPromisedAnswer(); - builder.setQuestionId(question.getId()); + builder.setQuestionId(questionRef.questionId); FromPipelineOps(ops, builder); return null; } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 89b918dc..33c71881 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -371,6 +371,9 @@ public void testRelease() { handle1 = null; handle2 = null; + + System.gc(); + client.echoRequest().send().join(); } @org.junit.Test From f0d4d9d75a9b157f902aae903eab8c010e3fa2f5 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 9 Nov 2020 14:32:05 +0000 Subject: [PATCH 140/246] add embargoUnwrap test --- .../java/org/capnproto/CapabilityTest.java | 12 ----- .../src/test/java/org/capnproto/RpcTest.java | 46 ++++++++++++++++++- .../test/java/org/capnproto/RpcTestUtil.java | 16 +++++++ 3 files changed, 61 insertions(+), 13 deletions(-) diff --git a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java index e4677644..df32650e 100644 --- a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java @@ -66,18 +66,6 @@ protected CompletableFuture grault(CallContext getCallSequence(CallContext context) { - var result = context.getResults(); - result.setN(this.count++); - return READY_NOW; - } -} - public class CapabilityTest { @org.junit.Test diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 33c71881..af0cdfab 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -450,7 +450,7 @@ public void testEmbargo() { var context = new TestContext(bootstrapFactory); var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); - var cap = new Test.TestCallOrder.Client(new TestCallOrderImpl()); + var cap = new Test.TestCallOrder.Client(new RpcTestUtil.TestCallOrderImpl()); var earlyCall = client.getCallSequenceRequest().send(); var echoRequest = client.echoRequest(); @@ -536,5 +536,49 @@ public void testCallCancel() { // check that the connection is still open getCallSequence(client, 1); } + + @org.junit.Test + public void testEmbargoUnwrap() { + var context = new TestContext(bootstrapFactory); + var capSet = new Capability.CapabilityServerSet(); + var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); + + var cap = capSet.add(Test.TestCallOrder.factory, new RpcTestUtil.TestCallOrderImpl()); + + var earlyCall = client.getCallSequenceRequest().send(); + + var echoRequest = client.echoRequest(); + echoRequest.getParams().setCap(cap); + var echo = echoRequest.send(); + + var pipeline = echo.getCap(); + + var unwrap = capSet.getLocalServer(pipeline).thenApply(unwrapped -> { + return ((RpcTestUtil.TestCallOrderImpl)unwrapped).getCount(); + }); + + var call0 = getCallSequence(pipeline, 0); + var call1 = getCallSequence(pipeline, 1); + + earlyCall.join(); + + var call2 = getCallSequence(pipeline, 2); + + var resolved = echo.join().getCap(); + + var call3 = getCallSequence(pipeline, 3); + var call4 = getCallSequence(pipeline, 4); + var call5 = getCallSequence(pipeline, 5); + + Assert.assertEquals(0, call0.join().getN()); + Assert.assertEquals(1, call1.join().getN()); + Assert.assertEquals(2, call2.join().getN()); + Assert.assertEquals(3, call3.join().getN()); + Assert.assertEquals(4, call4.join().getN()); + Assert.assertEquals(5, call5.join().getN()); + + int unwrappedAt = unwrap.join(); + //Assert.assertTrue(unwrappedAt >= 3); + } } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java index 14f5c281..c6c016cc 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java @@ -244,6 +244,22 @@ protected CompletableFuture foo(CallContext getCallSequence(CallContext context) { + var result = context.getResults(); + result.setN(this.count++); + return READY_NOW; + } + + public int getCount() { + return this.count; + } + } + static class TestPipelineImpl extends Test.TestPipeline.Server { final Counter callCount; From 6e066d43c2201a782cacdd2c8368149d4fecbfa2 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 14 Nov 2020 10:31:59 +0000 Subject: [PATCH 141/246] send abort to close test connection --- runtime-rpc/src/main/java/org/capnproto/VatNetwork.java | 1 - runtime-rpc/src/test/java/org/capnproto/RpcTest.java | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java index 4204b788..3ee87268 100644 --- a/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java @@ -1,6 +1,5 @@ package org.capnproto; -import java.io.IOException; import java.util.concurrent.CompletableFuture; public interface VatNetwork diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index af0cdfab..26f96a05 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -33,10 +33,11 @@ import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; +import static org.capnproto.RpcState.FromException; public class RpcTest { - final class TestNetwork { + static final class TestNetwork { final Map map = new HashMap<>(); int received = 0; @@ -51,7 +52,7 @@ TestNetworkAdapter find(String name) { } } - final class TestNetworkAdapter + static final class TestNetworkAdapter implements VatNetwork { @Override @@ -169,6 +170,10 @@ public Test.TestSturdyRef.Reader getPeerVatId() { @Override public void close() { + var msg = newOutgoingMessage(0); + var abort = msg.getBody().initAs(RpcProtocol.Message.factory).initAbort(); + FromException(RpcException.disconnected(""), abort); + msg.send(); } } From 330eb50cf0ff0eddbee0df46950b7ddc4a73794a Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 14 Nov 2020 12:50:33 +0000 Subject: [PATCH 142/246] disconnect test networks on close --- .../src/test/java/org/capnproto/RpcTest.java | 32 +++++++++++++------ .../test/java/org/capnproto/TwoPartyTest.java | 5 +-- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 26f96a05..4d3987e4 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -53,12 +53,8 @@ TestNetworkAdapter find(String name) { } static final class TestNetworkAdapter - implements VatNetwork { - - @Override - public CompletableFuture> baseAccept() { - return this.accept().thenApply(conn -> conn); - } + implements VatNetwork, + AutoCloseable { class Connection implements VatNetwork.Connection { @@ -82,6 +78,14 @@ void attach(Connection other) { other.partner = this; } + void disconnect(Exception exc) { + while (!fulfillers.isEmpty()) { + fulfillers.remove().completeExceptionally(exc); + } + + this.networkException = exc; + } + TestNetwork getNetwork() { return network; } @@ -170,10 +174,6 @@ public Test.TestSturdyRef.Reader getPeerVatId() { @Override public void close() { - var msg = newOutgoingMessage(0); - var abort = msg.getBody().initAs(RpcProtocol.Message.factory).initAbort(); - FromException(RpcException.disconnected(""), abort); - msg.send(); } } @@ -194,6 +194,18 @@ Connection newConnection(boolean isClient, Test.TestSturdyRef.Reader peerId) { return new Connection(isClient, peerId); } + public CompletableFuture> baseAccept() { + return this.accept().thenApply(conn -> conn); + } + + @Override + public void close() { + var exc = RpcException.failed("Network was destroyed"); + for (var conn: this.connections.values()) { + conn.disconnect(exc); + } + } + @Override public VatNetwork.Connection connect(Test.TestSturdyRef.Reader refId) { var hostId = refId.getHostId().getHost().toString(); diff --git a/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java b/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java index fa92cd5e..03fad39f 100644 --- a/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java @@ -12,6 +12,7 @@ import java.util.concurrent.ExecutionException; import java.util.function.Consumer; +@SuppressWarnings({"OverlyCoupledMethod", "OverlyLongMethod"}) public class TwoPartyTest { static final class PipeThread { @@ -163,8 +164,8 @@ public void testPipelining() throws Exception { var pipelineRequest2 = new Test.TestExtends.Client(promise.getOutBox().getCap()).graultRequest(); var pipelinePromise2 = pipelineRequest2.send(); - Assert.assertThrows(Exception.class, () -> pipelinePromise.join()); - Assert.assertThrows(Exception.class, () -> pipelinePromise2.join()); + Assert.assertThrows(Exception.class, pipelinePromise::join); + Assert.assertThrows(Exception.class, pipelinePromise2::join); Assert.assertEquals(3, callCount.value()); Assert.assertEquals(1, chainedCallCount.value()); From 9f13f29bf68c649a2c8f701fb50e96c4bdc03c82 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 17 Nov 2020 14:01:55 +0000 Subject: [PATCH 143/246] implement missing overrides for PromiseClient --- .../src/main/java/org/capnproto/RpcState.java | 90 +++++++++++++------ 1 file changed, 63 insertions(+), 27 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index f739710f..b8af7ff1 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1793,23 +1793,82 @@ private class PromiseClient extends RpcClient { private final Integer importId; private boolean receivedCall = false; private ResolutionType resolutionType = ResolutionType.UNRESOLVED; + private final CompletableFuture eventual; PromiseClient(RpcClient initial, CompletableFuture eventual, Integer importId) { this.cap = initial; this.importId = importId; - eventual.whenComplete((resolution, exc) -> { + this.eventual = eventual.whenComplete((resolution, exc) -> { if (exc == null) { - resolve(resolution); + this.resolve(resolution); } else { - resolve(Capability.newBrokenCap(exc)); + this.resolve(Capability.newBrokenCap(exc)); } }); } - public boolean isResolved() { + @Override + public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder target, List fds) { + this.receivedCall = true; + return RpcState.this.writeDescriptor(this.cap, target, fds); + } + + @Override + public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { + this.receivedCall = true; + return RpcState.this.writeTarget(this.cap, target); + } + + @Override + public ClientHook getInnermostClient() { + this.receivedCall = true; + return RpcState.this.getInnermostClient(this.cap); + } + + @Override + public Request newCall(long interfaceId, short methodId) { + this.receivedCall = true; + return this.cap.newCall(interfaceId, methodId); + } + + @Override + public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { + this.receivedCall = true; + return this.cap.call(interfaceId, methodId, ctx); + } + + @Override + public ClientHook getResolved() { + return this.isResolved() + ? this.cap + : null; + } + + @Override + public CompletableFuture whenMoreResolved() { + return this.eventual.copy(); + } + + @Override + public Integer getFd() { + if (this.isResolved()) { + return this.cap.getFd(); + } + else { + // In theory, before resolution, the ImportClient for the promise could have an FD + // attached, if the promise itself was presented with an attached FD. However, we can't + // really return that one here because it may be closed when we get the Resolve message + // later. In theory we could have the PromiseClient itself take ownership of an FD that + // arrived attached to a promise cap, but the use case for that is questionable. I'm + // keeping it simple for now. + return null; + } + } + + private boolean isResolved() { return resolutionType != ResolutionType.UNRESOLVED; } @@ -1877,29 +1936,6 @@ private ClientHook resolve(ClientHook replacement) { return replacement; } - - @Override - public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder target, List fds) { - this.receivedCall = true; - return RpcState.this.writeDescriptor(cap, target, fds); - } - - @Override - public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { - this.receivedCall = true; - return RpcState.this.writeTarget(this.cap, target); - } - - @Override - public ClientHook getInnermostClient() { - this.receivedCall = true; - return RpcState.this.getInnermostClient(cap); - } - - @Override - public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { - return null; - } } private class PipelineClient extends RpcClient { From 224bc3a3ad89a76cbe3c8d5128fba87765a74c19 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 17 Nov 2020 14:17:56 +0000 Subject: [PATCH 144/246] oops, ensure bootstrap uses the questionRef promise --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index b8af7ff1..94322fff 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -376,8 +376,7 @@ ClientHook restore() { var question = questions.next(); question.isAwaitingReturn = true; var questionRef = question.selfRef; - var promise = new CompletableFuture(); - var pipeline = new RpcPipeline(questionRef, promise); + var pipeline = new RpcPipeline(questionRef, questionRef.response); int sizeHint = messageSizeHint(RpcProtocol.Bootstrap.factory); var message = connection.newOutgoingMessage(sizeHint); @@ -507,7 +506,7 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo return; } - final var answerId = bootstrap.getQuestionId(); + var answerId = bootstrap.getQuestionId(); var answer = answers.put(answerId); if (answer.active) { assert false: "bootstrap questionId is already in use: " + answerId; From 3513db0588dfba7372dddd5613e598d5e2bcf37f Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 17 Nov 2020 14:19:38 +0000 Subject: [PATCH 145/246] setup/teardown rpc tests --- .../src/test/java/org/capnproto/RpcTest.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 4d3987e4..7eb64db5 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -248,7 +248,7 @@ public CompletableFuture accept() { } } - final class TestContext { + static final class TestContext { final TestNetwork network = new TestNetwork(); final TestNetworkAdapter clientNetwork; final TestNetworkAdapter serverNetwork; @@ -312,9 +312,23 @@ public Capability.Client createFor(Test.TestSturdyRef.Reader refId) { } }; + TestContext context; + + @org.junit.Before + public void setUp() { + this.context = new TestContext(bootstrapFactory); + } + + @org.junit.After + public void tearDown() { + this.context.clientNetwork.close(); + this.context.serverNetwork.close(); + this.context = null; + } + + @org.junit.Test public void testBasic() { - var context = new TestContext(bootstrapFactory); var client = new Test.TestInterface.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_INTERFACE)); var request1 = client.fooRequest(); request1.getParams().setI(123); @@ -345,7 +359,6 @@ public void testBasic() { @org.junit.Test public void testPipelining() { - var context = new TestContext(bootstrapFactory); var client = new Test.TestPipeline.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_PIPELINE)); var chainedCallCount = new Counter(); @@ -379,7 +392,6 @@ public void testPipelining() { @org.junit.Test public void testRelease() { - var context = new TestContext(bootstrapFactory); var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); var handle1 = client.getHandleRequest().send().join().getHandle(); @@ -395,7 +407,6 @@ public void testRelease() { @org.junit.Test public void testPromiseResolve() { - var context = new TestContext(bootstrapFactory); var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); var chainedCallCount = new Counter(); @@ -431,7 +442,6 @@ public void testPromiseResolve() { @org.junit.Test public void testTailCall() { - var context = new TestContext(bootstrapFactory); var caller = new Test.TestTailCaller.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_TAIL_CALLER)); var calleeCallCount = new Counter(); @@ -464,7 +474,6 @@ static CompletableFuture getCa @org.junit.Test public void testEmbargo() { - var context = new TestContext(bootstrapFactory); var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); var cap = new Test.TestCallOrder.Client(new RpcTestUtil.TestCallOrderImpl()); @@ -498,7 +507,6 @@ public void testEmbargo() { @org.junit.Test public void testCallBrokenPromise() throws ExecutionException, InterruptedException { - var context = new TestContext(bootstrapFactory); var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); var paf = new CompletableFuture(); @@ -529,7 +537,6 @@ public void testCallBrokenPromise() throws ExecutionException, InterruptedExcept @org.junit.Test public void testCallCancel() { - var context = new TestContext(bootstrapFactory); var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); var request = client.expectCancelRequest(); @@ -556,7 +563,6 @@ public void testCallCancel() { @org.junit.Test public void testEmbargoUnwrap() { - var context = new TestContext(bootstrapFactory); var capSet = new Capability.CapabilityServerSet(); var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); @@ -571,6 +577,7 @@ public void testEmbargoUnwrap() { var pipeline = echo.getCap(); var unwrap = capSet.getLocalServer(pipeline).thenApply(unwrapped -> { + Assert.assertNotNull(unwrapped); return ((RpcTestUtil.TestCallOrderImpl)unwrapped).getCount(); }); From 054e4efdb15205d179e3ebc2acc6b046b279ed00 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 17 Nov 2020 14:32:37 +0000 Subject: [PATCH 146/246] Revert "resolve PromiseClient requests in order" This reverts commit d526eca4b9175ec1e2b89746b995b56b13723722. --- .../src/main/java/org/capnproto/RpcState.java | 51 +++++++++++++------ 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 94322fff..d6894e6f 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1509,43 +1509,62 @@ enum PipelineState { private class RpcPipeline implements PipelineHook { private final QuestionRef questionRef; + private PipelineState state = PipelineState.WAITING; + private RpcResponse resolved; + private Throwable broken; final HashMap, ClientHook> clientMap = new HashMap<>(); final CompletableFuture redirectLater; + final CompletableFuture resolveSelf; RpcPipeline(QuestionRef questionRef, CompletableFuture redirectLater) { this.questionRef = questionRef; assert redirectLater != null; this.redirectLater = redirectLater; + this.resolveSelf = this.redirectLater + .thenAccept(response -> { + this.state = PipelineState.RESOLVED; + this.resolved = response; + }) + .exceptionally(exc -> { + this.state = PipelineState.BROKEN; + this.broken = exc; + return null; + }); } RpcPipeline(QuestionRef questionRef) { this(questionRef, null); - // never resolves } @Override public ClientHook getPipelinedCap(PipelineOp[] ops) { - // We differ from the C++ implementation here. - // Previously, we would just store and return the resolved client, but this - // could cause tail calls to execute out of order. - // So instead we always chain resolution on the redirectLater promise, which - // ensures that each call initiated from this PromiseClient is executed in order. - // TODO avoid conversion to/from ArrayList? var key = new ArrayList<>(Arrays.asList(ops)); - return this.clientMap.computeIfAbsent(key, k -> { - var pipelineClient = new PipelineClient(this.questionRef, ops); - if (this.redirectLater == null) { - // This pipeline will never get redirected, so just return the PipelineClient. - return pipelineClient; - } - var resolutionPromise = this.redirectLater.thenApply( - response -> response.getResults().getPipelinedCap(ops)); - return new PromiseClient(pipelineClient, resolutionPromise, null); + var hook = this.clientMap.computeIfAbsent(key, k -> { + switch (state) { + case WAITING: { + var pipelineClient = new PipelineClient(this.questionRef, ops); + if (this.redirectLater == null) { + // This pipeline will never get redirected, so just return the PipelineClient. + return pipelineClient; + } + + var resolutionPromise = this.redirectLater.thenApply( + response -> response.getResults().getPipelinedCap(ops)); + return new PromiseClient(pipelineClient, resolutionPromise, null); + } + + case RESOLVED: + return resolved.getResults().getPipelinedCap(ops); + + default: + return Capability.newBrokenCap(broken); + } }); + return hook; } @Override From 13dec22063fa94a415aaefc2a26857f1eeb5ea5f Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 17 Nov 2020 16:18:23 +0000 Subject: [PATCH 147/246] implement evalLast queue --- .../src/main/java/org/capnproto/RpcState.java | 56 ++++++++++--------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index d6894e6f..03a800c4 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -238,11 +238,11 @@ Embargo newExportable(int id) { private final VatNetwork.Connection connection; private final CompletableFuture disconnectFulfiller; private Throwable disconnected = null; - private CompletableFuture messageReady = CompletableFuture.completedFuture(null); private final CompletableFuture messageLoop = new CompletableFuture<>(); // completes when the message loop exits private final ReferenceQueue questionRefs = new ReferenceQueue<>(); private final ReferenceQueue importRefs = new ReferenceQueue<>(); + private final Queue> lastEvals = new ArrayDeque<>(); RpcState(BootstrapFactory bootstrapFactory, VatNetwork.Connection connection, @@ -360,16 +360,8 @@ final boolean isConnected() { } // Run func() before the next IO event. - private void evalLast(Callable func) { - this.messageReady = this.messageReady.thenCompose(x -> { - try { - func.call(); - } - catch (java.lang.Exception exc) { - return CompletableFuture.failedFuture(exc); - } - return CompletableFuture.completedFuture(null); - }); + private void evalLast(Callable func) { + this.lastEvals.add(func); } ClientHook restore() { @@ -402,7 +394,13 @@ private void startMessageLoop() { } try { this.handleMessage(message); - } catch (Exception rpcExc) { + + while (!this.lastEvals.isEmpty()) { + this.lastEvals.remove().call(); + } + + } + catch (Throwable rpcExc) { // either we received an Abort message from peer // or internal RpcState is bad. this.disconnect(rpcExc); @@ -410,8 +408,7 @@ private void startMessageLoop() { }); messageReader.thenRunAsync(this::startMessageLoop).exceptionallyCompose(exc -> { - //System.out.println("Exception in startMessageLoop!"); - //exc.printStackTrace(); + //System.out.println("Exception in startMessageLoop!" + exc); return CompletableFuture.failedFuture(exc); }); } @@ -790,7 +787,6 @@ private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reade // It appears this is a valid entry on the import table, but was not expected to be a // promise. assert imp.importClient == null : "Import already resolved."; - } private void handleRelease(RpcProtocol.Release.Reader release) { @@ -1053,9 +1049,11 @@ private ClientHook receiveCap(RpcProtocol.CapDescriptor.Reader descriptor, List< var exp = exports.find(descriptor.getReceiverHosted()); if (exp == null) { return Capability.newBrokenCap("invalid 'receiverHosted' export ID"); - } else if (exp.clientHook.getBrand() == this) { + } + else if (exp.clientHook.getBrand() == this) { return new TribbleRaceBlocker(exp.clientHook); - } else { + } + else { return exp.clientHook; } } @@ -1513,9 +1511,9 @@ private class RpcPipeline implements PipelineHook { private RpcResponse resolved; private Throwable broken; - final HashMap, ClientHook> clientMap = new HashMap<>(); - final CompletableFuture redirectLater; - final CompletableFuture resolveSelf; + private final HashMap, ClientHook> clientMap = new HashMap<>(); + private final CompletableFuture redirectLater; + private final CompletableFuture resolveSelf; RpcPipeline(QuestionRef questionRef, CompletableFuture redirectLater) { @@ -1523,9 +1521,10 @@ private class RpcPipeline implements PipelineHook { assert redirectLater != null; this.redirectLater = redirectLater; this.resolveSelf = this.redirectLater - .thenAccept(response -> { + .thenApply(response -> { this.state = PipelineState.RESOLVED; this.resolved = response; + return response; }) .exceptionally(exc -> { this.state = PipelineState.BROKEN; @@ -1534,8 +1533,12 @@ private class RpcPipeline implements PipelineHook { }); } + /** + * Construct a new RpcPipeline that is never expected to resolve. + */ RpcPipeline(QuestionRef questionRef) { this(questionRef, null); + // TODO implement tail calls... } @Override @@ -1552,13 +1555,15 @@ public ClientHook getPipelinedCap(PipelineOp[] ops) { return pipelineClient; } - var resolutionPromise = this.redirectLater.thenApply( + assert this.resolveSelf != null; + var resolutionPromise = this.resolveSelf.thenApply( response -> response.getResults().getPipelinedCap(ops)); return new PromiseClient(pipelineClient, resolutionPromise, null); } case RESOLVED: - return resolved.getResults().getPipelinedCap(ops); + assert this.resolved != null; + return this.resolved.getResults().getPipelinedCap(ops); default: return Capability.newBrokenCap(broken); @@ -1807,7 +1812,7 @@ enum ResolutionType { private class PromiseClient extends RpcClient { - private final ClientHook cap; + private ClientHook cap; private final Integer importId; private boolean receivedCall = false; private ResolutionType resolutionType = ResolutionType.UNRESOLVED; @@ -1940,7 +1945,7 @@ private ClientHook resolve(ClientHook replacement) { var message = connection.newOutgoingMessage(sizeHint); var disembargo = message.getBody().initAs(RpcProtocol.Message.factory).initDisembargo(); var redirect = RpcState.this.writeTarget(cap, disembargo.initTarget()); - assert redirect == null; + assert redirect == null: "Original promise target should always be from this RPC connection."; var embargo = embargos.next(); disembargo.getContext().setSenderLoopback(embargo.id); @@ -1952,6 +1957,7 @@ private ClientHook resolve(ClientHook replacement) { message.send(); } + this.cap = replacement; return replacement; } } From d6112f0be72113c69d69677eb5297b8195ec5ebb Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 17 Nov 2020 16:19:25 +0000 Subject: [PATCH 148/246] allow for testEmbargoUnwrapped ordering --- runtime-rpc/src/test/java/org/capnproto/RpcTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 7eb64db5..c7f27188 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -578,7 +578,9 @@ public void testEmbargoUnwrap() { var unwrap = capSet.getLocalServer(pipeline).thenApply(unwrapped -> { Assert.assertNotNull(unwrapped); - return ((RpcTestUtil.TestCallOrderImpl)unwrapped).getCount(); + return unwrapped != null + ? ((RpcTestUtil.TestCallOrderImpl)unwrapped).getCount() + : -1; }); var call0 = getCallSequence(pipeline, 0); @@ -602,7 +604,7 @@ public void testEmbargoUnwrap() { Assert.assertEquals(5, call5.join().getN()); int unwrappedAt = unwrap.join(); - //Assert.assertTrue(unwrappedAt >= 3); + Assert.assertTrue(unwrappedAt >= 0); } } From 709751a885ebceafbb95bc3e7517fcfdb52ec6ba Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 17 Nov 2020 16:57:06 +0000 Subject: [PATCH 149/246] add logging for inbound messages --- .../src/main/java/org/capnproto/RpcState.java | 50 ++++++++++++++++--- .../org/capnproto/TwoPartyVatNetwork.java | 5 ++ .../src/test/java/org/capnproto/RpcTest.java | 5 ++ 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 03a800c4..df32bd70 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -11,9 +11,12 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.CompletionStage; +import java.util.logging.*; final class RpcState { + private static final Logger LOGGER = Logger.getLogger(RpcState.class.getName()); + private static int messageSizeHint() { return 1 + RpcProtocol.Message.factory.structSize().total(); } @@ -68,6 +71,7 @@ void finish() { var builder = message.getBody().getAs(RpcProtocol.Message.factory).initFinish(); builder.setQuestionId(this.id); builder.setReleaseResultCaps(this.isAwaitingReturn); + LOGGER.info(() -> RpcState.this.toString() + ": > FINISH question=" + this.id); message.send(); } this.skipFinish = true; @@ -185,6 +189,7 @@ public void dispose() { var builder = message.getBody().initAs(RpcProtocol.Message.factory).initRelease(); builder.setId(importId); builder.setReferenceCount(remoteRefCount); + LOGGER.info(() -> this.toString() + ": > RELEASE import=" + importId); message.send(); } } @@ -253,6 +258,11 @@ Embargo newExportable(int id) { startMessageLoop(); } + @Override + public String toString() { + return super.toString() + ": " + this.connection.toString(); + } + CompletableFuture onDisconnection() { return this.messageLoop; } @@ -315,6 +325,7 @@ void disconnect(Throwable exc) { var message = this.connection.newOutgoingMessage(sizeHint); var abort = message.getBody().getAs(RpcProtocol.Message.factory).initAbort(); FromException(exc, abort); + LOGGER.log(Level.INFO, this.toString() + ": > ABORT", exc.getMessage()); message.send(); } catch (Exception ignored) { @@ -374,6 +385,7 @@ ClientHook restore() { var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initBootstrap(); builder.setQuestionId(question.id); + LOGGER.info(() -> this.toString() + ": > BOOTSTRAP question=" + question.id); message.send(); return pipeline.getPipelinedCap(new PipelineOp[0]); @@ -407,15 +419,12 @@ private void startMessageLoop() { } }); - messageReader.thenRunAsync(this::startMessageLoop).exceptionallyCompose(exc -> { - //System.out.println("Exception in startMessageLoop!" + exc); - return CompletableFuture.failedFuture(exc); - }); + messageReader.thenRunAsync(this::startMessageLoop).exceptionallyCompose( + exc -> CompletableFuture.failedFuture(exc)); } private void handleMessage(IncomingRpcMessage message) throws RpcException { var reader = message.getBody().getAs(RpcProtocol.Message.factory); - //System.out.println(this + ": Received message: " + reader.which()); switch (reader.which()) { case UNIMPLEMENTED: handleUnimplemented(reader.getUnimplemented()); @@ -444,14 +453,17 @@ private void handleMessage(IncomingRpcMessage message) throws RpcException { case RELEASE: handleRelease(reader.getRelease()); break; - default: + default: { + LOGGER.warning(() -> this.toString() + ": < Unhandled RPC message: " + reader.which().toString()); if (!isDisconnected()) { // boomin' back atcha var msg = connection.newOutgoingMessage(); msg.getBody().initAs(RpcProtocol.Message.factory).setUnimplemented(reader); + LOGGER.info(() -> this.toString() + ": > UNIMPLEMENTED"); msg.send(); } break; + } } this.cleanupImports(); @@ -459,6 +471,8 @@ private void handleMessage(IncomingRpcMessage message) throws RpcException { } void handleUnimplemented(RpcProtocol.Message.Reader message) { + LOGGER.info(() -> this.toString() + ": < UNIMPLEMENTED"); + switch (message.which()) { case RESOLVE: var resolve = message.getResolve(); @@ -495,10 +509,13 @@ void handleUnimplemented(RpcProtocol.Message.Reader message) { } void handleAbort(RpcProtocol.Exception.Reader abort) throws RpcException { - throw ToException(abort); + var exc = ToException(abort); + LOGGER.log(Level.INFO, this.toString() + ": < ABORT ", exc.getMessage()); + throw exc; } void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bootstrap) { + LOGGER.info(() -> this.toString() + ": < BOOTSTRAP question=" + bootstrap.getQuestionId()); if (isDisconnected()) { return; } @@ -537,6 +554,7 @@ void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bo ? capHook : Capability.newBrokenCap("Invalid pipeline transform."); + LOGGER.info(() -> this.toString() + ": > RETURN answer=" + answerId); response.send(); assert answer.active; @@ -622,6 +640,8 @@ private ClientHook.VoidPromiseAndPipeline startCall(long interfaceId, short meth } void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callReturn) { + LOGGER.info(() -> this.toString() + ": < RETURN answer=" + callReturn.getAnswerId()); + var question = questions.find(callReturn.getAnswerId()); if (question == null) { assert false: "Invalid question ID in Return message."; @@ -721,6 +741,8 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu } void handleFinish(RpcProtocol.Finish.Reader finish) { + LOGGER.info(() -> this.toString() + ": < FINISH question=" + finish.getQuestionId()); + var answer = answers.find(finish.getQuestionId()); if (answer == null || !answer.active) { assert false: "'Finish' for invalid question ID."; @@ -750,6 +772,8 @@ void handleFinish(RpcProtocol.Finish.Reader finish) { } private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { + LOGGER.info(() -> this.toString() + ": < RESOLVE promise=" + resolve.getPromiseId()); + ClientHook cap = null; Throwable exc = null; @@ -790,10 +814,13 @@ private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reade } private void handleRelease(RpcProtocol.Release.Reader release) { + LOGGER.info(() -> this.toString() + ": < RELEASE promise=" + release.getId()); this.releaseExport(release.getId(), release.getReferenceCount()); } private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { + LOGGER.info(() -> this.toString() + ": < DISEMBARGO"); + var ctx = disembargo.getContext(); switch (ctx.which()) { case SENDER_LOOPBACK: @@ -837,6 +864,7 @@ private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { return null; } builder.getContext().setReceiverLoopback(embargoId); + LOGGER.info(() -> this.toString() + ": > DISEMBARGO"); message.send(); return null; }; @@ -973,6 +1001,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS var fds = List.of(); writeDescriptor(exp.clientHook, resolve.initCap(), fds); message.setFds(fds); + LOGGER.info(() -> this.toString() + ": > RESOLVE export=" + exportId); message.send(); return CompletableFuture.completedFuture(null); }).whenComplete((value, exc) -> { @@ -984,6 +1013,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS var resolve = message.getBody().initAs(RpcProtocol.Message.factory).initResolve(); resolve.setPromiseId(exportId); FromException(exc, resolve.initException()); + LOGGER.log(Level.INFO, this.toString() + ": > RESOLVE", exc.getMessage()); message.send(); // TODO disconnect? @@ -1381,6 +1411,7 @@ public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { builder.setAnswerId(this.answerId); builder.setReleaseParamCaps(false); builder.setTakeFromOtherQuestion(tailInfo.questionId); + LOGGER.info(() -> this.toString() + ": > RETURN answer=" + answerId); message.send(); } @@ -1423,6 +1454,8 @@ private void sendReturn() { this.returnMessage.setAnswerId(this.answerId); this.returnMessage.setReleaseParamCaps(false); + LOGGER.info(() -> RpcState.this.toString() + ": > RETURN answer=" + this.answerId); + int[] exports = null; try { exports = ((RpcServerResponseImpl) response).send(); @@ -1446,6 +1479,7 @@ private void sendErrorReturn(Throwable exc) { builder.setAnswerId(this.answerId); builder.setReleaseParamCaps(false); FromException(exc, builder.initException()); + LOGGER.log(Level.INFO, this.toString() + ": > RETURN", exc.getMessage()); message.send(); } @@ -1703,6 +1737,7 @@ QuestionRef sendInternal(boolean isTailCall) { callBuilder.getSendResultsTo().getYourself(); } try { + LOGGER.info(() -> RpcState.this.toString() + ": > CALL question=" + question.id); message.send(); } catch (Exception exc) { question.isAwaitingReturn = false; @@ -1954,6 +1989,7 @@ private ClientHook resolve(ClientHook replacement) { var embargoPromise = embargo.disembargo.thenApply( void_ -> finalReplacement); replacement = Capability.newLocalPromiseClient(embargoPromise); + LOGGER.info(() -> RpcState.this.toString() + ": > DISEMBARGO"); message.send(); } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 40b4ba16..84a758f3 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -47,6 +47,11 @@ public void close() { } } + @Override + public String toString() { + return this.getSide().toString(); + } + public RpcTwoPartyProtocol.Side getSide() { return side; } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index c7f27188..93523e48 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -71,6 +71,11 @@ class Connection implements VatNetwork.Connection { this.peerId = peerId; } + @Override + public String toString() { + return this.isClient ? "CLIENT" : "SERVER"; + } + void attach(Connection other) { Assert.assertNull(this.partner); Assert.assertNull(other.partner); From 5e797d36a30a7eb1767aa3e4e0c17b405eca131e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 19 Nov 2020 15:17:04 +0000 Subject: [PATCH 150/246] remove baseAccept and tidy TowPartyVatNetwork --- .../main/java/org/capnproto/RpcSystem.java | 2 +- .../org/capnproto/TwoPartyVatNetwork.java | 70 +++++++++---------- .../main/java/org/capnproto/VatNetwork.java | 3 +- .../src/test/java/org/capnproto/RpcTest.java | 13 ++-- 4 files changed, 39 insertions(+), 49 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java index 2dda98d5..fba8bf4f 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java @@ -82,7 +82,7 @@ public void accept(VatNetwork.Connection connection) { } private void startAcceptLoop() { - this.network.baseAccept() + this.network.accept() .thenAccept(this::accept) .thenRunAsync(this::startAcceptLoop); } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 84a758f3..1e82da3f 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -1,6 +1,5 @@ package org.capnproto; -import java.io.IOException; import java.nio.channels.AsynchronousByteChannel; import java.nio.channels.AsynchronousSocketChannel; import java.util.List; @@ -10,11 +9,6 @@ public class TwoPartyVatNetwork implements VatNetwork, VatNetwork.Connection { - @Override - public CompletableFuture> baseAccept() { - return this.accept(); - } - public interface MessageTap { void incoming(IncomingRpcMessage message, RpcTwoPartyProtocol.Side side); } @@ -49,23 +43,7 @@ public void close() { @Override public String toString() { - return this.getSide().toString(); - } - - public RpcTwoPartyProtocol.Side getSide() { - return side; - } - - public void setTap(MessageTap tap) { - this.tap = tap; - } - - public Connection asConnection() { - return this; - } - - public CompletableFuture onDisconnect() { - return this.disconnectPromise.copy(); + return this.side.toString(); } @Override @@ -75,17 +53,7 @@ public Connection connect(RpcTwoPartyProtocol. : null; } - public CompletableFuture> accept() { - if (side == RpcTwoPartyProtocol.Side.SERVER & !accepted) { - accepted = true; - return CompletableFuture.completedFuture(this.asConnection()); - } - else { - // never completes - return new CompletableFuture<>(); - } - } - + @Override public RpcTwoPartyProtocol.VatId.Reader getPeerVatId() { return this.peerVatId.getRoot(RpcTwoPartyProtocol.VatId.factory).asReader(); } @@ -108,7 +76,7 @@ public CompletableFuture receiveIncomingMessage() { return; } - var side = this.getSide() == RpcTwoPartyProtocol.Side.CLIENT + var side = this.side == RpcTwoPartyProtocol.Side.CLIENT ? RpcTwoPartyProtocol.Side.SERVER : RpcTwoPartyProtocol.Side.CLIENT; @@ -137,6 +105,34 @@ public CompletableFuture shutdown() { return result; } + public RpcTwoPartyProtocol.Side getSide() { + return side; + } + + public void setTap(MessageTap tap) { + this.tap = tap; + } + + public Connection asConnection() { + return this; + } + + public CompletableFuture onDisconnect() { + return this.disconnectPromise.copy(); + } + + + public CompletableFuture> accept() { + if (side == RpcTwoPartyProtocol.Side.SERVER & !accepted) { + accepted = true; + return CompletableFuture.completedFuture(this.asConnection()); + } + else { + // never completes + return new CompletableFuture<>(); + } + } + final class OutgoingMessage implements OutgoingRpcMessage { private final MessageBuilder message; @@ -160,7 +156,7 @@ public void setFds(List fds) { @Override public void send() { - previousWrite = previousWrite.thenCompose(x -> Serialize.writeAsync(channel, message)); + previousWrite = previousWrite.thenRun(() -> Serialize.writeAsync(channel, message)); } @Override @@ -173,7 +169,7 @@ public int sizeInWords() { } } - final class IncomingMessage implements IncomingRpcMessage { + static final class IncomingMessage implements IncomingRpcMessage { private final MessageReader message; private final List fds; diff --git a/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java index 3ee87268..eb8fc211 100644 --- a/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java @@ -15,7 +15,6 @@ default OutgoingRpcMessage newOutgoingMessage() { void close(); } - CompletableFuture> baseAccept(); + CompletableFuture> accept(); Connection connect(VatId hostId); } - diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 93523e48..66e8f924 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -33,7 +33,6 @@ import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; -import static org.capnproto.RpcState.FromException; public class RpcTest { @@ -187,7 +186,7 @@ public void close() { int sent = 0; int received = 0; Map connections = new HashMap<>(); - Queue> fulfillerQueue = new ArrayDeque<>(); + Queue>> fulfillerQueue = new ArrayDeque<>(); Queue connectionQueue = new ArrayDeque<>(); TestNetworkAdapter(TestNetwork network, String self) { @@ -199,10 +198,6 @@ Connection newConnection(boolean isClient, Test.TestSturdyRef.Reader peerId) { return new Connection(isClient, peerId); } - public CompletableFuture> baseAccept() { - return this.accept().thenApply(conn -> conn); - } - @Override public void close() { var exc = RpcException.failed("Network was destroyed"); @@ -241,11 +236,11 @@ public VatNetwork.Connection connect(Test.TestSturdyR return local; } - public CompletableFuture accept() { + public CompletableFuture> accept() { if (this.connections.isEmpty()) { - var promise = new CompletableFuture(); + var promise = new CompletableFuture>(); this.fulfillerQueue.add(promise); - return promise.thenApply(conn -> conn); + return promise; } else { return CompletableFuture.completedFuture(this.connectionQueue.remove()); From 68edac583b6c353b9c87ec4edaa4b37985a1f8f6 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 19 Nov 2020 15:26:21 +0000 Subject: [PATCH 151/246] remove unused getVatIdFactory() --- .../src/main/java/org/capnproto/RpcSystem.java | 15 ++++----------- .../src/test/java/org/capnproto/RpcStateTest.java | 5 ----- .../src/test/java/org/capnproto/RpcTest.java | 5 ----- .../main/java/org/capnproto/BootstrapFactory.java | 3 --- 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java index fba8bf4f..cb6eff2a 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java @@ -15,7 +15,7 @@ public class RpcSystem { private final Map, RpcState> connections = new ConcurrentHashMap<>(); public RpcSystem(VatNetwork network) { - this(network, (BootstrapFactory)null); + this(network, (BootstrapFactory)null); } public RpcSystem(VatNetwork network, @@ -26,12 +26,6 @@ public RpcSystem(VatNetwork network, public RpcSystem(VatNetwork network, Capability.Client bootstrapInterface) { this(network, new BootstrapFactory() { - - @Override - public FromPointerReader getVatIdFactory() { - return this.getVatIdFactory(); - } - @Override public Capability.Client createFor(VatId clientId) { return bootstrapInterface; @@ -47,7 +41,7 @@ public RpcSystem(VatNetwork network, } public Capability.Client bootstrap(VatId vatId) { - var connection = this.getNetwork().connect(vatId); + var connection = this.network.connect(vatId); if (connection != null) { var state = getConnectionState(connection); var hook = state.restore(); @@ -66,15 +60,14 @@ public VatNetwork getNetwork() { } RpcState getConnectionState(VatNetwork.Connection connection) { - var state = this.connections.computeIfAbsent(connection, conn -> { + return this.connections.computeIfAbsent(connection, conn -> { var onDisconnect = new CompletableFuture(); onDisconnect.thenCompose(info -> { this.connections.remove(connection); - return info.shutdownPromise.thenRun(() -> connection.close()); + return info.shutdownPromise.thenRun(connection::close); }); return new RpcState<>(this.bootstrapFactory, conn, onDisconnect); }); - return state; } public void accept(VatNetwork.Connection connection) { diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java index 6a2f4756..258f7daf 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java @@ -83,11 +83,6 @@ public void setUp() { this.connection = new TestConnection(); this.bootstrapInterface = new Capability.Client(Capability.newNullCap()); var bootstrapFactory = new BootstrapFactory() { - @Override - public FromPointerReader getVatIdFactory() { - return RpcTwoPartyProtocol.VatId.factory; - } - @Override public Capability.Client createFor(RpcTwoPartyProtocol.VatId.Reader clientId) { return bootstrapInterface; diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 66e8f924..f66a1e19 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -281,11 +281,6 @@ Capability.Client connect(Test.TestSturdyRefObjectId.Tag tag) { } static BootstrapFactory bootstrapFactory = new BootstrapFactory<>() { - @Override - public FromPointerReader getVatIdFactory() { - return Test.TestSturdyRef.factory; - } - @Override public Capability.Client createFor(Test.TestSturdyRef.Reader refId) { var callCount = new Counter(); diff --git a/runtime/src/main/java/org/capnproto/BootstrapFactory.java b/runtime/src/main/java/org/capnproto/BootstrapFactory.java index c6bd0758..a3195d45 100644 --- a/runtime/src/main/java/org/capnproto/BootstrapFactory.java +++ b/runtime/src/main/java/org/capnproto/BootstrapFactory.java @@ -1,8 +1,5 @@ package org.capnproto; public interface BootstrapFactory { - - FromPointerReader getVatIdFactory(); - Capability.Client createFor(VatId clientId); } \ No newline at end of file From f0fbaacae1dfae7c8c55709367e3afe811fa3614 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 19 Nov 2020 15:32:32 +0000 Subject: [PATCH 152/246] avoid null bootstrap interface --- .../main/java/org/capnproto/RpcSystem.java | 29 +++++-------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java index cb6eff2a..caee17e8 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java @@ -1,9 +1,5 @@ package org.capnproto; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; @@ -15,7 +11,8 @@ public class RpcSystem { private final Map, RpcState> connections = new ConcurrentHashMap<>(); public RpcSystem(VatNetwork network) { - this(network, (BootstrapFactory)null); + this(network, clientId -> new Capability.Client( + Capability.newBrokenCap("No bootstrap interface available"))); } public RpcSystem(VatNetwork network, @@ -25,12 +22,7 @@ public RpcSystem(VatNetwork network, public RpcSystem(VatNetwork network, Capability.Client bootstrapInterface) { - this(network, new BootstrapFactory() { - @Override - public Capability.Client createFor(VatId clientId) { - return bootstrapInterface; - } - }); + this(network, clientId -> bootstrapInterface); } public RpcSystem(VatNetwork network, @@ -47,19 +39,16 @@ public Capability.Client bootstrap(VatId vatId) { var hook = state.restore(); return new Capability.Client(hook); } - else if (this.bootstrapFactory != null) { - return this.bootstrapFactory.createFor(vatId); - } else { - return new Capability.Client(Capability.newBrokenCap("No bootstrap interface available")); + return this.bootstrapFactory.createFor(vatId); } } - public VatNetwork getNetwork() { - return this.network; + public void accept(VatNetwork.Connection connection) { + getConnectionState(connection); } - RpcState getConnectionState(VatNetwork.Connection connection) { + private RpcState getConnectionState(VatNetwork.Connection connection) { return this.connections.computeIfAbsent(connection, conn -> { var onDisconnect = new CompletableFuture(); onDisconnect.thenCompose(info -> { @@ -70,10 +59,6 @@ RpcState getConnectionState(VatNetwork.Connection connection) { }); } - public void accept(VatNetwork.Connection connection) { - getConnectionState(connection); - } - private void startAcceptLoop() { this.network.accept() .thenAccept(this::accept) From af229ccb99a1d3c9227aba6148a3df02eee33134 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 19 Nov 2020 15:48:51 +0000 Subject: [PATCH 153/246] cleanup minor code quality issues in RpcState simplify handleResolve use enhanced switch in getMessageTarget --- .../src/main/java/org/capnproto/RpcState.java | 155 +++++++----------- 1 file changed, 58 insertions(+), 97 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index df32bd70..e922b663 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -60,7 +60,7 @@ private final class Question { Question(int id) { this.id = id; - this.selfRef = new QuestionRef(this.id);; + this.selfRef = new QuestionRef(this.id); this.disposer = new QuestionDisposer(this.selfRef); } @@ -239,9 +239,9 @@ Embargo newExportable(int id) { }; private final Map exportsByCap = new HashMap<>(); - private final BootstrapFactory bootstrapFactory; + private final BootstrapFactory bootstrapFactory; private final VatNetwork.Connection connection; - private final CompletableFuture disconnectFulfiller; + private final CompletableFuture disconnectFulfiller; private Throwable disconnected = null; private final CompletableFuture messageLoop = new CompletableFuture<>(); // completes when the message loop exits @@ -249,9 +249,9 @@ Embargo newExportable(int id) { private final ReferenceQueue importRefs = new ReferenceQueue<>(); private final Queue> lastEvals = new ArrayDeque<>(); - RpcState(BootstrapFactory bootstrapFactory, + RpcState(BootstrapFactory bootstrapFactory, VatNetwork.Connection connection, - CompletableFuture disconnectFulfiller) { + CompletableFuture disconnectFulfiller) { this.bootstrapFactory = bootstrapFactory; this.connection = connection; this.disconnectFulfiller = disconnectFulfiller; @@ -420,40 +420,22 @@ private void startMessageLoop() { }); messageReader.thenRunAsync(this::startMessageLoop).exceptionallyCompose( - exc -> CompletableFuture.failedFuture(exc)); + CompletableFuture::failedFuture); } private void handleMessage(IncomingRpcMessage message) throws RpcException { var reader = message.getBody().getAs(RpcProtocol.Message.factory); switch (reader.which()) { - case UNIMPLEMENTED: - handleUnimplemented(reader.getUnimplemented()); - break; - case ABORT: - handleAbort(reader.getAbort()); - break; - case BOOTSTRAP: - handleBootstrap(message, reader.getBootstrap()); - break; - case CALL: - handleCall(message, reader.getCall()); - return; - case RETURN: - handleReturn(message, reader.getReturn()); - break; - case FINISH: - handleFinish(reader.getFinish()); - break; - case RESOLVE: - handleResolve(message, reader.getResolve()); - break; - case DISEMBARGO: - handleDisembargo(reader.getDisembargo()); - break; - case RELEASE: - handleRelease(reader.getRelease()); - break; - default: { + case UNIMPLEMENTED -> handleUnimplemented(reader.getUnimplemented()); + case ABORT -> handleAbort(reader.getAbort()); + case BOOTSTRAP -> handleBootstrap(reader.getBootstrap()); + case CALL -> handleCall(message, reader.getCall()); + case RETURN -> handleReturn(message, reader.getReturn()); + case FINISH -> handleFinish(reader.getFinish()); + case RESOLVE -> handleResolve(message, reader.getResolve()); + case DISEMBARGO -> handleDisembargo(reader.getDisembargo()); + case RELEASE -> handleRelease(reader.getRelease()); + default -> { LOGGER.warning(() -> this.toString() + ": < Unhandled RPC message: " + reader.which().toString()); if (!isDisconnected()) { // boomin' back atcha @@ -462,7 +444,6 @@ private void handleMessage(IncomingRpcMessage message) throws RpcException { LOGGER.info(() -> this.toString() + ": > UNIMPLEMENTED"); msg.send(); } - break; } } @@ -514,7 +495,7 @@ void handleAbort(RpcProtocol.Exception.Reader abort) throws RpcException { throw exc; } - void handleBootstrap(IncomingRpcMessage message, RpcProtocol.Bootstrap.Reader bootstrap) { + void handleBootstrap(RpcProtocol.Bootstrap.Reader bootstrap) { LOGGER.info(() -> this.toString() + ": < BOOTSTRAP question=" + bootstrap.getQuestionId()); if (isDisconnected()) { return; @@ -570,15 +551,12 @@ void handleCall(IncomingRpcMessage message, RpcProtocol.Call.Reader call) { boolean redirectResults; switch (call.getSendResultsTo().which()) { - case CALLER: - redirectResults = false; - break; - case YOURSELF: - redirectResults = true; - break; - default: - assert false: "Unsupported 'Call.sendResultsTo'."; + case CALLER -> redirectResults = false; + case YOURSELF -> redirectResults = true; + default -> { + assert false : "Unsupported 'Call.sendResultsTo'."; return; + } } var payload = call.getParams(); @@ -774,43 +752,34 @@ void handleFinish(RpcProtocol.Finish.Reader finish) { private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { LOGGER.info(() -> this.toString() + ": < RESOLVE promise=" + resolve.getPromiseId()); - ClientHook cap = null; - Throwable exc = null; - - switch (resolve.which()) { - case CAP: - cap = receiveCap(resolve.getCap(), message.getAttachedFds()); - break; - case EXCEPTION: - exc = ToException(resolve.getException()); - break; - default: - assert false: "Unknown 'Resolve' type."; - return; - } - var importId = resolve.getPromiseId(); - var imp = this.imports.find(resolve.getPromiseId()); + var imp = this.imports.find(importId); if (imp == null) { return; } - if (imp.promise != null) { - // This import is an unfulfilled promise. + if (imp.promise == null) { + assert imp.importClient == null : "Import already resolved."; + // It appears this is a valid entry on the import table, but was not expected to be a + // promise. + return; + } - assert !imp.promise.isDone(); - if (exc == null) { + // This import is an unfulfilled promise. + assert !imp.promise.isDone(); + switch (resolve.which()) { + case CAP -> { + var cap = receiveCap(resolve.getCap(), message.getAttachedFds()); imp.promise.complete(cap); } - else { + case EXCEPTION -> { + var exc = ToException(resolve.getException()); imp.promise.completeExceptionally(exc); } - return; + default -> { + assert false : "Unknown 'Resolve' type."; + } } - - // It appears this is a valid entry on the import table, but was not expected to be a - // promise. - assert imp.importClient == null : "Import already resolved."; } private void handleRelease(RpcProtocol.Release.Reader release) { @@ -842,8 +811,8 @@ private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { return; } - final var embargoId = ctx.getSenderLoopback(); - final var rpcTarget = (RpcClient) target; + var embargoId = ctx.getSenderLoopback(); + var rpcTarget = (RpcClient) target; Callable sendDisembargo = () -> { if (isDisconnected()) { @@ -877,14 +846,13 @@ private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { assert false: "Invalid embargo ID in 'Disembargo.context.receiverLoopback'."; return; } - assert embargo.disembargo != null; embargo.disembargo.complete(null); embargos.erase(ctx.getReceiverLoopback(), embargo); break; default: assert false: "Unimplemented Disembargo type. " + ctx.which(); - return; + break; } } @@ -1169,7 +1137,7 @@ ClientHook writeTarget(ClientHook cap, RpcProtocol.MessageTarget.Builder target) ClientHook getMessageTarget(RpcProtocol.MessageTarget.Reader target) { switch (target.which()) { - case IMPORTED_CAP: + case IMPORTED_CAP -> { var exp = exports.find(target.getImportedCap()); if (exp != null) { return exp.clientHook; @@ -1178,8 +1146,8 @@ ClientHook getMessageTarget(RpcProtocol.MessageTarget.Reader target) { assert false: "Message target is not a current export ID."; return null; } - - case PROMISED_ANSWER: + } + case PROMISED_ANSWER -> { var promisedAnswer = target.getPromisedAnswer(); var questionId = promisedAnswer.getQuestionId(); var base = answers.put(questionId); @@ -1187,22 +1155,21 @@ ClientHook getMessageTarget(RpcProtocol.MessageTarget.Reader target) { assert false: "PromisedAnswer.questionId is not a current question."; return null; } - var pipeline = base.pipeline; if (pipeline == null) { pipeline = PipelineHook.newBrokenPipeline( RpcException.failed("Pipeline call on a request that returned no capabilities or was already closed.")); } - var ops = ToPipelineOps(promisedAnswer); if (ops == null) { return null; } return pipeline.getPipelinedCap(ops); - - default: + } + default -> { assert false: "Unknown message target type. " + target.which(); return null; + } } } @@ -1317,7 +1284,7 @@ private final class RpcCallContext implements CallContextHook { // response private RpcServerResponse response; private RpcProtocol.Return.Builder returnMessage; - private boolean redirectResults = false; + private final boolean redirectResults; private boolean responseSent = false; private CompletableFuture tailCallPipeline; @@ -1377,7 +1344,7 @@ public CompletableFuture tailCall(RequestHook request) { @Override public void allowCancellation() { - boolean previouslyRequestedButNotAllowed = (this.cancelAllowed == false && this.cancelRequested == true); + boolean previouslyRequestedButNotAllowed = (!this.cancelAllowed && this.cancelRequested); this.cancelAllowed = true; if (previouslyRequestedButNotAllowed) { @@ -1423,9 +1390,8 @@ public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { // Just forward to another local call var response = request.send(); - var promise = response.thenAccept(results -> { - getResults(0).setAs(AnyPointer.factory, results); - }); + var promise = response.thenAccept( + results -> getResults(0).setAs(AnyPointer.factory, results)); return new ClientHook.VoidPromiseAndPipeline(promise, response.pipeline().hook); } @@ -1703,7 +1669,7 @@ public RemotePromise send() { return replacement.send(); } - final var questionRef = sendInternal(false); + var questionRef = sendInternal(false); // The pipeline must get notified of resolution before the app does to maintain ordering. var pipeline = new RpcPipeline(questionRef, questionRef.response); @@ -1815,7 +1781,7 @@ public CompletableFuture whenMoreResolved() { private void cleanupImports() { while (true) { - var ref = (ImportRef) this.importRefs.poll(); + var ref = (ImportRef)this.importRefs.poll(); if (ref == null) { return; } @@ -1985,7 +1951,7 @@ private ClientHook resolve(ClientHook replacement) { var embargo = embargos.next(); disembargo.getContext().setSenderLoopback(embargo.id); - final ClientHook finalReplacement = replacement; + ClientHook finalReplacement = replacement; var embargoPromise = embargo.disembargo.thenApply( void_ -> finalReplacement); replacement = Capability.newLocalPromiseClient(embargoPromise); @@ -2038,13 +2004,10 @@ public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { static void FromPipelineOps(PipelineOp[] ops, RpcProtocol.PromisedAnswer.Builder builder) { var transforms = builder.initTransform(ops.length); for (int ii = 0; ii < ops.length; ++ii) { + var transform = transforms.get(ii); switch (ops[ii].type) { - case NOOP: - transforms.get(ii).setNoop(null); - break; - case GET_POINTER_FIELD: - transforms.get(ii).setGetPointerField(ops[ii].pointerIndex); - break; + case NOOP -> transform.setNoop(null); + case GET_POINTER_FIELD -> transform.setGetPointerField(ops[ii].pointerIndex); } } } @@ -2079,7 +2042,6 @@ static void FromException(Throwable exc, RpcProtocol.Exception.Builder builder) case OVERLOADED -> RpcProtocol.Exception.Type.OVERLOADED; case DISCONNECTED -> RpcProtocol.Exception.Type.DISCONNECTED; case UNIMPLEMENTED -> RpcProtocol.Exception.Type.UNIMPLEMENTED; - default -> RpcProtocol.Exception.Type.FAILED; }; } builder.setType(type); @@ -2091,7 +2053,6 @@ static void FromException(Throwable exc, RpcProtocol.Exception.Builder builder) static RpcException ToException(RpcProtocol.Exception.Reader reader) { var type = switch (reader.getType()) { - case FAILED -> RpcException.Type.FAILED; case OVERLOADED -> RpcException.Type.OVERLOADED; case DISCONNECTED -> RpcException.Type.DISCONNECTED; case UNIMPLEMENTED -> RpcException.Type.UNIMPLEMENTED; From 0c4e98848ed8d4a60f51e1dc62d3e3bdafd7afc9 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 19 Nov 2020 16:19:34 +0000 Subject: [PATCH 154/246] ensure whenMoreResolved resolves to eventual client in PromiseClient --- .../src/main/java/org/capnproto/RpcState.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index e922b663..29ef26c9 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1824,13 +1824,11 @@ private class PromiseClient extends RpcClient { Integer importId) { this.cap = initial; this.importId = importId; - this.eventual = eventual.whenComplete((resolution, exc) -> { - if (exc == null) { - this.resolve(resolution); - } - else { - this.resolve(Capability.newBrokenCap(exc)); - } + this.eventual = eventual.handle((resolution, exc) -> { + this.cap = exc == null + ? this.resolve(resolution) + : this.resolve(Capability.newBrokenCap(exc)); + return this.cap; }); } @@ -1954,13 +1952,13 @@ private ClientHook resolve(ClientHook replacement) { ClientHook finalReplacement = replacement; var embargoPromise = embargo.disembargo.thenApply( void_ -> finalReplacement); - replacement = Capability.newLocalPromiseClient(embargoPromise); LOGGER.info(() -> RpcState.this.toString() + ": > DISEMBARGO"); message.send(); + return Capability.newLocalPromiseClient(embargoPromise); + } + else { + return replacement; } - - this.cap = replacement; - return replacement; } } From 1366e28fd54f6747bd1837c9341a2f8e2bb884c5 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 19 Nov 2020 17:36:48 +0000 Subject: [PATCH 155/246] simplify conversion to CompletableFuture --- runtime/src/main/java/org/capnproto/Capability.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 61bbaa7d..5f9475a0 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -584,7 +584,7 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext var callResult = this.promiseForCallForwarding.thenApply( client -> client.call(interfaceId, methodId, ctx)); var pipeline = new QueuedPipeline(callResult.thenApply(result -> result.pipeline)); - return new VoidPromiseAndPipeline(callResult.thenAccept(x -> {}), pipeline); + return new VoidPromiseAndPipeline(callResult.thenRun(() -> {}), pipeline); } @Override From d3e639eaee142ff3f15c6714079b43f2f0e9c04b Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 19 Nov 2020 18:34:21 +0000 Subject: [PATCH 156/246] add capability tail call test --- .../java/org/capnproto/CapabilityTest.java | 36 ++++++++++++++++++- .../main/java/org/capnproto/Capability.java | 10 +++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java index df32650e..23e005f6 100644 --- a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java @@ -66,7 +66,7 @@ protected CompletableFuture grault(CallContext this.callInternal(interfaceId, methodId, ctx)); - var pipelinePromise = promise.thenApply(x -> { ctx.releaseParams(); return (PipelineHook)new LocalPipeline(ctx); From e314d26ab35905eff26e944df417c694ca47ccf8 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 20 Nov 2020 16:27:44 +0000 Subject: [PATCH 157/246] use sendInternal rather than calling hook directly --- compiler/src/main/cpp/capnpc-java.c++ | 2 +- runtime/src/main/java/org/capnproto/AnyPointer.java | 5 +++++ runtime/src/main/java/org/capnproto/Request.java | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 5226bc4e..76ffe257 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -2031,7 +2031,7 @@ private: sp, " return ", paramFactory, ";\n", sp, " }\n", sp, " default Response send() {\n", - sp, " return new Response(this.getHook().send());\n", + sp, " return new Response(this.sendInternal());\n", sp, " }\n", sp, " }\n", sp, " public static final class Response\n", diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 63d5ca43..0526237d 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -221,6 +221,11 @@ public FromPointerBuilder getParamsFactory() { return AnyPointer.factory; } + @Override + public RemotePromise sendInternal() { + return this.send(); + } + public RemotePromise send() { return this.getHook().send(); } diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index e1fb41d7..854c0082 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -16,6 +16,10 @@ default RequestHook getHook() { Request getTypelessRequest(); + default RemotePromise sendInternal() { + return this.getTypelessRequest().sendInternal(); + } + static Request newBrokenRequest(FromPointerBuilder paramsFactory, Throwable exc) { From 1cadca604efaa38dd22ac06c4738b2ce9828e2a4 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 20 Nov 2020 17:04:50 +0000 Subject: [PATCH 158/246] add releaseCall to delay call execution --- .../java/org/capnproto/CallContextHook.java | 4 + .../main/java/org/capnproto/Capability.java | 90 +++++++++++++------ .../main/java/org/capnproto/ClientHook.java | 1 - 3 files changed, 69 insertions(+), 26 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/CallContextHook.java b/runtime/src/main/java/org/capnproto/CallContextHook.java index 9b00255c..38ffe49c 100644 --- a/runtime/src/main/java/org/capnproto/CallContextHook.java +++ b/runtime/src/main/java/org/capnproto/CallContextHook.java @@ -21,4 +21,8 @@ default AnyPointer.Builder getResults() { CompletableFuture onTailCall(); ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request); + + default CompletableFuture releaseCall() { + return CompletableFuture.completedFuture(null); + } } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index f5738d26..dfe48d61 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -171,7 +171,7 @@ private final class LocalClient implements ClientHook { } @Override - public AnyPointer.Request newCall(long interfaceId, short methodId) { + public Request newCall(long interfaceId, short methodId) { var hook = new LocalRequest(interfaceId, methodId, this); var root = hook.message.getRoot(AnyPointer.factory); return new AnyPointer.Request(root, hook); @@ -185,16 +185,20 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext return null; } - // We don't want to actually dispatch the call synchronously, because we don't want the callee - // to have any side effects before the promise is returned to the caller. This helps avoid - // race conditions. + // Note this comment from the C++ source: // - // So, we do an evalLater() here. + // "We don't want to actually dispatch the call synchronously, because we don't want the callee + // to have any side effects before the promise is returned to the caller. This helps avoid + // race conditions. // - // Note also that QueuedClient depends on this evalLater() to ensure that pipelined calls don't - // complete before 'whenMoreResolved()' promises resolve. - // TODO fix the above comment! we don't have the option of evalLater (yes) - var promise = this.whenResolved().thenCompose( + // So, we do an evalLater() here. + // + // Note also that QueuedClient depends on this evalLater() to ensure that pipelined calls don't + // complete before 'whenMoreResolved()' promises resolve." + // + // As the Java implementation doesn't (currently) have an evalLater() call, we obtain a promise + // from the CallContextHook that will be completed by QueuedClient when appropriate. + var promise = ctx.releaseCall().thenCompose( void_ -> this.callInternal(interfaceId, methodId, ctx)); var pipelinePromise = promise.thenApply(x -> { @@ -344,6 +348,7 @@ private static class LocalRequest implements RequestHook { final long interfaceId; final short methodId; final ClientHook client; + private final CompletableFuture callRelease = new CompletableFuture<>(); LocalRequest(long interfaceId, short methodId, ClientHook client) { this.interfaceId = interfaceId; @@ -354,7 +359,7 @@ private static class LocalRequest implements RequestHook { @Override public RemotePromise send() { var cancel = new CompletableFuture(); - var context = new LocalCallContext(message, client, cancel); + var context = new LocalCallContext(message, client, cancel, this.callRelease); var promiseAndPipeline = client.call(interfaceId, methodId, context); var promise = promiseAndPipeline.promise.thenApply(x -> { context.getResults(); // force allocation @@ -365,6 +370,7 @@ public RemotePromise send() { promiseAndPipeline.promise.cancel(false); }); + this.callRelease.complete(null); assert promiseAndPipeline.pipeline != null; return new RemotePromise<>(promise, new AnyPointer.Pipeline(promiseAndPipeline.pipeline)); } @@ -380,6 +386,10 @@ public CompletableFuture sendStreaming() { public Object getBrand() { return null; } + + void releaseCall() { + this.callRelease.complete(null); + } } private static final class LocalPipeline implements PipelineHook { @@ -410,6 +420,7 @@ private static final class LocalResponse implements ResponseHook { private static class LocalCallContext implements CallContextHook { final CompletableFuture cancelAllowed; + private final CompletableFuture callRelease; CompletableFuture tailCallPipeline; MessageBuilder request; Response response; @@ -418,10 +429,12 @@ private static class LocalCallContext implements CallContextHook { LocalCallContext(MessageBuilder request, ClientHook clientRef, - CompletableFuture cancelAllowed) { + CompletableFuture cancelAllowed, + CompletableFuture callRelease) { this.request = request; this.clientRef = clientRef; this.cancelAllowed = cancelAllowed; + this.callRelease = callRelease; } @Override @@ -441,6 +454,7 @@ public AnyPointer.Builder getResults(int sizeHint) { this.responseBuilder = localResponse.message.getRoot(AnyPointer.factory); this.response = new Response<>(this.responseBuilder.asReader(), localResponse); } + assert this.response != null; return this.responseBuilder; } @@ -466,13 +480,18 @@ public CompletableFuture onTailCall() { @Override public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { - assert this.response == null: "Can't call tailCall() after initializing the results struct."; + assert this.response == null : "Can't call tailCall() after initializing the results struct."; var promise = request.send(); var voidPromise = promise._getResponse().thenAccept(tailResponse -> { this.response = tailResponse; }); return new ClientHook.VoidPromiseAndPipeline(voidPromise, promise.pipeline().hook); } + + @Override + public CompletableFuture releaseCall() { + return this.callRelease; + } } public static ClientHook newBrokenCap(String reason) { @@ -494,7 +513,7 @@ static private ClientHook newBrokenClient(String reason, boolean resolved, Objec static private ClientHook newBrokenClient(Throwable exc, boolean resolved, Object brand) { return new ClientHook() { @Override - public AnyPointer.Request newCall(long interfaceId, short methodId) { + public Request newCall(long interfaceId, short methodId) { var broken = Request.newBrokenRequest(AnyPointer.factory, exc); return new AnyPointer.Request(broken.getParams(), broken.getHook()); } @@ -561,28 +580,49 @@ public void close() { // A ClientHook which simply queues calls while waiting for a ClientHook to which to forward them. private static class QueuedClient implements ClientHook { - private final CompletableFuture promise; - private final CompletableFuture promiseForCallForwarding; - private final CompletableFuture promiseForClientResolution; private final CompletableFuture setResolutionOp; + // Represents the operation which will set `redirect` when possible. + + private final CompletableFuture promiseForCallForwarding = new CompletableFuture<>(); + // When this promise resolves, each queued call will be forwarded to the real client. This needs + // to occur *before* any 'whenMoreResolved()' promises resolve, because we want to make sure + // previously-queued calls are delivered before any new calls made in response to the resolution. + + private final CompletableFuture promiseForClientResolution = new CompletableFuture<>(); + // whenMoreResolved() returns forks of this promise. These must resolve *after* queued calls + // have been initiated (so that any calls made in the whenMoreResolved() handler are correctly + // delivered after calls made earlier), but *before* any queued calls return (because it might + // confuse the application if a queued call returns before the capability on which it was made + // resolves). + + private final CompletableFuture promiseForCallRelease = new CompletableFuture<>(); + // When this promise resolves, all pending calls will return. + private ClientHook redirect; QueuedClient(CompletableFuture promise) { - // TODO revisit futures - this.promise = promise; - this.promiseForCallForwarding = promise.toCompletableFuture().copy(); - this.promiseForClientResolution = promise.toCompletableFuture().copy(); - this.setResolutionOp = promise.thenAccept(inner -> { - this.redirect = inner; - }).exceptionally(exc -> { - this.redirect = newBrokenCap(exc); + this.setResolutionOp = promise.handle((inner, exc) -> { + this.redirect = exc == null + ? inner + : newBrokenCap(exc); + + // Resolve the promise for call forwarding. + this.promiseForCallForwarding.complete(this.redirect); + + // Now resolve the promise for client resolution + this.promiseForClientResolution.complete(this.redirect); + + // Finally, execute any pending calls. + this.promiseForCallRelease.complete(null); + return null; }); } @Override - public AnyPointer.Request newCall(long interfaceId, short methodId) { + public Request newCall(long interfaceId, short methodId) { var hook = new LocalRequest(interfaceId, methodId, this); + this.promiseForCallRelease.thenRun(hook::releaseCall); var root = hook.message.getRoot(AnyPointer.factory); return new AnyPointer.Request(root, hook); } diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index 7dd34dea..2d4842d5 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -1,7 +1,6 @@ package org.capnproto; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; public interface ClientHook { From 52892478efb6fc026cd63f665d61552b72452549 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 20 Nov 2020 20:08:31 +0000 Subject: [PATCH 159/246] serialise write and correct chaining --- .../src/main/java/org/capnproto/TwoPartyVatNetwork.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 1e82da3f..0ae1ecd5 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -133,6 +133,10 @@ public CompletableFuture> accept() } } + private synchronized void write(MessageBuilder message) { + this.previousWrite = this.previousWrite.thenCompose(void_ -> Serialize.writeAsync(channel, message)); + } + final class OutgoingMessage implements OutgoingRpcMessage { private final MessageBuilder message; @@ -156,7 +160,7 @@ public void setFds(List fds) { @Override public void send() { - previousWrite = previousWrite.thenRun(() -> Serialize.writeAsync(channel, message)); + write(message); } @Override From 119a682d4dd6be5d40e048c5b8ab62f09f807899 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 23 Nov 2020 19:53:35 +0000 Subject: [PATCH 160/246] memoise queuespipeline caps. use queues to order queuedclient resolution --- .../main/java/org/capnproto/Capability.java | 50 +++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index dfe48d61..7b85d265 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -1,5 +1,6 @@ package org.capnproto; +import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; @@ -546,6 +547,7 @@ private static final class QueuedPipeline implements PipelineHook { private final CompletableFuture promise; private final CompletableFuture selfResolutionOp; PipelineHook redirect; + private final Map, ClientHook> clientMap = new HashMap<>(); QueuedPipeline(CompletableFuture promiseParam) { this.promise = promiseParam; @@ -559,10 +561,14 @@ private static final class QueuedPipeline implements PipelineHook { @Override public final ClientHook getPipelinedCap(PipelineOp[] ops) { - return redirect != null - ? redirect.getPipelinedCap(ops) - : new QueuedClient(this.promise.thenApply( - pipeline -> pipeline.getPipelinedCap(ops))); + if (redirect != null) { + return redirect.getPipelinedCap(ops); + } + + var key = new ArrayList<>(Arrays.asList(ops)); + return this.clientMap.computeIfAbsent(key, + k -> new QueuedClient(this.promise.thenApply( + pipeline -> pipeline.getPipelinedCap(ops)))); } /* @Override @@ -580,14 +586,9 @@ public void close() { // A ClientHook which simply queues calls while waiting for a ClientHook to which to forward them. private static class QueuedClient implements ClientHook { - private final CompletableFuture setResolutionOp; + private final CompletableFuture selfResolutionOp; // Represents the operation which will set `redirect` when possible. - private final CompletableFuture promiseForCallForwarding = new CompletableFuture<>(); - // When this promise resolves, each queued call will be forwarded to the real client. This needs - // to occur *before* any 'whenMoreResolved()' promises resolve, because we want to make sure - // previously-queued calls are delivered before any new calls made in response to the resolution. - private final CompletableFuture promiseForClientResolution = new CompletableFuture<>(); // whenMoreResolved() returns forks of this promise. These must resolve *after* queued calls // have been initiated (so that any calls made in the whenMoreResolved() handler are correctly @@ -595,25 +596,28 @@ private static class QueuedClient implements ClientHook { // confuse the application if a queued call returns before the capability on which it was made // resolves). - private final CompletableFuture promiseForCallRelease = new CompletableFuture<>(); - // When this promise resolves, all pending calls will return. - private ClientHook redirect; + private final Queue> queuedCalls = new ArrayDeque<>(); + private final Queue pendingCalls = new ArrayDeque<>(); QueuedClient(CompletableFuture promise) { - this.setResolutionOp = promise.handle((inner, exc) -> { + this.selfResolutionOp = promise.handle((inner, exc) -> { this.redirect = exc == null ? inner : newBrokenCap(exc); - // Resolve the promise for call forwarding. - this.promiseForCallForwarding.complete(this.redirect); + // Resolve promises for call forwarding. + for (var call: this.queuedCalls) { + call.complete(this.redirect); + } // Now resolve the promise for client resolution this.promiseForClientResolution.complete(this.redirect); // Finally, execute any pending calls. - this.promiseForCallRelease.complete(null); + for (var hook: this.pendingCalls) { + hook.releaseCall(); + } return null; }); @@ -622,17 +626,21 @@ private static class QueuedClient implements ClientHook { @Override public Request newCall(long interfaceId, short methodId) { var hook = new LocalRequest(interfaceId, methodId, this); - this.promiseForCallRelease.thenRun(hook::releaseCall); + this.pendingCalls.add(hook); var root = hook.message.getRoot(AnyPointer.factory); return new AnyPointer.Request(root, hook); } @Override public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { - var callResult = this.promiseForCallForwarding.thenApply( + var promise = new CompletableFuture(); + this.queuedCalls.add(promise); + + var callResult = promise.thenApply( client -> client.call(interfaceId, methodId, ctx)); - var pipeline = new QueuedPipeline(callResult.thenApply(result -> result.pipeline)); - return new VoidPromiseAndPipeline(callResult.thenRun(() -> {}), pipeline); + var pipelineResult = callResult.thenApply(result -> result.pipeline); + var pipeline = new QueuedPipeline(pipelineResult); + return new VoidPromiseAndPipeline(pipelineResult.thenRun(() -> {}), pipeline); } @Override From cdb719eed00c7ab0c7e207473e930791b967363e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 23 Nov 2020 20:06:52 +0000 Subject: [PATCH 161/246] oops, invert senderLoopback assertion --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 29ef26c9..73b03a32 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -828,7 +828,7 @@ private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { // a PromiseClient. The code which sends `Resolve` and `Return` should have replaced // any promise with a direct node in order to solve the Tribble 4-way race condition. // See the documentation of Disembargo in rpc.capnp for more. - if (redirect == null) { + if (redirect != null) { assert false : "'Disembargo' of type 'senderLoopback' sent to an object that does not appear to have been the subject of a previous 'Resolve' message."; return null; } From beec84a1bcbf21259a716b6976bca846026b44dd Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 23 Nov 2020 20:50:11 +0000 Subject: [PATCH 162/246] calling thread drives client side loop --- .../src/main/java/org/capnproto/RpcState.java | 61 +++---- .../main/java/org/capnproto/RpcSystem.java | 19 ++- .../java/org/capnproto/TwoPartyClient.java | 8 + .../java/org/capnproto/TwoPartyServer.java | 61 +++---- .../org/capnproto/TwoPartyVatNetwork.java | 31 +--- .../test/java/org/capnproto/RpcStateTest.java | 161 ------------------ .../src/test/java/org/capnproto/RpcTest.java | 84 +++++---- .../test/java/org/capnproto/TwoPartyTest.java | 74 ++++---- 8 files changed, 162 insertions(+), 337 deletions(-) delete mode 100644 runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 73b03a32..220d5599 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -255,7 +255,6 @@ Embargo newExportable(int id) { this.bootstrapFactory = bootstrapFactory; this.connection = connection; this.disconnectFulfiller = disconnectFulfiller; - startMessageLoop(); } @Override @@ -391,36 +390,41 @@ ClientHook restore() { return pipeline.getPipelinedCap(new PipelineOp[0]); } - private void startMessageLoop() { + /** + * Returns a CompletableFuture that, when complete, has processed one message. + */ + public CompletableFuture pollOnce() { if (isDisconnected()) { this.messageLoop.completeExceptionally(this.disconnected); - return; + return CompletableFuture.failedFuture(this.disconnected); } - var messageReader = this.connection.receiveIncomingMessage() - .thenAccept(message -> { - if (message == null) { - this.disconnect(RpcException.disconnected("Peer disconnected")); - this.messageLoop.complete(null); - return; - } - try { - this.handleMessage(message); - - while (!this.lastEvals.isEmpty()) { - this.lastEvals.remove().call(); + return this.connection.receiveIncomingMessage() + .thenAccept(message -> { + if (message == null) { + this.disconnect(RpcException.disconnected("Peer disconnected")); + this.messageLoop.complete(null); + return; } + try { + this.handleMessage(message); + while (!this.lastEvals.isEmpty()) { + this.lastEvals.remove().call(); + } + } + catch (Throwable rpcExc) { + // either we received an Abort message from peer + // or internal RpcState is bad. + this.disconnect(rpcExc); + } + }); + } - } - catch (Throwable rpcExc) { - // either we received an Abort message from peer - // or internal RpcState is bad. - this.disconnect(rpcExc); - } - }); - - messageReader.thenRunAsync(this::startMessageLoop).exceptionallyCompose( - CompletableFuture::failedFuture); + public void runMessageLoop() { + this.pollOnce().thenRun(this::runMessageLoop).exceptionally(exc -> { + LOGGER.warning(() -> "Event loop exited: " + exc.getMessage()); + return null; + }); } private void handleMessage(IncomingRpcMessage message) throws RpcException { @@ -766,7 +770,6 @@ private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reade } // This import is an unfulfilled promise. - assert !imp.promise.isDone(); switch (resolve.which()) { case CAP -> { var cap = receiveCap(resolve.getCap(), message.getAttachedFds()); @@ -981,10 +984,8 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS var resolve = message.getBody().initAs(RpcProtocol.Message.factory).initResolve(); resolve.setPromiseId(exportId); FromException(exc, resolve.initException()); - LOGGER.log(Level.INFO, this.toString() + ": > RESOLVE", exc.getMessage()); + LOGGER.info(() -> this.toString() + ": > RESOLVE FAILED export=" + exportId + " msg=" + exc.getMessage()); message.send(); - - // TODO disconnect? }); } @@ -1900,6 +1901,7 @@ private ClientHook resolve(ClientHook replacement) { var replacementBrand = replacement.getBrand(); boolean isSameConnection = replacementBrand == RpcState.this; if (isSameConnection) { + // We resolved to some other RPC capability hosted by the same peer. var promise = replacement.whenMoreResolved(); if (promise != null) { var other = (PromiseClient)replacement; @@ -1936,6 +1938,7 @@ private ClientHook resolve(ClientHook replacement) { // TODO Flow control if (resolutionType == ResolutionType.REFLECTED && receivedCall && !isDisconnected()) { + LOGGER.fine(() -> RpcState.this.toString() + ": embargoing reflected capability " + this.toString()); // The new capability is hosted locally, not on the remote machine. And, we had made calls // to the promise. We need to make sure those calls echo back to us before we allow new // calls to go directly to the local capability, so we need to set a local embargo and send diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java index caee17e8..7f7c1817 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcSystem.java @@ -1,14 +1,14 @@ package org.capnproto; +import java.util.HashMap; import java.util.Map; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ConcurrentHashMap; public class RpcSystem { private final VatNetwork network; private final BootstrapFactory bootstrapFactory; - private final Map, RpcState> connections = new ConcurrentHashMap<>(); + private final Map, RpcState> connections = new HashMap<>(); public RpcSystem(VatNetwork network) { this(network, clientId -> new Capability.Client( @@ -29,7 +29,6 @@ public RpcSystem(VatNetwork network, BootstrapFactory bootstrapFactory) { this.network = network; this.bootstrapFactory = bootstrapFactory; - this.startAcceptLoop(); } public Capability.Client bootstrap(VatId vatId) { @@ -45,7 +44,8 @@ public Capability.Client bootstrap(VatId vatId) { } public void accept(VatNetwork.Connection connection) { - getConnectionState(connection); + var state = getConnectionState(connection); + state.runMessageLoop(); } private RpcState getConnectionState(VatNetwork.Connection connection) { @@ -59,10 +59,17 @@ private RpcState getConnectionState(VatNetwork.Connection connecti }); } - private void startAcceptLoop() { + public void runOnce() { + for (var state: this.connections.values()) { + state.pollOnce().join(); + return; + } + } + + public void start() { this.network.accept() .thenAccept(this::accept) - .thenRunAsync(this::startAcceptLoop); + .thenRunAsync(this::start); } public static diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java index f42f5b2c..d1d3159b 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java @@ -1,5 +1,6 @@ package org.capnproto; +import java.io.IOException; import java.nio.channels.AsynchronousByteChannel; import java.util.concurrent.CompletableFuture; @@ -35,4 +36,11 @@ public Capability.Client bootstrap() { CompletableFuture onDisconnect() { return this.network.onDisconnect(); } + + public CompletableFuture runUntil(CompletableFuture done) { + while (!done.isDone()) { + this.rpcSystem.runOnce(); + } + return done; + } } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java index b51b7526..9bab21fe 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java @@ -1,8 +1,6 @@ package org.capnproto; -import java.nio.channels.AsynchronousServerSocketChannel; -import java.nio.channels.AsynchronousSocketChannel; -import java.nio.channels.CompletionHandler; +import java.nio.channels.*; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -10,41 +8,18 @@ public class TwoPartyServer { private class AcceptedConnection { - final AsynchronousSocketChannel connection; - final TwoPartyVatNetwork network; - final RpcSystem rpcSystem; + private final AsynchronousByteChannel connection; + private final TwoPartyVatNetwork network; + private final RpcSystem rpcSystem; - AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousSocketChannel connection) { + AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousByteChannel connection) { this.connection = connection; this.network = new TwoPartyVatNetwork(this.connection, RpcTwoPartyProtocol.Side.SERVER); this.rpcSystem = new RpcSystem<>(network, bootstrapInterface); + this.rpcSystem.start(); } } - class ConnectionReceiver { - final AsynchronousServerSocketChannel listener; - - ConnectionReceiver(AsynchronousServerSocketChannel listener) { - this.listener = listener; - } - - CompletableFuture accept() { - CompletableFuture result = new CompletableFuture<>(); - this.listener.accept(null, new CompletionHandler<>() { - @Override - public void completed(AsynchronousSocketChannel channel, Object attachment) { - result.complete(channel); - } - - @Override - public void failed(Throwable exc, Object attachment) { - result.completeExceptionally(exc); - } - }); - return result.copy(); - } - } - private final Capability.Client bootstrapInterface; private final List connections = new ArrayList<>(); @@ -65,14 +40,20 @@ public void accept(AsynchronousSocketChannel channel) { } public CompletableFuture listen(AsynchronousServerSocketChannel listener) { - return this.listen(wrapListenSocket(listener)); - } - - CompletableFuture listen(ConnectionReceiver listener) { - return listener.accept().thenCompose(channel -> { - this.accept(channel); - return this.listen(listener); + var result = new CompletableFuture(); + listener.accept(null, new CompletionHandler<>() { + @Override + public void completed(AsynchronousSocketChannel channel, Object attachment) { + accept(channel); + result.complete(null); + } + + @Override + public void failed(Throwable exc, Object attachment) { + result.completeExceptionally(exc); + } }); + return result.thenCompose(void_ -> this.listen(listener)); } CompletableFuture drain() { @@ -82,8 +63,4 @@ CompletableFuture drain() { } return loop; } - - ConnectionReceiver wrapListenSocket(AsynchronousServerSocketChannel channel) { - return new ConnectionReceiver(channel); - } } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 0ae1ecd5..965d8123 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -9,17 +9,12 @@ public class TwoPartyVatNetwork implements VatNetwork, VatNetwork.Connection { - public interface MessageTap { - void incoming(IncomingRpcMessage message, RpcTwoPartyProtocol.Side side); - } - private CompletableFuture previousWrite = CompletableFuture.completedFuture(null); private final CompletableFuture disconnectPromise = new CompletableFuture<>(); private final AsynchronousByteChannel channel; private final RpcTwoPartyProtocol.Side side; private final MessageBuilder peerVatId = new MessageBuilder(4); private boolean accepted; - private MessageTap tap; public TwoPartyVatNetwork(AsynchronousByteChannel channel, RpcTwoPartyProtocol.Side side) { this.channel = channel; @@ -65,26 +60,9 @@ public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { @Override public CompletableFuture receiveIncomingMessage() { - var message = Serialize.readAsync(channel) + return Serialize.readAsync(channel) .thenApply(reader -> (IncomingRpcMessage) new IncomingMessage(reader)) .exceptionally(exc -> null); - - // send to message tap - if (this.tap != null) { - message = message.whenComplete((msg, exc) -> { - if (this.tap == null || msg == null) { - return; - } - - var side = this.side == RpcTwoPartyProtocol.Side.CLIENT - ? RpcTwoPartyProtocol.Side.SERVER - : RpcTwoPartyProtocol.Side.CLIENT; - - this.tap.incoming(msg, side); - }); - } - - return message; } @Override @@ -109,10 +87,6 @@ public RpcTwoPartyProtocol.Side getSide() { return side; } - public void setTap(MessageTap tap) { - this.tap = tap; - } - public Connection asConnection() { return this; } @@ -120,8 +94,7 @@ public Connection asConnection() { public CompletableFuture onDisconnect() { return this.disconnectPromise.copy(); } - - + public CompletableFuture> accept() { if (side == RpcTwoPartyProtocol.Side.SERVER & !accepted) { accepted = true; diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java deleted file mode 100644 index 258f7daf..00000000 --- a/runtime-rpc/src/test/java/org/capnproto/RpcStateTest.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.capnproto; - -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import java.io.IOException; -import java.util.ArrayDeque; -import java.util.Queue; -import java.util.concurrent.CompletableFuture; - -public class RpcStateTest { - - class TestConnection implements VatNetwork.Connection { - - private CompletableFuture nextIncomingMessage = new CompletableFuture<>(); - private final CompletableFuture disconnect = new CompletableFuture<>(); - - @Override - public OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize) { - var message = new MessageBuilder(); - - return new OutgoingRpcMessage() { - @Override - public AnyPointer.Builder getBody() { - return message.getRoot(AnyPointer.factory); - } - - @Override - public void send() { - sent.add(this); - var msg = new IncomingRpcMessage() { - @Override - public AnyPointer.Reader getBody() { - return message.getRoot(AnyPointer.factory).asReader(); - } - }; - - if (nextIncomingMessage.isDone()) { - nextIncomingMessage = CompletableFuture.completedFuture(msg); - } - else { - nextIncomingMessage.complete(msg); - } - } - - @Override - public int sizeInWords() { - return 0; - } - }; - } - - @Override - public CompletableFuture receiveIncomingMessage() { - return this.nextIncomingMessage; - } - - @Override - public CompletableFuture shutdown() { - this.disconnect.complete(null); - return this.disconnect.thenRun(() -> {}); - } - - @Override - public RpcTwoPartyProtocol.VatId.Reader getPeerVatId() { - return null; - } - - @Override - public void close() { - } - } - - TestConnection connection; - Capability.Client bootstrapInterface; - RpcState rpc; - final Queue sent = new ArrayDeque<>(); - - @Before - public void setUp() { - this.connection = new TestConnection(); - this.bootstrapInterface = new Capability.Client(Capability.newNullCap()); - var bootstrapFactory = new BootstrapFactory() { - @Override - public Capability.Client createFor(RpcTwoPartyProtocol.VatId.Reader clientId) { - return bootstrapInterface; - } - }; - - this.rpc = new RpcState<>(bootstrapFactory, connection, connection.disconnect); - } - - @After - public void tearDown() { - this.connection = null; - this.rpc = null; - this.sent.clear(); - } -/* - @Test - public void handleUnimplemented() { - var msg = this.connection.newOutgoingMessage(0); - var root = msg.getBody().initAs(RpcProtocol.Message.factory).initUnimplemented(); - var resolve = root.initResolve(); - RpcState.FromException(new Exception("foo"), resolve.initException()); - msg.send(); - Assert.assertFalse(sent.isEmpty()); - } -*/ - @Test - public void handleAbort() { - var msg = this.connection.newOutgoingMessage(0); - var builder = msg.getBody().initAs(RpcProtocol.Message.factory); - RpcState.FromException(RpcException.failed("Test abort"), builder.initAbort()); - msg.send(); - } - - @Test - public void handleBootstrap() { - var msg = this.connection.newOutgoingMessage(0); - var bootstrap = msg.getBody().initAs(RpcProtocol.Message.factory).initBootstrap(); - bootstrap.setQuestionId(0); - msg.send(); - Assert.assertEquals(2, sent.size()); - - sent.remove(); // bootstrap - var reply = sent.remove(); // return - - var rpcMsg = reply.getBody().getAs(RpcProtocol.Message.factory); - Assert.assertEquals(RpcProtocol.Message.Which.RETURN, rpcMsg.which()); - var ret = rpcMsg.getReturn(); - Assert.assertEquals(ret.getAnswerId(), 0); - Assert.assertEquals(RpcProtocol.Return.Which.RESULTS, ret.which()); - var results = ret.getResults(); - Assert.assertEquals(results.getCapTable().size(), 1); // got a capability! - Assert.assertTrue(results.hasContent()); - } - - @Test - public void handleCall() { - } - - @Test - public void handleReturn() { - } - - @Test - public void handleFinish() { - } - - @Test - public void handleResolve() { - } - - @Test - public void handleDisembargo() { - } - -} \ No newline at end of file diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index f66a1e19..a8aa9879 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -31,7 +31,6 @@ import java.util.Queue; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; -import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; public class RpcTest { @@ -268,6 +267,7 @@ static final class TestContext { this.serverNetwork = this.network.add("server"); this.rpcClient = RpcSystem.makeRpcClient(this.clientNetwork); this.rpcServer = RpcSystem.makeRpcServer(this.serverNetwork, bootstrapFactory); + this.rpcServer.start(); } Capability.Client connect(Test.TestSturdyRefObjectId.Tag tag) { @@ -278,6 +278,13 @@ Capability.Client connect(Test.TestSturdyRefObjectId.Tag tag) { ref.getObjectId().initAs(Test.TestSturdyRefObjectId.factory).setTag(tag); return rpcClient.bootstrap(ref.asReader()); } + + public CompletableFuture runUntil(CompletableFuture done) { + while (!done.isDone()) { + this.rpcClient.runOnce(); + } + return done; + } } static BootstrapFactory bootstrapFactory = new BootstrapFactory<>() { @@ -321,7 +328,6 @@ public void tearDown() { this.context = null; } - @org.junit.Test public void testBasic() { var client = new Test.TestInterface.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_INTERFACE)); @@ -343,12 +349,15 @@ public void testBasic() { RpcTestUtil.initTestMessage(request2.getParams().initS()); var promise2 = request2.send(); - var response1 = promise1.join(); + var response1 = this.context.runUntil(promise1).join(); Assert.assertEquals("foo", response1.getX().toString()); - var response2 = promise2.join(); - promise3.join(); + while (!promise2.isDone()) { + this.context.rpcClient.runOnce(); + } + var response2 = this.context.runUntil(promise2).join(); + this.context.runUntil(promise3).join(); Assert.assertTrue(ref.barFailed); } @@ -376,10 +385,10 @@ public void testPipelining() { //Assert.assertEquals(0, chainedCallCount.value()); - var response = pipelinePromise.join(); + var response = this.context.runUntil(pipelinePromise).join(); Assert.assertEquals("bar", response.getX().toString()); - var response2 = pipelinePromise2.join(); + var response2 = this.context.runUntil(pipelinePromise2).join(); RpcTestUtil.checkTestMessage(response2); Assert.assertEquals(1, chainedCallCount.value()); @@ -389,15 +398,15 @@ public void testPipelining() { public void testRelease() { var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); - var handle1 = client.getHandleRequest().send().join().getHandle(); + var handle1 = this.context.runUntil(client.getHandleRequest().send()).join().getHandle(); var promise = client.getHandleRequest().send(); - var handle2 = promise.join().getHandle(); + var handle2 = this.context.runUntil(promise).join().getHandle(); handle1 = null; handle2 = null; System.gc(); - client.echoRequest().send().join(); + this.context.runUntil(client.echoRequest().send()).join(); } @org.junit.Test @@ -421,15 +430,15 @@ public void testPromiseResolve() { // Make sure getCap() has been called on the server side by sending another call and waiting // for it. - Assert.assertEquals(2, client.getCallSequenceRequest().send().join().getN()); + Assert.assertEquals(2, this.context.runUntil(client.getCallSequenceRequest().send()).join().getN()); //Assert.assertEquals(3, context.restorer.callCount); // OK, now fulfill the local promise. paf.complete(new Test.TestInterface.Client(new RpcTestUtil.TestInterfaceImpl(chainedCallCount))); // We should now be able to wait for getCap() to finish. - Assert.assertEquals("bar", promise.join().getS().toString()); - Assert.assertEquals("bar", promise2.join().getS().toString()); + Assert.assertEquals("bar", this.context.runUntil(promise).join().getS().toString()); + Assert.assertEquals("bar", this.context.runUntil(promise2).join().getS().toString()); //Assert.assertEquals(3, context.restorer.callCount); Assert.assertEquals(2, chainedCallCount.value()); @@ -447,16 +456,16 @@ public void testTailCall() { var promise = request.send(); var dependentCall0 = promise.getC().getCallSequenceRequest().send(); - var response = promise.join(); + var response = this.context.runUntil(promise).join(); Assert.assertEquals(456, response.getI()); var dependentCall1 = promise.getC().getCallSequenceRequest().send(); - Assert.assertEquals(0, dependentCall0.join().getN()); - Assert.assertEquals(1, dependentCall1.join().getN()); + Assert.assertEquals(0, this.context.runUntil(dependentCall0).join().getN()); + Assert.assertEquals(1, this.context.runUntil(dependentCall1).join().getN()); var dependentCall2 = response.getC().getCallSequenceRequest().send(); - Assert.assertEquals(2, dependentCall2.join().getN()); + Assert.assertEquals(2, this.context.runUntil(dependentCall2).join().getN()); Assert.assertEquals(1, calleeCallCount.value()); } @@ -482,26 +491,26 @@ public void testEmbargo() { var call0 = getCallSequence(pipeline, 0); var call1 = getCallSequence(pipeline, 1); - earlyCall.join(); + this.context.runUntil(earlyCall).join(); var call2 = getCallSequence(pipeline, 2); - var resolved = echo.join().getCap(); + var resolved = this.context.runUntil(echo).join().getCap(); var call3 = getCallSequence(pipeline, 3); var call4 = getCallSequence(pipeline, 4); var call5 = getCallSequence(pipeline, 5); - Assert.assertEquals(0, call0.join().getN()); - Assert.assertEquals(1, call1.join().getN()); - Assert.assertEquals(2, call2.join().getN()); - Assert.assertEquals(3, call3.join().getN()); - Assert.assertEquals(4, call4.join().getN()); - Assert.assertEquals(5, call5.join().getN()); + Assert.assertEquals(0, this.context.runUntil(call0).join().getN()); + Assert.assertEquals(1, this.context.runUntil(call1).join().getN()); + Assert.assertEquals(2, this.context.runUntil(call2).join().getN()); + Assert.assertEquals(3, this.context.runUntil(call3).join().getN()); + Assert.assertEquals(4, this.context.runUntil(call4).join().getN()); + Assert.assertEquals(5, this.context.runUntil(call5).join().getN()); } @org.junit.Test - public void testCallBrokenPromise() throws ExecutionException, InterruptedException { + public void testCallBrokenPromise() { var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); var paf = new CompletableFuture(); @@ -509,7 +518,7 @@ public void testCallBrokenPromise() throws ExecutionException, InterruptedExcept { var req = client.holdRequest(); req.getParams().setCap(paf); - req.send().join(); + this.context.runUntil(req.send()).join(); } AtomicBoolean returned = new AtomicBoolean(false); @@ -524,10 +533,11 @@ public void testCallBrokenPromise() throws ExecutionException, InterruptedExcept Assert.assertFalse(returned.get()); paf.completeExceptionally(new Exception("foo")); + this.context.runUntil(req); Assert.assertTrue(returned.get()); // Verify that we are still connected - getCallSequence(client, 1).get(); + this.context.runUntil(getCallSequence(client, 1)).join(); } @org.junit.Test @@ -581,24 +591,24 @@ public void testEmbargoUnwrap() { var call0 = getCallSequence(pipeline, 0); var call1 = getCallSequence(pipeline, 1); - earlyCall.join(); + this.context.runUntil(earlyCall).join(); var call2 = getCallSequence(pipeline, 2); - var resolved = echo.join().getCap(); + var resolved = this.context.runUntil(echo).join().getCap(); var call3 = getCallSequence(pipeline, 3); var call4 = getCallSequence(pipeline, 4); var call5 = getCallSequence(pipeline, 5); - Assert.assertEquals(0, call0.join().getN()); - Assert.assertEquals(1, call1.join().getN()); - Assert.assertEquals(2, call2.join().getN()); - Assert.assertEquals(3, call3.join().getN()); - Assert.assertEquals(4, call4.join().getN()); - Assert.assertEquals(5, call5.join().getN()); + Assert.assertEquals(0, this.context.runUntil(call0).join().getN()); + Assert.assertEquals(1, this.context.runUntil(call1).join().getN()); + Assert.assertEquals(2, this.context.runUntil(call2).join().getN()); + Assert.assertEquals(3, this.context.runUntil(call3).join().getN()); + Assert.assertEquals(4, this.context.runUntil(call4).join().getN()); + Assert.assertEquals(5, this.context.runUntil(call5).join().getN()); - int unwrappedAt = unwrap.join(); + int unwrappedAt = this.context.runUntil(unwrap).join(); Assert.assertTrue(unwrappedAt >= 0); } } diff --git a/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java b/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java index 03fad39f..2586e223 100644 --- a/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java @@ -7,39 +7,44 @@ import java.io.IOException; import java.nio.channels.AsynchronousByteChannel; +import java.nio.channels.AsynchronousChannelGroup; import java.nio.channels.AsynchronousServerSocketChannel; import java.nio.channels.AsynchronousSocketChannel; import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import java.util.function.Consumer; -@SuppressWarnings({"OverlyCoupledMethod", "OverlyLongMethod"}) public class TwoPartyTest { static final class PipeThread { Thread thread; - AsynchronousByteChannel channel; - - static PipeThread newPipeThread(Consumer startFunc) throws Exception { - var pipeThread = new PipeThread(); - var serverAcceptSocket = AsynchronousServerSocketChannel.open(); - serverAcceptSocket.bind(null); - var clientSocket = AsynchronousSocketChannel.open(); - - pipeThread.thread = new Thread(() -> { - try { - var serverSocket = serverAcceptSocket.accept().get(); - startFunc.accept(serverSocket); - } catch (InterruptedException | ExecutionException e) { - e.printStackTrace(); - } - }); - pipeThread.thread.start(); - pipeThread.thread.setName("TwoPartyTest server"); - - clientSocket.connect(serverAcceptSocket.getLocalAddress()).get(); - pipeThread.channel = clientSocket; - return pipeThread; - } + AsynchronousSocketChannel channel; + + } + + private AsynchronousChannelGroup group; + + PipeThread newPipeThread(Consumer startFunc) throws Exception { + var pipeThread = new PipeThread(); + var serverAcceptSocket = AsynchronousServerSocketChannel.open(this.group); + serverAcceptSocket.bind(null); + var clientSocket = AsynchronousSocketChannel.open(); + + pipeThread.thread = new Thread(() -> { + try { + var serverSocket = serverAcceptSocket.accept().get(); + startFunc.accept(serverSocket); + } catch (InterruptedException | ExecutionException exc) { + exc.printStackTrace(); + } + }); + pipeThread.thread.start(); + pipeThread.thread.setName("TwoPartyTest server"); + + clientSocket.connect(serverAcceptSocket.getLocalAddress()).get(); + pipeThread.channel = clientSocket; + return pipeThread; } PipeThread runServer(Capability.Server bootstrapInterface) throws Exception { @@ -47,19 +52,22 @@ PipeThread runServer(Capability.Server bootstrapInterface) throws Exception { } PipeThread runServer(Capability.Client bootstrapInterface) throws Exception { - return PipeThread.newPipeThread(channel -> { + return newPipeThread(channel -> { var network = new TwoPartyVatNetwork(channel, RpcTwoPartyProtocol.Side.SERVER); var system = new RpcSystem<>(network, bootstrapInterface); + system.start(); network.onDisconnect().join(); }); } @Before - public void setUp() { + public void setUp() throws IOException { + this.group = AsynchronousChannelGroup.withThreadPool(Executors.newFixedThreadPool(5)); } @After public void tearDown() { + this.group.shutdown(); } @org.junit.Test @@ -68,7 +76,7 @@ public void testNullCap() throws Exception { var rpcClient = new TwoPartyClient(pipe.channel); var client = rpcClient.bootstrap(); var resolved = client.whenResolved(); - resolved.get(); + rpcClient.runUntil(resolved).join(); } @org.junit.Test @@ -93,11 +101,11 @@ public void testBasic() throws Exception { .thenAccept(results -> Assert.fail("Expected bar() to fail")) .exceptionally(exc -> null); - var response1 = promise1.join(); + var response1 = rpcClient.runUntil(promise1).join(); Assert.assertEquals("foo", response1.getX().toString()); - promise2.join(); - promise3.join(); + rpcClient.runUntil(promise2).join(); + rpcClient.runUntil(promise3).join(); Assert.assertEquals(2, callCount.value()); } @@ -136,10 +144,10 @@ public void testPipelining() throws Exception { //Assert.assertEquals(0, chainedCallCount.value()); - var response = pipelinePromise.join(); + var response = rpcClient.runUntil(pipelinePromise).join(); Assert.assertEquals("bar", response.getX().toString()); - var response2 = pipelinePromise2.join(); + var response2 = rpcClient.runUntil(pipelinePromise2).join(); RpcTestUtil.checkTestMessage(response2); Assert.assertEquals(1, chainedCallCount.value()); @@ -147,7 +155,7 @@ public void testPipelining() throws Exception { // disconnect the client ((AsynchronousSocketChannel)pipe.channel).shutdownOutput(); - rpcClient.onDisconnect().join(); + rpcClient.runUntil(rpcClient.onDisconnect()).join(); { // Use the now-broken capability. From 3b642d03557c1dee357cd5743d636eaa893d6e84 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 23 Nov 2020 21:04:09 +0000 Subject: [PATCH 163/246] add a delay to testTailCall --- runtime-rpc/src/test/java/org/capnproto/RpcTest.java | 8 +++++++- runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index a8aa9879..97510754 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -446,16 +446,18 @@ public void testPromiseResolve() { @org.junit.Test public void testTailCall() { + var releaseMe = new CompletableFuture(); var caller = new Test.TestTailCaller.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_TAIL_CALLER)); var calleeCallCount = new Counter(); - var callee = new Test.TestTailCallee.Client(new RpcTestUtil.TestTailCalleeImpl(calleeCallCount)); + var callee = new Test.TestTailCallee.Client(new RpcTestUtil.TestTailCalleeImpl(calleeCallCount, releaseMe)); var request = caller.fooRequest(); request.getParams().setI(456); request.getParams().setCallee(callee); var promise = request.send(); var dependentCall0 = promise.getC().getCallSequenceRequest().send(); + releaseMe.complete(null); var response = this.context.runUntil(promise).join(); Assert.assertEquals(456, response.getI()); @@ -467,6 +469,10 @@ public void testTailCall() { var dependentCall2 = response.getC().getCallSequenceRequest().send(); Assert.assertEquals(2, this.context.runUntil(dependentCall2).join().getN()); Assert.assertEquals(1, calleeCallCount.value()); + + // The imported cap has resolved locally, and can be called directly + Assert.assertEquals(3, promise.getC().getCallSequenceRequest().send().join().getN()); + Assert.assertEquals(4, promise.getC().getCallSequenceRequest().send().join().getN()); } static CompletableFuture getCallSequence( diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java index c6c016cc..319037e4 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java @@ -225,9 +225,14 @@ protected CompletableFuture neverReturn(CallContext releaseMe; public TestTailCalleeImpl(Counter count) { + this(count, READY_NOW); + } + public TestTailCalleeImpl(Counter count, CompletableFuture releaseMe) { this.count = count; + this.releaseMe = releaseMe; } @Override @@ -240,7 +245,7 @@ protected CompletableFuture foo(CallContext Date: Tue, 24 Nov 2020 15:37:28 +0000 Subject: [PATCH 164/246] add default getBrand to RequestHook --- runtime/src/main/java/org/capnproto/Request.java | 11 +++-------- runtime/src/main/java/org/capnproto/RequestHook.java | 7 ++++++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index 854c0082..29988a15 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -6,6 +6,8 @@ public interface Request { FromPointerBuilder getParamsFactory(); + Request getTypelessRequest(); + default Params getParams() { return this.getTypelessRequest().getParams().getAs(this.getParamsFactory()); } @@ -14,7 +16,6 @@ default RequestHook getHook() { return this.getTypelessRequest().getHook(); } - Request getTypelessRequest(); default RemotePromise sendInternal() { return this.getTypelessRequest().sendInternal(); @@ -23,7 +24,7 @@ default RemotePromise sendInternal() { static Request newBrokenRequest(FromPointerBuilder paramsFactory, Throwable exc) { - final MessageBuilder message = new MessageBuilder(); + var message = new MessageBuilder(); var hook = new RequestHook() { @Override @@ -36,14 +37,8 @@ public RemotePromise send() { public CompletableFuture sendStreaming() { return CompletableFuture.failedFuture(exc); } - - @Override - public Object getBrand() { - return null; - } }; - var root = message.getRoot(AnyPointer.factory); return new Request<>() { @Override public FromPointerBuilder getParamsFactory() { diff --git a/runtime/src/main/java/org/capnproto/RequestHook.java b/runtime/src/main/java/org/capnproto/RequestHook.java index 8bdf9c46..7e90f3ea 100644 --- a/runtime/src/main/java/org/capnproto/RequestHook.java +++ b/runtime/src/main/java/org/capnproto/RequestHook.java @@ -3,7 +3,12 @@ import java.util.concurrent.CompletionStage; public interface RequestHook { + RemotePromise send(); + CompletionStage sendStreaming(); - Object getBrand(); + + default Object getBrand() { + return null; + } } From 5a27b4b860c56867d3c040fbb0787096d5d76e6e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 24 Nov 2020 15:38:07 +0000 Subject: [PATCH 165/246] tidy up Builder refs in AnyPointer.Pipeline --- .../main/java/org/capnproto/AnyPointer.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 0526237d..838207f9 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -90,7 +90,6 @@ public final ClientHook getPipelinedCap(PipelineOp[] ops) { case GET_POINTER_FIELD: var index = op.pointerIndex; var reader = WireHelpers.readStructPointer(any.segment, any.capTable, any.pointer, null, 0, any.nestingLimit); - // TODO getpointerfield any = reader._getPointerField(AnyPointer.factory, op.pointerIndex); break; } @@ -148,10 +147,11 @@ public final void clear() { } } - public static class Pipeline implements org.capnproto.Pipeline { + public static final class Pipeline + implements org.capnproto.Pipeline { - protected final PipelineHook hook; - protected final PipelineOp[] ops; + final PipelineHook hook; + private final PipelineOp[] ops; public Pipeline(PipelineHook hook) { this(hook, new PipelineOp[0]); @@ -182,9 +182,7 @@ public ClientHook asCap() { public Pipeline getPointerField(short pointerIndex) { var newOps = new PipelineOp[this.ops.length + 1]; - for (int ii = 0; ii < this.ops.length; ++ii) { - newOps[ii] = this.ops[ii]; - } + System.arraycopy(this.ops, 0, newOps, 0, this.ops.length); newOps[this.ops.length] = PipelineOp.PointerField(pointerIndex); return new Pipeline(this.hook, newOps); } @@ -193,16 +191,16 @@ public Pipeline getPointerField(short pointerIndex) { public static final class Request implements org.capnproto.Request { - private final AnyPointer.Builder params; + private final Builder params; private final RequestHook requestHook; - Request(AnyPointer.Builder params, RequestHook requestHook) { + Request(Builder params, RequestHook requestHook) { this.params = params; this.requestHook = requestHook; } @Override - public AnyPointer.Builder getParams() { + public Builder getParams() { return this.params; } @@ -227,7 +225,7 @@ public RemotePromise sendInternal() { } public RemotePromise send() { - return this.getHook().send(); + return this.requestHook.send(); } } } From 594e5e3a284451c32f77ac322e9ceed06050927e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 24 Nov 2020 17:48:08 +0000 Subject: [PATCH 166/246] reduce visibility of cap contexts --- runtime/src/main/java/org/capnproto/Capability.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 7b85d265..ebe89164 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -6,11 +6,11 @@ public final class Capability { - public static abstract class BuilderContext { + static class BuilderContext { CapTableBuilder capTable; } - public static class ReaderContext { + static class ReaderContext { CapTableReader capTable; } From fb5f1bf2ba8a5601940ef59ad0448b7a6fc66bae Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 24 Nov 2020 15:23:37 +0000 Subject: [PATCH 167/246] cleanup import lifecycle --- .../src/main/java/org/capnproto/RpcState.java | 124 +++++++++++------- .../src/test/java/org/capnproto/RpcTest.java | 12 +- 2 files changed, 89 insertions(+), 47 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 220d5599..17533741 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -161,9 +161,10 @@ static final class Export { final class Import { final int importId; - ImportRef importClient; + ImportDisposer disposer; + Integer fd; int remoteRefCount; - WeakReference appClient; + RpcClient appClient; CompletableFuture promise; // If non-null, the import is a promise. @@ -175,6 +176,12 @@ void addRemoteRef() { this.remoteRefCount++; } + void setFdIfMissing(Integer fd) { + if (this.fd == null) { + this.fd = fd; + } + } + public void dispose() { // Remove self from the import table. var imp = imports.find(importId); @@ -246,7 +253,7 @@ Embargo newExportable(int id) { private final CompletableFuture messageLoop = new CompletableFuture<>(); // completes when the message loop exits private final ReferenceQueue questionRefs = new ReferenceQueue<>(); - private final ReferenceQueue importRefs = new ReferenceQueue<>(); + private final ReferenceQueue importRefs = new ReferenceQueue<>(); private final Queue> lastEvals = new ArrayDeque<>(); RpcState(BootstrapFactory bootstrapFactory, @@ -763,7 +770,7 @@ private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reade } if (imp.promise == null) { - assert imp.importClient == null : "Import already resolved."; + assert imp.disposer != null: "Import already resolved."; // It appears this is a valid entry on the import table, but was not expected to be a // promise. return; @@ -1087,36 +1094,45 @@ else if (exp.clientHook.getBrand() == this) { private ClientHook importCap(int importId, boolean isPromise, Integer fd) { // Receive a new import. + var imp = imports.put(importId); - ImportClient importClient = null; - if (imp.importClient != null) { - importClient = imp.importClient.get(); - } - if (importClient == null) { - importClient = new ImportClient(imp, fd); - imp.importClient = new ImportRef(importId, importClient); + + ImportClient importClient; + + // new import + if (imp.disposer == null) { + var importRef = new ImportRef(importId); + imp.disposer = new ImportDisposer(importRef); + importClient = new ImportClient(importRef); } else { - importClient.setFdIfMissing(fd); + var importRef = imp.disposer.get(); + if (importRef == null) { + // Import still exists, but has no references. Resurrect it. + importRef = new ImportRef(importId); + imp.disposer = new ImportDisposer(importRef); + importClient = new ImportClient(importRef); + } + else { + importClient = new ImportClient(importRef); + } } + + imp.setFdIfMissing(fd); imp.addRemoteRef(); if (!isPromise) { - imp.appClient = new WeakReference<>(importClient); return importClient; } if (imp.appClient != null) { - var tmp = imp.appClient.get(); - if (tmp != null) { - return tmp; - } + return imp.appClient; } imp.promise = new CompletableFuture<>(); - var result = new PromiseClient(importClient, imp.promise, importId); - imp.appClient = new WeakReference<>(result); + var result = new PromiseClient(importClient, imp.promise, importClient.importRef); + imp.appClient = result; return result; } @@ -1736,41 +1752,49 @@ TailInfo tailSend() { } } - private class ImportRef extends WeakReference { + private class ImportDisposer extends WeakReference { + + private final int importId; + + ImportDisposer(ImportRef importRef) { + super(importRef, importRefs); + this.importId = importRef.importId; + } + + void dispose() { + var imp = imports.find(this.importId); + if (imp != null) { + imp.dispose(); + } + } + } + + private static class ImportRef { final int importId; - ImportRef(int importId, ImportClient hook) { - super(hook, importRefs); + ImportRef(int importId) { this.importId = importId; } } private class ImportClient extends RpcClient { - final Import imp; - Integer fd; - - ImportClient(Import imp, Integer fd) { - this.imp = imp; - this.fd = fd; - } + private final ImportRef importRef; - void setFdIfMissing(Integer fd) { - if (this.fd == null) { - this.fd = fd; - } + ImportClient(ImportRef importRef) { + this.importRef = importRef; } @Override public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { - descriptor.setReceiverHosted(this.imp.importId); + descriptor.setReceiverHosted(this.importRef.importId); return null; } @Override public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { - target.setImportedCap(this.imp.importId); + target.setImportedCap(this.importRef.importId); return null; } @@ -1778,19 +1802,21 @@ public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { public CompletableFuture whenMoreResolved() { return null; } + + @Override + public Integer getFd() { + var imp = imports.find(this.importRef.importId); + return imp != null ? imp.fd : null; + } } private void cleanupImports() { while (true) { - var ref = (ImportRef)this.importRefs.poll(); - if (ref == null) { + var disposer = (ImportDisposer)this.importRefs.poll(); + if (disposer == null) { return; } - var imp = this.imports.find(ref.importId); - assert imp != null; - if (imp != null) { - imp.dispose(); - } + disposer.dispose(); } } @@ -1815,20 +1841,28 @@ enum ResolutionType { private class PromiseClient extends RpcClient { private ClientHook cap; - private final Integer importId; + private final ImportRef importRef; private boolean receivedCall = false; private ResolutionType resolutionType = ResolutionType.UNRESOLVED; private final CompletableFuture eventual; PromiseClient(RpcClient initial, CompletableFuture eventual, - Integer importId) { + ImportRef importRef) { this.cap = initial; - this.importId = importId; + this.importRef = importRef; this.eventual = eventual.handle((resolution, exc) -> { this.cap = exc == null ? this.resolve(resolution) : this.resolve(Capability.newBrokenCap(exc)); + + if (this.importRef != null) { + var imp = imports.find(this.importRef.importId); + if (imp != null && imp.appClient == this) { + imp.appClient = null; + } + } + return this.cap; }); } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 97510754..c0541192 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -25,6 +25,7 @@ import org.junit.Assert; +import java.lang.ref.WeakReference; import java.util.ArrayDeque; import java.util.HashMap; import java.util.Map; @@ -402,11 +403,18 @@ public void testRelease() { var promise = client.getHandleRequest().send(); var handle2 = this.context.runUntil(promise).join().getHandle(); + var handleRef1 = new WeakReference<>(handle1); + var handleRef2 = new WeakReference<>(handle2); + + promise = null; handle1 = null; handle2 = null; - System.gc(); - this.context.runUntil(client.echoRequest().send()).join(); + // TODO monitor the imported caps for release? close? + while (handleRef1.get() != null && handleRef2.get() != null) { + System.gc(); + this.context.runUntil(client.echoRequest().send()).join(); + } } @org.junit.Test From 2d072a6b12fb1e892914343eafaa9283980a7929 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 25 Nov 2020 15:47:02 +0000 Subject: [PATCH 168/246] implement streaming requests --- compiler/src/main/cpp/capnpc-java.c++ | 5 +- .../src/main/java/org/capnproto/RpcState.java | 4 +- .../java/org/capnproto/CapabilityTest.java | 14 +++++- .../test/java/org/capnproto/RpcTestUtil.java | 44 +++++++++++++++-- runtime-rpc/src/test/schema/test.capnp | 7 +++ .../main/java/org/capnproto/AnyPointer.java | 47 +++++++++++++++++++ .../main/java/org/capnproto/Capability.java | 42 +++++++++++++---- .../src/main/java/org/capnproto/Request.java | 34 ++++++++------ .../main/java/org/capnproto/RequestBase.java | 20 ++++++++ .../main/java/org/capnproto/RequestHook.java | 4 +- .../org/capnproto/StreamingCallContext.java | 16 +++++-- .../java/org/capnproto/StreamingRequest.java | 27 +++++------ 12 files changed, 208 insertions(+), 56 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/RequestBase.java diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 76ffe257..49bc4a9d 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -2027,9 +2027,6 @@ private: kj::strTree( sp, " public static final class ", methodName, " {\n", sp, " public interface Request extends org.capnproto.Request<", paramBuilder, "> {\n", - sp, " default org.capnproto.FromPointerBuilder<", paramBuilder, "> getParamsFactory() {\n", - sp, " return ", paramFactory, ";\n", - sp, " }\n", sp, " default Response send() {\n", sp, " return new Response(this.sendInternal());\n", sp, " }\n", @@ -2050,7 +2047,7 @@ private: // client call kj::strTree( sp, "public Methods.", methodName, ".Request ", methodName, "Request() {\n", - sp, " var result = newCall(0x", interfaceIdHex, "L, (short)", methodId, ");\n", + sp, " var result = newCall(", paramFactory, ", 0x", interfaceIdHex, "L, (short)", methodId, ");\n", sp, " return () -> result;\n", sp, "}\n" ), diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 17533741..852c3cd8 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1698,9 +1698,9 @@ public RemotePromise send() { } @Override - public CompletionStage sendStreaming() { + public CompletableFuture sendStreaming() { // TODO falling back to regular send for now... - return send(); + return send().thenApply(results -> null); } QuestionRef sendInternal(boolean isTailCall) { diff --git a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java index 23e005f6..4843392c 100644 --- a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java @@ -215,8 +215,6 @@ public void testGenerics() { var factory = Test.TestGenerics.newFactory(Test.TestAllTypes.factory, AnyPointer.factory); } - - @org.junit.Test public void thisCap() { var callCount = new Counter(); @@ -234,4 +232,16 @@ public void thisCap() { client2.barRequest().send().join(); Assert.assertEquals(3, callCount.value()); } + + @org.junit.Test + public void testStreamingCallsBlockSubsequentCalls() { + var server = new RpcTestUtil.TestStreamingImpl(); + var cap = new Test.TestStreaming.Client(server); + + { + var req = cap.doStreamIRequest(); + } + + + } } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java index 319037e4..1de666f0 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java @@ -114,7 +114,7 @@ public TestMoreStuffImpl(Counter callCount, Counter handleCount) { this.callCount = callCount; this.handleCount = handleCount; } - + @Override protected CompletableFuture echo(CallContext context) { this.callCount.inc(); @@ -129,9 +129,9 @@ protected CompletableFuture expectCancel(CallContext().whenComplete((void_, exc) -> { - if (exc != null) { - System.out.println("expectCancel completed exceptionally: " + exc.getMessage()); - } + if (exc != null) { + System.out.println("expectCancel completed exceptionally: " + exc.getMessage()); + } }); // never completes, just await doom... } @@ -230,6 +230,7 @@ static class TestTailCalleeImpl extends Test.TestTailCallee.Server { public TestTailCalleeImpl(Counter count) { this(count, READY_NOW); } + public TestTailCalleeImpl(Counter count, CompletableFuture releaseMe) { this.count = count; this.releaseMe = releaseMe; @@ -328,5 +329,40 @@ protected CompletableFuture foo(CallContext fulfiller; + boolean jShouldThrow = false; + + @Override + protected CompletableFuture doStreamI(StreamingCallContext context) { + iSum += context.getParams().getI(); + fulfiller = new CompletableFuture<>(); + return fulfiller; + } + + @Override + protected CompletableFuture doStreamJ(StreamingCallContext context) { + context.allowCancellation(); + jSum += context.getParams().getJ(); + if (jShouldThrow) { + return CompletableFuture.failedFuture(RpcException.failed("throw requested")); + } + fulfiller = new CompletableFuture<>(); + return fulfiller; + } + + @Override + protected CompletableFuture finishStream(CallContext context) { + var results = context.getResults(); + results.setTotalI(iSum); + results.setTotalJ(jSum); + return READY_NOW; + } + } } diff --git a/runtime-rpc/src/test/schema/test.capnp b/runtime-rpc/src/test/schema/test.capnp index fff9a0cf..8c6c8e2e 100644 --- a/runtime-rpc/src/test/schema/test.capnp +++ b/runtime-rpc/src/test/schema/test.capnp @@ -95,6 +95,13 @@ interface TestTailCaller { foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult; } +interface TestStreaming { + doStreamI @0 (i: UInt32) -> stream; + doStreamJ @1 (j: UInt32) -> stream; + finishStream @2 () -> (totalI :UInt32, totalJ: UInt32); + # Test streaming. finishStream() returns the totals of the values streamed to the other calls. +} + interface TestHandle {} interface TestMoreStuff extends(TestCallOrder) { diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 838207f9..5fba51d0 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -21,6 +21,8 @@ package org.capnproto; +import java.util.concurrent.CompletableFuture; + public final class AnyPointer { public static final class Factory implements PointerFactory, @@ -209,6 +211,11 @@ public org.capnproto.Request getTypelessRequest() { return this; } + @Override + public org.capnproto.Request getBaseRequest() { + return this; + } + @Override public RequestHook getHook() { return this.requestHook; @@ -228,4 +235,44 @@ public RemotePromise send() { return this.requestHook.send(); } } + + public static final class StreamingRequest + implements org.capnproto.StreamingRequest { + + private final Builder params; + private final RequestHook requestHook; + + StreamingRequest(AnyPointer.Request request) { + this(request.params, request.requestHook); + } + + StreamingRequest(Builder params, RequestHook requestHook) { + this.params = params; + this.requestHook = requestHook; + } + + @Override + public Builder getParams() { + return this.params; + } + + @Override + public org.capnproto.StreamingRequest getTypelessRequest() { + return this; + } + + @Override + public RequestHook getHook() { + return this.requestHook; + } + + @Override + public FromPointerBuilder getParamsFactory() { + return AnyPointer.factory; + } + + public CompletableFuture send() { + return this.requestHook.sendStreaming(); + } + } } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index ebe89164..8c720fc1 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -87,14 +87,40 @@ default CompletableFuture getFd() { return CompletableFuture.completedFuture(null); } - default Request newCall(long interfaceId, short methodId) { - return this.getHook().newCall(interfaceId, methodId); + default Request newCall(FromPointerBuilder paramsFactory, long interfaceId, short methodId) { + var request = this.getHook().newCall(interfaceId, methodId); + return new Request<>() { + @Override + public FromPointerBuilder getParamsFactory() { + return paramsFactory; + } + + @Override + public Request getTypelessRequest() { + return request; + } + + @Override + public Request getBaseRequest() { + return this; + } + }; } - default StreamingRequest newStreamingCall(FromPointerBuilder paramsBuilder, - long interfaceId, short methodId) { - var request = getHook().newCall(interfaceId, methodId); - return new StreamingRequest<> (paramsBuilder, request.getParams(), request.getHook()); + default StreamingRequest newStreamingCall(FromPointerBuilder paramsFactory, long interfaceId, short methodId) { + var request = this.getHook().newCall(interfaceId, methodId); + var streamingRequest = new AnyPointer.StreamingRequest(request.getParams(), request.getHook()); + return new StreamingRequest<>() { + @Override + public FromPointerBuilder getParamsFactory() { + return paramsFactory; + } + + @Override + public StreamingRequest getTypelessRequest() { + return streamingRequest; + } + }; } } @@ -377,10 +403,10 @@ public RemotePromise send() { } @Override - public CompletableFuture sendStreaming() { + public CompletableFuture sendStreaming() { // We don't do any special handling of streaming in RequestHook for local requests, because // there is no latency to compensate for between the client and server in this case. - return send(); + return send().thenApply(results -> null); } @Override diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index 29988a15..5e24a826 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -2,23 +2,17 @@ import java.util.concurrent.CompletableFuture; -public interface Request { +public interface Request + extends RequestBase { - FromPointerBuilder getParamsFactory(); + RequestBase getBaseRequest(); - Request getTypelessRequest(); - - default Params getParams() { - return this.getTypelessRequest().getParams().getAs(this.getParamsFactory()); - } - - default RequestHook getHook() { - return this.getTypelessRequest().getHook(); + default FromPointerBuilder getParamsFactory() { + return getBaseRequest().getParamsFactory(); } - - default RemotePromise sendInternal() { - return this.getTypelessRequest().sendInternal(); + default RequestBase getTypelessRequest() { + return getBaseRequest().getTypelessRequest(); } static Request newBrokenRequest(FromPointerBuilder paramsFactory, @@ -34,7 +28,7 @@ public RemotePromise send() { } @Override - public CompletableFuture sendStreaming() { + public CompletableFuture sendStreaming() { return CompletableFuture.failedFuture(exc); } }; @@ -46,9 +40,14 @@ public FromPointerBuilder getParamsFactory() { } @Override - public Request getTypelessRequest() { + public RequestBase getTypelessRequest() { return new AnyPointer.Request(message.getRoot(AnyPointer.factory), hook); } + + @Override + public Request getBaseRequest() { + return this; + } }; } @@ -65,6 +64,11 @@ public FromPointerBuilder getParamsFactory() { public Request getTypelessRequest() { return typeless; } + + @Override + public Request getBaseRequest() { + return this; + } }; } } diff --git a/runtime/src/main/java/org/capnproto/RequestBase.java b/runtime/src/main/java/org/capnproto/RequestBase.java new file mode 100644 index 00000000..fb3b5f50 --- /dev/null +++ b/runtime/src/main/java/org/capnproto/RequestBase.java @@ -0,0 +1,20 @@ +package org.capnproto; + +public interface RequestBase { + + FromPointerBuilder getParamsFactory(); + + RequestBase getTypelessRequest(); + + default Params getParams() { + return this.getTypelessRequest().getParams().getAs(this.getParamsFactory()); + } + + default RequestHook getHook() { + return this.getTypelessRequest().getHook(); + } + + default RemotePromise sendInternal() { + return this.getTypelessRequest().sendInternal(); + } +} diff --git a/runtime/src/main/java/org/capnproto/RequestHook.java b/runtime/src/main/java/org/capnproto/RequestHook.java index 7e90f3ea..08607a4a 100644 --- a/runtime/src/main/java/org/capnproto/RequestHook.java +++ b/runtime/src/main/java/org/capnproto/RequestHook.java @@ -1,12 +1,12 @@ package org.capnproto; -import java.util.concurrent.CompletionStage; +import java.util.concurrent.CompletableFuture; public interface RequestHook { RemotePromise send(); - CompletionStage sendStreaming(); + CompletableFuture sendStreaming(); default Object getBrand() { return null; diff --git a/runtime/src/main/java/org/capnproto/StreamingCallContext.java b/runtime/src/main/java/org/capnproto/StreamingCallContext.java index 750d8dc3..a4128c01 100644 --- a/runtime/src/main/java/org/capnproto/StreamingCallContext.java +++ b/runtime/src/main/java/org/capnproto/StreamingCallContext.java @@ -2,12 +2,20 @@ public class StreamingCallContext { - private final FromPointerReader params; - final CallContextHook hook; + private final FromPointerReader paramsFactory; + private final CallContextHook hook; - public StreamingCallContext(FromPointerReader params, + public StreamingCallContext(FromPointerReader paramsFactory, CallContextHook hook) { - this.params = params; + this.paramsFactory = paramsFactory; this.hook = hook; } + + public final Params getParams() { + return this.hook.getParams().getAs(paramsFactory); + } + + public final void allowCancellation() { + this.hook.allowCancellation(); + } } diff --git a/runtime/src/main/java/org/capnproto/StreamingRequest.java b/runtime/src/main/java/org/capnproto/StreamingRequest.java index a66182b0..1cf63857 100644 --- a/runtime/src/main/java/org/capnproto/StreamingRequest.java +++ b/runtime/src/main/java/org/capnproto/StreamingRequest.java @@ -1,26 +1,23 @@ package org.capnproto; - import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; -public class StreamingRequest { +public interface StreamingRequest { + + FromPointerBuilder getParamsFactory(); - private final FromPointerBuilder paramsBuilder; - AnyPointer.Builder params; - RequestHook hook; + StreamingRequest getTypelessRequest(); + + default Params getParams() { + return this.getTypelessRequest().getParams().getAs(this.getParamsFactory()); + } - StreamingRequest(FromPointerBuilder paramsBuilder, - AnyPointer.Builder params, RequestHook hook) { - this.paramsBuilder = paramsBuilder; - this.params = params; - this.hook = hook; + default RequestHook getHook() { + return this.getTypelessRequest().getHook(); } - CompletionStage send() { - var promise = hook.sendStreaming(); - hook = null; // prevent reuse - return promise; + default CompletableFuture send() { + return this.getHook().sendStreaming(); } } From 941a254e41d3a98c18f3b34f0f24b685416541fb Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 25 Nov 2020 15:53:25 +0000 Subject: [PATCH 169/246] by default, streaming calls fal back to regular calls --- .../src/main/java/org/capnproto/RpcState.java | 6 ------ .../src/main/java/org/capnproto/Capability.java | 15 ++++----------- .../src/main/java/org/capnproto/RequestHook.java | 4 +++- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 852c3cd8..2e8a824b 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1697,12 +1697,6 @@ public RemotePromise send() { return new RemotePromise<>(appPromise, new AnyPointer.Pipeline(pipeline)); } - @Override - public CompletableFuture sendStreaming() { - // TODO falling back to regular send for now... - return send().thenApply(results -> null); - } - QuestionRef sendInternal(boolean isTailCall) { // TODO refactor var fds = List.of(); diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 8c720fc1..181e89e0 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -371,10 +371,10 @@ public static PipelineHook newLocalPromisePipeline(CompletionStage private static class LocalRequest implements RequestHook { - final MessageBuilder message = new MessageBuilder(); - final long interfaceId; - final short methodId; - final ClientHook client; + private final MessageBuilder message = new MessageBuilder(); + private final long interfaceId; + private final short methodId; + private final ClientHook client; private final CompletableFuture callRelease = new CompletableFuture<>(); LocalRequest(long interfaceId, short methodId, ClientHook client) { @@ -402,13 +402,6 @@ public RemotePromise send() { return new RemotePromise<>(promise, new AnyPointer.Pipeline(promiseAndPipeline.pipeline)); } - @Override - public CompletableFuture sendStreaming() { - // We don't do any special handling of streaming in RequestHook for local requests, because - // there is no latency to compensate for between the client and server in this case. - return send().thenApply(results -> null); - } - @Override public Object getBrand() { return null; diff --git a/runtime/src/main/java/org/capnproto/RequestHook.java b/runtime/src/main/java/org/capnproto/RequestHook.java index 08607a4a..9cd1a41e 100644 --- a/runtime/src/main/java/org/capnproto/RequestHook.java +++ b/runtime/src/main/java/org/capnproto/RequestHook.java @@ -6,7 +6,9 @@ public interface RequestHook { RemotePromise send(); - CompletableFuture sendStreaming(); + default CompletableFuture sendStreaming() { + return this.send().thenApply(results -> null); + } default Object getBrand() { return null; From 07f8f22acde4067752d40f6fbe54b8908229b3d0 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 25 Nov 2020 17:21:47 +0000 Subject: [PATCH 170/246] implement call blocking stack --- .../java/org/capnproto/CapabilityTest.java | 47 +++++++++++++ .../main/java/org/capnproto/Capability.java | 69 +++++++++++++++---- .../org/capnproto/DispatchCallResult.java | 6 +- 3 files changed, 102 insertions(+), 20 deletions(-) diff --git a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java index 4843392c..7354a106 100644 --- a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java @@ -238,10 +238,57 @@ public void testStreamingCallsBlockSubsequentCalls() { var server = new RpcTestUtil.TestStreamingImpl(); var cap = new Test.TestStreaming.Client(server); + CompletableFuture promise1 = null; + CompletableFuture promise2 = null; + CompletableFuture promise3 = null; + + { + var req = cap.doStreamIRequest(); + req.getParams().setI(123); + promise1 = req.send(); + } + + { + var req = cap.doStreamJRequest(); + req.getParams().setJ(321); + promise2 = req.send(); + } + { var req = cap.doStreamIRequest(); + req.getParams().setI(456); + promise3 = req.send(); } + var promise4 = cap.finishStreamRequest().send(); + + // Only the first streaming call has executed + Assert.assertEquals(123, server.iSum); + Assert.assertEquals(0, server.jSum); + + // Complete first streaming call + Assert.assertNotNull(server.fulfiller); + server.fulfiller.complete(null); + + // second streaming call unblocked + Assert.assertEquals(123, server.iSum); + Assert.assertEquals(321, server.jSum); + + // complete second streaming call + Assert.assertNotNull(server.fulfiller); + server.fulfiller.complete(null); + + // third streaming call unblocked + Assert.assertEquals(579, server.iSum); + Assert.assertEquals(321, server.jSum); + + // complete third streaming call + Assert.assertNotNull(server.fulfiller); + server.fulfiller.complete(null); + // last call is unblocked + var result = promise4.join(); + Assert.assertEquals(579, result.getTotalI()); + Assert.assertEquals(321, result.getTotalJ()); } } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 181e89e0..71bcbd17 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -177,9 +177,12 @@ ClientHook makeLocalClient(CapabilityServerSetBase capServerSet) { } private final class LocalClient implements ClientHook { + private CompletableFuture resolveTask; private ClientHook resolved; private boolean blocked = false; + private Throwable brokenException; + private final Queue blockedCalls = new ArrayDeque<>(); private final CapabilityServerSetBase capServerSet; LocalClient() { @@ -206,12 +209,6 @@ public Request newCall(long interfaceId, short methodId) { @Override public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { - assert !blocked: "Blocked condition not implemented"; - if (blocked) { - // TODO implement blocked behaviour - return null; - } - // Note this comment from the C++ source: // // "We don't want to actually dispatch the call synchronously, because we don't want the callee @@ -225,12 +222,27 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext // // As the Java implementation doesn't (currently) have an evalLater() call, we obtain a promise // from the CallContextHook that will be completed by QueuedClient when appropriate. - var promise = ctx.releaseCall().thenCompose( - void_ -> this.callInternal(interfaceId, methodId, ctx)); + var promise = ctx.releaseCall().thenCompose(void_ -> { + if (blocked) { + var blockedCall = new CompletableFuture(); + this.blockedCalls.add(() -> callInternal(interfaceId, methodId, ctx).whenComplete((result, exc) -> { + if (exc == null) { + blockedCall.complete(result); + } + else { + blockedCall.completeExceptionally(exc); + } + })); + return blockedCall; + } + else { + return this.callInternal(interfaceId, methodId, ctx); + } + }); var pipelinePromise = promise.thenApply(x -> { ctx.releaseParams(); - return (PipelineHook)new LocalPipeline(ctx); + return (PipelineHook) new LocalPipeline(ctx); }); var tailCall = ctx.onTailCall().thenApply(pipeline -> pipeline.hook); @@ -264,31 +276,58 @@ public Object getBrand() { return BRAND; } + void unblock() { + this.blocked = false; + while (!this.blocked) { + if (this.blockedCalls.isEmpty()) { + break; + } + var call = this.blockedCalls.remove(); + call.run(); + } + } + CompletableFuture callInternal(long interfaceId, short methodId, CallContextHook ctx) { + assert !this.blocked; + + if (this.brokenException != null) { + return CompletableFuture.failedFuture(this.brokenException); + } + var result = dispatchCall( interfaceId, methodId, new CallContext<>(AnyPointer.factory, AnyPointer.factory, ctx)); - if (result.isStreaming()) { - // TODO streaming - return null; + if (!result.isStreaming()) { + return result.promise; } else { - return result.getPromise(); + this.blocked = true; + return result.promise.exceptionallyCompose(exc -> { + this.brokenException = exc; + return CompletableFuture.failedFuture(exc); + }).whenComplete((void_, exc) -> { + this.unblock(); + }); } } public CompletableFuture getLocalServer(CapabilityServerSetBase capServerSet) { if (this.capServerSet == capServerSet) { if (this.blocked) { - assert false: "Blocked local server not implemented"; + var promise = new CompletableFuture(); + this.blockedCalls.add(() -> promise.complete(Server.this)); + return promise; } - return CompletableFuture.completedFuture(Server.this); } return null; } } + public Integer getFd() { + return null; + } + /** * If this returns non-null, then it is a promise which, when resolved, points to a new * capability to which future calls can be sent. Use this in cases where an object implementation diff --git a/runtime/src/main/java/org/capnproto/DispatchCallResult.java b/runtime/src/main/java/org/capnproto/DispatchCallResult.java index 536a2a07..1c7c86cb 100644 --- a/runtime/src/main/java/org/capnproto/DispatchCallResult.java +++ b/runtime/src/main/java/org/capnproto/DispatchCallResult.java @@ -4,7 +4,7 @@ public final class DispatchCallResult { - private final CompletableFuture promise; + final CompletableFuture promise; private final boolean streaming; public DispatchCallResult(CompletableFuture promise, boolean isStreaming) { @@ -16,10 +16,6 @@ public DispatchCallResult(Throwable exc) { this(CompletableFuture.failedFuture(exc), false); } - public CompletableFuture getPromise() { - return promise.copy(); - } - public boolean isStreaming() { return streaming; } From de85613570272dd72fcd8c98d115023ae3971326 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 26 Nov 2020 13:07:28 +0000 Subject: [PATCH 171/246] consistent naming of factories --- .../main/java/org/capnproto/CallContext.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/CallContext.java b/runtime/src/main/java/org/capnproto/CallContext.java index 5f955d31..e27925fa 100644 --- a/runtime/src/main/java/org/capnproto/CallContext.java +++ b/runtime/src/main/java/org/capnproto/CallContext.java @@ -4,20 +4,20 @@ public final class CallContext { - private final FromPointerReader params; - private final FromPointerBuilder results; + private final FromPointerReader paramsFactory; + private final FromPointerBuilder resultsFactory; private final CallContextHook hook; - public CallContext(FromPointerReader params, - FromPointerBuilder results, + public CallContext(FromPointerReader paramsFactory, + FromPointerBuilder resultsFactory, CallContextHook hook) { - this.params = params; - this.results = results; + this.paramsFactory = paramsFactory; + this.resultsFactory = resultsFactory; this.hook = hook; } public final Params getParams() { - return this.hook.getParams().getAs(params); + return this.hook.getParams().getAs(paramsFactory); } public final void releaseParams() { @@ -25,11 +25,11 @@ public final void releaseParams() { } public final Results getResults() { - return this.hook.getResults().getAs(results); + return this.hook.getResults().getAs(resultsFactory); } public final Results initResults() { - return this.hook.getResults().initAs(results); + return this.hook.getResults().initAs(resultsFactory); } public final CompletableFuture tailCall(Request tailRequest) { From e3d52a0bbd2dc1753e761a44c20c22c94090f329 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 23 Nov 2020 12:44:46 +0000 Subject: [PATCH 172/246] use gather writes for AsynchronousSocketChannels --- .../java/org/capnproto/TwoPartyClient.java | 9 +- .../java/org/capnproto/TwoPartyServer.java | 4 +- .../org/capnproto/TwoPartyVatNetwork.java | 5 +- .../main/java/org/capnproto/Serialize.java | 216 ++++++++++++++---- .../java/org/capnproto/SerializeTest.java | 10 +- 5 files changed, 177 insertions(+), 67 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java index d1d3159b..5c21a48f 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java @@ -1,7 +1,6 @@ package org.capnproto; -import java.io.IOException; -import java.nio.channels.AsynchronousByteChannel; +import java.nio.channels.AsynchronousSocketChannel; import java.util.concurrent.CompletableFuture; public class TwoPartyClient { @@ -9,15 +8,15 @@ public class TwoPartyClient { private final TwoPartyVatNetwork network; private final RpcSystem rpcSystem; - public TwoPartyClient(AsynchronousByteChannel channel) { + public TwoPartyClient(AsynchronousSocketChannel channel) { this(channel, null); } - public TwoPartyClient(AsynchronousByteChannel channel, Capability.Client bootstrapInterface) { + public TwoPartyClient(AsynchronousSocketChannel channel, Capability.Client bootstrapInterface) { this(channel, bootstrapInterface, RpcTwoPartyProtocol.Side.CLIENT); } - public TwoPartyClient(AsynchronousByteChannel channel, + public TwoPartyClient(AsynchronousSocketChannel channel, Capability.Client bootstrapInterface, RpcTwoPartyProtocol.Side side) { this.network = new TwoPartyVatNetwork(channel, side); diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java index 9bab21fe..7f39f16a 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java @@ -8,11 +8,11 @@ public class TwoPartyServer { private class AcceptedConnection { - private final AsynchronousByteChannel connection; + private final AsynchronousSocketChannel connection; private final TwoPartyVatNetwork network; private final RpcSystem rpcSystem; - AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousByteChannel connection) { + AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousSocketChannel connection) { this.connection = connection; this.network = new TwoPartyVatNetwork(this.connection, RpcTwoPartyProtocol.Side.SERVER); this.rpcSystem = new RpcSystem<>(network, bootstrapInterface); diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 965d8123..70df26dd 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -1,6 +1,5 @@ package org.capnproto; -import java.nio.channels.AsynchronousByteChannel; import java.nio.channels.AsynchronousSocketChannel; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -11,12 +10,12 @@ public class TwoPartyVatNetwork private CompletableFuture previousWrite = CompletableFuture.completedFuture(null); private final CompletableFuture disconnectPromise = new CompletableFuture<>(); - private final AsynchronousByteChannel channel; + private final AsynchronousSocketChannel channel; private final RpcTwoPartyProtocol.Side side; private final MessageBuilder peerVatId = new MessageBuilder(4); private boolean accepted; - public TwoPartyVatNetwork(AsynchronousByteChannel channel, RpcTwoPartyProtocol.Side side) { + public TwoPartyVatNetwork(AsynchronousSocketChannel channel, RpcTwoPartyProtocol.Side side) { this.channel = channel; this.side = side; this.peerVatId.initRoot(RpcTwoPartyProtocol.VatId.factory).setSide( diff --git a/runtime/src/main/java/org/capnproto/Serialize.java b/runtime/src/main/java/org/capnproto/Serialize.java index 7bdc158a..8b519636 100644 --- a/runtime/src/main/java/org/capnproto/Serialize.java +++ b/runtime/src/main/java/org/capnproto/Serialize.java @@ -24,14 +24,10 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import java.nio.channels.AsynchronousByteChannel; -import java.nio.channels.CompletionHandler; -import java.nio.channels.ReadableByteChannel; -import java.nio.channels.WritableByteChannel; +import java.nio.channels.*; import java.util.ArrayList; -import java.util.Arrays; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; +import java.util.concurrent.TimeUnit; import java.util.function.Consumer; public final class Serialize { @@ -208,14 +204,11 @@ public static void write(WritableByteChannel outputChannel, } } - static final class AsyncMessageReader { - - private final AsynchronousByteChannel channel; + static abstract class AsyncMessageReader { private final ReaderOptions options; - private final CompletableFuture readCompleted = new CompletableFuture<>(); + protected final CompletableFuture readCompleted = new CompletableFuture<>(); - public AsyncMessageReader(AsynchronousByteChannel channel, ReaderOptions options) { - this.channel = channel; + AsyncMessageReader(ReaderOptions options) { this.options = options; } @@ -226,8 +219,8 @@ public CompletableFuture getMessage() { private void readHeader() { read(Constants.BYTES_PER_WORD, firstWord -> { - final var segmentCount = 1 + firstWord.getInt(0); - final var segment0Size = firstWord.getInt(4); + var segmentCount = 1 + firstWord.getInt(0); + var segment0Size = firstWord.getInt(4); if (segmentCount == 1) { readSegments(segment0Size, segmentCount, segment0Size, null); @@ -241,7 +234,7 @@ private void readHeader() { } read(4 * (segmentCount & ~1), moreSizesRaw -> { - final var moreSizes = new int[segmentCount - 1]; + var moreSizes = new int[segmentCount - 1]; var totalWords = segment0Size; for (int ii = 0; ii < segmentCount - 1; ++ii) { @@ -262,7 +255,7 @@ private void readSegments(int totalWords, int segmentCount, int segment0Size, in return; } - final var segmentSlices = new ByteBuffer[segmentCount]; + var segmentSlices = new ByteBuffer[segmentCount]; if (totalWords == 0) { for (int ii = 0; ii < segmentCount; ++ii) { segmentSlices[ii] = ByteBuffer.allocate(0); @@ -273,17 +266,19 @@ private void readSegments(int totalWords, int segmentCount, int segment0Size, in read(totalWords * Constants.BYTES_PER_WORD, allSegments -> { allSegments.rewind(); - segmentSlices[0] = allSegments.slice(); - segmentSlices[0].limit(segment0Size * Constants.BYTES_PER_WORD); - segmentSlices[0].order(ByteOrder.LITTLE_ENDIAN); + var segment0 = allSegments.slice(); + segment0.limit(segment0Size * Constants.BYTES_PER_WORD); + segment0.order(ByteOrder.LITTLE_ENDIAN); + segmentSlices[0] = segment0; int offset = segment0Size; for (int ii = 1; ii < segmentCount; ++ii) { allSegments.position(offset * Constants.BYTES_PER_WORD); var segmentSize = moreSizes[ii-1]; - segmentSlices[ii] = allSegments.slice(); - segmentSlices[ii].limit(segmentSize * Constants.BYTES_PER_WORD); - segmentSlices[ii].order(ByteOrder.LITTLE_ENDIAN); + var segment = allSegments.slice(); + segment.limit(segmentSize * Constants.BYTES_PER_WORD); + segment.order(ByteOrder.LITTLE_ENDIAN); + segmentSlices[ii] = segment; offset += segmentSize; } @@ -291,19 +286,71 @@ private void readSegments(int totalWords, int segmentCount, int segment0Size, in }); } - private void read(int bytes, Consumer consumer) { - final var buffer = Serialize.makeByteBuffer(bytes); - final var handler = new CompletionHandler() { + abstract void read(int bytes, Consumer consumer); + } + + static class AsyncSocketReader extends AsyncMessageReader { + private final AsynchronousSocketChannel channel; + private final long timeout; + private final TimeUnit timeUnit; + + AsyncSocketReader(AsynchronousSocketChannel channel, ReaderOptions options, long timeout, TimeUnit timeUnit) { + super(options); + this.channel = channel; + this.timeout = timeout; + this.timeUnit = timeUnit; + } + + void read(int bytes, Consumer consumer) { + var buffer = Serialize.makeByteBuffer(bytes); + var handler = new CompletionHandler() { + @Override + public void completed(Integer result, Object attachment) { + //System.out.println(channel.toString() + ": read " + result + " bytes"); + if (result <= 0) { + var text = result == 0 + ? "Read zero bytes. Is the channel in non-blocking mode?" + : "Premature EOF"; + readCompleted.completeExceptionally(new IOException(text)); + } else if (buffer.hasRemaining()) { + // partial read + channel.read(buffer, timeout, timeUnit, null, this); + } else { + consumer.accept(buffer); + } + } + + @Override + public void failed(Throwable exc, Object attachment) { + readCompleted.completeExceptionally(exc); + } + }; + + this.channel.read(buffer, this.timeout, this.timeUnit, null, handler); + } + } + + static class AsyncByteChannelReader extends AsyncMessageReader { + private final AsynchronousByteChannel channel; + + AsyncByteChannelReader(AsynchronousByteChannel channel, ReaderOptions options) { + super(options); + this.channel = channel; + } + + void read(int bytes, Consumer consumer) { + var buffer = Serialize.makeByteBuffer(bytes); + var handler = new CompletionHandler() { @Override public void completed(Integer result, Object attachment) { - // System.out.println("read " + result + " bytes"); + //System.out.println(channel.toString() + ": read " + result + " bytes"); if (result <= 0) { var text = result == 0 ? "Read zero bytes. Is the channel in non-blocking mode?" : "Premature EOF"; readCompleted.completeExceptionally(new IOException(text)); } else if (buffer.hasRemaining()) { - // retry + // partial read channel.read(buffer, null, this); } else { consumer.accept(buffer); @@ -325,46 +372,115 @@ public static CompletableFuture readAsync(AsynchronousByteChannel } public static CompletableFuture readAsync(AsynchronousByteChannel channel, ReaderOptions options) { - return new AsyncMessageReader(channel, options).getMessage(); + return new AsyncByteChannelReader(channel, options).getMessage(); + } + + public static CompletableFuture readAsync(AsynchronousSocketChannel channel) { + return readAsync(channel, ReaderOptions.DEFAULT_READER_OPTIONS, Long.MAX_VALUE, TimeUnit.SECONDS); + } + + public static CompletableFuture readAsync(AsynchronousSocketChannel channel, ReaderOptions options) { + return readAsync(channel, options, Long.MAX_VALUE, TimeUnit.SECONDS); + } + + public static CompletableFuture readAsync(AsynchronousSocketChannel channel, long timeout, TimeUnit timeUnit) { + return readAsync(channel, ReaderOptions.DEFAULT_READER_OPTIONS, timeout, timeUnit); + } + + public static CompletableFuture readAsync(AsynchronousSocketChannel channel, ReaderOptions options, long timeout, TimeUnit timeUnit) { + return new AsyncSocketReader(channel, options, timeout, timeUnit).getMessage(); } public static CompletableFuture writeAsync(AsynchronousByteChannel outputChannel, MessageBuilder message) { - final var writeCompleted = new CompletableFuture(); - final var segments = message.getSegmentsForOutput(); - assert segments.length > 0: "Empty message"; - final int tableSize = (segments.length + 2) & (~1); - final var table = ByteBuffer.allocate(4 * tableSize); + var writeCompleted = new CompletableFuture(); + var segments = message.getSegmentsForOutput(); + var header = getHeaderForOutput(segments); - table.order(ByteOrder.LITTLE_ENDIAN); - table.putInt(0, segments.length - 1); + outputChannel.write(header, -1, new CompletionHandler<>() { + @Override + public void completed(Integer result, Integer index) { + var currentSegment = index < 0 ? header : segments[index]; + + if (result < 0) { + writeCompleted.completeExceptionally(new IOException("Write failed")); + } + else if (currentSegment.hasRemaining()) { + // partial write + outputChannel.write(currentSegment, index, this); + } + else { + index++; + if (index == segments.length) { + writeCompleted.complete(null); + } + else { + outputChannel.write(segments[index], index, this); + } + } + } + + @Override + public void failed(Throwable exc, Integer attachment) { + writeCompleted.completeExceptionally(exc); + } + }); + + return writeCompleted; + } + public static CompletableFuture writeAsync(AsynchronousSocketChannel outputChannel, MessageBuilder message) { + return writeAsync(outputChannel, message, Long.MAX_VALUE, TimeUnit.SECONDS); + } + + public static CompletableFuture writeAsync(AsynchronousSocketChannel outputChannel, MessageBuilder message, long timeout, TimeUnit timeUnit) { + var writeCompleted = new CompletableFuture(); + var segments = message.getSegmentsForOutput(); + var header = getHeaderForOutput(segments); + long totalBytes = header.remaining(); + + // TODO avoid this copy? + var allSegments = new ByteBuffer[segments.length+1]; + allSegments[0] = header; for (int ii = 0; ii < segments.length; ++ii) { - table.putInt(4 * (ii + 1), segments[ii].limit() / 8); + var segment = segments[ii]; + allSegments[ii+1] = segment; + totalBytes += segment.remaining(); } - outputChannel.write(table, 0, new CompletionHandler<>() { - + outputChannel.write(allSegments, 0, allSegments.length, timeout, timeUnit, totalBytes, new CompletionHandler<>() { @Override - public void completed(Integer result, Integer attachment) { - //System.out.println("Wrote " + result + " bytes"); - if (writeCompleted.isCancelled()) { - // TODO do we really want to interrupt here? - return; + public void completed(Long result, Long totalBytes) { + //System.out.println(outputChannel.toString() + ": Wrote " + result + "/" + totalBytes + " bytes"); + if (result < 0) { + writeCompleted.completeExceptionally(new IOException("Write failed")); } - - if (attachment == segments.length) { + else if (result < totalBytes) { + // partial write + outputChannel.write(allSegments, 0, allSegments.length, timeout, timeUnit, totalBytes - result, this); + } + else { writeCompleted.complete(null); - return; } - - outputChannel.write(segments[attachment], attachment + 1, this); } @Override - public void failed(Throwable exc, Integer attachment) { + public void failed(Throwable exc, Long attachment) { writeCompleted.completeExceptionally(exc); } }); - return writeCompleted.copy(); + + return writeCompleted; + } + + private static ByteBuffer getHeaderForOutput(ByteBuffer[] segments) { + assert segments.length > 0: "Empty message"; + int tableSize = (segments.length + 2) & (~1); + var table = ByteBuffer.allocate(4 * tableSize); + table.order(ByteOrder.LITTLE_ENDIAN); + table.putInt(0, segments.length - 1); + for (int ii = 0; ii < segments.length; ++ii) { + table.putInt(4 * (ii + 1), segments[ii].limit() / 8); + } + return table; } } diff --git a/runtime/src/test/java/org/capnproto/SerializeTest.java b/runtime/src/test/java/org/capnproto/SerializeTest.java index aecd4867..d2245bb4 100644 --- a/runtime/src/test/java/org/capnproto/SerializeTest.java +++ b/runtime/src/test/java/org/capnproto/SerializeTest.java @@ -22,7 +22,6 @@ package org.capnproto; import java.io.IOException; -import java.net.SocketOptions; import java.nio.ByteBuffer; import java.nio.channels.AsynchronousServerSocketChannel; import java.nio.channels.AsynchronousSocketChannel; @@ -72,10 +71,10 @@ private void expectSerializesTo(int exampleSegmentCount, byte[] exampleBytes) th } // read via AsyncChannel - expectSerializesToAsync(exampleSegmentCount, exampleBytes); + expectSerializesToAsyncSocket(exampleSegmentCount, exampleBytes); } - private void expectSerializesToAsync(int exampleSegmentCount, byte[] exampleBytes) throws IOException { + private void expectSerializesToAsyncSocket(int exampleSegmentCount, byte[] exampleBytes) throws IOException { var done = new CompletableFuture(); var server = AsynchronousServerSocketChannel.open(); server.bind(null); @@ -108,10 +107,7 @@ public void failed(Throwable exc, Object attachment) { checkSegmentContents(exampleSegmentCount, messageReader.arena); done.get(); } - catch (InterruptedException exc) { - Assert.fail(exc.getMessage()); - } - catch (ExecutionException exc) { + catch (InterruptedException | ExecutionException exc) { Assert.fail(exc.getMessage()); } } From 359dae8b1c34687391d167da5af3654d0f511c25 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 26 Nov 2020 14:39:53 +0000 Subject: [PATCH 173/246] lower logging level to FINE --- .../src/main/java/org/capnproto/RpcState.java | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 2e8a824b..ad3fc9c4 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -71,7 +71,7 @@ void finish() { var builder = message.getBody().getAs(RpcProtocol.Message.factory).initFinish(); builder.setQuestionId(this.id); builder.setReleaseResultCaps(this.isAwaitingReturn); - LOGGER.info(() -> RpcState.this.toString() + ": > FINISH question=" + this.id); + LOGGER.fine(() -> RpcState.this.toString() + ": > FINISH question=" + this.id); message.send(); } this.skipFinish = true; @@ -196,7 +196,7 @@ public void dispose() { var builder = message.getBody().initAs(RpcProtocol.Message.factory).initRelease(); builder.setId(importId); builder.setReferenceCount(remoteRefCount); - LOGGER.info(() -> this.toString() + ": > RELEASE import=" + importId); + LOGGER.fine(() -> this.toString() + ": > RELEASE import=" + importId); message.send(); } } @@ -331,7 +331,7 @@ void disconnect(Throwable exc) { var message = this.connection.newOutgoingMessage(sizeHint); var abort = message.getBody().getAs(RpcProtocol.Message.factory).initAbort(); FromException(exc, abort); - LOGGER.log(Level.INFO, this.toString() + ": > ABORT", exc.getMessage()); + LOGGER.log(Level.FINE, this.toString() + ": > ABORT", exc); message.send(); } catch (Exception ignored) { @@ -391,7 +391,7 @@ ClientHook restore() { var message = connection.newOutgoingMessage(sizeHint); var builder = message.getBody().initAs(RpcProtocol.Message.factory).initBootstrap(); builder.setQuestionId(question.id); - LOGGER.info(() -> this.toString() + ": > BOOTSTRAP question=" + question.id); + LOGGER.fine(() -> this.toString() + ": > BOOTSTRAP question=" + question.id); message.send(); return pipeline.getPipelinedCap(new PipelineOp[0]); @@ -452,7 +452,7 @@ private void handleMessage(IncomingRpcMessage message) throws RpcException { // boomin' back atcha var msg = connection.newOutgoingMessage(); msg.getBody().initAs(RpcProtocol.Message.factory).setUnimplemented(reader); - LOGGER.info(() -> this.toString() + ": > UNIMPLEMENTED"); + LOGGER.fine(() -> this.toString() + ": > UNIMPLEMENTED"); msg.send(); } } @@ -463,7 +463,7 @@ private void handleMessage(IncomingRpcMessage message) throws RpcException { } void handleUnimplemented(RpcProtocol.Message.Reader message) { - LOGGER.info(() -> this.toString() + ": < UNIMPLEMENTED"); + LOGGER.fine(() -> this.toString() + ": < UNIMPLEMENTED"); switch (message.which()) { case RESOLVE: @@ -502,12 +502,12 @@ void handleUnimplemented(RpcProtocol.Message.Reader message) { void handleAbort(RpcProtocol.Exception.Reader abort) throws RpcException { var exc = ToException(abort); - LOGGER.log(Level.INFO, this.toString() + ": < ABORT ", exc.getMessage()); + LOGGER.log(Level.FINE, this.toString() + ": < ABORT ", exc); throw exc; } void handleBootstrap(RpcProtocol.Bootstrap.Reader bootstrap) { - LOGGER.info(() -> this.toString() + ": < BOOTSTRAP question=" + bootstrap.getQuestionId()); + LOGGER.fine(() -> this.toString() + ": < BOOTSTRAP question=" + bootstrap.getQuestionId()); if (isDisconnected()) { return; } @@ -546,7 +546,7 @@ void handleBootstrap(RpcProtocol.Bootstrap.Reader bootstrap) { ? capHook : Capability.newBrokenCap("Invalid pipeline transform."); - LOGGER.info(() -> this.toString() + ": > RETURN answer=" + answerId); + LOGGER.fine(() -> this.toString() + ": > RETURN answer=" + answerId); response.send(); assert answer.active; @@ -555,6 +555,8 @@ void handleBootstrap(RpcProtocol.Bootstrap.Reader bootstrap) { } void handleCall(IncomingRpcMessage message, RpcProtocol.Call.Reader call) { + LOGGER.fine(() -> this.toString() + ": < CALL question=" + call.getQuestionId()); + var cap = getMessageTarget(call.getTarget()); if (cap == null) { return; @@ -629,7 +631,7 @@ private ClientHook.VoidPromiseAndPipeline startCall(long interfaceId, short meth } void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callReturn) { - LOGGER.info(() -> this.toString() + ": < RETURN answer=" + callReturn.getAnswerId()); + LOGGER.fine(() -> this.toString() + ": < RETURN answer=" + callReturn.getAnswerId()); var question = questions.find(callReturn.getAnswerId()); if (question == null) { @@ -730,7 +732,7 @@ void handleReturn(IncomingRpcMessage message, RpcProtocol.Return.Reader callRetu } void handleFinish(RpcProtocol.Finish.Reader finish) { - LOGGER.info(() -> this.toString() + ": < FINISH question=" + finish.getQuestionId()); + LOGGER.fine(() -> this.toString() + ": < FINISH question=" + finish.getQuestionId()); var answer = answers.find(finish.getQuestionId()); if (answer == null || !answer.active) { @@ -761,7 +763,7 @@ void handleFinish(RpcProtocol.Finish.Reader finish) { } private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reader resolve) { - LOGGER.info(() -> this.toString() + ": < RESOLVE promise=" + resolve.getPromiseId()); + LOGGER.fine(() -> this.toString() + ": < RESOLVE promise=" + resolve.getPromiseId()); var importId = resolve.getPromiseId(); var imp = this.imports.find(importId); @@ -793,12 +795,12 @@ private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reade } private void handleRelease(RpcProtocol.Release.Reader release) { - LOGGER.info(() -> this.toString() + ": < RELEASE promise=" + release.getId()); + LOGGER.fine(() -> this.toString() + ": < RELEASE promise=" + release.getId()); this.releaseExport(release.getId(), release.getReferenceCount()); } private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { - LOGGER.info(() -> this.toString() + ": < DISEMBARGO"); + LOGGER.fine(() -> this.toString() + ": < DISEMBARGO"); var ctx = disembargo.getContext(); switch (ctx.which()) { @@ -843,7 +845,7 @@ private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { return null; } builder.getContext().setReceiverLoopback(embargoId); - LOGGER.info(() -> this.toString() + ": > DISEMBARGO"); + LOGGER.fine(() -> this.toString() + ": > DISEMBARGO"); message.send(); return null; }; @@ -979,7 +981,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS var fds = List.of(); writeDescriptor(exp.clientHook, resolve.initCap(), fds); message.setFds(fds); - LOGGER.info(() -> this.toString() + ": > RESOLVE export=" + exportId); + LOGGER.fine(() -> this.toString() + ": > RESOLVE export=" + exportId); message.send(); return CompletableFuture.completedFuture(null); }).whenComplete((value, exc) -> { @@ -991,7 +993,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS var resolve = message.getBody().initAs(RpcProtocol.Message.factory).initResolve(); resolve.setPromiseId(exportId); FromException(exc, resolve.initException()); - LOGGER.info(() -> this.toString() + ": > RESOLVE FAILED export=" + exportId + " msg=" + exc.getMessage()); + LOGGER.fine(() -> this.toString() + ": > RESOLVE FAILED export=" + exportId + " msg=" + exc.getMessage()); message.send(); }); } @@ -1395,7 +1397,7 @@ public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { builder.setAnswerId(this.answerId); builder.setReleaseParamCaps(false); builder.setTakeFromOtherQuestion(tailInfo.questionId); - LOGGER.info(() -> this.toString() + ": > RETURN answer=" + answerId); + LOGGER.fine(() -> this.toString() + ": > RETURN answer=" + answerId); message.send(); } @@ -1437,7 +1439,7 @@ private void sendReturn() { this.returnMessage.setAnswerId(this.answerId); this.returnMessage.setReleaseParamCaps(false); - LOGGER.info(() -> RpcState.this.toString() + ": > RETURN answer=" + this.answerId); + LOGGER.fine(() -> RpcState.this.toString() + ": > RETURN answer=" + this.answerId); int[] exports = null; try { @@ -1462,7 +1464,7 @@ private void sendErrorReturn(Throwable exc) { builder.setAnswerId(this.answerId); builder.setReleaseParamCaps(false); FromException(exc, builder.initException()); - LOGGER.log(Level.INFO, this.toString() + ": > RETURN", exc.getMessage()); + LOGGER.log(Level.FINE, this.toString() + ": > RETURN", exc); message.send(); } @@ -1714,7 +1716,7 @@ QuestionRef sendInternal(boolean isTailCall) { callBuilder.getSendResultsTo().getYourself(); } try { - LOGGER.info(() -> RpcState.this.toString() + ": > CALL question=" + question.id); + LOGGER.fine(() -> RpcState.this.toString() + ": > CALL question=" + question.id); message.send(); } catch (Exception exc) { question.isAwaitingReturn = false; @@ -1983,7 +1985,7 @@ private ClientHook resolve(ClientHook replacement) { ClientHook finalReplacement = replacement; var embargoPromise = embargo.disembargo.thenApply( void_ -> finalReplacement); - LOGGER.info(() -> RpcState.this.toString() + ": > DISEMBARGO"); + LOGGER.fine(() -> RpcState.this.toString() + ": > DISEMBARGO"); message.send(); return Capability.newLocalPromiseClient(embargoPromise); } From 3ba96956a88d609c66461dd4494c0334ec78ebaa Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 26 Nov 2020 14:44:38 +0000 Subject: [PATCH 174/246] disembargo promise is always non-null --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index ad3fc9c4..3582b704 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -205,6 +205,7 @@ public void dispose() { final static class Embargo { final int id; final CompletableFuture disembargo = new CompletableFuture<>(); + Embargo(int id) { this.id = id; } @@ -320,9 +321,7 @@ void disconnect(Throwable exc) { } for (var embargo: embargos) { - if (embargo.disembargo != null) { - embargo.disembargo.completeExceptionally(networkExc); - } + embargo.disembargo.completeExceptionally(networkExc); } // Send an abort message, but ignore failure. From 772108ff12808eb6d5f7ca54e5f7b176cf36b1bd Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 26 Nov 2020 15:05:50 +0000 Subject: [PATCH 175/246] add testEmbargoNull test throw RpcExceptions rather than RuntimeExceptions --- foo.raw | Bin 0 -> 28864 bytes .../src/main/java/org/capnproto/RpcState.java | 5 +++++ .../src/test/java/org/capnproto/RpcTest.java | 21 +++++++++++++++--- .../test/java/org/capnproto/RpcTestUtil.java | 5 +++++ .../test/java/org/capnproto/TwoPartyTest.java | 2 +- .../main/java/org/capnproto/Capability.java | 4 ++-- 6 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 foo.raw diff --git a/foo.raw b/foo.raw new file mode 100644 index 0000000000000000000000000000000000000000..fe793207cfd1e01ddc81cc99a51a6de553ce164b GIT binary patch literal 28864 zcmdsA3v^t?dA^c)1f_vs>`)AeuZ02IN0uL8Frt)LHed|qA)G_v(**BISJKMsU2%71 z%Wh5sYEKMqD8}U#!)c6x@Cd;~gcO_y#6S%OlGx|qSh9pW90-|rshc`dU&uU=6+ zuMYlP6ZX9KA>?^YARg)+=AAYFx);2+gGZ()YVyyEe+EqO{44xZ;2&|M=be$9+`Hw` zN5;MR>~H>w@*D~Y_V-Q>ZrS$xXIz#!z}W@j+3*jyBIhGKPDySNaVt3QFDDNPO$Yx5 zP>Fxakl3Mwmp(oD+OMuW?Dk6X61N`Zp9kNTcQ(Rt@;-j>$$`N)!)qx+ou%*kGH%bC z0{*SQJ=4Ku9fCZ>J-*>nCl(%_`mo0JO7&Rh;7$bIUI0)Jw!AYDK4%E3=l#b=?(YA_ zmgXba8h7k#idnA&sOJS40u<2byGby5OeI)VO~<0l*wrq|!2aU&?VU8K>E#mPCCK!5Z{ z*B_bNc=Apc*R_Y155(g}l9b^!})x~x7uqOd` z654T`e%8;N@R2#*ErTwutB0)#{N<&OLg(!I<2Ca>^Y#6-GYn}~JC4%u?tsCadsMl6 zttQ<1!E*Zcm$N@>Tfh5jr-HYYT zXMB0SJ5Sj9+ilk$e6kYm0mC=XSEUT+e&`>4RJMU$kYti@Rfjma~3hxxC|@u;kbD{5{2=?0NG`f-7`) zJl>qZzdwQg+`N6CZ49m+baBU(%@Q!*`cS!?l7Gvw@$?B7)GhwjQ{UO<;=29AoAjZoGl(0{pT%9gz!4K|3pN%gjFlE&R(d_msh zgoS?Xo%h{v&zi1#1y|^9y)8dJUfu^1=ptXGcJaUo8h5|(CI1;8*7TN-l;^woUryS5 z^GiQ{Z5|TZ?ZU0MB@Un9ZcU)S_KAkOHXr@>U#x^XcXGKrg1aGs{#TP5-+%YIMl~-P zZoFs&5a*j|;|p$R!h0S16HhEze8|T?b=T>j+j?;AY`?>YpmJOzF+bOxJaFO4|C#pC zn}YlAhy3Tto;#j?#I=VOFq40S@danI6BfGQRI-QhSSu2@&G^DUV8Z(x`dcsF`s%-3 zan@rZucUYNaKPb{bghTR>*2c%-`(^2A70;5N#0hhX({i3@dbC22_JCi&wuFdg_m9b z=qr_Q>krqst;QGJHWN-e^och;{5SJIe)?0|ekC<+0|_k`I(!nfBZ0o{x(AQH>B!xm zt%SP->lW(4b(<6D-}w1S_g%7K&JC4txekiMU6(+A_MzV{I_$~|U#Nszk99yCF4r+} z^!AmR7k~W3E&D3r?oZ%v!8#xgck72|f4=kJtS?u>-I2gQ3G0A3+}9?5^2Y6Vz3_M? z+^q@x2NLMHYZ^W={c|V2;^Mmf?>fxakm|1XK@`7CvQ&z{q%2bnswAUC$6s~FV_KaxKeJ{KY!f)Z!}%qbkN0h+cDP>ak!fj z=wGZq#C$srchWZ>o;;;>+-?`wwciI4_}%)F@E6~==!_GWpR!luMl(Bi+^omEJWj6V z3H0qJ9QEpi{`dcvE3b>YcS1bw+==n@)4qNF;TtEexXHzJ_0WQOb)39XZr2~2e(LQ5 z)Aroy;=1;`Apv)90)5fjZO4CS>s>!|ab0=SnD193?=Ldr_O`yZUF}B=H$NLRxCb2k zdaMta-(JjL?R=MB^WQ(Y_o@rczEPwlR}XJFe3Ehr=D#+c&=;REAvpW$V{fjchdl}W zg5&ys`K2AV4PNr|XI)%Z-Wixb$H_I2K>zs%55D+|r4yY_Wc>=+DM)+FuWC)?6Y5w`$1f?KYkjQ?Dlor)8s=AL3YmNk zX&G({+B3bGAjcF8FYC^P9hauU;@X9&UJGwYK9g$;3Vqq4#=js}48qP-dtmZAx4#(V zI+U0S$AssKJeOvAgKQ?p@byf~HX$SQ6fUYZXB z=%Q2faDI>r!c4mo0Lv2CZ++?cAEqY=)p=9lGe(}X`3RBTL^6C#i_09_z#y)C*riQ3 z%op>`uvy z!7~364z>l*zwuXG)HjoY<%Y+45=Z^<`RN4sw2N*uDaKW*kEHlo%EA2TsAnxtvi#GL zu0^HRKeTVkKOXCSmQ*f{7A2g5+a*!Zn`_c9H$KbFrq6amC;hMvMZfu|Yf(hzcPs{! z`S6F+`&uMyi(tHdgemvm!KdDdqn&;4dDl36R~x?18NPZjX?=U3Pb;76k zk-OjFyU*}_)$pNOJ@y66mG|Plf_RQ|;vP19-!Oc%KP{iOMM?L#!}plsd)n|ZFRjNq zldtCdw!`X-N8e&z7}((t`v_*UmL9p`0&ESlD+Tsoi6+BjO4WXPoW zOs+WJ#99mL5aORwD0oiRR4ksxdIH%6FaO^e}hm#Z!oYPOUaO^e~hm#cFcR{&= z>^2vNlN3)JTS0akjKfKaCyuQk-B#idG%YEfIJSax-;j)x6yKT6r)+`jHXDbQ6t8eB zf$TOMhm#av4El>!wbwjucch9b8^>S4>5ib}<{i%&&dilh5X4yR!MFAxys0;FB){pDt-!(Xq+# z()R5ZcsnZlNvGDu>4)zh*V3*jGv#sn$DN?jPR5xP z4Q@SoPgUM4y$m$F-)9=zor?f*iBBi*jmmqT9EXSFXFouGbXm&Ddz|v#w-e;BfPph>@X}9v8DeZBt79sZ6 zwMTi6RB)z%t0k6G6U8236jrJ_PgP2ZQs-%<3PIbSJztaO1yKt9y+rl)sY^?Ha`i1? zwtvRk`OEVOJOA-$q*dfE)8OW=pok6rasy(1V>Q3fGHM-)ysSsNp56IH&LpgLev!$c zNWeJS;JEc=$fbA*i_h}!z)vmuY|Zz_wx5xXdv<^7&M&YpuS6V8xh9RyPD*_s1sO{_ zA(rm#)s6b0o!IT!wG){KB+aJ;DJdS0HCSDxd4jw*Eqvn3JVV0bQ|8th^{LjPc$S9M zYC&2b@wVa8{cQ5Qp5wZ0Cm%(a^Ye?~%e+2LpBFfMiwxhTh7UzCW4*n)_q?T`&%h;a zF>aV&2Ylu?TD!#a0|h-^GDz@~;&MS15`4n6nr)eiLesG_>5tqor{Ys8w zVqjux3Q;9kbG~$d9^(bB3S0!b)I}rBj3Nc`>kcn2+YAndxvQ$C*QZo zcOxf(+GgV7JiLac`1M>;Qq-ya(@V`5Csb;x)OSTh-03-@+wRiU*?Z}A5I-u1fz?eSr;+dXEU{$N^;DcKuF6zMK!a`?=KPa4socy&MBZwvXXlQatOmc70N{ z+UOaKKZ)82c*$??d&qZdq%X(i z);#HP{egT(C;XJR5m%DqNX-7g-M1t@>2$OJhHJIk@K4ka*z<_7?g!eG znDry^7D?SwpS9Xc2;R8*iL(d!p77nUhfNToiut7dI%}-_VsEk!C}FX`Msz4u~d#ChB)!l;ygjJK+1*`RwYT zL*}&arFz>imgTeR5UQ)nKJ9Up<0r?}v8=}`_x+-FmkU-0VOxOL_jB*X`dd^Sx^;?&C?nBRJx-om4qqNA=d7&z2gT0emmDyDFdmIOQs@FqUgn z{qJJD+bYHlEaFwUZxzYMaZ2GuGFGGace@{`dHls<(@~SsQ_Xr8yhu$|^_Pvtrs>7B zI~6PKs+RG*=5`mfcb8s#GBQ?E|J9VMmi0}|?M{`;sw|Z4y;QCxwT=UNQ*2=hdu~~) z4`9{3Tji_89^1yGd_(JRU9GsQf?{{Rwku8p0~%;t5^+j$Le_wC}R^K*Orn}#sw!KcCJdZq(Dom+lQjee8j1Ct~vUJ%@P%18amdteOLJU`&Lr@je| zIve8g?4p|1#SxxVlhWr%*Twe!iaU;Wn{QWT9F^~YA#RzI_%b2_N^hem*TsF=vM!l; zRqn@^=4F(P{O*3ldOXsc54yb{FXtA?IYa#3td#%>?jFPwm-uvYj*y)D!|&?0>ZsV? zn+-oyrJS7WBj@n&JHT`-rzZ0ILgp_|XXTt7ITxo7@%H-=E>ydn4!6d=l~Y zb0wGmV}_smkaThmjhq{E0pf?#-`R#=zC)68VdNZ_Ifx%l{*w&9)UBM;BIl|chxi^X zTI}!9hF|(^IX6YlIXM*Zn`1dOvCi-}m^5;ZiJUv~I_Pb~@V|;U$}Zmr$+;qOUdOKx zH=O={VECoqlJhv^{EX)izX?~8dj=8A{|J*n&c~4REFK4a(8R@gkAg`4512?fuR_k3 zxF7W4%73TfH(PuLh41O8EkAn;$;8pC^QK>($ z=cRgTXw!!dkx{JRTA%%!NR=PEG&_85E+4MS_Z2QLhM8QK4Fmb2e8^^|S*0{}-kLB| z43_23D=(NHQ|;#v?m7YHTKjq#^3Q$a%`$qZ?Q%i z>5c*r|4%t@Oi>89r1I<7bGP=6pi|=c|Ka|M4~#YroQa?<5bAO z`TA`5^8A@tlu-LBpyv5D-!zczd46XHdVx8$zYneW=hn_oS!+tRIF*CiruNU!q!HT!rR z#cz*mavl_MIlm}3b-YV_WyS=4Vec5L&B9e)}qO7G@7qVWb>^djdaNtO~XVe!LY zwYrt}0bM?wPTRs{1P;N)eBE@+_Y_V-FNy~PoEtCl>e%R) z`LO<&FD2o6f%+34k9Qg2wWdPlGkulcQHi}Y+qOU)&QIy2{1Q%jPJI;8QlFYb%Xyjk z4yRX9>xY#4Tx7)Z$-IT@p6$3&xH$gFxmvhY?qgW6F&{bq%aBW+``ygBNY8qf^TSFB z&5fKhCiJrnzMM}c^fN)HobrD#LKoj%=g&lX>Py}im2@W=d})V5pJLLx-)$cU`WZ+h z|8GOwJ@vws{J#Zq{#le#-^uwE{D z1Ng1*``~kb=6d+cQLkTt-vgiP)BU)9g^TT3+#hihqLFd^KMB`TT)V9J0QY;*IV_~8 zEATXx?;uT^zM{#;*?jFQA$Z_pNW$K8laKWl?)jA3Z^S-bBjvp)voi3_BGOOy75z1- z3<}qo4;9)9znCXK-%ap4Ghv}fCb&iUppZMIXz-eS{}cH>ztElU%XR>c4+{JY)9R<< z1wXTDRnU=16@%iuhIOU-YU$?B=9za~ueLh|;N&`f708~7bT zp*_s>7V}}D*}sD8{DR*I>u(gBQueAKl(~b9Vh6sSsx|uyvIQtD3{XofkcRF}Wl%+G zf(kTz7_QLrxxmK}h;|dwwVnrH$S5g+jEAa`;76~gtOhF)#&^>v^+!5+U1_{6htcn^ zv)`%KU5wKKRaXYZn6m?6AARlJehTI1>4-spYE^GGV87DX%!)e@zA^fzBe+5r{fG8($qc=(qDwLa?JlRSc?LhoTvTO8QIEm#f!GIFgFP_Vv7;kM_jO@J=~BaosXjTgEV({KUa4;xcO?9O<-2m!z5UKR_hLMw u Assert.fail("Never completing call returned?")); } catch (CompletionException exc) { - Assert.assertTrue(exc instanceof CompletionException); Assert.assertNotNull(exc.getCause()); Assert.assertTrue(exc.getCause() instanceof RpcException); - Assert.assertTrue(((RpcException)exc.getCause()).getType() == RpcException.Type.FAILED); + Assert.assertSame(((RpcException) exc.getCause()).getType(), RpcException.Type.FAILED); } catch (Exception exc) { Assert.fail(exc.toString()); } // check that the connection is still open - getCallSequence(client, 1); + this.context.runUntil(getCallSequence(client, 1)).join(); } @org.junit.Test @@ -625,5 +624,21 @@ public void testEmbargoUnwrap() { int unwrappedAt = this.context.runUntil(unwrap).join(); Assert.assertTrue(unwrappedAt >= 0); } + + @org.junit.Test + public void testEmbargoNull() { + var client = new Test.TestMoreStuff.Client(context.connect(Test.TestSturdyRefObjectId.Tag.TEST_MORE_STUFF)); + var promise = client.getNullRequest().send(); + var cap = promise.getNullCap(); + var call0 = cap.getCallSequenceRequest().send(); + this.context.runUntil(promise); + var call1 = cap.getCallSequenceRequest().send(); + + Assert.assertThrows(CompletionException.class, () -> this.context.runUntil(call0).join()); + Assert.assertThrows(CompletionException.class, () -> this.context.runUntil(call1).join()); + + // check that the connection is still open + this.context.runUntil(getCallSequence(client, 0)).join(); + } } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java index 1de666f0..370940b3 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTestUtil.java @@ -220,6 +220,11 @@ protected CompletableFuture neverReturn(CallContext getNull(CallContext context) { + return READY_NOW; + } } static class TestTailCalleeImpl extends Test.TestTailCallee.Server { diff --git a/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java b/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java index 2586e223..39cb1098 100644 --- a/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/TwoPartyTest.java @@ -111,7 +111,7 @@ public void testBasic() throws Exception { } @org.junit.Test - public void testDisconnect() throws IOException { + public void testDisconnect() { //this.serverSocket.shutdownOutput(); //this.serverNetwork.close(); //this.serverNetwork.onDisconnect().join(); diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 71bcbd17..14e00fa7 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -562,11 +562,11 @@ public static ClientHook newBrokenCap(Throwable exc) { } public static ClientHook newNullCap() { - return newBrokenClient(new RuntimeException("Called null capability"), true, ClientHook.NULL_CAPABILITY_BRAND); + return newBrokenClient(RpcException.failed("Called null capability"), true, ClientHook.NULL_CAPABILITY_BRAND); } static private ClientHook newBrokenClient(String reason, boolean resolved, Object brand) { - return newBrokenClient(new RuntimeException(reason), resolved, brand); + return newBrokenClient(RpcException.failed(reason), resolved, brand); } static private ClientHook newBrokenClient(Throwable exc, boolean resolved, Object brand) { From 6326f965ab804aebcd5787a33057030e252e5733 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 26 Nov 2020 15:17:39 +0000 Subject: [PATCH 176/246] new style resolve switch --- .../src/main/java/org/capnproto/RpcState.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index ea8f9304..2c62f147 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1561,7 +1561,6 @@ private class RpcPipeline implements PipelineHook { */ RpcPipeline(QuestionRef questionRef) { this(questionRef, null); - // TODO implement tail calls... } @Override @@ -1569,30 +1568,30 @@ public ClientHook getPipelinedCap(PipelineOp[] ops) { // TODO avoid conversion to/from ArrayList? var key = new ArrayList<>(Arrays.asList(ops)); - var hook = this.clientMap.computeIfAbsent(key, k -> { - switch (state) { - case WAITING: { + return this.clientMap.computeIfAbsent(key, k -> { + return switch (state) { + case WAITING -> { var pipelineClient = new PipelineClient(this.questionRef, ops); if (this.redirectLater == null) { // This pipeline will never get redirected, so just return the PipelineClient. - return pipelineClient; + yield pipelineClient; } assert this.resolveSelf != null; var resolutionPromise = this.resolveSelf.thenApply( response -> response.getResults().getPipelinedCap(ops)); - return new PromiseClient(pipelineClient, resolutionPromise, null); + yield new PromiseClient(pipelineClient, resolutionPromise, null); } - - case RESOLVED: + case RESOLVED -> { assert this.resolved != null; - return this.resolved.getResults().getPipelinedCap(ops); - - default: - return Capability.newBrokenCap(broken); - } + yield this.resolved.getResults().getPipelinedCap(ops); + } + case BROKEN -> { + assert this.broken != null; + yield Capability.newBrokenCap(broken); + } + }; }); - return hook; } @Override From 60690c1e70e1caf8af8e03c8304e5e036f7d2e3f Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 26 Nov 2020 15:21:02 +0000 Subject: [PATCH 177/246] fix construction of never-resolving pipeline --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 2c62f147..52f70e16 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1560,7 +1560,9 @@ private class RpcPipeline implements PipelineHook { * Construct a new RpcPipeline that is never expected to resolve. */ RpcPipeline(QuestionRef questionRef) { - this(questionRef, null); + this.questionRef = questionRef; + this.redirectLater = null; + this.resolveSelf = null; } @Override From a2a17ea3cb5eedaf82123170757cc439a0b715f0 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 26 Nov 2020 16:01:40 +0000 Subject: [PATCH 178/246] remove CapabilityServerSetBase, add test case --- .../java/org/capnproto/CapabilityTest.java | 71 +++++++++++++++++-- .../main/java/org/capnproto/Capability.java | 41 +++++------ 2 files changed, 88 insertions(+), 24 deletions(-) diff --git a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java index 7354a106..2296746a 100644 --- a/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/CapabilityTest.java @@ -21,16 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import org.capnproto.AnyPointer; -import org.capnproto.CallContext; -import org.capnproto.Capability; -import org.capnproto.RpcException; import org.capnproto.rpctest.Test; import org.junit.Assert; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; +import java.util.concurrent.atomic.AtomicBoolean; class Counter { private int count = 0; @@ -291,4 +288,70 @@ public void testStreamingCallsBlockSubsequentCalls() { Assert.assertEquals(579, result.getTotalI()); Assert.assertEquals(321, result.getTotalJ()); } + + @org.junit.Test + public void testCapabilityServerSet() { + var set1 = new Capability.CapabilityServerSet(); + var set2 = new Capability.CapabilityServerSet(); + + var callCount = new Counter(); + var clientStandalone = new Test.TestInterface.Client(new RpcTestUtil.TestInterfaceImpl(callCount)); + var clientNull = new Test.TestInterface.Client(); + + var ownServer1 = new RpcTestUtil.TestInterfaceImpl(callCount); + var server1 = ownServer1; + var client1 = set1.add(Test.TestInterface.factory, ownServer1); + + var ownServer2 = new RpcTestUtil.TestInterfaceImpl(callCount); + var server2 = ownServer2; + var client2 = set2.add(Test.TestInterface.factory, ownServer2); + + // Getting the local server using the correct set works. + Assert.assertEquals(server1, set1.getLocalServer(client1).join()); + Assert.assertEquals(server2, set2.getLocalServer(client2).join()); + + // Getting the local server using the wrong set doesn't work. + Assert.assertNull(set1.getLocalServer(client2).join()); + Assert.assertNull(set2.getLocalServer(client1).join()); + Assert.assertNull(set1.getLocalServer(clientStandalone).join()); + Assert.assertNull(set1.getLocalServer(clientNull).join()); + + var promise = new CompletableFuture(); + var clientPromise = new Test.TestInterface.Client(promise); + + var errorPromise = new CompletableFuture(); + var clientErrorPromise = new Test.TestInterface.Client(errorPromise); + + var resolved1 = new AtomicBoolean(false); + var resolved2 = new AtomicBoolean(false); + var resolved3 = new AtomicBoolean(false); + + var promise1 = set1.getLocalServer(clientPromise).thenAccept(server -> { + resolved1.set(true); + Assert.assertEquals(server1, server); + }); + + var promise2 = set2.getLocalServer(clientPromise).thenAccept(server -> { + resolved2.set(true); + Assert.assertNull(server); + }); + + var promise3 = set1.getLocalServer(clientErrorPromise).whenComplete((server, exc) -> { + resolved3.set(true); + Assert.assertNull(server); + Assert.assertNotNull(exc); + Assert.assertTrue(exc.getCause() instanceof RpcException); + }); + + Assert.assertFalse(resolved1.get()); + Assert.assertFalse(resolved2.get()); + Assert.assertFalse(resolved3.get()); + + promise.complete(client1); + errorPromise.completeExceptionally(RpcException.failed("foo")); + + Assert.assertTrue(resolved1.get()); + Assert.assertTrue(resolved2.get()); + Assert.assertTrue(resolved3.get()); + } } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 14e00fa7..5dd80841 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -136,7 +136,7 @@ public Client(Client other) { this(other.hook); } - public Client(Server server) { + public Client(T server) { this(makeLocalClient(server)); } @@ -157,7 +157,7 @@ public ClientHook getHook() { return this.hook; } - private static ClientHook makeLocalClient(Server server) { + private static ClientHook makeLocalClient(T server) { return server.makeLocalClient(); } } @@ -169,27 +169,27 @@ public abstract static class Server { private ClientHook hook; ClientHook makeLocalClient() { - return new LocalClient(); + return new LocalClient<>(); } - ClientHook makeLocalClient(CapabilityServerSetBase capServerSet) { - return new LocalClient(capServerSet); + ClientHook makeLocalClient(CapabilityServerSet capServerSet) { + return new LocalClient<>(capServerSet); } - private final class LocalClient implements ClientHook { + private final class LocalClient implements ClientHook { private CompletableFuture resolveTask; private ClientHook resolved; private boolean blocked = false; private Throwable brokenException; private final Queue blockedCalls = new ArrayDeque<>(); - private final CapabilityServerSetBase capServerSet; + private final CapabilityServerSet capServerSet; LocalClient() { this(null); } - LocalClient(CapabilityServerSetBase capServerSet) { + LocalClient(CapabilityServerSet capServerSet) { Server.this.hook = this; this.capServerSet = capServerSet; var resolveTask = shortenPath(); @@ -311,14 +311,17 @@ CompletableFuture callInternal(long interfaceId, short methodId, } } - public CompletableFuture getLocalServer(CapabilityServerSetBase capServerSet) { + public CompletableFuture getLocalServer(CapabilityServerSet capServerSet) { if (this.capServerSet == capServerSet) { if (this.blocked) { - var promise = new CompletableFuture(); - this.blockedCalls.add(() -> promise.complete(Server.this)); + var promise = new CompletableFuture(); + var server = (T)Server.this; + this.blockedCalls.add(() -> promise.complete(server)); return promise; } - return CompletableFuture.completedFuture(Server.this); + + var server = (T)Server.this; + return CompletableFuture.completedFuture(server); } return null; } @@ -712,13 +715,13 @@ public CompletableFuture whenMoreResolved() { } } - static class CapabilityServerSetBase { + public static final class CapabilityServerSet { - ClientHook addInternal(Server server) { + ClientHook addInternal(T server) { return server.makeLocalClient(this); } - CompletableFuture getLocalServerInternal(ClientHook hook) { + CompletableFuture getLocalServerInternal(ClientHook hook) { for (;;) { var next = hook.getResolved(); if (next != null) { @@ -728,8 +731,9 @@ CompletableFuture getLocalServerInternal(ClientHook hook) { break; } } + if (hook.getBrand() == Server.BRAND) { - var promise = ((Server.LocalClient)hook).getLocalServer(this); + var promise = ((Server.LocalClient)hook).getLocalServer(this); if (promise != null) { return promise; } @@ -744,12 +748,9 @@ CompletableFuture getLocalServerInternal(ClientHook hook) { } else { // Cap is settled, so it definitely will never resolve to a member of this set. - return CompletableFuture.completedFuture(null); + return CompletableFuture.completedFuture(null); } } - } - - public static final class CapabilityServerSet extends CapabilityServerSetBase { /** * Create a new capability Client for the given Server and also add this server to the set. From a3837e6010ddc1ae46ddd76e28109179982ff614 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 26 Nov 2020 16:09:07 +0000 Subject: [PATCH 179/246] message loop exit logging level as FINE --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 2 +- runtime/src/main/java/org/capnproto/Capability.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 52f70e16..1335daa9 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -433,7 +433,7 @@ public CompletableFuture pollOnce() { public void runMessageLoop() { this.pollOnce().thenRun(this::runMessageLoop).exceptionally(exc -> { - LOGGER.warning(() -> "Event loop exited: " + exc.getMessage()); + LOGGER.log(Level.FINE, "Event loop exited", exc); return null; }); } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 5dd80841..927a8d3e 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -731,7 +731,7 @@ CompletableFuture getLocalServerInternal(ClientHook hook) { break; } } - + if (hook.getBrand() == Server.BRAND) { var promise = ((Server.LocalClient)hook).getLocalServer(this); if (promise != null) { From b5c1c48c4f3f2c04568a57ba0c4ed6f49583aade Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 26 Nov 2020 16:52:47 +0000 Subject: [PATCH 180/246] all channels are socket channels --- .../src/main/java/org/capnproto/TwoPartyVatNetwork.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 70df26dd..9af830c9 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -70,9 +70,7 @@ public CompletableFuture shutdown() { var result = this.previousWrite.whenComplete((void_, exc) -> { try { - if (this.channel instanceof AsynchronousSocketChannel) { - ((AsynchronousSocketChannel)this.channel).shutdownOutput(); - } + this.channel.shutdownOutput(); } catch (Exception ignored) { } From 585a21259e117b5842ffdfb643c0736b53ead1dc Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 27 Nov 2020 09:50:26 +0000 Subject: [PATCH 181/246] remove unused AnyRequest.send() --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 2 +- runtime/src/main/java/org/capnproto/AnyPointer.java | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 1335daa9..6bf83014 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1690,7 +1690,7 @@ public RemotePromise send() { var redirected = redirect.newCall( this.callBuilder.getInterfaceId(), this.callBuilder.getMethodId()); var replacement = new AnyPointer.Request(paramsBuilder, redirected.getHook()); - return replacement.send(); + return replacement.sendInternal(); } var questionRef = sendInternal(false); diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 5fba51d0..9153edf4 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -228,10 +228,6 @@ public FromPointerBuilder getParamsFactory() { @Override public RemotePromise sendInternal() { - return this.send(); - } - - public RemotePromise send() { return this.requestHook.send(); } } From 6e5bcc62ae38c6f2aa1e4de8a81b039a86ae4da9 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 27 Nov 2020 10:19:06 +0000 Subject: [PATCH 182/246] replace typeless requests with anonymous implementations --- .../src/main/java/org/capnproto/RpcState.java | 6 +- .../main/java/org/capnproto/AnyPointer.java | 84 ---------------- .../main/java/org/capnproto/Capability.java | 96 +++++++++++++++++-- .../src/main/java/org/capnproto/Request.java | 57 ----------- 4 files changed, 92 insertions(+), 151 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 6bf83014..77dc415e 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1637,7 +1637,7 @@ public final Object getBrand() { private Request newCallNoIntercept(long interfaceId, short methodId) { if (isDisconnected()) { - return Request.newBrokenRequest(AnyPointer.factory, disconnected); + return Capability.newBrokenRequest(disconnected); } var request = new RpcRequest(this); @@ -1645,7 +1645,7 @@ private Request newCallNoIntercept(long interfaceId, short m callBuilder.setInterfaceId(interfaceId); callBuilder.setMethodId(methodId); var root = request.getRoot(); - return new AnyPointer.Request(root, request); + return Capability.newTypelessRequest(root, request); } } @@ -1689,7 +1689,7 @@ public RemotePromise send() { if (redirect != null) { var redirected = redirect.newCall( this.callBuilder.getInterfaceId(), this.callBuilder.getMethodId()); - var replacement = new AnyPointer.Request(paramsBuilder, redirected.getHook()); + var replacement = Capability.newTypelessRequest(paramsBuilder, redirected.getHook()); return replacement.sendInternal(); } diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 9153edf4..ca3f4901 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -21,8 +21,6 @@ package org.capnproto; -import java.util.concurrent.CompletableFuture; - public final class AnyPointer { public static final class Factory implements PointerFactory, @@ -189,86 +187,4 @@ public Pipeline getPointerField(short pointerIndex) { return new Pipeline(this.hook, newOps); } } - - public static final class Request - implements org.capnproto.Request { - - private final Builder params; - private final RequestHook requestHook; - - Request(Builder params, RequestHook requestHook) { - this.params = params; - this.requestHook = requestHook; - } - - @Override - public Builder getParams() { - return this.params; - } - - @Override - public org.capnproto.Request getTypelessRequest() { - return this; - } - - @Override - public org.capnproto.Request getBaseRequest() { - return this; - } - - @Override - public RequestHook getHook() { - return this.requestHook; - } - - @Override - public FromPointerBuilder getParamsFactory() { - return AnyPointer.factory; - } - - @Override - public RemotePromise sendInternal() { - return this.requestHook.send(); - } - } - - public static final class StreamingRequest - implements org.capnproto.StreamingRequest { - - private final Builder params; - private final RequestHook requestHook; - - StreamingRequest(AnyPointer.Request request) { - this(request.params, request.requestHook); - } - - StreamingRequest(Builder params, RequestHook requestHook) { - this.params = params; - this.requestHook = requestHook; - } - - @Override - public Builder getParams() { - return this.params; - } - - @Override - public org.capnproto.StreamingRequest getTypelessRequest() { - return this; - } - - @Override - public RequestHook getHook() { - return this.requestHook; - } - - @Override - public FromPointerBuilder getParamsFactory() { - return AnyPointer.factory; - } - - public CompletableFuture send() { - return this.requestHook.sendStreaming(); - } - } } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 927a8d3e..a54bc573 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -109,7 +109,7 @@ public Request getBaseRequest() { default StreamingRequest newStreamingCall(FromPointerBuilder paramsFactory, long interfaceId, short methodId) { var request = this.getHook().newCall(interfaceId, methodId); - var streamingRequest = new AnyPointer.StreamingRequest(request.getParams(), request.getHook()); + var streamingRequest = newTypelessStreamingRequest(request.getParams(), request.getHook()); return new StreamingRequest<>() { @Override public FromPointerBuilder getParamsFactory() { @@ -204,7 +204,7 @@ private final class LocalClient implements ClientHook { public Request newCall(long interfaceId, short methodId) { var hook = new LocalRequest(interfaceId, methodId, this); var root = hook.message.getRoot(AnyPointer.factory); - return new AnyPointer.Request(root, hook); + return newTypelessRequest(root, hook); } @Override @@ -556,6 +556,89 @@ public CompletableFuture releaseCall() { } } + static Request newTypelessRequest(AnyPointer.Builder params, RequestHook requestHook) { + return new Request<>() { + @Override + public AnyPointer.Builder getParams() { + return params; + } + + @Override + public org.capnproto.Request getTypelessRequest() { + return this; + } + + @Override + public org.capnproto.Request getBaseRequest() { + return this; + } + + @Override + public RequestHook getHook() { + return requestHook; + } + + @Override + public FromPointerBuilder getParamsFactory() { + return AnyPointer.factory; + } + + @Override + public RemotePromise sendInternal() { + return requestHook.send(); + } + }; + } + + static StreamingRequest newTypelessStreamingRequest(AnyPointer.Builder params, RequestHook requestHook) { + return new StreamingRequest<>() { + @Override + public AnyPointer.Builder getParams() { + return params; + } + + @Override + public org.capnproto.StreamingRequest getTypelessRequest() { + return this; + } + + @Override + public RequestHook getHook() { + return requestHook; + } + + @Override + public FromPointerBuilder getParamsFactory() { + return AnyPointer.factory; + } + + public CompletableFuture send() { + return requestHook.sendStreaming(); + } + }; + } + + static Request newBrokenRequest(Throwable exc) { + + var message = new MessageBuilder(); + var params = message.getRoot(AnyPointer.factory); + + var hook = new RequestHook() { + @Override + public RemotePromise send() { + return new RemotePromise<>(CompletableFuture.failedFuture(exc), + new AnyPointer.Pipeline(PipelineHook.newBrokenPipeline(exc))); + } + + @Override + public CompletableFuture sendStreaming() { + return CompletableFuture.failedFuture(exc); + } + }; + + return Capability.newTypelessRequest(params, hook); + } + public static ClientHook newBrokenCap(String reason) { return newBrokenClient(reason, false, ClientHook.BROKEN_CAPABILITY_BRAND); } @@ -568,16 +651,15 @@ public static ClientHook newNullCap() { return newBrokenClient(RpcException.failed("Called null capability"), true, ClientHook.NULL_CAPABILITY_BRAND); } - static private ClientHook newBrokenClient(String reason, boolean resolved, Object brand) { + private static ClientHook newBrokenClient(String reason, boolean resolved, Object brand) { return newBrokenClient(RpcException.failed(reason), resolved, brand); } - static private ClientHook newBrokenClient(Throwable exc, boolean resolved, Object brand) { + private static ClientHook newBrokenClient(Throwable exc, boolean resolved, Object brand) { return new ClientHook() { @Override public Request newCall(long interfaceId, short methodId) { - var broken = Request.newBrokenRequest(AnyPointer.factory, exc); - return new AnyPointer.Request(broken.getParams(), broken.getHook()); + return newBrokenRequest(exc); } @Override @@ -689,7 +771,7 @@ public Request newCall(long interfaceId, short methodId) { var hook = new LocalRequest(interfaceId, methodId, this); this.pendingCalls.add(hook); var root = hook.message.getRoot(AnyPointer.factory); - return new AnyPointer.Request(root, hook); + return newTypelessRequest(root, hook); } @Override diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index 5e24a826..6f782373 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -14,61 +14,4 @@ default FromPointerBuilder getParamsFactory() { default RequestBase getTypelessRequest() { return getBaseRequest().getTypelessRequest(); } - - static Request newBrokenRequest(FromPointerBuilder paramsFactory, - Throwable exc) { - - var message = new MessageBuilder(); - - var hook = new RequestHook() { - @Override - public RemotePromise send() { - return new RemotePromise<>(CompletableFuture.failedFuture(exc), - new AnyPointer.Pipeline(PipelineHook.newBrokenPipeline(exc))); - } - - @Override - public CompletableFuture sendStreaming() { - return CompletableFuture.failedFuture(exc); - } - }; - - return new Request<>() { - @Override - public FromPointerBuilder getParamsFactory() { - return paramsFactory; - } - - @Override - public RequestBase getTypelessRequest() { - return new AnyPointer.Request(message.getRoot(AnyPointer.factory), hook); - } - - @Override - public Request getBaseRequest() { - return this; - } - }; - } - - static Request fromTypeless( - FromPointerBuilder paramsFactory, - Request typeless) { - return new Request<>() { - @Override - public FromPointerBuilder getParamsFactory() { - return paramsFactory; - } - - @Override - public Request getTypelessRequest() { - return typeless; - } - - @Override - public Request getBaseRequest() { - return this; - } - }; - } } From 250f14e2f4c939a05f5dc412a91c03fb3ba16473 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 27 Nov 2020 11:25:39 +0000 Subject: [PATCH 183/246] simplify QueuedPipeline promise --- .../main/java/org/capnproto/Capability.java | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index a54bc573..e41e949b 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -688,17 +688,14 @@ public Object getBrand() { private static final class QueuedPipeline implements PipelineHook { private final CompletableFuture promise; - private final CompletableFuture selfResolutionOp; PipelineHook redirect; private final Map, ClientHook> clientMap = new HashMap<>(); - QueuedPipeline(CompletableFuture promiseParam) { - this.promise = promiseParam; - this.selfResolutionOp = promise.handle((pipeline, exc) -> { + QueuedPipeline(CompletableFuture promise) { + this.promise = promise.whenComplete((pipeline, exc) -> { this.redirect = exc == null ? pipeline : PipelineHook.newBrokenPipeline(exc); - return null; }); } @@ -713,17 +710,6 @@ public final ClientHook getPipelinedCap(PipelineOp[] ops) { k -> new QueuedClient(this.promise.thenApply( pipeline -> pipeline.getPipelinedCap(ops)))); } -/* - @Override - public void close() { - if (this.redirect != null) { - this.redirect.close(); - } - else { - this.promise.cancel(false); - } - } - */ } // A ClientHook which simply queues calls while waiting for a ClientHook to which to forward them. From a53f7db25eab3ce792d6e2eb95ffd2449e36d0de Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 27 Nov 2020 11:30:12 +0000 Subject: [PATCH 184/246] remove extraneous ArrayList wrapper from ops key --- runtime/src/main/java/org/capnproto/Capability.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index e41e949b..ba09aff8 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -704,8 +704,7 @@ public final ClientHook getPipelinedCap(PipelineOp[] ops) { if (redirect != null) { return redirect.getPipelinedCap(ops); } - - var key = new ArrayList<>(Arrays.asList(ops)); + var key = Arrays.asList(ops); return this.clientMap.computeIfAbsent(key, k -> new QueuedClient(this.promise.thenApply( pipeline -> pipeline.getPipelinedCap(ops)))); From 789d2df6e43b5970d573b97f6ddbf8278825c632 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 27 Nov 2020 11:12:40 +0000 Subject: [PATCH 185/246] replace PipelineOp[] with short[] --- .../src/main/java/org/capnproto/RpcState.java | 43 ++++++++++--------- .../main/java/org/capnproto/AnyPointer.java | 25 +++++------ .../main/java/org/capnproto/Capability.java | 13 ++++-- .../main/java/org/capnproto/PipelineHook.java | 2 +- .../main/java/org/capnproto/PipelineOp.java | 28 ------------ 5 files changed, 43 insertions(+), 68 deletions(-) delete mode 100644 runtime/src/main/java/org/capnproto/PipelineOp.java diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 77dc415e..a0ea905c 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -398,7 +398,7 @@ ClientHook restore() { LOGGER.fine(() -> this.toString() + ": > BOOTSTRAP question=" + question.id); message.send(); - return pipeline.getPipelinedCap(new PipelineOp[0]); + return pipeline.getPipelinedCap(new short[0]); } /** @@ -1534,7 +1534,7 @@ private class RpcPipeline implements PipelineHook { private RpcResponse resolved; private Throwable broken; - private final HashMap, ClientHook> clientMap = new HashMap<>(); + private final HashMap, ClientHook> clientMap = new HashMap<>(); private final CompletableFuture redirectLater; private final CompletableFuture resolveSelf; @@ -1566,9 +1566,11 @@ private class RpcPipeline implements PipelineHook { } @Override - public ClientHook getPipelinedCap(PipelineOp[] ops) { - // TODO avoid conversion to/from ArrayList? - var key = new ArrayList<>(Arrays.asList(ops)); + public ClientHook getPipelinedCap(short[] ops) { + var key = new ArrayList(ops.length); + for (short op: ops) { + key.add(op); + } return this.clientMap.computeIfAbsent(key, k -> { return switch (state) { @@ -2003,11 +2005,11 @@ private ClientHook resolve(ClientHook replacement) { private class PipelineClient extends RpcClient { private final QuestionRef questionRef; - private final PipelineOp[] ops; + private final short[] ops; - PipelineClient(QuestionRef questionRef, PipelineOp[] ops) { + PipelineClient(QuestionRef questionRef, short[] ops) { this.questionRef = questionRef; - this.ops = ops; + this.ops = ops.clone(); } @Override @@ -2037,34 +2039,35 @@ public ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target) { } } - static void FromPipelineOps(PipelineOp[] ops, RpcProtocol.PromisedAnswer.Builder builder) { + static void FromPipelineOps(short[] ops, RpcProtocol.PromisedAnswer.Builder builder) { var transforms = builder.initTransform(ops.length); for (int ii = 0; ii < ops.length; ++ii) { var transform = transforms.get(ii); - switch (ops[ii].type) { - case NOOP -> transform.setNoop(null); - case GET_POINTER_FIELD -> transform.setGetPointerField(ops[ii].pointerIndex); + var pointerIndex = ops[ii]; + if (pointerIndex < 0) { + transform.setNoop(null); + } + else { + transform.setGetPointerField(pointerIndex); } } } - static PipelineOp[] ToPipelineOps(RpcProtocol.PromisedAnswer.Reader reader) { + static short[] ToPipelineOps(RpcProtocol.PromisedAnswer.Reader reader) { var transforms = reader.getTransform(); - var ops = new PipelineOp[transforms.size()]; + var ops = new short[transforms.size()]; for (int ii = 0; ii < ops.length; ++ii) { var transform = transforms.get(ii); switch (transform.which()) { case NOOP: - ops[ii] = PipelineOp.Noop(); // TODO null? + ops[ii] = -1; break; case GET_POINTER_FIELD: - ops[ii] = PipelineOp.PointerField(transform.getGetPointerField()); + ops[ii] = transform.getGetPointerField(); break; - default: - // TODO improve error handling here - // Unsupported pipeline ops + case _NOT_IN_SCHEMA: return null; - } + }; } return ops; } diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index ca3f4901..8f750cb0 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -80,18 +80,13 @@ public final T getAs(FromPointerReader factory) { return factory.fromPointerReader(this.segment, this.capTable, this.pointer, this.nestingLimit); } - public final ClientHook getPipelinedCap(PipelineOp[] ops) { + public final ClientHook getPipelinedCap(short[] ops) { AnyPointer.Reader any = this; - for (var op: ops) { - switch (op.type) { - case NOOP: - break; - case GET_POINTER_FIELD: - var index = op.pointerIndex; - var reader = WireHelpers.readStructPointer(any.segment, any.capTable, any.pointer, null, 0, any.nestingLimit); - any = reader._getPointerField(AnyPointer.factory, op.pointerIndex); - break; + for (var pointerIndex: ops) { + if (pointerIndex >= 0) { + var reader = WireHelpers.readStructPointer(any.segment, any.capTable, any.pointer, null, 0, any.nestingLimit); + any = reader._getPointerField(AnyPointer.factory, pointerIndex); } } return WireHelpers.readCapabilityPointer(any.segment, any.capTable, any.pointer, 0); @@ -151,13 +146,13 @@ public static final class Pipeline implements org.capnproto.Pipeline { final PipelineHook hook; - private final PipelineOp[] ops; + private final short[] ops; public Pipeline(PipelineHook hook) { - this(hook, new PipelineOp[0]); + this(hook, new short[0]); } - Pipeline(PipelineHook hook, PipelineOp[] ops) { + Pipeline(PipelineHook hook, short[] ops) { this.hook = hook; this.ops = ops; } @@ -181,9 +176,9 @@ public ClientHook asCap() { } public Pipeline getPointerField(short pointerIndex) { - var newOps = new PipelineOp[this.ops.length + 1]; + var newOps = new short[this.ops.length + 1]; System.arraycopy(this.ops, 0, newOps, 0, this.ops.length); - newOps[this.ops.length] = PipelineOp.PointerField(pointerIndex); + newOps[this.ops.length] = pointerIndex; return new Pipeline(this.hook, newOps); } } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index ba09aff8..5abe634a 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -465,7 +465,7 @@ private static final class LocalPipeline implements PipelineHook { } @Override - public final ClientHook getPipelinedCap(PipelineOp[] ops) { + public final ClientHook getPipelinedCap(short[] ops) { return this.results.getPipelinedCap(ops); } } @@ -689,7 +689,7 @@ private static final class QueuedPipeline implements PipelineHook { private final CompletableFuture promise; PipelineHook redirect; - private final Map, ClientHook> clientMap = new HashMap<>(); + private final Map, ClientHook> clientMap = new HashMap<>(); QueuedPipeline(CompletableFuture promise) { this.promise = promise.whenComplete((pipeline, exc) -> { @@ -700,11 +700,16 @@ private static final class QueuedPipeline implements PipelineHook { } @Override - public final ClientHook getPipelinedCap(PipelineOp[] ops) { + public final ClientHook getPipelinedCap(short[] ops) { if (redirect != null) { return redirect.getPipelinedCap(ops); } - var key = Arrays.asList(ops); + + var key = new ArrayList(ops.length); + for (short op: ops) { + key.add(op); + } + return this.clientMap.computeIfAbsent(key, k -> new QueuedClient(this.promise.thenApply( pipeline -> pipeline.getPipelinedCap(ops)))); diff --git a/runtime/src/main/java/org/capnproto/PipelineHook.java b/runtime/src/main/java/org/capnproto/PipelineHook.java index 1298ab1a..2a2adad9 100644 --- a/runtime/src/main/java/org/capnproto/PipelineHook.java +++ b/runtime/src/main/java/org/capnproto/PipelineHook.java @@ -2,7 +2,7 @@ public interface PipelineHook { - ClientHook getPipelinedCap(PipelineOp[] ops); + ClientHook getPipelinedCap(short[] ops); default void cancel(Throwable exc) { } diff --git a/runtime/src/main/java/org/capnproto/PipelineOp.java b/runtime/src/main/java/org/capnproto/PipelineOp.java deleted file mode 100644 index 11d32ca9..00000000 --- a/runtime/src/main/java/org/capnproto/PipelineOp.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.capnproto; - -final class PipelineOp { - - // TODO just use array of Short? - - enum Type { - NOOP, - GET_POINTER_FIELD - } - - final PipelineOp.Type type; - final short pointerIndex; - - private PipelineOp(PipelineOp.Type type, short pointerIndex) { - this.type = type; - this.pointerIndex = pointerIndex; - } - - static PipelineOp Noop() { - return new PipelineOp(Type.NOOP, (short) 0); - } - - static PipelineOp PointerField(short pointerIndex) { - return new PipelineOp(Type.GET_POINTER_FIELD, pointerIndex); - } - -} From ab44843b123b15a3a166069d4ac74aa2280095a9 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 27 Nov 2020 15:24:37 +0000 Subject: [PATCH 186/246] QueuedClient should stop queuing calls once it has resolved --- .../src/main/java/org/capnproto/Capability.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 5abe634a..8115b718 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -759,7 +759,12 @@ private static class QueuedClient implements ClientHook { @Override public Request newCall(long interfaceId, short methodId) { var hook = new LocalRequest(interfaceId, methodId, this); - this.pendingCalls.add(hook); + if (this.redirect == null) { + this.pendingCalls.add(hook); + } + else { + hook.releaseCall(); + } var root = hook.message.getRoot(AnyPointer.factory); return newTypelessRequest(root, hook); } @@ -767,7 +772,12 @@ public Request newCall(long interfaceId, short methodId) { @Override public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { var promise = new CompletableFuture(); - this.queuedCalls.add(promise); + if (this.redirect == null) { + this.queuedCalls.add(promise); + } + else { + promise.complete(this.redirect); + } var callResult = promise.thenApply( client -> client.call(interfaceId, methodId, ctx)); From 66ee9471f92e42c5829716422895c546f977712a Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 28 Nov 2020 09:55:53 +0000 Subject: [PATCH 187/246] replace Integers with FileDescriptors --- .../src/main/java/org/capnproto/RpcState.java | 43 +++++++++---------- .../org/capnproto/TwoPartyVatNetwork.java | 11 ++--- .../main/java/org/capnproto/Capability.java | 3 +- .../main/java/org/capnproto/ClientHook.java | 3 +- .../org/capnproto/IncomingRpcMessage.java | 3 +- .../org/capnproto/OutgoingRpcMessage.java | 3 +- 6 files changed, 34 insertions(+), 32 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index a0ea905c..0211aa05 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1,5 +1,6 @@ package org.capnproto; +import java.io.FileDescriptor; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; @@ -162,7 +163,7 @@ static final class Export { final class Import { final int importId; ImportDisposer disposer; - Integer fd; + FileDescriptor fd; int remoteRefCount; RpcClient appClient; CompletableFuture promise; @@ -176,7 +177,7 @@ void addRemoteRef() { this.remoteRefCount++; } - void setFdIfMissing(Integer fd) { + void setFdIfMissing(FileDescriptor fd) { if (this.fd == null) { this.fd = fd; } @@ -541,7 +542,7 @@ void handleBootstrap(RpcProtocol.Bootstrap.Reader bootstrap) { ? caps[0] : Capability.newNullCap(); - var fds = List.of(); + var fds = List.of(); response.setFds(List.of()); answer.resultExports = writeDescriptors(caps, payload, fds); @@ -872,7 +873,7 @@ private void handleDisembargo(RpcProtocol.Disembargo.Reader disembargo) { } } - private int[] writeDescriptors(ClientHook[] capTable, RpcProtocol.Payload.Builder payload, List fds) { + private int[] writeDescriptors(ClientHook[] capTable, RpcProtocol.Payload.Builder payload, List fds) { if (capTable.length == 0) { return new int[0]; } @@ -897,7 +898,7 @@ private int[] writeDescriptors(ClientHook[] capTable, RpcProtocol.Payload.Builde .toArray(); } - private Integer writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builder descriptor, List fds) { + private Integer writeDescriptor(ClientHook cap, RpcProtocol.CapDescriptor.Builder descriptor, List fds) { ClientHook inner = cap; for (;;) { var resolved = inner.getResolved(); @@ -982,7 +983,7 @@ CompletionStage resolveExportedPromise(int exportId, CompletionS var message = connection.newOutgoingMessage(sizeHint); var resolve = message.getBody().initAs(RpcProtocol.Message.factory).initResolve(); resolve.setPromiseId(exportId); - var fds = List.of(); + var fds = List.of(); writeDescriptor(exp.clientHook, resolve.initCap(), fds); message.setFds(fds); LOGGER.fine(() -> this.toString() + ": > RESOLVE export=" + exportId); @@ -1027,7 +1028,7 @@ void releaseExport(int exportId, int refcount) { } } - private List receiveCaps(StructList.Reader capTable, List fds) { + private List receiveCaps(StructList.Reader capTable, List fds) { var result = new ArrayList(); for (var cap: capTable) { result.add(receiveCap(cap, fds)); @@ -1035,10 +1036,8 @@ private List receiveCaps(StructList.Reader fds) { - // TODO AutoCloseFd - Integer fd = null; - + private ClientHook receiveCap(RpcProtocol.CapDescriptor.Reader descriptor, List fds) { + FileDescriptor fd = null; int fdIndex = descriptor.getAttachedFd(); if (fdIndex >= 0 && fdIndex < fds.size()) { fd = fds.get(fdIndex); @@ -1097,10 +1096,8 @@ else if (exp.clientHook.getBrand() == this) { } } - private ClientHook importCap(int importId, boolean isPromise, Integer fd) { + private ClientHook importCap(int importId, boolean isPromise, FileDescriptor fd) { // Receive a new import. - - var imp = imports.put(importId); ImportClient importClient; @@ -1260,7 +1257,7 @@ public AnyPointer.Builder getResultsBuilder() { int[] send() { var capTable = this.capTable.getTable(); - var fds = List.of(); + var fds = List.of(); var exports = writeDescriptors(capTable, payload, fds); // TODO process FDs message.setFds(fds); @@ -1606,7 +1603,7 @@ public void cancel(Throwable exc) { abstract class RpcClient implements ClientHook { - public abstract Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds); + public abstract Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds); public abstract ClientHook writeTarget(RpcProtocol.MessageTarget.Builder target); @@ -1708,7 +1705,7 @@ public RemotePromise send() { QuestionRef sendInternal(boolean isTailCall) { // TODO refactor - var fds = List.of(); + var fds = List.of(); var exports = writeDescriptors(capTable.getTable(), callBuilder.getParams(), fds); message.setFds(fds); var question = questions.next(); @@ -1790,7 +1787,7 @@ private class ImportClient extends RpcClient { } @Override - public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { + public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { descriptor.setReceiverHosted(this.importRef.importId); return null; } @@ -1807,7 +1804,7 @@ public CompletableFuture whenMoreResolved() { } @Override - public Integer getFd() { + public FileDescriptor getFd() { var imp = imports.find(this.importRef.importId); return imp != null ? imp.fd : null; } @@ -1871,7 +1868,7 @@ private class PromiseClient extends RpcClient { } @Override - public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder target, List fds) { + public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder target, List fds) { this.receivedCall = true; return RpcState.this.writeDescriptor(this.cap, target, fds); } @@ -1913,7 +1910,7 @@ public CompletableFuture whenMoreResolved() { } @Override - public Integer getFd() { + public FileDescriptor getFd() { if (this.isResolved()) { return this.cap.getFd(); } @@ -2023,7 +2020,7 @@ public CompletableFuture whenMoreResolved() { } @Override - public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { + public Integer writeDescriptor(RpcProtocol.CapDescriptor.Builder descriptor, List fds) { var promisedAnswer = descriptor.initReceiverAnswer(); promisedAnswer.setQuestionId(questionRef.questionId); FromPipelineOps(ops, promisedAnswer); @@ -2134,7 +2131,7 @@ public Object getBrand() { } @Override - public Integer getFd() { + public FileDescriptor getFd() { return this.inner.getFd(); } } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 9af830c9..9dbfa376 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -1,5 +1,6 @@ package org.capnproto; +import java.io.FileDescriptor; import java.nio.channels.AsynchronousSocketChannel; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -110,7 +111,7 @@ private synchronized void write(MessageBuilder message) { final class OutgoingMessage implements OutgoingRpcMessage { private final MessageBuilder message; - private List fds = List.of(); + private List fds = List.of(); OutgoingMessage(int firstSegmentWordSize) { this.message = new MessageBuilder(firstSegmentWordSize == 0 @@ -124,7 +125,7 @@ public AnyPointer.Builder getBody() { } @Override - public void setFds(List fds) { + public void setFds(List fds) { this.fds = fds; } @@ -146,13 +147,13 @@ public int sizeInWords() { static final class IncomingMessage implements IncomingRpcMessage { private final MessageReader message; - private final List fds; + private final List fds; IncomingMessage(MessageReader message) { this(message, List.of()); } - IncomingMessage(MessageReader message, List fds) { + IncomingMessage(MessageReader message, List fds) { this.message = message; this.fds = fds; } @@ -163,7 +164,7 @@ public AnyPointer.Reader getBody() { } @Override - public List getAttachedFds() { + public List getAttachedFds() { return this.fds; } } diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 8115b718..43eeaf65 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -1,5 +1,6 @@ package org.capnproto; +import java.io.FileDescriptor; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; @@ -75,7 +76,7 @@ default CompletableFuture whenResolved() { * The file descriptor will remain open at least as long as the {@link Client} remains alive. * If you need it to last longer, you will need to `dup()` it. */ - default CompletableFuture getFd() { + default CompletableFuture getFd() { var fd = this.getHook().getFd(); if (fd != null) { return CompletableFuture.completedFuture(fd); diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index 2d4842d5..bb815502 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -1,5 +1,6 @@ package org.capnproto; +import java.io.FileDescriptor; import java.util.concurrent.CompletableFuture; public interface ClientHook { @@ -71,7 +72,7 @@ default boolean isError() { * Implements {@link Capability.Client.getFd}. If this returns null but whenMoreResolved() returns * non-null, then Capability::Client::getFd() waits for resolution and tries again. */ - default Integer getFd() { + default FileDescriptor getFd() { return null; } diff --git a/runtime/src/main/java/org/capnproto/IncomingRpcMessage.java b/runtime/src/main/java/org/capnproto/IncomingRpcMessage.java index 60b4c5dd..eb5692dc 100644 --- a/runtime/src/main/java/org/capnproto/IncomingRpcMessage.java +++ b/runtime/src/main/java/org/capnproto/IncomingRpcMessage.java @@ -1,12 +1,13 @@ package org.capnproto; +import java.io.FileDescriptor; import java.util.List; public interface IncomingRpcMessage { AnyPointer.Reader getBody(); - default List getAttachedFds() { + default List getAttachedFds() { return List.of(); } } diff --git a/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java b/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java index 86b7a1e7..e91f5292 100644 --- a/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java +++ b/runtime/src/main/java/org/capnproto/OutgoingRpcMessage.java @@ -1,12 +1,13 @@ package org.capnproto; +import java.io.FileDescriptor; import java.util.List; public interface OutgoingRpcMessage { AnyPointer.Builder getBody(); - default void setFds(List fds) { + default void setFds(List fds) { } default List getFds() { From c66250f4927865077041801509cd5b21870f117b Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 28 Nov 2020 10:23:21 +0000 Subject: [PATCH 188/246] remove sizeHint branch from new outgoing messages --- .../src/main/java/org/capnproto/TwoPartyVatNetwork.java | 4 +--- runtime-rpc/src/main/java/org/capnproto/VatNetwork.java | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 9dbfa376..70ee22a6 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -114,9 +114,7 @@ final class OutgoingMessage implements OutgoingRpcMessage { private List fds = List.of(); OutgoingMessage(int firstSegmentWordSize) { - this.message = new MessageBuilder(firstSegmentWordSize == 0 - ? BuilderArena.SUGGESTED_FIRST_SEGMENT_WORDS - : firstSegmentWordSize); + this.message = new MessageBuilder(firstSegmentWordSize); } @Override diff --git a/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java index eb8fc211..534e8d0e 100644 --- a/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/VatNetwork.java @@ -6,7 +6,7 @@ public interface VatNetwork { interface Connection extends AutoCloseable { default OutgoingRpcMessage newOutgoingMessage() { - return newOutgoingMessage(0); + return newOutgoingMessage(BuilderArena.SUGGESTED_FIRST_SEGMENT_WORDS); } OutgoingRpcMessage newOutgoingMessage(int firstSegmentWordSize); CompletableFuture receiveIncomingMessage(); From d02e460f06f47965a4d99bb151042a8b6eb1401e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 30 Nov 2020 17:47:23 +0000 Subject: [PATCH 189/246] tidy up response and pipeline construction --- .../src/main/java/org/capnproto/RpcState.java | 7 ++++--- .../src/main/java/org/capnproto/Capability.java | 14 +++++++++----- .../src/main/java/org/capnproto/PipelineHook.java | 4 ---- .../src/main/java/org/capnproto/RemotePromise.java | 11 ++++++----- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 0211aa05..7cc1e021 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1177,7 +1177,7 @@ ClientHook getMessageTarget(RpcProtocol.MessageTarget.Reader target) { } var pipeline = base.pipeline; if (pipeline == null) { - pipeline = PipelineHook.newBrokenPipeline( + pipeline = Capability.newBrokenPipeline( RpcException.failed("Pipeline call on a request that returned no capabilities or was already closed.")); } var ops = ToPipelineOps(promisedAnswer); @@ -1681,7 +1681,8 @@ private RpcProtocol.Call.Builder getCall() { @Override public RemotePromise send() { if (isDisconnected()) { - return new RemotePromise<>(CompletableFuture.failedFuture(disconnected), null); + return new RemotePromise<>(CompletableFuture.failedFuture(disconnected), + Capability.newBrokenPipeline(disconnected)); } var redirect = this.target.writeTarget(this.callBuilder.getTarget()); @@ -1700,7 +1701,7 @@ public RemotePromise send() { var appPromise = questionRef.response.thenApply( hook -> new Response<>(hook.getResults(), hook)); - return new RemotePromise<>(appPromise, new AnyPointer.Pipeline(pipeline)); + return new RemotePromise<>(appPromise, pipeline); } QuestionRef sendInternal(boolean isTailCall) { diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 43eeaf65..ee026175 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -442,7 +442,7 @@ public RemotePromise send() { this.callRelease.complete(null); assert promiseAndPipeline.pipeline != null; - return new RemotePromise<>(promise, new AnyPointer.Pipeline(promiseAndPipeline.pipeline)); + return new RemotePromise<>(promise, promiseAndPipeline.pipeline); } @Override @@ -545,7 +545,7 @@ public CompletableFuture onTailCall() { public ClientHook.VoidPromiseAndPipeline directTailCall(RequestHook request) { assert this.response == null : "Can't call tailCall() after initializing the results struct."; var promise = request.send(); - var voidPromise = promise._getResponse().thenAccept(tailResponse -> { + var voidPromise = promise.response.thenAccept(tailResponse -> { this.response = tailResponse; }); return new ClientHook.VoidPromiseAndPipeline(voidPromise, promise.pipeline().hook); @@ -619,6 +619,10 @@ public CompletableFuture send() { }; } + static PipelineHook newBrokenPipeline(Throwable exc) { + return ops -> newBrokenCap(exc); + } + static Request newBrokenRequest(Throwable exc) { var message = new MessageBuilder(); @@ -628,7 +632,7 @@ static Request newBrokenRequest(Throwable exc) { @Override public RemotePromise send() { return new RemotePromise<>(CompletableFuture.failedFuture(exc), - new AnyPointer.Pipeline(PipelineHook.newBrokenPipeline(exc))); + newBrokenPipeline(exc)); } @Override @@ -665,7 +669,7 @@ public Request newCall(long interfaceId, short methodId) { @Override public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { - return new VoidPromiseAndPipeline(CompletableFuture.failedFuture(exc), PipelineHook.newBrokenPipeline(exc)); + return new VoidPromiseAndPipeline(CompletableFuture.failedFuture(exc), newBrokenPipeline(exc)); } @Override @@ -696,7 +700,7 @@ private static final class QueuedPipeline implements PipelineHook { this.promise = promise.whenComplete((pipeline, exc) -> { this.redirect = exc == null ? pipeline - : PipelineHook.newBrokenPipeline(exc); + : newBrokenPipeline(exc); }); } diff --git a/runtime/src/main/java/org/capnproto/PipelineHook.java b/runtime/src/main/java/org/capnproto/PipelineHook.java index 2a2adad9..0b691e02 100644 --- a/runtime/src/main/java/org/capnproto/PipelineHook.java +++ b/runtime/src/main/java/org/capnproto/PipelineHook.java @@ -6,8 +6,4 @@ public interface PipelineHook { default void cancel(Throwable exc) { } - - static PipelineHook newBrokenPipeline(Throwable exc) { - return ops -> Capability.newBrokenCap(exc); - } } diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index 6ea45030..21d9c7d4 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -6,7 +6,7 @@ public class RemotePromise extends CompletableFutureWrapper implements AutoCloseable { - private final CompletableFuture> response; + final CompletableFuture> response; private final AnyPointer.Pipeline pipeline; public RemotePromise(FromPointerReader factory, @@ -19,6 +19,11 @@ public RemotePromise(FromPointerReader factory, this.pipeline = other.pipeline; } + public RemotePromise(CompletableFuture> promise, + PipelineHook pipeline) { + this(promise, new AnyPointer.Pipeline(pipeline)); + } + public RemotePromise(CompletableFuture> promise, AnyPointer.Pipeline pipeline) { super(promise.thenApply(Response::getResults)); @@ -32,10 +37,6 @@ public void close() { this.join(); } - CompletableFuture> _getResponse() { - return this.response; - } - public AnyPointer.Pipeline pipeline() { return this.pipeline; } From c04bdb80882405cf96bb8e59f6900bf64a1e32f2 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 30 Nov 2020 18:42:04 +0000 Subject: [PATCH 190/246] add clienthook commentary --- .../src/main/java/org/capnproto/ClientHook.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index bb815502..d21156b1 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -8,8 +8,25 @@ public interface ClientHook { Object NULL_CAPABILITY_BRAND = new Object(); Object BROKEN_CAPABILITY_BRAND = new Object(); + /** + * Start a new call, allowing the client to allocate request/response objects as it sees fit. + * This version is used when calls are made from application code in the local process. + */ Request newCall(long interfaceId, short methodId); + /** + * Call the object, but the caller controls allocation of the request/response objects. If the + * callee insists on allocating these objects itself, it must make a copy. This version is used + * when calls come in over the network via an RPC system. + * + * Since the caller of this method chooses the CallContext implementation, it is the caller's + * responsibility to ensure that the returned promise is not canceled unless allowed via + * the context's `allowCancellation()`. + * + * The call must not begin synchronously; the callee must arrange for the call to begin in a + * later turn of the event loop. Otherwise, application code may call back and affect the + * callee's state in an unexpected way. + */ VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context); /** From 2b5bf0eb2137eb43f031568bfded4145dd45791d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 30 Nov 2020 18:52:28 +0000 Subject: [PATCH 191/246] tidy up branding and implement QueuedClient,getBrand() correctly --- .../src/main/java/org/capnproto/RpcState.java | 15 ++++++--------- .../src/main/java/org/capnproto/Capability.java | 14 +++++++++++--- .../src/main/java/org/capnproto/ClientHook.java | 11 +++-------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 7cc1e021..55be7b26 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1939,10 +1939,10 @@ private ClientHook resolve(ClientHook replacement) { // We resolved to some other RPC capability hosted by the same peer. var promise = replacement.whenMoreResolved(); if (promise != null) { - var other = (PromiseClient)replacement; + var other = (PromiseClient) replacement; while (other.resolutionType == ResolutionType.MERGED) { replacement = other.cap; - other = (PromiseClient)replacement; + other = (PromiseClient) replacement; assert replacement.getBrand() == replacementBrand; } @@ -1958,14 +1958,11 @@ private ClientHook resolve(ClientHook replacement) { resolutionType = ResolutionType.REMOTE; } } + else if (replacement.isNull() || replacement.isError()) { + resolutionType = ResolutionType.BROKEN; + } else { - if (replacementBrand == NULL_CAPABILITY_BRAND - || replacementBrand == BROKEN_CAPABILITY_BRAND) { - resolutionType = ResolutionType.BROKEN; - } - else { - resolutionType = ResolutionType.REFLECTED; - } + resolutionType = ResolutionType.REFLECTED; } assert isResolved(); diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index ee026175..ff8b5933 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -7,6 +7,9 @@ public final class Capability { + static final Object NULL_CAPABILITY_BRAND = new Object(); + static final Object BROKEN_CAPABILITY_BRAND = new Object(); + static class BuilderContext { CapTableBuilder capTable; } @@ -645,15 +648,15 @@ public CompletableFuture sendStreaming() { } public static ClientHook newBrokenCap(String reason) { - return newBrokenClient(reason, false, ClientHook.BROKEN_CAPABILITY_BRAND); + return newBrokenClient(reason, false, BROKEN_CAPABILITY_BRAND); } public static ClientHook newBrokenCap(Throwable exc) { - return newBrokenClient(exc, false, ClientHook.BROKEN_CAPABILITY_BRAND); + return newBrokenClient(exc, false, BROKEN_CAPABILITY_BRAND); } public static ClientHook newNullCap() { - return newBrokenClient(RpcException.failed("Called null capability"), true, ClientHook.NULL_CAPABILITY_BRAND); + return newBrokenClient(RpcException.failed("Called null capability"), true, NULL_CAPABILITY_BRAND); } private static ClientHook newBrokenClient(String reason, boolean resolved, Object brand) { @@ -800,6 +803,11 @@ public ClientHook getResolved() { public CompletableFuture whenMoreResolved() { return this.promiseForClientResolution.copy(); } + + @Override + public Object getBrand() { + return null; + } } public static final class CapabilityServerSet { diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index d21156b1..d04e125c 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -5,9 +5,6 @@ public interface ClientHook { - Object NULL_CAPABILITY_BRAND = new Object(); - Object BROKEN_CAPABILITY_BRAND = new Object(); - /** * Start a new call, allowing the client to allocate request/response objects as it sees fit. * This version is used when calls are made from application code in the local process. @@ -56,9 +53,7 @@ default CompletableFuture whenMoreResolved() { discover when a capability it needs to marshal is one that it created in the first place, and therefore it can transfer the capability without proxying. */ - default Object getBrand() { - return NULL_CAPABILITY_BRAND; - } + Object getBrand(); /** * Repeatedly calls whenMoreResolved() until it returns nullptr. @@ -75,14 +70,14 @@ default CompletableFuture whenResolved() { * reading a null pointer out of a Cap'n Proto message. */ default boolean isNull() { - return getBrand() == NULL_CAPABILITY_BRAND; + return getBrand() == Capability.NULL_CAPABILITY_BRAND; } /** * Returns true if the capability was created by newBrokenCap(). */ default boolean isError() { - return getBrand() == BROKEN_CAPABILITY_BRAND; + return getBrand() == Capability.BROKEN_CAPABILITY_BRAND; } /** From e9493cf2e1f80d21679d82c01356c002f701a0a1 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 6 Nov 2020 19:21:07 +0000 Subject: [PATCH 192/246] ensure group access pipelines are created --- runtime-rpc/src/test/schema/test.capnp | 102 +++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/runtime-rpc/src/test/schema/test.capnp b/runtime-rpc/src/test/schema/test.capnp index 8c6c8e2e..cd317a93 100644 --- a/runtime-rpc/src/test/schema/test.capnp +++ b/runtime-rpc/src/test/schema/test.capnp @@ -4,6 +4,17 @@ using Java = import "/capnp/java.capnp"; $Java.package("org.capnproto.rpctest"); $Java.outerClassname("Test"); +enum TestEnum { + foo @0; + bar @1; + baz @2; + qux @3; + quux @4; + corge @5; + grault @6; + garply @7; +} + struct TestAllTypes { voidField @0 : Void; boolField @1 : Bool; @@ -19,8 +30,99 @@ struct TestAllTypes { float64Field @11 : Float64; textField @12 : Text; dataField @13 : Data; + structField @14 : TestAllTypes; + enumField @15 : TestEnum; + interfaceField @16 : Void; # TODO + + voidList @17 : List(Void); + boolList @18 : List(Bool); + int8List @19 : List(Int8); + int16List @20 : List(Int16); + int32List @21 : List(Int32); + int64List @22 : List(Int64); + uInt8List @23 : List(UInt8); + uInt16List @24 : List(UInt16); + uInt32List @25 : List(UInt32); + uInt64List @26 : List(UInt64); + float32List @27 : List(Float32); + float64List @28 : List(Float64); + textList @29 : List(Text); + dataList @30 : List(Data); + structList @31 : List(TestAllTypes); + enumList @32 : List(TestEnum); + interfaceList @33 : List(Void); # TODO +} + +struct TestAnyPointer { + anyPointerField @0 :AnyPointer; + + # Do not add any other fields here! Some tests rely on anyPointerField being the last pointer + # in the struct. +} + +#struct TestAnyOthers { +# anyStructField @0 :AnyStruct; +# anyListField @1 :AnyList; +# capabilityField @2 :Capability; +#} + +struct TestOutOfOrder { + foo @3 :Text; + bar @2 :Text; + baz @8 :Text; + qux @0 :Text; + quux @6 :Text; + corge @4 :Text; + grault @1 :Text; + garply @7 :Text; + waldo @5 :Text; +} + +struct TestUnnamedUnion { + before @0 :Text; + + union { + foo @1 :UInt16; + bar @3 :UInt32; + } + + middle @2 :UInt16; + + after @4 :Text; +} + +struct TestUnionInUnion { + # There is no reason to ever do this. + outer :union { + inner :union { + foo @0 :Int32; + bar @1 :Int32; + } + baz @2 :Int32; + } } +struct TestGroups { + groups :union { + foo :group { + corge @0 :Int32; + grault @2 :Int64; + garply @8 :Text; + } + bar :group { + corge @3 :Int32; + grault @4 :Text; + garply @5 :Int64; + } + baz :group { + corge @1 :Int32; + grault @6 :Text; + garply @7 :Text; + } + } +} + + struct TestSturdyRef { hostId @0 :TestSturdyRefHostId; objectId @1 :AnyPointer; From 837f1b324c52a2433fffda71a2b4ed4f05c1a58e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 30 Nov 2020 20:20:53 +0000 Subject: [PATCH 193/246] add AnyList --- compiler/src/main/cpp/capnpc-java.c++ | 7 ++- runtime-rpc/src/test/schema/test.capnp | 10 ++-- .../src/main/java/org/capnproto/AnyList.java | 58 +++++++++++++++++++ 3 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/AnyList.java diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 49bc4a9d..c8e6bdd3 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -414,6 +414,8 @@ private: return kj::strTree("org.capnproto.Capability.", suffix); case schema::Type::AnyPointer::Unconstrained::STRUCT: return kj::strTree("org.capnproto.AnyStruct.", suffix); + case schema::Type::AnyPointer::Unconstrained::LIST: + return kj::strTree("org.capnproto.AnyList.", suffix); default: return kj::strTree("org.capnproto.AnyPointer.", suffix); } @@ -781,6 +783,8 @@ private: return kj::str("org.capnproto.Capability.factory"); case schema::Type::AnyPointer::Unconstrained::STRUCT: return kj::str("org.capnproto.AnyStruct.factory"); + case schema::Type::AnyPointer::Unconstrained::LIST: + return kj::str("org.capnproto.AnyList.factory"); default: return kj::str("org.capnproto.AnyPointer.factory"); } @@ -1042,7 +1046,8 @@ private: kind = FieldKind::ANY_POINTER; break; case schema::Type::AnyPointer::Unconstrained::LIST: - kind = FieldKind::LIST; + kind = FieldKind::ANY_POINTER; + break; case schema::Type::AnyPointer::Unconstrained::CAPABILITY: kind = FieldKind::INTERFACE; break; diff --git a/runtime-rpc/src/test/schema/test.capnp b/runtime-rpc/src/test/schema/test.capnp index cd317a93..06e7a18f 100644 --- a/runtime-rpc/src/test/schema/test.capnp +++ b/runtime-rpc/src/test/schema/test.capnp @@ -60,11 +60,11 @@ struct TestAnyPointer { # in the struct. } -#struct TestAnyOthers { -# anyStructField @0 :AnyStruct; -# anyListField @1 :AnyList; -# capabilityField @2 :Capability; -#} +struct TestAnyOthers { + anyStructField @0 :AnyStruct; + anyListField @1 :AnyList; + capabilityField @2 :Capability; +} struct TestOutOfOrder { foo @3 :Text; diff --git a/runtime/src/main/java/org/capnproto/AnyList.java b/runtime/src/main/java/org/capnproto/AnyList.java new file mode 100644 index 00000000..5524594d --- /dev/null +++ b/runtime/src/main/java/org/capnproto/AnyList.java @@ -0,0 +1,58 @@ +package org.capnproto; + +public class AnyList { + + public static final class Factory extends ListFactory { + + Factory() { + super(ElementSize.VOID); + } + + public final Reader asReader(Builder builder) { + return builder.asReader(); + } + + @Override + public Builder constructBuilder(SegmentBuilder segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount) { + return new Builder(segment, ptr, elementCount, step, structDataSize, structPointerCount); + } + + @Override + public Reader constructReader(SegmentReader segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount, int nestingLimit) { + return new Reader(segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); + } + } + + public static final Factory factory = new Factory(); + + public static final ListList.Factory listFactory = + new ListList.Factory<>(factory); + + public static final class Builder extends ListBuilder { + Builder(SegmentBuilder segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount){ + super(segment, ptr, elementCount, step, structDataSize, structPointerCount); + } + + public final Reader asReader() { + return new Reader(this.segment, this.ptr, this.elementCount, this.step, this.structDataSize, this.structPointerCount, 0x7fffffff); + } + + public final T initAs(Factory factory) { + return factory.constructBuilder(this.segment, this.ptr, this.elementCount, this.step, this.structDataSize, this.structPointerCount); + } + + public final T setAs(Factory factory) { + return factory.constructBuilder(this.segment, this.ptr, this.elementCount, this.step, this.structDataSize, this.structPointerCount); + } + } + + public static final class Reader extends ListReader { + Reader(SegmentReader segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount, int nestingLimit){ + super(segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); + } + + public final T getAs(Factory factory) { + return factory.constructReader(this.segment, this.ptr, this.elementCount, this.step, this.structDataSize, this.structPointerCount, this.nestingLimit); + } + } +} From 3b1f5f416c96e374064293f7f11786e152e0dbb8 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 1 Dec 2020 17:08:27 +0000 Subject: [PATCH 194/246] use lists for queued calls, clean up on resolution --- runtime/src/main/java/org/capnproto/Capability.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index ff8b5933..9bf9e28a 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -738,8 +738,8 @@ private static class QueuedClient implements ClientHook { // resolves). private ClientHook redirect; - private final Queue> queuedCalls = new ArrayDeque<>(); - private final Queue pendingCalls = new ArrayDeque<>(); + private final List> queuedCalls = new ArrayList<>(); + private final List pendingCalls = new ArrayList<>(); QueuedClient(CompletableFuture promise) { this.selfResolutionOp = promise.handle((inner, exc) -> { @@ -760,6 +760,9 @@ private static class QueuedClient implements ClientHook { hook.releaseCall(); } + this.queuedCalls.clear(); + this.pendingCalls.clear(); + return null; }); } From 53eeed97e27c8c84df9fcc690a2328729f924ac5 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 1 Dec 2020 17:12:49 +0000 Subject: [PATCH 195/246] make direct call if QueuedClient has resolved --- runtime/src/main/java/org/capnproto/Capability.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 9bf9e28a..b7f614b0 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -782,18 +782,16 @@ public Request newCall(long interfaceId, short methodId) { @Override public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) { - var promise = new CompletableFuture(); - if (this.redirect == null) { - this.queuedCalls.add(promise); - } - else { - promise.complete(this.redirect); + if (this.redirect != null) { + return this.redirect.call(interfaceId, methodId, ctx); } + var promise = new CompletableFuture(); var callResult = promise.thenApply( client -> client.call(interfaceId, methodId, ctx)); var pipelineResult = callResult.thenApply(result -> result.pipeline); var pipeline = new QueuedPipeline(pipelineResult); + this.queuedCalls.add(promise); return new VoidPromiseAndPipeline(pipelineResult.thenRun(() -> {}), pipeline); } From e3eabe6476529348ea0aa70eb4cc22171dfcccd7 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 3 Dec 2020 12:11:15 +0000 Subject: [PATCH 196/246] copy params in direct tail call and remove invalid override in PipelineClient --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 55be7b26..81f64609 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1622,10 +1622,12 @@ public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContext } public VoidPromiseAndPipeline callNoIntercept(long interfaceId, short methodId, CallContextHook ctx) { + // Implement call() by copying params and results messages. var params = ctx.getParams(); var request = newCallNoIntercept(interfaceId, methodId); - ctx.allowCancellation(); + request.getParams().setAs(AnyPointer.factory, params); ctx.releaseParams(); + ctx.allowCancellation(); return ctx.directTailCall(request.getHook()); } @@ -2007,11 +2009,6 @@ private class PipelineClient extends RpcClient { this.ops = ops.clone(); } - @Override - public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook context) { - return null; - } - @Override public CompletableFuture whenMoreResolved() { return null; From 998b569d4cdc889be0de54f7b71b44955bca852f Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 3 Dec 2020 12:13:50 +0000 Subject: [PATCH 197/246] add ez-rpc --- .../main/java/org/capnproto/EzRpcClient.java | 46 +++++++++++++++++++ .../main/java/org/capnproto/EzRpcServer.java | 38 +++++++++++++++ .../test/java/org/capnproto/EzRpcTest.java | 31 +++++++++++++ runtime-rpc/src/test/logging.properties | 2 + 4 files changed, 117 insertions(+) create mode 100644 runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java create mode 100644 runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java create mode 100644 runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java create mode 100644 runtime-rpc/src/test/logging.properties diff --git a/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java b/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java new file mode 100644 index 00000000..b28da339 --- /dev/null +++ b/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java @@ -0,0 +1,46 @@ +package org.capnproto; + +import java.io.IOException; +import java.net.Socket; +import java.net.SocketAddress; +import java.nio.channels.AsynchronousSocketChannel; +import java.nio.channels.CompletionHandler; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +public class EzRpcClient { + + private final AsynchronousSocketChannel socket; + private final TwoPartyClient twoPartyRpc; + private final Capability.Client client; + + public EzRpcClient(SocketAddress address) throws Exception { + this.socket = AsynchronousSocketChannel.open(); + + var connected = new CompletableFuture(); + + this.socket.connect(address, null, new CompletionHandler<>() { + + @Override + public void completed(java.lang.Void result, Object attachment) { + connected.complete(null); + } + + @Override + public void failed(Throwable exc, Object attachment) { + connected.completeExceptionally(exc); + } + }); + + this.twoPartyRpc = new TwoPartyClient(socket); + this.client = new Capability.Client(connected.thenApply(void_ -> this.twoPartyRpc.bootstrap())); + } + + public Capability.Client getMain() { + return this.client; + } + + public CompletableFuture runUntil(CompletableFuture done) { + return this.twoPartyRpc.runUntil(done); + } +} diff --git a/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java b/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java new file mode 100644 index 00000000..2764c5a2 --- /dev/null +++ b/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java @@ -0,0 +1,38 @@ +package org.capnproto; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.nio.channels.AsynchronousChannelGroup; +import java.nio.channels.AsynchronousServerSocketChannel; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executors; + +public class EzRpcServer { + + private final AsynchronousChannelGroup channelgroup; + private final AsynchronousServerSocketChannel serverAcceptSocket; + private final TwoPartyServer twoPartyRpc; + private final int port; + + public EzRpcServer(Capability.Server bootstrapInterface, SocketAddress address) throws IOException { + this(new Capability.Client(bootstrapInterface), address); + } + + public EzRpcServer(Capability.Client bootstrapInterface, SocketAddress address) throws IOException { + this.channelgroup = AsynchronousChannelGroup.withThreadPool(Executors.newFixedThreadPool(1)); + this.serverAcceptSocket = AsynchronousServerSocketChannel.open(this.channelgroup); + this.serverAcceptSocket.bind(address); + var localAddress = (InetSocketAddress) this.serverAcceptSocket.getLocalAddress(); + this.port = localAddress.getPort(); + this.twoPartyRpc = new TwoPartyServer(bootstrapInterface); + } + + public int getPort() { + return this.port; + } + + public CompletableFuture start() { + return this.twoPartyRpc.listen(this.serverAcceptSocket); + } +} diff --git a/runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java b/runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java new file mode 100644 index 00000000..a089aa9c --- /dev/null +++ b/runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java @@ -0,0 +1,31 @@ +package org.capnproto; + + +import org.capnproto.rpctest.Test; +import org.junit.Assert; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.SocketAddress; + +public class EzRpcTest { + + @org.junit.Test + public void testBasic() throws Exception { + var callCount = new Counter(); + var address = new InetSocketAddress("localhost", 0); + var server = new EzRpcServer(new RpcTestUtil.TestInterfaceImpl(callCount), address); + server.start(); + + var client = new EzRpcClient(new InetSocketAddress("localhost", server.getPort())); + + var cap = new Test.TestInterface.Client(client.getMain()); + var request = cap.fooRequest(); + request.getParams().setI(123); + request.getParams().setJ(true); + + var response = client.runUntil(request.send()).join(); + Assert.assertEquals("foo", response.getX().toString()); + Assert.assertEquals(1, callCount.value()); + } +} diff --git a/runtime-rpc/src/test/logging.properties b/runtime-rpc/src/test/logging.properties new file mode 100644 index 00000000..73307ed0 --- /dev/null +++ b/runtime-rpc/src/test/logging.properties @@ -0,0 +1,2 @@ +handlers = java.util.logging.FileHandler +java.util.logging.ConsoleHandler.level = ALL \ No newline at end of file From f74ad80dea2d4c1fe63a2021013b2b1e28b57a84 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 3 Dec 2020 12:09:48 +0000 Subject: [PATCH 198/246] remove cancellation completion for now --- runtime/src/main/java/org/capnproto/Capability.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index b7f614b0..d481ae37 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -439,10 +439,6 @@ public RemotePromise send() { return context.response; }); - cancel.whenComplete((void_, exc) -> { - promiseAndPipeline.promise.cancel(false); - }); - this.callRelease.complete(null); assert promiseAndPipeline.pipeline != null; return new RemotePromise<>(promise, promiseAndPipeline.pipeline); From 196b82515c035f86a68befa3681952a0ddb61c50 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 3 Dec 2020 14:19:35 +0000 Subject: [PATCH 199/246] ensure StructBuilders and StructLists maintain capTable context --- .../src/main/java/org/capnproto/CapTableBuilder.java | 2 +- runtime/src/main/java/org/capnproto/Capability.java | 8 ++++---- .../src/main/java/org/capnproto/StructBuilder.java | 6 ++++++ .../src/main/java/org/capnproto/StructReader.java | 8 ++------ runtime/src/main/java/org/capnproto/WireHelpers.java | 12 ++++++------ 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/CapTableBuilder.java b/runtime/src/main/java/org/capnproto/CapTableBuilder.java index b1f7497b..01e68255 100644 --- a/runtime/src/main/java/org/capnproto/CapTableBuilder.java +++ b/runtime/src/main/java/org/capnproto/CapTableBuilder.java @@ -1,6 +1,6 @@ package org.capnproto; -interface CapTableBuilder extends CapTableReader { +public interface CapTableBuilder extends CapTableReader { int injectCap(ClientHook cap); void dropCap(int index); diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index d481ae37..e00733ba 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -10,12 +10,12 @@ public final class Capability { static final Object NULL_CAPABILITY_BRAND = new Object(); static final Object BROKEN_CAPABILITY_BRAND = new Object(); - static class BuilderContext { - CapTableBuilder capTable; + public static class BuilderContext { + public CapTableBuilder capTable; } - static class ReaderContext { - CapTableReader capTable; + public static class ReaderContext { + public CapTableReader capTable; } public static abstract class Factory diff --git a/runtime/src/main/java/org/capnproto/StructBuilder.java b/runtime/src/main/java/org/capnproto/StructBuilder.java index 0bded78a..6285dce6 100644 --- a/runtime/src/main/java/org/capnproto/StructBuilder.java +++ b/runtime/src/main/java/org/capnproto/StructBuilder.java @@ -44,11 +44,17 @@ default T constructBuilder(SegmentBuilder segment, CapTableBuilder capTable, int public StructBuilder(SegmentBuilder segment, int data, int pointers, int dataSize, short pointerCount) { + this(segment, null, data, pointers, dataSize, pointerCount); + } + + public StructBuilder(SegmentBuilder segment, CapTableBuilder capTable, int data, + int pointers, int dataSize, short pointerCount) { this.segment = segment; this.data = data; this.pointers = pointers; this.dataSize = dataSize; this.pointerCount = pointerCount; + this.capTable = capTable; } protected final boolean _getBooleanField(int offset) { diff --git a/runtime/src/main/java/org/capnproto/StructReader.java b/runtime/src/main/java/org/capnproto/StructReader.java index 4d8083f3..3225c712 100644 --- a/runtime/src/main/java/org/capnproto/StructReader.java +++ b/runtime/src/main/java/org/capnproto/StructReader.java @@ -51,17 +51,13 @@ public StructReader() { this.dataSize = 0; this.pointerCount = 0; this.nestingLimit = 0x7fffffff; + this.capTable = null; } public StructReader(SegmentReader segment, int data, int pointers, int dataSize, short pointerCount, int nestingLimit) { - this.segment = segment; - this.data = data; - this.pointers = pointers; - this.dataSize = dataSize; - this.pointerCount = pointerCount; - this.nestingLimit = nestingLimit; + this(segment, null, data, pointers, dataSize, pointerCount, nestingLimit); } public StructReader(SegmentReader segment, CapTableReader capTable, diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 782744d1..956883e2 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -503,7 +503,7 @@ static T initListPointer(ListBuilder.Factory factory, ListPointer.set(allocation.segment.buffer, allocation.refOffset, elementSize, elementCount); - return factory.constructBuilder(allocation.segment, + return factory.constructBuilder(allocation.segment, capTable, allocation.ptr * Constants.BYTES_PER_WORD, elementCount, step, dataSize, (short)pointerCount); } @@ -527,7 +527,7 @@ static T initStructListPointer(ListBuilder.Factory factory, WirePointer.STRUCT, elementCount); StructPointer.setFromStructSize(allocation.segment.buffer, allocation.ptr, elementSize); - return factory.constructBuilder(allocation.segment, + return factory.constructBuilder(allocation.segment, capTable, (allocation.ptr + 1) * Constants.BYTES_PER_WORD, elementCount, wordsPerElement * Constants.BITS_PER_WORD, elementSize.data * Constants.BITS_PER_WORD, elementSize.pointers); @@ -586,7 +586,7 @@ static T getWritableListPointer(ListBuilder.Factory factory, int step = dataSize + pointerCount * Constants.BITS_PER_POINTER; - return factory.constructBuilder(resolved.segment, resolved.ptr * Constants.BYTES_PER_WORD, + return factory.constructBuilder(resolved.segment, capTable, resolved.ptr * Constants.BYTES_PER_WORD, ListPointer.elementCount(resolved.ref), step, dataSize, (short) pointerCount); } @@ -629,7 +629,7 @@ static T getWritableStructListPointer(ListBuilder.Factory factory, if (oldDataSize >= elementSize.data && oldPointerCount >= elementSize.pointers) { //# Old size is at least as large as we need. Ship it. - return factory.constructBuilder(resolved.segment, oldPtr * Constants.BYTES_PER_WORD, + return factory.constructBuilder(resolved.segment, capTable, oldPtr * Constants.BYTES_PER_WORD, elementCount, oldStep * Constants.BITS_PER_WORD, oldDataSize * Constants.BITS_PER_WORD, oldPointerCount); @@ -685,7 +685,7 @@ static T getWritableStructListPointer(ListBuilder.Factory factory, memset(resolved.segment.buffer, resolved.ptr * Constants.BYTES_PER_WORD, (byte)0, (1 + oldStep * elementCount) * Constants.BYTES_PER_WORD); - return factory.constructBuilder(allocation.segment, newPtr * Constants.BYTES_PER_WORD, + return factory.constructBuilder(allocation.segment, capTable, newPtr * Constants.BYTES_PER_WORD, elementCount, newStep * Constants.BITS_PER_WORD, newDataSize * Constants.BITS_PER_WORD, @@ -764,7 +764,7 @@ static T getWritableStructListPointer(ListBuilder.Factory factory, memset(resolved.segment.buffer, resolved.ptr * Constants.BYTES_PER_WORD, (byte)0, roundBitsUpToBytes(oldStep * elementCount)); - return factory.constructBuilder(allocation.segment, newPtr * Constants.BYTES_PER_WORD, + return factory.constructBuilder(allocation.segment, capTable, newPtr * Constants.BYTES_PER_WORD, elementCount, newStep * Constants.BITS_PER_WORD, newDataSize * Constants.BITS_PER_WORD, From 25c50b105d551221434ae810acb2132b9969b801 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 3 Dec 2020 15:06:17 +0000 Subject: [PATCH 200/246] moar capTable context maintenance --- .../main/java/org/capnproto/ListBuilder.java | 7 ++++ .../main/java/org/capnproto/ListReader.java | 23 ++++++---- .../main/java/org/capnproto/StructList.java | 42 ++++++++++++++++++- .../main/java/org/capnproto/WireHelpers.java | 5 ++- 4 files changed, 67 insertions(+), 10 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/ListBuilder.java b/runtime/src/main/java/org/capnproto/ListBuilder.java index 7af8840e..19f3c59c 100644 --- a/runtime/src/main/java/org/capnproto/ListBuilder.java +++ b/runtime/src/main/java/org/capnproto/ListBuilder.java @@ -49,12 +49,19 @@ default T constructBuilder(SegmentBuilder segment, CapTableBuilder capTable, int public ListBuilder(SegmentBuilder segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount) { + this(segment, null, ptr, elementCount, step, structDataSize, structPointerCount); + } + + public ListBuilder(SegmentBuilder segment, CapTableBuilder capTable, int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount) { this.segment = segment; this.ptr = ptr; this.elementCount = elementCount; this.step = step; this.structDataSize = structDataSize; this.structPointerCount = structPointerCount; + this.capTable = capTable; } public int size() { diff --git a/runtime/src/main/java/org/capnproto/ListReader.java b/runtime/src/main/java/org/capnproto/ListReader.java index 79bb8653..bf1f45c6 100644 --- a/runtime/src/main/java/org/capnproto/ListReader.java +++ b/runtime/src/main/java/org/capnproto/ListReader.java @@ -28,9 +28,9 @@ T constructReader(SegmentReader segment, int elementCount, int step, int structDataSize, short structPointerCount, int nestingLimit); - default T constructReader(SegmentBuilder segment, CapTableReader capTable, int ptr, - int elementCount, int step, - int structDataSize, short structPointerCount, int nestingLimit) { + default T constructReader(SegmentReader segment, CapTableReader capTable, int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount, int nestingLimit) { var result = constructReader(segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); if (result instanceof Capability.ReaderContext) { ((Capability.ReaderContext) result).capTable = capTable; @@ -55,12 +55,22 @@ public ListReader() { this.structDataSize = 0; this.structPointerCount = 0; this.nestingLimit = 0x7fffffff; + this.capTable = null; } public ListReader(SegmentReader segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount, int nestingLimit) { + this(segment, null, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); + } + + public ListReader(SegmentReader segment, + CapTableReader capTable, + int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount, + int nestingLimit) { this.segment = segment; this.ptr = ptr; this.elementCount = elementCount; @@ -68,12 +78,11 @@ public ListReader(SegmentReader segment, int ptr, this.structDataSize = structDataSize; this.structPointerCount = structPointerCount; this.nestingLimit = nestingLimit; + this.capTable = capTable; } ListReader imbue(CapTableReader capTable) { - var result = new ListReader(segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); - result.capTable = capTable; - return result; + return new ListReader(segment, capTable, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); } public int size() { @@ -117,7 +126,7 @@ protected T _getStructElement(StructReader.Factory factory, int index) { int structData = this.ptr + (int)(indexBit / Constants.BITS_PER_BYTE); int structPointers = structData + (this.structDataSize / Constants.BITS_PER_BYTE); - return factory.constructReader(this.segment, structData, structPointers / 8, this.structDataSize, + return factory.constructReader(this.segment, this.capTable, structData, structPointers / 8, this.structDataSize, this.structPointerCount, this.nestingLimit - 1); } diff --git a/runtime/src/main/java/org/capnproto/StructList.java b/runtime/src/main/java/org/capnproto/StructList.java index df803879..414fcb6d 100644 --- a/runtime/src/main/java/org/capnproto/StructList.java +++ b/runtime/src/main/java/org/capnproto/StructList.java @@ -55,6 +55,27 @@ public final Builder constructBuilder(SegmentBuilder segment, return new Builder (factory, segment, ptr, elementCount, step, structDataSize, structPointerCount); } + @Override + public final Reader constructReader(SegmentReader segment, + CapTableReader capTable, + int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount, + int nestingLimit) { + return new Reader(factory, capTable, + segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); + } + + @Override + public final Builder constructBuilder(SegmentBuilder segment, + CapTableBuilder capTable, + int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount) { + return new Builder (factory, capTable, + segment, ptr, elementCount, step, structDataSize, structPointerCount); + } + @Override public final Builder fromPointerBuilderRefDefault(SegmentBuilder segment, CapTableBuilder capTable, int pointer, SegmentReader defaultSegment, int defaultOffset) { @@ -97,6 +118,17 @@ public Reader(StructReader.Factory factory, this.factory = factory; } + public Reader(StructReader.Factory factory, + CapTableReader capTable, + SegmentReader segment, + int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount, + int nestingLimit) { + super(segment, capTable, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); + this.factory = factory; + } + public T get(int index) { return _getStructElement(factory, index); } @@ -132,7 +164,15 @@ public Builder(StructBuilder.Factory factory, SegmentBuilder segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount){ - super(segment, ptr, elementCount, step, structDataSize, structPointerCount); + this(factory, null, segment, ptr, elementCount, step, structDataSize, structPointerCount); + } + + public Builder(StructBuilder.Factory factory, + CapTableBuilder capTable, + SegmentBuilder segment, int ptr, + int elementCount, int step, + int structDataSize, short structPointerCount) { + super(segment, capTable, ptr, elementCount, step, structDataSize, structPointerCount); this.factory = factory; } diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 956883e2..6ca38a2a 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -1222,7 +1222,7 @@ static T readListPointer(ListReader.Factory factory, if (WirePointer.isNull(ref)) { if (defaultSegment == null) { - return factory.constructReader(SegmentReader.EMPTY, 0, 0, 0, 0, (short) 0, 0x7fffffff); + return factory.constructReader(SegmentReader.EMPTY, capTable, 0, 0, 0, 0, (short) 0, 0x7fffffff); } else { segment = defaultSegment; refOffset = defaultOffset; @@ -1264,7 +1264,7 @@ static T readListPointer(ListReader.Factory factory, // TODO check whether the size is compatible - return factory.constructReader(resolved.segment, + return factory.constructReader(resolved.segment, capTable, ptr * Constants.BYTES_PER_WORD, size, wordsPerElement * Constants.BITS_PER_WORD, @@ -1311,6 +1311,7 @@ static T readListPointer(ListReader.Factory factory, } return factory.constructReader(resolved.segment, + capTable, resolved.ptr * Constants.BYTES_PER_WORD, ListPointer.elementCount(resolved.ref), step, From ecd034e78e1cb90e5759d53a5f4484dbe64ed4d5 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 3 Dec 2020 12:14:23 +0000 Subject: [PATCH 201/246] add calculator example --- .run/Calculator.run.xml | 7 + .run/CalculatorClient.run.xml | 13 ++ .run/CalculatorServer.run.xml | 12 ++ examples/pom.xml | 26 ++- .../capnproto/examples/CalculatorClient.java | 98 ++++++++++ .../capnproto/examples/CalculatorServer.java | 178 ++++++++++++++++++ examples/src/main/schema/calculator.capnp | 122 ++++++++++++ 7 files changed, 454 insertions(+), 2 deletions(-) create mode 100644 .run/Calculator.run.xml create mode 100644 .run/CalculatorClient.run.xml create mode 100644 .run/CalculatorServer.run.xml create mode 100644 examples/src/main/java/org/capnproto/examples/CalculatorClient.java create mode 100644 examples/src/main/java/org/capnproto/examples/CalculatorServer.java create mode 100644 examples/src/main/schema/calculator.capnp diff --git a/.run/Calculator.run.xml b/.run/Calculator.run.xml new file mode 100644 index 00000000..17b1ab4b --- /dev/null +++ b/.run/Calculator.run.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.run/CalculatorClient.run.xml b/.run/CalculatorClient.run.xml new file mode 100644 index 00000000..87af5d16 --- /dev/null +++ b/.run/CalculatorClient.run.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/.run/CalculatorServer.run.xml b/.run/CalculatorServer.run.xml new file mode 100644 index 00000000..d90a6d44 --- /dev/null +++ b/.run/CalculatorServer.run.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/examples/pom.xml b/examples/pom.xml index c0ba8366..8249d322 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -38,6 +38,19 @@ runtime 0.1.6-SNAPSHOT + + + org.capnproto + runtime-rpc + 0.1.6-SNAPSHOT + + + + junit + junit + 4.13.1 + compile + @@ -62,15 +75,24 @@ generate-sources - + - + + + + + + + + + + diff --git a/examples/src/main/java/org/capnproto/examples/CalculatorClient.java b/examples/src/main/java/org/capnproto/examples/CalculatorClient.java new file mode 100644 index 00000000..e79b8f89 --- /dev/null +++ b/examples/src/main/java/org/capnproto/examples/CalculatorClient.java @@ -0,0 +1,98 @@ +package org.capnproto.examples; + +import org.capnproto.*; +import org.junit.Assert; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.nio.channels.AsynchronousSocketChannel; +import java.util.concurrent.ExecutionException; + +public class CalculatorClient { + + public static void usage() { + System.out.println("usage: host:port"); + } + + public static void main(String[] args) { + if (args.length < 1) { + usage(); + return; + } + + var endpoint = args[0].split(":"); + var address = new InetSocketAddress(endpoint[0], Integer.parseInt(endpoint[1])); + try { + var clientSocket = AsynchronousSocketChannel.open(); + clientSocket.connect(address).get(); + var rpcClient = new TwoPartyClient(clientSocket); + var calculator = new org.capnproto.examples.Calc.Calculator.Client(rpcClient.bootstrap()); + + { + System.out.println("Evaluating a literal..."); + var request = calculator.evaluateRequest(); + request.getParams().getExpression().setLiteral(123); + var evalPromise = request.send(); + var readPromise = evalPromise.getValue().readRequest().send(); + + var response = rpcClient.runUntil(readPromise); + Assert.assertTrue(response.get().getValue() == 123); + } + + { + // Make a request to evaluate 123 + 45 - 67. + // + // The Calculator interface requires that we first call getOperator() to + // get the addition and subtraction functions, then call evaluate() to use + // them. But, once again, we can get both functions, call evaluate(), and + // then read() the result -- four RPCs -- in the time of *one* network + // round trip, because of promise pipelining. + + System.out.println("Using add and subtract... "); + + Calc.Calculator.Function.Client add; + Calc.Calculator.Function.Client subtract; + + { + // Get the "add" function from the server. + var request = calculator.getOperatorRequest(); + request.getParams().setOp(Calc.Calculator.Operator.ADD); + add = request.send().getFunc(); + } + + { + // Get the "subtract" function from the server. + var request = calculator.getOperatorRequest(); + request.getParams().setOp(Calc.Calculator.Operator.SUBTRACT); + subtract = request.send().getFunc(); + } + + // Build the request to evaluate 123 + 45 - 67. + var request = calculator.evaluateRequest(); + + var subtractCall = request.getParams().getExpression().initCall(); + subtractCall.setFunction(subtract); + var subtractParams = subtractCall.initParams(2); + subtractParams.get(1).setLiteral(67); + + var addCall = subtractParams.get(0).initCall(); + addCall.setFunction(add); + var addParams = addCall.initParams(2); + addParams.get(0).setLiteral(123); + addParams.get(1).setLiteral(45); + + var evalPromise = request.send(); + var readPromise = evalPromise.getValue().readRequest().send(); + + // run the RPC system until the read request completes. + var response = rpcClient.runUntil(readPromise).join(); + Assert.assertEquals(101, response.getValue(), 0.0001); + + System.out.println("PASS"); + } + } + catch (IOException | InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + } +} diff --git a/examples/src/main/java/org/capnproto/examples/CalculatorServer.java b/examples/src/main/java/org/capnproto/examples/CalculatorServer.java new file mode 100644 index 00000000..94828c9a --- /dev/null +++ b/examples/src/main/java/org/capnproto/examples/CalculatorServer.java @@ -0,0 +1,178 @@ +package org.capnproto.examples; + +import org.capnproto.*; + +import java.io.IOException; +import java.lang.Void; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.util.List; +import java.util.ArrayList; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; +import java.util.stream.Collectors; + + +public class CalculatorServer { + + // https://www.nurkiewicz.com/2013/05/java-8-completablefuture-in-action.html + private static CompletableFuture> sequence(List> futures) { + var done = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])); + return done.thenApply(void_ -> + futures.stream(). + map(CompletableFuture::join). + collect(Collectors.toList()) + ); + } + + static CompletableFuture readValue(org.capnproto.examples.Calc.Calculator.Value.Client value) { + return value.readRequest().send().thenApply(result -> result.getValue()); + } + + static CompletableFuture evaluateImpl(org.capnproto.examples.Calc.Calculator.Expression.Reader expression, + PrimitiveList.Double.Reader params) { + switch (expression.which()) { + case LITERAL: + return CompletableFuture.completedFuture(expression.getLiteral()); + + case PREVIOUS_RESULT: + return readValue(expression.getPreviousResult()); + + case PARAMETER: + return CompletableFuture.completedFuture(params.get(expression.getParameter())); + + case CALL: { + var call = expression.getCall(); + var func = call.getFunction(); + + // Evaluate each parameter. + var paramPromises = new ArrayList>(); + for (var param: call.getParams()) { + paramPromises.add(evaluateImpl(param, params)); + } + + // When the parameters are complete, call the function. + var joinedParams = sequence(paramPromises); + + // When the parameters are complete, call the function. + return joinedParams.thenCompose(paramValues -> { + var request = func.callRequest(); + var funcParams = request.getParams().initParams(paramValues.size()); + for (int ii = 0; ii < paramValues.size(); ++ii) { + funcParams.set(ii, paramValues.get(ii)); + } + return request.send().thenApply(result -> result.getValue()); + }); + } + + default: + return CompletableFuture.failedFuture(RpcException.failed("Unknown expression type.")); + } + } + + static class ValueImpl extends Calc.Calculator.Value.Server { + private final double value; + + public ValueImpl(double value) { + this.value = value; + } + + @Override + protected CompletableFuture read(CallContext context) { + context.getResults().setValue(this.value); + return READY_NOW; + } + } + + static class FunctionImpl extends Calc.Calculator.Function.Server { + + private final int paramCount; + private final Calc.Calculator.Expression.Reader expression; + + public FunctionImpl(int paramCount, Calc.Calculator.Expression.Reader body) { + this.paramCount = paramCount; + this.expression = body; + } + + @Override + protected CompletableFuture call(CallContext context) { + var params = context.getParams().getParams(); + if (params.size() != this.paramCount) { + return CompletableFuture.failedFuture(RpcException.failed("Wrong number of parameters")); + } + + return evaluateImpl(expression, params) + .thenAccept(value -> context.getResults().setValue(value)); + } + } + + static class OperatorImpl extends Calc.Calculator.Function.Server { + private final Calc.Calculator.Operator op; + + public OperatorImpl(Calc.Calculator.Operator op) { + this.op = op; + } + + @Override + protected CompletableFuture call(CallContext context) { + var params = context.getParams().getParams(); + if (params.size() != 2) { + return CompletableFuture.failedFuture(RpcException.failed("Wrong number of parameters")); + } + + var x = params.get(0); + var y = params.get(1); + + double result = switch (op) { + case ADD -> x + y; + case SUBTRACT -> x - y; + case MULTIPLY -> x * y; + case DIVIDE -> x / y; + default -> Double.NaN; + }; + + context.getResults().setValue(result); + return READY_NOW; + } + } + + static class CalculatorImpl extends Calc.Calculator.Server { + @Override + protected CompletableFuture evaluate(CallContext context) { + return evaluateImpl(context.getParams().getExpression(), null).thenAccept(value -> { + context.getResults().setValue(new ValueImpl(value)); + }); + } + + @Override + protected CompletableFuture defFunction(CallContext context) { + var params = context.getParams(); + context.getResults().setFunc(new FunctionImpl(params.getParamCount(), params.getBody())); + return READY_NOW; + } + + @Override + protected CompletableFuture getOperator(CallContext context) { + context.getResults().setFunc(new OperatorImpl(context.getParams().getOp())); + return READY_NOW; + } + } + + public static void main(String[] args) { + if (args.length < 1) { + return; + } + + var hostPort = args[0].split(":"); + var address = new InetSocketAddress(hostPort[0], Integer.parseInt(hostPort[1])); + try { + var server = new EzRpcServer(new CalculatorImpl(), address); + var port = server.getPort(); + System.out.println("Listening on port " + port + "..."); + server.start().join(); + } + catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/examples/src/main/schema/calculator.capnp b/examples/src/main/schema/calculator.capnp new file mode 100644 index 00000000..cfd9ac48 --- /dev/null +++ b/examples/src/main/schema/calculator.capnp @@ -0,0 +1,122 @@ +# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors +# Licensed under the MIT License: +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +@0x85150b117366d14b; + +using Java = import "/capnp/java.capnp"; +$Java.package("org.capnproto.examples"); +$Java.outerClassname("Calc"); + +interface Calculator { + # A "simple" mathematical calculator, callable via RPC. + # + # But, to show off Cap'n Proto, we add some twists: + # + # - You can use the result from one call as the input to the next + # without a network round trip. To accomplish this, evaluate() + # returns a `Value` object wrapping the actual numeric value. + # This object may be used in a subsequent expression. With + # promise pipelining, the Value can actually be used before + # the evaluate() call that creates it returns! + # + # - You can define new functions, and then call them. This again + # shows off pipelining, but it also gives the client the + # opportunity to define a function on the client side and have + # the server call back to it. + # + # - The basic arithmetic operators are exposed as Functions, and + # you have to call getOperator() to obtain them from the server. + # This again demonstrates pipelining -- using getOperator() to + # get each operator and then using them in evaluate() still + # only takes one network round trip. + + evaluate @0 (expression :Expression) -> (value :Value); + # Evaluate the given expression and return the result. The + # result is returned wrapped in a Value interface so that you + # may pass it back to the server in a pipelined request. To + # actually get the numeric value, you must call read() on the + # Value -- but again, this can be pipelined so that it incurs + # no additional latency. + + struct Expression { + # A numeric expression. + + union { + literal @0 :Float64; + # A literal numeric value. + + previousResult @1 :Value; + # A value that was (or, will be) returned by a previous + # evaluate(). + + parameter @2 :UInt32; + # A parameter to the function (only valid in function bodies; + # see defFunction). + + call :group { + # Call a function on a list of parameters. + function @3 :Function; + params @4 :List(Expression); + } + } + } + + interface Value { + # Wraps a numeric value in an RPC object. This allows the value + # to be used in subsequent evaluate() requests without the client + # waiting for the evaluate() that returns the Value to finish. + + read @0 () -> (value :Float64); + # Read back the raw numeric value. + } + + defFunction @1 (paramCount :Int32, body :Expression) + -> (func :Function); + # Define a function that takes `paramCount` parameters and returns the + # evaluation of `body` after substituting these parameters. + + interface Function { + # An algebraic function. Can be called directly, or can be used inside + # an Expression. + # + # A client can create a Function that runs on the server side using + # `defFunction()` or `getOperator()`. Alternatively, a client can + # implement a Function on the client side and the server will call back + # to it. However, a function defined on the client side will require a + # network round trip whenever the server needs to call it, whereas + # functions defined on the server and then passed back to it are called + # locally. + + call @0 (params :List(Float64)) -> (value :Float64); + # Call the function on the given parameters. + } + + getOperator @2 (op :Operator) -> (func :Function); + # Get a Function representing an arithmetic operator, which can then be + # used in Expressions. + + enum Operator { + add @0; + subtract @1; + multiply @2; + divide @3; + } +} From 635bfa0d62fdf575c25497248976ad39bfa59617 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 5 Dec 2020 14:04:19 +0000 Subject: [PATCH 202/246] imports --- runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java b/runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java index a089aa9c..5352c7c6 100644 --- a/runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java @@ -1,12 +1,8 @@ package org.capnproto; - import org.capnproto.rpctest.Test; import org.junit.Assert; - -import java.io.IOException; import java.net.InetSocketAddress; -import java.net.SocketAddress; public class EzRpcTest { From 21d3eba0e55c0cf5d77f8cc668ea9656743da4a6 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 5 Dec 2020 14:55:28 +0000 Subject: [PATCH 203/246] remove CompletableFutureWrapper --- .../capnproto/CompletableFutureWrapper.java | 25 ----------------- .../java/org/capnproto/RemotePromise.java | 28 ++++++++----------- 2 files changed, 11 insertions(+), 42 deletions(-) delete mode 100644 runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java diff --git a/runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java b/runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java deleted file mode 100644 index bfe3ed44..00000000 --- a/runtime/src/main/java/org/capnproto/CompletableFutureWrapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.capnproto; - -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; - -public class CompletableFutureWrapper extends CompletableFuture { - - private final CompletableFuture other; - - public CompletableFutureWrapper(CompletionStage other) { - this.other = other.toCompletableFuture().whenComplete((value, exc) -> { - if (exc == null) { - this.complete(value); - } - else { - this.completeExceptionally(exc); - } - }); - } - - @Override - public boolean cancel(boolean mayInterruptIfRunning) { - return this.other.cancel(mayInterruptIfRunning); - } -} \ No newline at end of file diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index 21d9c7d4..4f27e8dc 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -3,7 +3,7 @@ import java.util.concurrent.CompletableFuture; public class RemotePromise - extends CompletableFutureWrapper + extends CompletableFuture implements AutoCloseable { final CompletableFuture> response; @@ -11,12 +11,7 @@ public class RemotePromise public RemotePromise(FromPointerReader factory, RemotePromise other) { - super(other.thenApply(response -> response.getAs(factory))); - this.response = other.response.thenApply( - response -> new Response<>( - response.getResults().getAs(factory), - response.getHook())); - this.pipeline = other.pipeline; + this(other.response.thenApply(response -> Response.fromTypeless(factory, response)), other.pipeline); } public RemotePromise(CompletableFuture> promise, @@ -26,8 +21,15 @@ public RemotePromise(CompletableFuture> promise, public RemotePromise(CompletableFuture> promise, AnyPointer.Pipeline pipeline) { - super(promise.thenApply(Response::getResults)); - this.response = promise; + this.response = promise + .thenApply(response -> { + this.complete(response.getResults()); + return response; + }) + .exceptionallyCompose(exc -> { + this.completeExceptionally(exc); + return CompletableFuture.failedFuture(exc); + }); this.pipeline = pipeline; } @@ -40,13 +42,5 @@ public void close() { public AnyPointer.Pipeline pipeline() { return this.pipeline; } - - public static RemotePromise fromTypeless( - FromPointerReader resultsFactory, - RemotePromise typeless) { - var promise = typeless.response.thenApply( - response -> Response.fromTypeless(resultsFactory, response)); - return new RemotePromise<>(promise, typeless.pipeline); - } } From c7621d1de3f1fdd8ff586c28d25286008b7c7cc7 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 7 Dec 2020 18:55:54 +0000 Subject: [PATCH 204/246] whenMoreResolved should return null when resolved --- runtime/src/main/java/org/capnproto/Capability.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index e00733ba..2ee1f22b 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -265,7 +265,7 @@ public ClientHook getResolved() { @Override public CompletableFuture whenMoreResolved() { if (this.resolved != null) { - return CompletableFuture.completedFuture(this.resolved); + return null; } else if (this.resolveTask != null) { return this.resolveTask.thenApply(void_ -> this.resolved); From 23c3c789f7a53ca8312e972991d0a39f7ea7dfad Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 7 Dec 2020 18:57:22 +0000 Subject: [PATCH 205/246] combine cleanup methods --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 81f64609..62878418 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -441,6 +441,7 @@ public void runMessageLoop() { private void handleMessage(IncomingRpcMessage message) throws RpcException { var reader = message.getBody().getAs(RpcProtocol.Message.factory); + LOGGER.fine(() -> this.toString() + ": < RPC message: " + reader.which().toString()); switch (reader.which()) { case UNIMPLEMENTED -> handleUnimplemented(reader.getUnimplemented()); case ABORT -> handleAbort(reader.getAbort()); @@ -463,8 +464,7 @@ private void handleMessage(IncomingRpcMessage message) throws RpcException { } } - this.cleanupImports(); - this.cleanupQuestions(); + this.cleanupReferences(); } void handleUnimplemented(RpcProtocol.Message.Reader message) { @@ -1813,17 +1813,15 @@ public FileDescriptor getFd() { } } - private void cleanupImports() { + private void cleanupReferences() { while (true) { var disposer = (ImportDisposer)this.importRefs.poll(); if (disposer == null) { - return; + break; } disposer.dispose(); } - } - private void cleanupQuestions() { while (true) { var disposer = (QuestionDisposer)this.questionRefs.poll(); if (disposer == null) { From c9dcefb153eda2127022377a2942650d7c1664b3 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 7 Dec 2020 19:00:49 +0000 Subject: [PATCH 206/246] EzRpcClient must connect synchronously --- .../main/java/org/capnproto/EzRpcClient.java | 27 ++----------------- .../test/java/org/capnproto/EzRpcTest.java | 6 +++-- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java b/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java index b28da339..2c891799 100644 --- a/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java +++ b/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java @@ -1,39 +1,16 @@ package org.capnproto; -import java.io.IOException; -import java.net.Socket; -import java.net.SocketAddress; import java.nio.channels.AsynchronousSocketChannel; -import java.nio.channels.CompletionHandler; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; public class EzRpcClient { - private final AsynchronousSocketChannel socket; private final TwoPartyClient twoPartyRpc; private final Capability.Client client; - public EzRpcClient(SocketAddress address) throws Exception { - this.socket = AsynchronousSocketChannel.open(); - - var connected = new CompletableFuture(); - - this.socket.connect(address, null, new CompletionHandler<>() { - - @Override - public void completed(java.lang.Void result, Object attachment) { - connected.complete(null); - } - - @Override - public void failed(Throwable exc, Object attachment) { - connected.completeExceptionally(exc); - } - }); - + public EzRpcClient(AsynchronousSocketChannel socket) { this.twoPartyRpc = new TwoPartyClient(socket); - this.client = new Capability.Client(connected.thenApply(void_ -> this.twoPartyRpc.bootstrap())); + this.client = new Capability.Client(this.twoPartyRpc.bootstrap()); } public Capability.Client getMain() { diff --git a/runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java b/runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java index 5352c7c6..31de620f 100644 --- a/runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/EzRpcTest.java @@ -3,6 +3,7 @@ import org.capnproto.rpctest.Test; import org.junit.Assert; import java.net.InetSocketAddress; +import java.nio.channels.AsynchronousSocketChannel; public class EzRpcTest { @@ -13,8 +14,9 @@ public void testBasic() throws Exception { var server = new EzRpcServer(new RpcTestUtil.TestInterfaceImpl(callCount), address); server.start(); - var client = new EzRpcClient(new InetSocketAddress("localhost", server.getPort())); - + var clientSocket = AsynchronousSocketChannel.open(); + clientSocket.connect(new InetSocketAddress("localhost", server.getPort())).get(); + var client = new EzRpcClient(clientSocket); var cap = new Test.TestInterface.Client(client.getMain()); var request = cap.fooRequest(); request.getParams().setI(123); From 59c6913d0d26d0073c86e19758ea17fb6648e275 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 7 Dec 2020 19:07:56 +0000 Subject: [PATCH 207/246] EzRpcServer expects internet sockets --- runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java b/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java index 2764c5a2..ccd313f4 100644 --- a/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java +++ b/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java @@ -2,7 +2,6 @@ import java.io.IOException; import java.net.InetSocketAddress; -import java.net.SocketAddress; import java.nio.channels.AsynchronousChannelGroup; import java.nio.channels.AsynchronousServerSocketChannel; import java.util.concurrent.CompletableFuture; @@ -15,11 +14,11 @@ public class EzRpcServer { private final TwoPartyServer twoPartyRpc; private final int port; - public EzRpcServer(Capability.Server bootstrapInterface, SocketAddress address) throws IOException { + public EzRpcServer(Capability.Server bootstrapInterface, InetSocketAddress address) throws IOException { this(new Capability.Client(bootstrapInterface), address); } - public EzRpcServer(Capability.Client bootstrapInterface, SocketAddress address) throws IOException { + public EzRpcServer(Capability.Client bootstrapInterface, InetSocketAddress address) throws IOException { this.channelgroup = AsynchronousChannelGroup.withThreadPool(Executors.newFixedThreadPool(1)); this.serverAcceptSocket = AsynchronousServerSocketChannel.open(this.channelgroup); this.serverAcceptSocket.bind(address); From 2dcaebb8f32e6ee6e380f902c18a8bc21ad3004c Mon Sep 17 00:00:00 2001 From: Vaci Date: Mon, 7 Dec 2020 19:36:56 +0000 Subject: [PATCH 208/246] github CI workflow --- .github/workflows/ci.yml | 51 +++++++++++++++++++++++++++++++++++++ .github/workflows/maven.yml | 24 ----------------- runtime-rpc/pom.xml | 2 -- 3 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..45770780 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + env: + PKG_CONFIG_PATH: /home/runner/lib/pkgconfig + + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.ACTIONS_TOKEN }} + + - name: Install Cap'n Proto + run: | + export DEBIAN_FRONTEND=noninteractive + env + sudo apt-get install -y gcc-7 g++-7 + curl -O https://capnproto.org/capnproto-c++-0.8.0.tar.gz + tar zxf capnproto-c++-0.8.0.tar.gz + cd capnproto-c++-0.8.0 + ./configure --prefix=$HOME CC=gcc-7 CXX=g++-7 + make -j + make install + cd .. + + - name: Set up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + + - name: Build with Maven + env: + LD_LIBRARY_PATH: /home/runner/lib + run: | + env + make CC=gcc-7 CXX=g++-7 + env PATH="${PATH}:/home/runner/bin" mvn -e -X compile + + - name: Run tests + env: + LD_LIBRARY_PATH: /home/runner/lib + run: | + env PATH="${PATH}:/home/runner/bin" + env PATH="${PATH}:/home/runner/bin" mvn -e -X test diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index 438a6454..00000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,24 +0,0 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ master, rpc ] - pull_request: - branches: [ master, rpc ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 14 - uses: actions/setup-java@v1 - with: - java-version: 14 - - name: Build with Maven - run: mvn -B package --file runtime/pom.xml diff --git a/runtime-rpc/pom.xml b/runtime-rpc/pom.xml index 47068e25..20dabdf4 100644 --- a/runtime-rpc/pom.xml +++ b/runtime-rpc/pom.xml @@ -35,11 +35,9 @@ - UTF-8 14 14 - From 4f55af417fc6591002531f6d2a25f501cb80eaba Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 8 Dec 2020 16:29:28 +0000 Subject: [PATCH 209/246] remove excess client construction from EzRpcClient --- runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java b/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java index 2c891799..cb72660c 100644 --- a/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java +++ b/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java @@ -10,7 +10,7 @@ public class EzRpcClient { public EzRpcClient(AsynchronousSocketChannel socket) { this.twoPartyRpc = new TwoPartyClient(socket); - this.client = new Capability.Client(this.twoPartyRpc.bootstrap()); + this.client = this.twoPartyRpc.bootstrap(); } public Capability.Client getMain() { From 21b8aa6acd0389fee3958e848ad3c24fc8ffdcd1 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 24 Feb 2021 16:27:59 +0000 Subject: [PATCH 210/246] add gitlab CI --- .gitlab-ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..eeadba34 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +image: maven:latest + +stages: + - build + - quality + +build: + stage: build + script: + - mvn -e -X clean compile + +test: + stage: quality + dependencies: + - build + script: + - mvn -e -X test + From 3d819628322b361ec495c74c11e2b0262b73e11f Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 19 Mar 2021 13:39:39 +0000 Subject: [PATCH 211/246] add gitlab CI to master --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eeadba34..b0988158 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: maven:latest +image: capnproto-gitlab-builder stages: - build From 1bf1228756f4a9192ac29352565c3f2a18eee634 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Fri, 5 Mar 2021 10:29:16 +0000 Subject: [PATCH 212/246] revert to java version 11 --- benchmark/pom.xml | 4 ++-- compiler/pom.xml | 4 ++-- runtime-rpc/pom.xml | 8 ++++---- runtime/pom.xml | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 42185ebe..9426d98c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -50,8 +50,8 @@ 3.3 -Xlint:unchecked - 14 - 14 + 11 + 11 diff --git a/compiler/pom.xml b/compiler/pom.xml index 43fb798e..bab021c4 100644 --- a/compiler/pom.xml +++ b/compiler/pom.xml @@ -53,8 +53,8 @@ maven-compiler-plugin 3.3 - 14 - 14 + 11 + 11 -Xlint:unchecked diff --git a/runtime-rpc/pom.xml b/runtime-rpc/pom.xml index 20dabdf4..7677eebc 100644 --- a/runtime-rpc/pom.xml +++ b/runtime-rpc/pom.xml @@ -36,8 +36,8 @@ UTF-8 - 14 - 14 + 11 + 11 @@ -77,8 +77,8 @@ 3.3 -Xlint:unchecked - 14 - 14 + 11 + 11 diff --git a/runtime/pom.xml b/runtime/pom.xml index 23276dd5..af83e636 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -36,8 +36,8 @@ UTF-8 - 14 - 14 + 11 + 11 @@ -67,8 +67,8 @@ 3.3 -Xlint:unchecked - 14 - 14 + 11 + 11 From 950ba824b958024f5fb81289d42aa65a224cbae1 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 18 Mar 2021 09:57:08 +0000 Subject: [PATCH 213/246] use java11 switches and completablefutures --- .../main/java/org/capnproto/RpcDumper.java | 56 ++++++------ .../src/main/java/org/capnproto/RpcState.java | 88 ++++++++++--------- .../src/test/java/org/capnproto/RpcTest.java | 4 +- .../main/java/org/capnproto/Capability.java | 8 +- .../java/org/capnproto/RemotePromise.java | 18 ++-- 5 files changed, 92 insertions(+), 82 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcDumper.java b/runtime-rpc/src/main/java/org/capnproto/RpcDumper.java index 220ff238..e7871459 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcDumper.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcDumper.java @@ -58,8 +58,8 @@ private String dumpCaps(StructList.Reader capT } String dump(RpcProtocol.Message.Reader message, RpcTwoPartyProtocol.Side sender) { - return switch (message.which()) { - case CALL -> { + switch (message.which()) { + case CALL: { var call = message.getCall(); var iface = call.getInterfaceId(); @@ -93,14 +93,14 @@ String dump(RpcProtocol.Message.Reader message, RpcTwoPartyProtocol.Side sender) } }*/ - yield sender.name() + "(" + call.getQuestionId() + "): call " + + return sender.name() + "(" + call.getQuestionId() + "): call " + call.getTarget() + " <- " + interfaceName + "." + methodName + " " + params.getClass().getName() + " caps:[" + dumpCaps(payload.getCapTable()) + "]" + (sendResultsTo.isCaller() ? "" : (" sendResultsTo:" + sendResultsTo)); } - case RETURN -> { + case RETURN: { var ret = message.getReturn(); var text = sender.name() + "(" + ret.getAnswerId() + "): "; var returnType = getReturnType( @@ -108,56 +108,60 @@ String dump(RpcProtocol.Message.Reader message, RpcTwoPartyProtocol.Side sender) ? RpcTwoPartyProtocol.Side.SERVER : RpcTwoPartyProtocol.Side.CLIENT, ret.getAnswerId()); - yield switch (ret.which()) { - case RESULTS -> { + switch (ret.which()) { + case RESULTS: { var payload = ret.getResults(); - yield text + "return " + payload + + return text + "return " + payload + " caps:[" + dumpCaps(payload.getCapTable()) + "]"; } - case EXCEPTION -> { + case EXCEPTION: { var exc = ret.getException(); - yield text + "exception " + return text + "exception " + exc.getType().toString() + " " + exc.getReason(); } - default -> { - yield text + ret.which().name(); + default: { + return text + ret.which().name(); } - }; + } } - case BOOTSTRAP -> { + case BOOTSTRAP: { var restore = message.getBootstrap(); setReturnType(sender, restore.getQuestionId(), 0); - yield sender.name() + "(" + restore.getQuestionId() + "): bootstrap " + + return sender.name() + "(" + restore.getQuestionId() + "): bootstrap " + restore.getDeprecatedObjectId(); } - case ABORT -> { + case ABORT: { var abort = message.getAbort(); - yield sender.name() + ": abort " + return sender.name() + ": abort " + abort.getType().toString() + " \"" + abort.getReason().toString() + "\""; } - case RESOLVE -> { + case RESOLVE: { var resolve = message.getResolve(); var id = resolve.getPromiseId(); - var text = switch (resolve.which()) { - case CAP -> { + String text; + switch (resolve.which()) { + case CAP: { var cap = resolve.getCap(); - yield cap.which().toString(); + text = cap.which().toString(); + break; } - case EXCEPTION -> { + case EXCEPTION: { var exc = resolve.getException(); - yield exc.getType().toString() + ": " + exc.getReason().toString(); + text = exc.getType().toString() + ": " + exc.getReason().toString(); + break; } - default -> resolve.which().toString(); + default: text = resolve.which().toString(); break; }; - yield sender.name() + "(" + id + "): resolve " + text; + return sender.name() + "(" + id + "): resolve " + text; } - default -> sender.name() + ": " + message.which().name(); - }; + default: + return sender.name() + ": " + message.which().name(); + } } } diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index 62878418..df85489a 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -343,7 +343,7 @@ void disconnect(Throwable exc) { } var shutdownPromise = this.connection.shutdown() - .exceptionallyCompose(ioExc -> { + .exceptionally(ioExc -> { assert !(ioExc instanceof IOException); @@ -352,17 +352,18 @@ void disconnect(Throwable exc) { // Don't report disconnects as an error if (rpcExc.getType() == RpcException.Type.DISCONNECTED) { - return CompletableFuture.completedFuture(null); + return null; } } else if (ioExc instanceof CompletionException) { var compExc = (CompletionException)ioExc; if (compExc.getCause() instanceof ClosedChannelException) { - return CompletableFuture.completedFuture(null); + return null; } } - return CompletableFuture.failedFuture(ioExc); + return null; + //return CompletableFuture.failedFuture(ioExc); }); this.disconnected = networkExc; @@ -443,16 +444,16 @@ private void handleMessage(IncomingRpcMessage message) throws RpcException { var reader = message.getBody().getAs(RpcProtocol.Message.factory); LOGGER.fine(() -> this.toString() + ": < RPC message: " + reader.which().toString()); switch (reader.which()) { - case UNIMPLEMENTED -> handleUnimplemented(reader.getUnimplemented()); - case ABORT -> handleAbort(reader.getAbort()); - case BOOTSTRAP -> handleBootstrap(reader.getBootstrap()); - case CALL -> handleCall(message, reader.getCall()); - case RETURN -> handleReturn(message, reader.getReturn()); - case FINISH -> handleFinish(reader.getFinish()); - case RESOLVE -> handleResolve(message, reader.getResolve()); - case DISEMBARGO -> handleDisembargo(reader.getDisembargo()); - case RELEASE -> handleRelease(reader.getRelease()); - default -> { + case UNIMPLEMENTED: handleUnimplemented(reader.getUnimplemented()); break; + case ABORT: handleAbort(reader.getAbort()); break; + case BOOTSTRAP: handleBootstrap(reader.getBootstrap()); break; + case CALL: handleCall(message, reader.getCall()); break; + case RETURN: handleReturn(message, reader.getReturn()); break; + case FINISH: handleFinish(reader.getFinish()); break; + case RESOLVE: handleResolve(message, reader.getResolve()); break; + case DISEMBARGO: handleDisembargo(reader.getDisembargo()); break; + case RELEASE: handleRelease(reader.getRelease()); break; + default: { LOGGER.warning(() -> this.toString() + ": < Unhandled RPC message: " + reader.which().toString()); if (!isDisconnected()) { // boomin' back atcha @@ -569,9 +570,9 @@ void handleCall(IncomingRpcMessage message, RpcProtocol.Call.Reader call) { boolean redirectResults; switch (call.getSendResultsTo().which()) { - case CALLER -> redirectResults = false; - case YOURSELF -> redirectResults = true; - default -> { + case CALLER: redirectResults = false; break; + case YOURSELF: redirectResults = true; break; + default: { assert false : "Unsupported 'Call.sendResultsTo'."; return; } @@ -785,15 +786,17 @@ private void handleResolve(IncomingRpcMessage message, RpcProtocol.Resolve.Reade // This import is an unfulfilled promise. switch (resolve.which()) { - case CAP -> { + case CAP:{ var cap = receiveCap(resolve.getCap(), message.getAttachedFds()); imp.promise.complete(cap); + break; } - case EXCEPTION -> { + case EXCEPTION: { var exc = ToException(resolve.getException()); imp.promise.completeExceptionally(exc); + break; } - default -> { + default: { assert false : "Unknown 'Resolve' type."; } } @@ -1157,7 +1160,7 @@ ClientHook writeTarget(ClientHook cap, RpcProtocol.MessageTarget.Builder target) ClientHook getMessageTarget(RpcProtocol.MessageTarget.Reader target) { switch (target.which()) { - case IMPORTED_CAP -> { + case IMPORTED_CAP: { var exp = exports.find(target.getImportedCap()); if (exp != null) { return exp.clientHook; @@ -1167,7 +1170,7 @@ ClientHook getMessageTarget(RpcProtocol.MessageTarget.Reader target) { return null; } } - case PROMISED_ANSWER -> { + case PROMISED_ANSWER: { var promisedAnswer = target.getPromisedAnswer(); var questionId = promisedAnswer.getQuestionId(); var base = answers.put(questionId); @@ -1186,7 +1189,7 @@ ClientHook getMessageTarget(RpcProtocol.MessageTarget.Reader target) { } return pipeline.getPipelinedCap(ops); } - default -> { + default: { assert false: "Unknown message target type. " + target.which(); return null; } @@ -1570,28 +1573,30 @@ public ClientHook getPipelinedCap(short[] ops) { } return this.clientMap.computeIfAbsent(key, k -> { - return switch (state) { - case WAITING -> { + switch (state) { + case WAITING: { var pipelineClient = new PipelineClient(this.questionRef, ops); if (this.redirectLater == null) { // This pipeline will never get redirected, so just return the PipelineClient. - yield pipelineClient; + return pipelineClient; } assert this.resolveSelf != null; var resolutionPromise = this.resolveSelf.thenApply( response -> response.getResults().getPipelinedCap(ops)); - yield new PromiseClient(pipelineClient, resolutionPromise, null); + return new PromiseClient(pipelineClient, resolutionPromise, null); } - case RESOLVED -> { + case RESOLVED: { assert this.resolved != null; - yield this.resolved.getResults().getPipelinedCap(ops); + return this.resolved.getResults().getPipelinedCap(ops); } - case BROKEN -> { + case BROKEN: { assert this.broken != null; - yield Capability.newBrokenCap(broken); + return Capability.newBrokenCap(broken); } }; + assert false; + return null; }); } @@ -2066,11 +2071,11 @@ static void FromException(Throwable exc, RpcProtocol.Exception.Builder builder) var type = RpcProtocol.Exception.Type.FAILED; if (exc instanceof RpcException) { var rpcExc = (RpcException) exc; - type = switch (rpcExc.getType()) { - case FAILED -> RpcProtocol.Exception.Type.FAILED; - case OVERLOADED -> RpcProtocol.Exception.Type.OVERLOADED; - case DISCONNECTED -> RpcProtocol.Exception.Type.DISCONNECTED; - case UNIMPLEMENTED -> RpcProtocol.Exception.Type.UNIMPLEMENTED; + switch (rpcExc.getType()) { + case FAILED: type = RpcProtocol.Exception.Type.FAILED; break; + case OVERLOADED: type = RpcProtocol.Exception.Type.OVERLOADED; break; + case DISCONNECTED: type = RpcProtocol.Exception.Type.DISCONNECTED; break; + case UNIMPLEMENTED: type = RpcProtocol.Exception.Type.UNIMPLEMENTED; break; }; } builder.setType(type); @@ -2081,11 +2086,12 @@ static void FromException(Throwable exc, RpcProtocol.Exception.Builder builder) } static RpcException ToException(RpcProtocol.Exception.Reader reader) { - var type = switch (reader.getType()) { - case OVERLOADED -> RpcException.Type.OVERLOADED; - case DISCONNECTED -> RpcException.Type.DISCONNECTED; - case UNIMPLEMENTED -> RpcException.Type.UNIMPLEMENTED; - default -> RpcException.Type.FAILED; + var type = RpcException.Type.FAILED; + switch (reader.getType()) { + case OVERLOADED: type = RpcException.Type.OVERLOADED; break; + case DISCONNECTED: type = RpcException.Type.DISCONNECTED; break; + case UNIMPLEMENTED: type = RpcException.Type.UNIMPLEMENTED; break; + default: type = RpcException.Type.FAILED; break; }; return new RpcException(type, reader.getReason().toString()); } diff --git a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java index 18c794a8..e9102f94 100644 --- a/runtime-rpc/src/test/java/org/capnproto/RpcTest.java +++ b/runtime-rpc/src/test/java/org/capnproto/RpcTest.java @@ -537,9 +537,9 @@ public void testCallBrokenPromise() { AtomicBoolean returned = new AtomicBoolean(false); - var req = client.callHeldRequest().send().exceptionallyCompose(exc -> { + var req = client.callHeldRequest().send().exceptionally(exc -> { returned.set(true); - return CompletableFuture.failedFuture(exc); + return null; }).thenAccept(results -> { returned.set(true); }); diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 2ee1f22b..8fc0f7a5 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -306,10 +306,10 @@ CompletableFuture callInternal(long interfaceId, short methodId, } else { this.blocked = true; - return result.promise.exceptionallyCompose(exc -> { - this.brokenException = exc; - return CompletableFuture.failedFuture(exc); - }).whenComplete((void_, exc) -> { + return result.promise.whenComplete((void_, exc) -> { + if (exc != null) { + this.brokenException = exc; + } this.unblock(); }); } diff --git a/runtime/src/main/java/org/capnproto/RemotePromise.java b/runtime/src/main/java/org/capnproto/RemotePromise.java index 4f27e8dc..431de040 100644 --- a/runtime/src/main/java/org/capnproto/RemotePromise.java +++ b/runtime/src/main/java/org/capnproto/RemotePromise.java @@ -21,15 +21,15 @@ public RemotePromise(CompletableFuture> promise, public RemotePromise(CompletableFuture> promise, AnyPointer.Pipeline pipeline) { - this.response = promise - .thenApply(response -> { - this.complete(response.getResults()); - return response; - }) - .exceptionallyCompose(exc -> { - this.completeExceptionally(exc); - return CompletableFuture.failedFuture(exc); - }); + this.response = promise.whenComplete((response, exc) -> { + if (exc != null) { + this.completeExceptionally(exc); + } + else { + this.complete(response.getResults()); + } + }); + this.pipeline = pipeline; } From b24a362d58e48c6a1044859753c4e9f91970adbe Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 19 Aug 2021 09:42:59 +0100 Subject: [PATCH 214/246] Merge from upstream --- CHANGELOG.md | 2 + Makefile | 3 +- benchmark/pom.xml | 5 +- compiler/pom.xml | 6 +- examples/pom.xml | 8 +- pom.xml | 2 +- runtime/pom.xml | 13 ++- .../src/main/java/org/capnproto/Arena.java | 2 +- .../main/java/org/capnproto/BuilderArena.java | 32 +++++++ .../java/org/capnproto/DefaultAllocator.java | 18 +++- .../java/org/capnproto/MessageBuilder.java | 16 ++++ .../main/java/org/capnproto/ReaderArena.java | 11 ++- .../java/org/capnproto/ReaderOptions.java | 11 +++ .../java/org/capnproto/SegmentBuilder.java | 2 +- .../main/java/org/capnproto/Serialize.java | 95 +++++++++++++------ .../java/org/capnproto/SerializePacked.java | 29 ++++++ .../org/capnproto/DefaultAllocatorTest.java | 26 +++++ .../java/org/capnproto/SerializeTest.java | 4 + 18 files changed, 238 insertions(+), 47 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 runtime/src/test/java/org/capnproto/DefaultAllocatorTest.java diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..a42245cb --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +## v0.1.9 +- Add `8` to pom.xml, to increase compability with Java 8. diff --git a/Makefile b/Makefile index 4882d9cb..493539b1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ -CAPNP_CXX_FLAGS=$(shell pkg-config capnp --cflags --libs) +PKG_CONFIG ?= pkg-config +CAPNP_CXX_FLAGS=$(shell $(PKG_CONFIG) capnp --cflags --libs) ifeq ($(CAPNP_CXX_FLAGS),) $(warning "Warning: pkg-config failed to find compilation configuration for capnp.") diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9426d98c..3914d488 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -5,7 +5,7 @@ benchmark jar capnproto-java benchmark - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT capnproto-java benchmark org.capnproto @@ -33,12 +33,13 @@ UTF-8 14 14 + 14 org.capnproto runtime - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT diff --git a/compiler/pom.xml b/compiler/pom.xml index bab021c4..5bd6837f 100644 --- a/compiler/pom.xml +++ b/compiler/pom.xml @@ -5,7 +5,7 @@ compiler jar schema compiler plugin for java - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT capnpc-java org.capnproto @@ -31,6 +31,8 @@ UTF-8 + 14 + 14 @@ -42,7 +44,7 @@ org.capnproto runtime - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT diff --git a/examples/pom.xml b/examples/pom.xml index 7462ccd4..7cb984ef 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -5,7 +5,7 @@ examples jar capnproto-java examples - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT capnproto-java examples org.capnproto @@ -38,7 +38,7 @@ org.capnproto runtime - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT @@ -46,8 +46,8 @@ runtime-rpc 0.1.6-SNAPSHOT - - + + junit junit 4.13.1 diff --git a/pom.xml b/pom.xml index 10d5c2b2..f33578db 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.capnproto capnproto-java pom - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT Cap'n Proto for Java https://capnproto.org/ diff --git a/runtime/pom.xml b/runtime/pom.xml index af83e636..63165dc2 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -5,7 +5,7 @@ runtime jar runtime - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT Cap'n Proto runtime library org.capnproto @@ -64,7 +64,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.3 + 3.6.2 -Xlint:unchecked 11 @@ -75,6 +75,15 @@ + + jdk9FF + + (1.8,) + + + 8 + + release diff --git a/runtime/src/main/java/org/capnproto/Arena.java b/runtime/src/main/java/org/capnproto/Arena.java index bb6c42e8..2866f61a 100644 --- a/runtime/src/main/java/org/capnproto/Arena.java +++ b/runtime/src/main/java/org/capnproto/Arena.java @@ -23,5 +23,5 @@ public interface Arena { public SegmentReader tryGetSegment(int id); - public void checkReadLimit(int numBytes); + public void checkReadLimit(int numWords); } diff --git a/runtime/src/main/java/org/capnproto/BuilderArena.java b/runtime/src/main/java/org/capnproto/BuilderArena.java index a05f3417..1ae46d0e 100644 --- a/runtime/src/main/java/org/capnproto/BuilderArena.java +++ b/runtime/src/main/java/org/capnproto/BuilderArena.java @@ -103,6 +103,30 @@ public CapTableBuilder getLocalCapTable() { return this.localCapTable; } + /** + * Constructs a BuilderArena from a ReaderArena and uses the size of the largest segment + * as the next allocation size. + */ + BuilderArena(ReaderArena arena) { + this.segments = new ArrayList(); + int largestSegment = SUGGESTED_FIRST_SEGMENT_WORDS*Constants.BYTES_PER_WORD; + for (int ii = 0; ii < arena.segments.size(); ++ii) { + SegmentReader segment = arena.segments.get(ii); + SegmentBuilder segmentBuilder = new SegmentBuilder(segment.buffer, this); + segmentBuilder.id = ii; + segmentBuilder.pos = segmentBuilder.capacity(); // buffer is pre-filled + segments.add(segmentBuilder); + + // Find the largest segment for the allocation strategy. + largestSegment = Math.max(largestSegment, segment.buffer.capacity()); + } + DefaultAllocator defaultAllocator = new DefaultAllocator(SUGGESTED_ALLOCATION_STRATEGY); + + // Use largest segment as next size. + defaultAllocator.setNextAllocationSizeBytes(largestSegment); + this.allocator = defaultAllocator; + } + @Override public final SegmentReader tryGetSegment(int id) { return this.segments.get(id); @@ -126,6 +150,10 @@ public AllocateResult(SegmentBuilder segment, int offset) { } } + /** + * Allocates `amount` words in an existing segment or, if no suitable segment + * exists, in a new segment. + */ public AllocateResult allocate(int amount) { int len = this.segments.size(); @@ -136,6 +164,10 @@ public AllocateResult allocate(int amount) { return new AllocateResult(this.segments.get(len - 1), result); } } + if (amount >= 1 << 28) { + // Computing `amount * Constants.BYTES_PER_WORD` would overflow. + throw new RuntimeException("Too many words to allocate: " + amount); + } SegmentBuilder newSegment = new SegmentBuilder( this.allocator.allocateSegment(amount * Constants.BYTES_PER_WORD), this); diff --git a/runtime/src/main/java/org/capnproto/DefaultAllocator.java b/runtime/src/main/java/org/capnproto/DefaultAllocator.java index d136356e..1d1d1bb6 100644 --- a/runtime/src/main/java/org/capnproto/DefaultAllocator.java +++ b/runtime/src/main/java/org/capnproto/DefaultAllocator.java @@ -18,6 +18,17 @@ public enum ByteBufferAllocationStyle { public AllocationStrategy allocationStrategy = AllocationStrategy.GROW_HEURISTICALLY; + /** + The largest number of bytes to try allocating when using `GROW_HEURISTICALLY`. + + Set this value smaller if you get the error: + + java.lang.OutOfMemoryError: Requested array size exceeds VM limit + + Experimentally, `Integer.MAX_VALUE - 2` seems to work on most systems. + */ + public int maxSegmentBytes = Integer.MAX_VALUE - 2; + public DefaultAllocator() {} public DefaultAllocator(AllocationStrategy allocationStrategy) { @@ -52,13 +63,16 @@ public java.nio.ByteBuffer allocateSegment(int minimumSize) { switch (this.allocationStrategy) { case GROW_HEURISTICALLY: - this.nextSize += size; + if (size < this.maxSegmentBytes - this.nextSize) { + this.nextSize += size; + } else { + this.nextSize = maxSegmentBytes; + } break; case FIXED_SIZE: break; } - this.nextSize += size; return result; } } diff --git a/runtime/src/main/java/org/capnproto/MessageBuilder.java b/runtime/src/main/java/org/capnproto/MessageBuilder.java index 98a55606..fbfe0829 100644 --- a/runtime/src/main/java/org/capnproto/MessageBuilder.java +++ b/runtime/src/main/java/org/capnproto/MessageBuilder.java @@ -71,6 +71,22 @@ public MessageBuilder(java.nio.ByteBuffer firstSegment) { this.arena = new BuilderArena(new DefaultAllocator(), firstSegment); } + /** + * Constructs a MessageBuilder from a MessageReader. This constructor is private + * because it is unsafe. To use it, you must call `unsafeConstructFromMessageReader()`. + */ + private MessageBuilder(MessageReader messageReader) { + this.arena = new BuilderArena(messageReader.arena); + } + + /** + * Constructs a MessageBuilder from a MessageReader without copying the segments. + * This method should only be used on trusted data. Otherwise you may observe infinite + * loops or large memory allocations or index-out-of-bounds errors. + */ + public static MessageBuilder unsafeConstructFromMessageReader(MessageReader messageReader) { + return new MessageBuilder(messageReader); + } private AnyPointer.Builder getRootInternal() { if (this.arena.segments.isEmpty()) { diff --git a/runtime/src/main/java/org/capnproto/ReaderArena.java b/runtime/src/main/java/org/capnproto/ReaderArena.java index 13c9c87f..c4994017 100644 --- a/runtime/src/main/java/org/capnproto/ReaderArena.java +++ b/runtime/src/main/java/org/capnproto/ReaderArena.java @@ -26,8 +26,8 @@ public final class ReaderArena implements Arena { + // Current limit. -1 means no limit. public long limit; - // current limit public final ArrayList segments; @@ -45,11 +45,14 @@ public SegmentReader tryGetSegment(int id) { } @Override - public final void checkReadLimit(int numBytes) { - if (numBytes > limit) { + public final void checkReadLimit(int numWords) { + if (limit == -1) { + // No limit. + return; + } else if (numWords > limit) { throw new DecodeException("Read limit exceeded."); } else { - limit -= numBytes; + limit -= numWords; } } } diff --git a/runtime/src/main/java/org/capnproto/ReaderOptions.java b/runtime/src/main/java/org/capnproto/ReaderOptions.java index fa22b402..21cee6d3 100644 --- a/runtime/src/main/java/org/capnproto/ReaderOptions.java +++ b/runtime/src/main/java/org/capnproto/ReaderOptions.java @@ -22,7 +22,18 @@ package org.capnproto; public final class ReaderOptions { + /** + How many words are allowed to be read before an exception is thrown, + to protect against denial of service attacks. + + -1 means "no limit". + */ public final long traversalLimitInWords; + + /** + How many pointer indirections deep a message may be before an exception + is thrown. + */ public final int nestingLimit; public ReaderOptions(long traversalLimitInWords, int nestingLimit) { diff --git a/runtime/src/main/java/org/capnproto/SegmentBuilder.java b/runtime/src/main/java/org/capnproto/SegmentBuilder.java index e9ac57a3..9727b586 100644 --- a/runtime/src/main/java/org/capnproto/SegmentBuilder.java +++ b/runtime/src/main/java/org/capnproto/SegmentBuilder.java @@ -35,7 +35,7 @@ public SegmentBuilder(ByteBuffer buf, Arena arena) { } // the total number of words the buffer can hold - private final int capacity() { + final int capacity() { this.buffer.rewind(); return this.buffer.remaining() / 8; } diff --git a/runtime/src/main/java/org/capnproto/Serialize.java b/runtime/src/main/java/org/capnproto/Serialize.java index 8b519636..9a8406ca 100644 --- a/runtime/src/main/java/org/capnproto/Serialize.java +++ b/runtime/src/main/java/org/capnproto/Serialize.java @@ -30,6 +30,10 @@ import java.util.concurrent.TimeUnit; import java.util.function.Consumer; +/** + * Serialization using the standard (unpacked) stream encoding: + * https://capnproto.org/encoding.html#serialization-over-a-stream + */ public final class Serialize { static ByteBuffer makeByteBuffer(int bytes) { @@ -39,6 +43,16 @@ static ByteBuffer makeByteBuffer(int bytes) { return result; } + static int MAX_SEGMENT_WORDS = (1 << 28) - 1; + + static ByteBuffer makeByteBufferForWords(int words) throws IOException { + if (words > MAX_SEGMENT_WORDS) { + // Trying to construct the segment would cause overflow. + throw new DecodeException("segment has too many words (" + words + ")"); + } + return makeByteBuffer(words * Constants.BYTES_PER_WORD); + } + public static void fillBuffer(ByteBuffer buffer, ReadableByteChannel bc) throws IOException { while(buffer.hasRemaining()) { int r = bc.read(buffer); @@ -55,21 +69,22 @@ public static MessageReader read(ReadableByteChannel bc) throws IOException { } public static MessageReader read(ReadableByteChannel bc, ReaderOptions options) throws IOException { - ByteBuffer firstWord = makeByteBuffer(Constants.BYTES_PER_WORD); + ByteBuffer firstWord = makeByteBufferForWords(1); fillBuffer(firstWord, bc); - int segmentCount = 1 + firstWord.getInt(0); + int rawSegmentCount = firstWord.getInt(0); + if (rawSegmentCount < 0 || rawSegmentCount > 511) { + throw new DecodeException("segment count must be between 0 and 512"); + } + + int segmentCount = 1 + rawSegmentCount; int segment0Size = 0; if (segmentCount > 0) { segment0Size = firstWord.getInt(4); } - int totalWords = segment0Size; - - if (segmentCount > 512) { - throw new IOException("too many segments"); - } + long totalWords = segment0Size; // in words ArrayList moreSizes = new ArrayList(); @@ -88,23 +103,17 @@ public static MessageReader read(ReadableByteChannel bc, ReaderOptions options) throw new DecodeException("Message size exceeds traversal limit."); } - ByteBuffer allSegments = makeByteBuffer(totalWords * Constants.BYTES_PER_WORD); - fillBuffer(allSegments, bc); - ByteBuffer[] segmentSlices = new ByteBuffer[segmentCount]; - allSegments.rewind(); - segmentSlices[0] = allSegments.slice(); - segmentSlices[0].limit(segment0Size * Constants.BYTES_PER_WORD); - segmentSlices[0].order(ByteOrder.LITTLE_ENDIAN); + segmentSlices[0] = makeByteBufferForWords(segment0Size); + fillBuffer(segmentSlices[0], bc); + segmentSlices[0].rewind(); int offset = segment0Size; for (int ii = 1; ii < segmentCount; ++ii) { - allSegments.position(offset * Constants.BYTES_PER_WORD); - segmentSlices[ii] = allSegments.slice(); - segmentSlices[ii].limit(moreSizes.get(ii - 1) * Constants.BYTES_PER_WORD); - segmentSlices[ii].order(ByteOrder.LITTLE_ENDIAN); - offset += moreSizes.get(ii - 1); + segmentSlices[ii] = makeByteBufferForWords(moreSizes.get(ii - 1)); + fillBuffer(segmentSlices[ii], bc); + segmentSlices[ii].rewind(); } return new MessageReader(segmentSlices, options); @@ -114,15 +123,16 @@ public static MessageReader read(ByteBuffer bb) throws IOException { return read(bb, ReaderOptions.DEFAULT_READER_OPTIONS); } - /* + /** * Upon return, `bb.position()` will be at the end of the message. */ public static MessageReader read(ByteBuffer bb, ReaderOptions options) throws IOException { bb.order(ByteOrder.LITTLE_ENDIAN); - int segmentCount = 1 + bb.getInt(); - if (segmentCount > 512) { - throw new IOException("too many segments"); + int rawSegmentCount = bb.getInt(); + int segmentCount = 1 + rawSegmentCount; + if (rawSegmentCount < 0 || rawSegmentCount > 511) { + throw new DecodeException("segment count must be between 0 and 512"); } ByteBuffer[] segmentSlices = new ByteBuffer[segmentCount]; @@ -137,6 +147,10 @@ public static MessageReader read(ByteBuffer bb, ReaderOptions options) throws IO for (int ii = 0; ii < segmentCount; ++ii) { int segmentSize = bb.getInt(segmentSizesBase + ii * 4); + if (segmentSize > MAX_SEGMENT_WORDS - + (totalWords + segmentBase / Constants.BYTES_PER_WORD)) { + throw new DecodeException("segment size is too large"); + } bb.position(segmentBase + totalWords * Constants.BYTES_PER_WORD); segmentSlices[ii] = bb.slice(); @@ -147,7 +161,7 @@ public static MessageReader read(ByteBuffer bb, ReaderOptions options) throws IO } bb.position(segmentBase + totalWords * Constants.BYTES_PER_WORD); - if (totalWords > options.traversalLimitInWords) { + if (options.traversalLimitInWords != -1 && totalWords > options.traversalLimitInWords) { throw new DecodeException("Message size exceeds traversal limit."); } @@ -178,9 +192,8 @@ public static long computeSerializedSizeInWords(MessageBuilder message) { return bytes / Constants.BYTES_PER_WORD; } - public static void write(WritableByteChannel outputChannel, - MessageBuilder message) throws IOException { - ByteBuffer[] segments = message.getSegmentsForOutput(); + private static void writeSegmentTable(WritableByteChannel outputChannel, + ByteBuffer[] segments) throws IOException { int tableSize = (segments.length + 2) & (~1); ByteBuffer table = ByteBuffer.allocate(4 * tableSize); @@ -196,6 +209,34 @@ public static void write(WritableByteChannel outputChannel, while (table.hasRemaining()) { outputChannel.write(table); } + } + + /** + * Serializes a MessageBuilder to a WritableByteChannel. + */ + public static void write(WritableByteChannel outputChannel, + MessageBuilder message) throws IOException { + ByteBuffer[] segments = message.getSegmentsForOutput(); + writeSegmentTable(outputChannel, segments); + + for (ByteBuffer buffer : segments) { + while(buffer.hasRemaining()) { + outputChannel.write(buffer); + } + } + } + + /** + * Serializes a MessageReader to a WritableByteChannel. + */ + public static void write(WritableByteChannel outputChannel, + MessageReader message) throws IOException { + ByteBuffer[] segments = new ByteBuffer[message.arena.segments.size()]; + for (int ii = 0 ; ii < message.arena.segments.size(); ++ii) { + segments[ii] = message.arena.segments.get(ii).buffer.duplicate(); + } + + writeSegmentTable(outputChannel, segments); for (ByteBuffer buffer : segments) { while(buffer.hasRemaining()) { diff --git a/runtime/src/main/java/org/capnproto/SerializePacked.java b/runtime/src/main/java/org/capnproto/SerializePacked.java index 1a107eb2..88b31a98 100644 --- a/runtime/src/main/java/org/capnproto/SerializePacked.java +++ b/runtime/src/main/java/org/capnproto/SerializePacked.java @@ -21,6 +21,9 @@ package org.capnproto; +/** + * Serialization using the packed encoding: https://capnproto.org/encoding.html#packing + */ public final class SerializePacked { public static MessageReader read(BufferedInputStream input) throws java.io.IOException { @@ -42,16 +45,42 @@ public static MessageReader readFromUnbuffered(java.nio.channels.ReadableByteCha return Serialize.read(packedInput, options); } + /** + * Serializes a MessageBuilder to a BufferedOutputStream. + */ public static void write(BufferedOutputStream output, MessageBuilder message) throws java.io.IOException { PackedOutputStream packedOutputStream = new PackedOutputStream(output); Serialize.write(packedOutputStream, message); } + /** + * Serializes a MessageReader to a BufferedOutputStream. + */ + public static void write(BufferedOutputStream output, + MessageReader message) throws java.io.IOException { + PackedOutputStream packedOutputStream = new PackedOutputStream(output); + Serialize.write(packedOutputStream, message); + } + + /** + * Serializes a MessageBuilder to an unbuffered output stream. + */ public static void writeToUnbuffered(java.nio.channels.WritableByteChannel output, MessageBuilder message) throws java.io.IOException { BufferedOutputStreamWrapper buffered = new BufferedOutputStreamWrapper(output); write(buffered, message); buffered.flush(); } + + /** + * Serializes a MessageReader to an unbuffered output stream. + */ + public static void writeToUnbuffered(java.nio.channels.WritableByteChannel output, + MessageReader message) throws java.io.IOException { + BufferedOutputStreamWrapper buffered = new BufferedOutputStreamWrapper(output); + write(buffered, message); + buffered.flush(); + } + } diff --git a/runtime/src/test/java/org/capnproto/DefaultAllocatorTest.java b/runtime/src/test/java/org/capnproto/DefaultAllocatorTest.java new file mode 100644 index 00000000..3770a7b2 --- /dev/null +++ b/runtime/src/test/java/org/capnproto/DefaultAllocatorTest.java @@ -0,0 +1,26 @@ +package org.capnproto; + +import org.junit.Assert; +import org.junit.Test; + +public class DefaultAllocatorTest { + @Test + public void maxSegmentBytes() { + DefaultAllocator allocator = new DefaultAllocator(); + Assert.assertEquals(allocator.allocationStrategy, + BuilderArena.AllocationStrategy.GROW_HEURISTICALLY); + allocator.maxSegmentBytes = (1 << 25) - 1; + + int allocationSize = 1 << 24; + allocator.setNextAllocationSizeBytes(allocationSize); + + Assert.assertEquals(allocationSize, + allocator.allocateSegment(allocationSize).capacity()); + + Assert.assertEquals(allocator.maxSegmentBytes, + allocator.allocateSegment(allocationSize).capacity()); + + Assert.assertEquals(allocator.maxSegmentBytes, + allocator.allocateSegment(allocationSize).capacity()); + } +} diff --git a/runtime/src/test/java/org/capnproto/SerializeTest.java b/runtime/src/test/java/org/capnproto/SerializeTest.java index d2245bb4..9ee4db9b 100644 --- a/runtime/src/test/java/org/capnproto/SerializeTest.java +++ b/runtime/src/test/java/org/capnproto/SerializeTest.java @@ -61,6 +61,10 @@ private void expectSerializesTo(int exampleSegmentCount, byte[] exampleBytes) th { MessageReader messageReader = Serialize.read(new ArrayInputStream(ByteBuffer.wrap(exampleBytes))); checkSegmentContents(exampleSegmentCount, messageReader.arena); + + byte[] outputBytes = new byte[exampleBytes.length]; + Serialize.write(new ArrayOutputStream(ByteBuffer.wrap(outputBytes)), messageReader); + Assert.assertArrayEquals(exampleBytes, outputBytes); } // ------ From 4fc6ffdce58cc518cd6c183df5d1e049f7652e5b Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 19 Aug 2021 09:59:43 +0100 Subject: [PATCH 215/246] try fixing jdk version to 11 --- runtime/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/pom.xml b/runtime/pom.xml index 63165dc2..b2a38d5b 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -76,12 +76,12 @@ - jdk9FF + jdk11FF - (1.8,) + (11,) - 8 + 11 From 6e3fa81ada505f5413adbaf8d64e056f781f5c69 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 19 Aug 2021 10:36:46 +0100 Subject: [PATCH 216/246] add some colour to the README --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index e74d51a3..2384c007 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,16 @@ and capabilities, and capnproto-java is a pure Java implementation. [Read more here.](https://dwrensha.github.io/capnproto-java/index.html) This repository clone adds an implementation of the RPC framework for Java. + +Promise pipelining is provided via java.util.concurrent.CompletableFuture. Unlike the KJ asynchronous model, which completes promises +only when they are waited upon, a CompletableFuture can complete immediately. This may break E-ordering, as the C++ implementation +relies on kj::evalLater() to defer method calls, and there is no obvious (to me, anyway) way to replicate the behaviour of +kj::evalLater() with CompletableFutures. + +Most of the C++ RPC test cases have been ported to this implementation, which gives me some comfort that the implementation logic is +correct, but more extensive testing is required. + +This implementation does not support generic interfaces. Extending the schema compiler to output code for generic interfaces is an +exercise I leave to the reader. + + From f37f934c6b866ea18a9858c57d937dd17a753926 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Thu, 19 Aug 2021 10:40:24 +0100 Subject: [PATCH 217/246] wqbump runtime-rpc dependencies to 0.1.10 --- examples/pom.xml | 2 +- runtime-rpc/pom.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/pom.xml b/examples/pom.xml index 7cb984ef..793edc77 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -44,7 +44,7 @@ org.capnproto runtime-rpc - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT diff --git a/runtime-rpc/pom.xml b/runtime-rpc/pom.xml index 7677eebc..1d84354a 100644 --- a/runtime-rpc/pom.xml +++ b/runtime-rpc/pom.xml @@ -5,7 +5,7 @@ runtime-rpc jar runtime-rpc - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT Cap'n Proto RPC runtime library org.capnproto @@ -49,12 +49,12 @@ org.capnproto runtime - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT org.capnproto compiler - 0.1.6-SNAPSHOT + 0.1.10-SNAPSHOT @@ -227,4 +227,4 @@ - \ No newline at end of file + From 2731586bb98f7725bc28eae58c320d33f7e7e55b Mon Sep 17 00:00:00 2001 From: Alessandro Arcangeli Date: Sat, 16 Oct 2021 13:30:47 +0200 Subject: [PATCH 218/246] fix "questionId is already in use" error --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index df85489a..dcf29046 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -758,10 +758,12 @@ void handleFinish(RpcProtocol.Finish.Reader finish) { if (ctx != null) { ctx.requestCancel(); } - else { - var questionId = finish.getQuestionId(); - answers.erase(questionId); - } + + // Remove question id + // this is a different then c++ implementation, but it is required as java's promises doesn't support + // all features of kj's promises + var questionId = finish.getQuestionId(); + answers.erase(questionId); if (exportsToRelease != null) { this.releaseExports(exportsToRelease); From 84dcb1008585e2460f9220f3a750450837e0cf0a Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 10 Nov 2021 11:40:10 +0000 Subject: [PATCH 219/246] correct pom version --- runtime-rpc/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime-rpc/pom.xml b/runtime-rpc/pom.xml index 1d84354a..aed08152 100644 --- a/runtime-rpc/pom.xml +++ b/runtime-rpc/pom.xml @@ -5,7 +5,7 @@ runtime-rpc jar runtime-rpc - 0.1.10-SNAPSHOT + 0.1.14-SNAPSHOT Cap'n Proto RPC runtime library org.capnproto @@ -49,12 +49,12 @@ org.capnproto runtime - 0.1.10-SNAPSHOT + 0.1.14-SNAPSHOT org.capnproto compiler - 0.1.10-SNAPSHOT + 0.1.14-SNAPSHOT From 9bb1032274bda10891f1f2bf8caf901cc171ff8d Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 10 Nov 2021 12:13:13 +0000 Subject: [PATCH 220/246] avoid truncating struct size --- runtime/src/main/java/org/capnproto/WireHelpers.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 275f9b4c..bc87d6b2 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -1008,7 +1008,7 @@ static StructReader readStructPointer(SegmentReader segment, } static SegmentBuilder setStructPointer(SegmentBuilder segment, CapTableBuilder capTable, int refOffset, StructReader value) { - short dataSize = (short)roundBitsUpToWords(value.dataSize); + int dataSize = roundBitsUpToWords(value.dataSize); int totalSize = dataSize + value.pointerCount * Constants.POINTER_SIZE_IN_WORDS; AllocateResult allocation = allocate(refOffset, segment, capTable, totalSize, WirePointer.STRUCT); From 42d5535e9afe5a2daa73a736c2f6cf8bda8cadf1 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sat, 5 Mar 2022 17:03:03 +0000 Subject: [PATCH 221/246] Track fix to ordering bug as described here: https://github.com/capnproto/capnproto/pull/1006 https://github.com/capnproto/capnproto/pull/1006/commits/6f77d092163d055b661873d72ef956009b1ed3d4 --- runtime-rpc/src/main/java/org/capnproto/RpcState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime-rpc/src/main/java/org/capnproto/RpcState.java b/runtime-rpc/src/main/java/org/capnproto/RpcState.java index dcf29046..c671c3dd 100644 --- a/runtime-rpc/src/main/java/org/capnproto/RpcState.java +++ b/runtime-rpc/src/main/java/org/capnproto/RpcState.java @@ -1896,7 +1896,7 @@ public ClientHook getInnermostClient() { @Override public Request newCall(long interfaceId, short methodId) { this.receivedCall = true; - return this.cap.newCall(interfaceId, methodId); + return super.newCall(interfaceId, methodId); } @Override From 3b4ee42cc355f81260951d87cf741556852642bb Mon Sep 17 00:00:00 2001 From: Vaci Date: Sun, 6 Mar 2022 13:32:01 +0000 Subject: [PATCH 222/246] remove unused import --- runtime/src/main/java/org/capnproto/Request.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Request.java b/runtime/src/main/java/org/capnproto/Request.java index 6f782373..45dff2b7 100644 --- a/runtime/src/main/java/org/capnproto/Request.java +++ b/runtime/src/main/java/org/capnproto/Request.java @@ -1,7 +1,5 @@ package org.capnproto; -import java.util.concurrent.CompletableFuture; - public interface Request extends RequestBase { From 59701de8482e3a7fc14acc9a332ed78e9cfbe879 Mon Sep 17 00:00:00 2001 From: Vaci Date: Sun, 6 Mar 2022 13:57:25 +0000 Subject: [PATCH 223/246] Provide fallback to original interface. --- runtime/src/main/java/org/capnproto/SetPointerBuilder.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/src/main/java/org/capnproto/SetPointerBuilder.java b/runtime/src/main/java/org/capnproto/SetPointerBuilder.java index c1566e13..cdc7f72d 100644 --- a/runtime/src/main/java/org/capnproto/SetPointerBuilder.java +++ b/runtime/src/main/java/org/capnproto/SetPointerBuilder.java @@ -22,5 +22,8 @@ package org.capnproto; public interface SetPointerBuilder { + default void setPointerBuilder(SegmentBuilder segment, int pointer, Reader value) { + setPointerBuilder(segment, null, pointer, value); + } void setPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, int pointer, Reader value); } From 4171577bf0659bdcb133b9e522e578e0a002265c Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 6 Mar 2022 14:08:13 +0000 Subject: [PATCH 224/246] Move NULL and BROKEN brands to ClientHook --- runtime/src/main/java/org/capnproto/Capability.java | 6 +++--- runtime/src/main/java/org/capnproto/ClientHook.java | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 8fc0f7a5..722f4781 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -5,10 +5,10 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; -public final class Capability { +import static org.capnproto.ClientHook.BROKEN_CAPABILITY_BRAND; +import static org.capnproto.ClientHook.NULL_CAPABILITY_BRAND; - static final Object NULL_CAPABILITY_BRAND = new Object(); - static final Object BROKEN_CAPABILITY_BRAND = new Object(); +public final class Capability { public static class BuilderContext { public CapTableBuilder capTable; diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index d04e125c..5f4cdb4d 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -5,6 +5,8 @@ public interface ClientHook { + static final Object NULL_CAPABILITY_BRAND = new Object(); + static final Object BROKEN_CAPABILITY_BRAND = new Object(); /** * Start a new call, allowing the client to allocate request/response objects as it sees fit. * This version is used when calls are made from application code in the local process. @@ -70,14 +72,14 @@ default CompletableFuture whenResolved() { * reading a null pointer out of a Cap'n Proto message. */ default boolean isNull() { - return getBrand() == Capability.NULL_CAPABILITY_BRAND; + return getBrand() == NULL_CAPABILITY_BRAND; } /** * Returns true if the capability was created by newBrokenCap(). */ default boolean isError() { - return getBrand() == Capability.BROKEN_CAPABILITY_BRAND; + return getBrand() == BROKEN_CAPABILITY_BRAND; } /** From 8c6b9c8caae7493146599fe43dc10b4699060750 Mon Sep 17 00:00:00 2001 From: Vaci Date: Sun, 6 Mar 2022 14:33:14 +0000 Subject: [PATCH 225/246] Avoid use of var --- runtime/src/main/java/org/capnproto/AnyPointer.java | 8 ++++---- runtime/src/main/java/org/capnproto/ExportTable.java | 6 +++--- runtime/src/main/java/org/capnproto/ImportTable.java | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 8f750cb0..23a034fd 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -67,7 +67,7 @@ public Reader(SegmentReader segment, CapTableReader capTable, int pointer, int n } final Reader imbue(CapTableReader capTable) { - var result = new Reader(segment, pointer, nestingLimit); + Reader result = new Reader(segment, pointer, nestingLimit); result.capTable = capTable; return result; } @@ -83,9 +83,9 @@ public final T getAs(FromPointerReader factory) { public final ClientHook getPipelinedCap(short[] ops) { AnyPointer.Reader any = this; - for (var pointerIndex: ops) { + for (short pointerIndex: ops) { if (pointerIndex >= 0) { - var reader = WireHelpers.readStructPointer(any.segment, any.capTable, any.pointer, null, 0, any.nestingLimit); + StructReader reader = WireHelpers.readStructPointer(any.segment, any.capTable, any.pointer, null, 0, any.nestingLimit); any = reader._getPointerField(AnyPointer.factory, pointerIndex); } } @@ -176,7 +176,7 @@ public ClientHook asCap() { } public Pipeline getPointerField(short pointerIndex) { - var newOps = new short[this.ops.length + 1]; + short[] newOps = new short[this.ops.length + 1]; System.arraycopy(this.ops, 0, newOps, 0, this.ops.length); newOps[this.ops.length] = pointerIndex; return new Pipeline(this.hook, newOps); diff --git a/runtime/src/main/java/org/capnproto/ExportTable.java b/runtime/src/main/java/org/capnproto/ExportTable.java index dcd7730d..8cb70896 100644 --- a/runtime/src/main/java/org/capnproto/ExportTable.java +++ b/runtime/src/main/java/org/capnproto/ExportTable.java @@ -19,7 +19,7 @@ public T find(int id) { } public T erase(int id, T entry) { - var value = slots.get(id); + T value = slots.get(id); if (value == entry) { freeIds.add(id); return slots.remove(id); @@ -30,8 +30,8 @@ public T erase(int id, T entry) { public T next() { int id = freeIds.isEmpty() ? max++ : freeIds.remove(); - var value = newExportable(id); - var prev = slots.put(id, value); + T value = newExportable(id); + T prev = slots.put(id, value); assert prev == null; return value; } diff --git a/runtime/src/main/java/org/capnproto/ImportTable.java b/runtime/src/main/java/org/capnproto/ImportTable.java index 69050607..970dee8f 100644 --- a/runtime/src/main/java/org/capnproto/ImportTable.java +++ b/runtime/src/main/java/org/capnproto/ImportTable.java @@ -19,7 +19,7 @@ public T find(int id) { } public T erase(int id, T entry) { - var removed = slots.remove(id, entry); + boolean removed = slots.remove(id, entry); assert removed; return entry; } From f510bd19aa87323dc76e8d895da9059d8fccd6d0 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 6 Mar 2022 16:46:39 +0000 Subject: [PATCH 226/246] move captable contexts --- runtime/src/main/java/org/capnproto/AnyPointer.java | 4 ++-- runtime/src/main/java/org/capnproto/CapTableBuilder.java | 5 +++++ runtime/src/main/java/org/capnproto/CapTableReader.java | 5 +++++ runtime/src/main/java/org/capnproto/ListBuilder.java | 8 ++++---- runtime/src/main/java/org/capnproto/ListReader.java | 8 ++++---- runtime/src/main/java/org/capnproto/StructBuilder.java | 8 ++++---- runtime/src/main/java/org/capnproto/StructReader.java | 8 ++++---- 7 files changed, 28 insertions(+), 18 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/AnyPointer.java b/runtime/src/main/java/org/capnproto/AnyPointer.java index 23a034fd..1094d3ac 100644 --- a/runtime/src/main/java/org/capnproto/AnyPointer.java +++ b/runtime/src/main/java/org/capnproto/AnyPointer.java @@ -48,7 +48,7 @@ public void setPointerBuilder(SegmentBuilder segment, CapTableBuilder capTable, } public static final Factory factory = new Factory(); - public final static class Reader extends Capability.ReaderContext { + public final static class Reader extends CapTableReader.ReaderContext { final SegmentReader segment; final int pointer; // offset in words final int nestingLimit; @@ -93,7 +93,7 @@ public final ClientHook getPipelinedCap(short[] ops) { } } - public static final class Builder extends Capability.BuilderContext { + public static final class Builder extends CapTableBuilder.BuilderContext { final SegmentBuilder segment; final int pointer; diff --git a/runtime/src/main/java/org/capnproto/CapTableBuilder.java b/runtime/src/main/java/org/capnproto/CapTableBuilder.java index 01e68255..8f137a70 100644 --- a/runtime/src/main/java/org/capnproto/CapTableBuilder.java +++ b/runtime/src/main/java/org/capnproto/CapTableBuilder.java @@ -1,6 +1,11 @@ package org.capnproto; public interface CapTableBuilder extends CapTableReader { + + class BuilderContext { + public CapTableBuilder capTable; + } + int injectCap(ClientHook cap); void dropCap(int index); diff --git a/runtime/src/main/java/org/capnproto/CapTableReader.java b/runtime/src/main/java/org/capnproto/CapTableReader.java index e8f5be5e..b6d6f8de 100644 --- a/runtime/src/main/java/org/capnproto/CapTableReader.java +++ b/runtime/src/main/java/org/capnproto/CapTableReader.java @@ -1,5 +1,10 @@ package org.capnproto; public interface CapTableReader { + + class ReaderContext { + public CapTableReader capTable; + } + ClientHook extractCap(int index); } diff --git a/runtime/src/main/java/org/capnproto/ListBuilder.java b/runtime/src/main/java/org/capnproto/ListBuilder.java index 19f3c59c..9d200189 100644 --- a/runtime/src/main/java/org/capnproto/ListBuilder.java +++ b/runtime/src/main/java/org/capnproto/ListBuilder.java @@ -23,7 +23,7 @@ import java.util.List; -public class ListBuilder extends Capability.BuilderContext { +public class ListBuilder extends CapTableBuilder.BuilderContext { public interface Factory { T constructBuilder(SegmentBuilder segment, int ptr, int elementCount, int step, @@ -31,9 +31,9 @@ T constructBuilder(SegmentBuilder segment, int ptr, default T constructBuilder(SegmentBuilder segment, CapTableBuilder capTable, int ptr, int elementCount, int step, int structDataSize, short structPointerCount) { - var result = constructBuilder(segment, ptr, elementCount, step, structDataSize, structPointerCount); - if (result instanceof Capability.BuilderContext) { - ((Capability.BuilderContext) result).capTable = capTable; + T result = constructBuilder(segment, ptr, elementCount, step, structDataSize, structPointerCount); + if (result instanceof CapTableBuilder.BuilderContext) { + ((CapTableBuilder.BuilderContext) result).capTable = capTable; } return result; } diff --git a/runtime/src/main/java/org/capnproto/ListReader.java b/runtime/src/main/java/org/capnproto/ListReader.java index bf1f45c6..f63ecfec 100644 --- a/runtime/src/main/java/org/capnproto/ListReader.java +++ b/runtime/src/main/java/org/capnproto/ListReader.java @@ -21,7 +21,7 @@ package org.capnproto; -public class ListReader extends Capability.ReaderContext { +public class ListReader extends CapTableReader.ReaderContext { public interface Factory { T constructReader(SegmentReader segment, int ptr, @@ -31,9 +31,9 @@ T constructReader(SegmentReader segment, default T constructReader(SegmentReader segment, CapTableReader capTable, int ptr, int elementCount, int step, int structDataSize, short structPointerCount, int nestingLimit) { - var result = constructReader(segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); - if (result instanceof Capability.ReaderContext) { - ((Capability.ReaderContext) result).capTable = capTable; + T result = constructReader(segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); + if (result instanceof CapTableReader.ReaderContext) { + ((CapTableReader.ReaderContext) result).capTable = capTable; } return result; } diff --git a/runtime/src/main/java/org/capnproto/StructBuilder.java b/runtime/src/main/java/org/capnproto/StructBuilder.java index 6285dce6..f9543771 100644 --- a/runtime/src/main/java/org/capnproto/StructBuilder.java +++ b/runtime/src/main/java/org/capnproto/StructBuilder.java @@ -21,15 +21,15 @@ package org.capnproto; -public class StructBuilder extends Capability.BuilderContext { +public class StructBuilder extends CapTableBuilder.BuilderContext { public interface Factory { T constructBuilder(SegmentBuilder segment, int data, int pointers, int dataSize, short pointerCount); default T constructBuilder(SegmentBuilder segment, CapTableBuilder capTable, int data, int pointers, int dataSize, short pointerCount) { - var result = constructBuilder(segment, data, pointers, dataSize, pointerCount); - if (result instanceof Capability.BuilderContext) { - ((Capability.BuilderContext) result).capTable = capTable; + T result = constructBuilder(segment, data, pointers, dataSize, pointerCount); + if (result instanceof CapTableBuilder.BuilderContext) { + ((CapTableBuilder.BuilderContext) result).capTable = capTable; } return result; } diff --git a/runtime/src/main/java/org/capnproto/StructReader.java b/runtime/src/main/java/org/capnproto/StructReader.java index 3225c712..14532a65 100644 --- a/runtime/src/main/java/org/capnproto/StructReader.java +++ b/runtime/src/main/java/org/capnproto/StructReader.java @@ -21,7 +21,7 @@ package org.capnproto; -public class StructReader extends Capability.ReaderContext { +public class StructReader extends CapTableReader.ReaderContext { public interface Factory { T constructReader(SegmentReader segment, int data, int pointers, int dataSize, short pointerCount, @@ -29,9 +29,9 @@ T constructReader(SegmentReader segment, int data, int pointers, default T constructReader(SegmentReader segment, CapTableReader capTable, int data, int pointers, int dataSize, short pointerCount, int nestingLimit) { - var result = constructReader(segment, data, pointers, dataSize, pointerCount, nestingLimit); - if (result instanceof Capability.ReaderContext) { - ((Capability.ReaderContext) result).capTable = capTable; + T result = constructReader(segment, data, pointers, dataSize, pointerCount, nestingLimit); + if (result instanceof CapTableReader.ReaderContext) { + ((CapTableReader.ReaderContext) result).capTable = capTable; } return result; } From 3ec3dbae570a2a0da706708e89f7164170243e41 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 6 Mar 2022 16:47:19 +0000 Subject: [PATCH 227/246] remove captable contexts from capability --- runtime/src/main/java/org/capnproto/Capability.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 722f4781..4521c541 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -10,14 +10,6 @@ public final class Capability { - public static class BuilderContext { - public CapTableBuilder capTable; - } - - public static class ReaderContext { - public CapTableReader capTable; - } - public static abstract class Factory implements FromPointerReader, FromPointerBuilder, From 7c521d5840f547b0dbb95f8d51666df46bff343e Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Sun, 6 Mar 2022 16:47:37 +0000 Subject: [PATCH 228/246] avoid var in ClientHook --- runtime/src/main/java/org/capnproto/ClientHook.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/ClientHook.java b/runtime/src/main/java/org/capnproto/ClientHook.java index 5f4cdb4d..ed4b3200 100644 --- a/runtime/src/main/java/org/capnproto/ClientHook.java +++ b/runtime/src/main/java/org/capnproto/ClientHook.java @@ -61,7 +61,7 @@ default CompletableFuture whenMoreResolved() { * Repeatedly calls whenMoreResolved() until it returns nullptr. */ default CompletableFuture whenResolved() { - var promise = whenMoreResolved(); + CompletableFuture promise = whenMoreResolved(); return promise != null ? promise.thenCompose(ClientHook::whenResolved) : CompletableFuture.completedFuture(null); @@ -83,7 +83,7 @@ default boolean isError() { } /** - * Implements {@link Capability.Client.getFd}. If this returns null but whenMoreResolved() returns + * Implements Capability.Client.getFd. If this returns null but whenMoreResolved() returns * non-null, then Capability::Client::getFd() waits for resolution and tries again. */ default FileDescriptor getFd() { From 3119bb5fab5dc964c92d6619942625d5f6a46284 Mon Sep 17 00:00:00 2001 From: jan Date: Mon, 21 Mar 2022 01:27:06 +0100 Subject: [PATCH 229/246] Fix generic structs with non-generic interface as type parameter. --- compiler/src/main/cpp/capnpc-java.c++ | 8 ++++++-- runtime/src/main/java/org/capnproto/Capability.java | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index c8e6bdd3..4aba1261 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -338,18 +338,22 @@ private: if (liteMode) { return kj::strTree("org.capnproto.Capability.", suffix); } + auto interfaceSuffix = kj::str(suffix); + if(suffix == kj::str("Builder") || suffix == kj::str("Reader")) { + interfaceSuffix = kj::str("Client"); + } auto interfaceSchema = type.asInterface(); if (interfaceSchema.getProto().getIsGeneric()) { auto typeArgs = getTypeArguments(interfaceSchema, interfaceSchema, kj::str(suffix)); return kj::strTree( - javaFullName(interfaceSchema), ".", suffix, "<", + javaFullName(interfaceSchema), ".", interfaceSuffix, "<", kj::StringTree(KJ_MAP(arg, typeArgs){ return kj::strTree(arg); }, ", "), ">" ); } else { - return kj::strTree(javaFullName(type.asInterface()), ".", suffix); + return kj::strTree(javaFullName(type.asInterface()), ".", interfaceSuffix); } } case schema::Type::LIST: diff --git a/runtime/src/main/java/org/capnproto/Capability.java b/runtime/src/main/java/org/capnproto/Capability.java index 4521c541..30eb6cf6 100644 --- a/runtime/src/main/java/org/capnproto/Capability.java +++ b/runtime/src/main/java/org/capnproto/Capability.java @@ -11,8 +11,7 @@ public final class Capability { public static abstract class Factory - implements FromPointerReader, - FromPointerBuilder, + implements PointerFactory, SetPointerBuilder { public abstract T newClient(ClientHook hook); From af9c1090b9b82f2bb582cbadcc2246d20e3f856c Mon Sep 17 00:00:00 2001 From: Vaci Date: Mon, 8 Aug 2022 14:41:11 +0100 Subject: [PATCH 230/246] CI token (#31) * replace ACTION_TOKEN with GITHUB_TOKEN * try removing token --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45770780..365fbe06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,9 +14,6 @@ jobs: steps: - uses: actions/checkout@v2 - with: - token: ${{ secrets.ACTIONS_TOKEN }} - - name: Install Cap'n Proto run: | export DEBIAN_FRONTEND=noninteractive From ced3f11e6fb8e09878b9f15e36cf0addcab4f5ee Mon Sep 17 00:00:00 2001 From: Vaci Date: Mon, 8 Aug 2022 14:51:46 +0100 Subject: [PATCH 231/246] Specify OpenJDK version for JitPack (#28) Co-authored-by: octeep --- jitpack.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 jitpack.yml diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 00000000..adb3fe10 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +jdk: + - openjdk11 From e77372b1cdc27786490f7872d43bc6ca6a2c1669 Mon Sep 17 00:00:00 2001 From: Martin Dindoffer Date: Thu, 28 Apr 2022 14:59:56 +0200 Subject: [PATCH 232/246] Fix integer overflow in bounds checking --- .../java/org/capnproto/SegmentReader.java | 12 ++++---- .../main/java/org/capnproto/WireHelpers.java | 2 +- .../test/java/org/capnproto/LayoutTest.java | 28 +++++++++++++++++++ .../java/org/capnproto/SegmentReaderTest.java | 18 ++++++++++++ 4 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 runtime/src/test/java/org/capnproto/SegmentReaderTest.java diff --git a/runtime/src/main/java/org/capnproto/SegmentReader.java b/runtime/src/main/java/org/capnproto/SegmentReader.java index 62a30ef6..d24ba34d 100644 --- a/runtime/src/main/java/org/capnproto/SegmentReader.java +++ b/runtime/src/main/java/org/capnproto/SegmentReader.java @@ -39,11 +39,13 @@ public final long get(int index) { return buffer.getLong(index * Constants.BYTES_PER_WORD); } - // Verify that the `size`-long (in words) range starting at word index - // `start` is within bounds. - public final boolean in_bounds(int start, int size) { + /** + * Verify that the `size`-long (in words) range starting at word index + * `start` is within bounds. + */ + public final boolean isInBounds(int start, int size) { if (start < 0 || size < 0) return false; - long sizeInWords = size * Constants.BYTES_PER_WORD; - return (long) start + sizeInWords <= (long) this.buffer.capacity(); + long sizeInWords = (long) size * Constants.BYTES_PER_WORD; + return start + sizeInWords <= this.buffer.capacity(); } } diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 6e09668e..8d85160e 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -43,7 +43,7 @@ static int roundBitsUpToWords(long bits) { static boolean bounds_check(SegmentReader segment, int start, int size) { - return segment == null || segment.in_bounds(start, size); + return segment == null || segment.isInBounds(start, size); } static class AllocateResult { diff --git a/runtime/src/test/java/org/capnproto/LayoutTest.java b/runtime/src/test/java/org/capnproto/LayoutTest.java index b885fcdf..a4dd8311 100644 --- a/runtime/src/test/java/org/capnproto/LayoutTest.java +++ b/runtime/src/test/java/org/capnproto/LayoutTest.java @@ -86,6 +86,34 @@ public void readStructPointerShouldThrowDecodeExceptionOnOutOfBoundsStructPointe StructReader reader = WireHelpers.readStructPointer(new BareStructReader(), arena.tryGetSegment(0), null, 0, null, 0, 0x7fffffff); } + + private static class BareListReader implements ListReader.Factory { + BareListReader() { + } + + @Override + public ListReader constructReader(SegmentReader segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount, int nestingLimit) { + return new ListReader(segment, ptr, elementCount, step, structDataSize, structPointerCount, nestingLimit); + } + } + + @Test(expected = DecodeException.class) + public void readListPointerShouldThrowDecodeExceptionOnOutOfBoundsCompositeListPointer() { + byte[] brokenMSG = { + // set list pointer bits to 1, elementSize to 7 to indicate composite list and number of words in the list (minus tag) to 0x1FFFFFFF (max value possible in 29b limit) + 0x01, 0x00, 0x00, 0x00, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,//tag with element wordSize of 1 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + ByteBuffer buffer = ByteBuffer.wrap(brokenMSG); + buffer.order(ByteOrder.LITTLE_ENDIAN); + + ReaderArena arena = new ReaderArena(new ByteBuffer[]{buffer}, 0x7fffffffffffffffL); + + ListReader reader = WireHelpers.readListPointer(new BareListReader(), arena.tryGetSegment(0), 0, null, 0, (byte) 0, 0x7fffffff); + } + private class BareStructBuilder implements StructBuilder.Factory { private StructSize structSize; diff --git a/runtime/src/test/java/org/capnproto/SegmentReaderTest.java b/runtime/src/test/java/org/capnproto/SegmentReaderTest.java new file mode 100644 index 00000000..4678963d --- /dev/null +++ b/runtime/src/test/java/org/capnproto/SegmentReaderTest.java @@ -0,0 +1,18 @@ +package org.capnproto; + +import org.hamcrest.MatcherAssert; +import org.junit.Test; + +import java.nio.ByteBuffer; + +import static org.hamcrest.CoreMatchers.is; + +public class SegmentReaderTest { + + @Test + public void in_boundsCalculationShouldNotOverflow() { + ByteBuffer byteBuffer = ByteBuffer.allocate(64); + SegmentReader segmentReader = new SegmentReader(byteBuffer, null); + MatcherAssert.assertThat(segmentReader.isInBounds(0, Integer.MAX_VALUE), is(false)); + } +} \ No newline at end of file From 89d1c5722ea4d8609351efe14b0d4ea25a53be63 Mon Sep 17 00:00:00 2001 From: Martin Dindoffer Date: Wed, 4 May 2022 18:40:12 +0200 Subject: [PATCH 233/246] Fix integer overflow in computeSerializedSizeInWords --- .../src/main/java/org/capnproto/Serialize.java | 11 +++++++---- .../test/java/org/capnproto/SerializeTest.java | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/Serialize.java b/runtime/src/main/java/org/capnproto/Serialize.java index 6dcccad5..4329dfcc 100644 --- a/runtime/src/main/java/org/capnproto/Serialize.java +++ b/runtime/src/main/java/org/capnproto/Serialize.java @@ -178,15 +178,18 @@ public static MessageReader read(ByteBuffer bb, ReaderOptions options) throws IO } public static long computeSerializedSizeInWords(MessageBuilder message) { - final ByteBuffer[] segments = message.getSegmentsForOutput(); + return computeSerializedSizeInWords(message.getSegmentsForOutput()); + } - // From the capnproto documentation: + //VisibleForTesting + static long computeSerializedSizeInWords(ByteBuffer[] segments) { + // From the capnproto documentation (https://capnproto.org/encoding.html#serialization-over-a-stream): // "When transmitting over a stream, the following should be sent..." long bytes = 0; // "(4 bytes) The number of segments, minus one..." bytes += 4; // "(N * 4 bytes) The size of each segment, in words." - bytes += segments.length * 4; + bytes += segments.length * 4L; // "(0 or 4 bytes) Padding up to the next word boundary." if (bytes % 8 != 0) { bytes += 4; @@ -194,7 +197,7 @@ public static long computeSerializedSizeInWords(MessageBuilder message) { // The content of each segment, in order. for (int i = 0; i < segments.length; ++i) { - final ByteBuffer s = segments[i]; + ByteBuffer s = segments[i]; bytes += s.limit(); } diff --git a/runtime/src/test/java/org/capnproto/SerializeTest.java b/runtime/src/test/java/org/capnproto/SerializeTest.java index 5ad9abe4..e9051a58 100644 --- a/runtime/src/test/java/org/capnproto/SerializeTest.java +++ b/runtime/src/test/java/org/capnproto/SerializeTest.java @@ -30,8 +30,15 @@ import java.util.concurrent.ExecutionException; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; +import java.nio.ByteBuffer; +import java.util.Arrays; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + public class SerializeTest { /** @@ -194,4 +201,13 @@ public void testSegment1SizeOverflow() throws java.io.IOException { java.nio.channels.Channels.newChannel(new java.io.ByteArrayInputStream(input)); MessageReader message = Serialize.read(channel); } + + @Test + @Ignore("Ignored by default because the huge array used in the test results in a long execution") + public void computeSerializedSizeInWordsShouldNotOverflowOnLargeSegmentCounts() { + ByteBuffer dummySegmentBuffer = ByteBuffer.allocate(0); + ByteBuffer[] segments = new ByteBuffer[Integer.MAX_VALUE / 2]; + Arrays.fill(segments, dummySegmentBuffer); + assertThat(Serialize.computeSerializedSizeInWords(segments), is((segments.length * 4L + 4) / Constants.BYTES_PER_WORD)); + } } From b1eadaee6c8bbfcfa43aa8c1d68eddd1984f1173 Mon Sep 17 00:00:00 2001 From: Martin Dindoffer Date: Fri, 6 May 2022 14:08:24 +0200 Subject: [PATCH 234/246] Fix intege overflow in _setBooleanElement in a primitive list --- .../main/java/org/capnproto/ListBuilder.java | 2 +- .../java/org/capnproto/ListBuilderTest.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 runtime/src/test/java/org/capnproto/ListBuilderTest.java diff --git a/runtime/src/main/java/org/capnproto/ListBuilder.java b/runtime/src/main/java/org/capnproto/ListBuilder.java index 9d200189..05b581c8 100644 --- a/runtime/src/main/java/org/capnproto/ListBuilder.java +++ b/runtime/src/main/java/org/capnproto/ListBuilder.java @@ -99,7 +99,7 @@ protected double _getDoubleElement(int index) { } protected void _setBooleanElement(int index, boolean value) { - long bitOffset = index * this.step; + long bitOffset = (long) index * this.step; byte bitnum = (byte)(bitOffset % 8); int position = (int)(this.ptr + (bitOffset / 8)); byte oldValue = this.segment.buffer.get(position); diff --git a/runtime/src/test/java/org/capnproto/ListBuilderTest.java b/runtime/src/test/java/org/capnproto/ListBuilderTest.java new file mode 100644 index 00000000..d100cb5e --- /dev/null +++ b/runtime/src/test/java/org/capnproto/ListBuilderTest.java @@ -0,0 +1,18 @@ +package org.capnproto; + +import org.junit.Test; + +import java.nio.ByteBuffer; + +public class ListBuilderTest { + + @Test(expected = IndexOutOfBoundsException.class) + public void _setBooleanElementShouldNotOverflowDuringPositionOffsetCalculation() { + ByteBuffer buffer = ByteBuffer.allocate(10); + BuilderArena builderArena = new BuilderArena(new DefaultAllocator()); + SegmentBuilder segmentBuilder = new SegmentBuilder(buffer, builderArena); + ListBuilder listBuilder = new ListBuilder(segmentBuilder, 0, 0, 2, 0, (short) 0); + + listBuilder._setBooleanElement(Integer.MAX_VALUE, true); + } +} \ No newline at end of file From 529a3daa6fa3f3f4af6c2bcaf7e84c61a0a08843 Mon Sep 17 00:00:00 2001 From: Martin Dindoffer Date: Fri, 6 May 2022 15:01:12 +0200 Subject: [PATCH 235/246] Fix integer overflow in setListPointer size calculation --- runtime/src/main/java/org/capnproto/WireHelpers.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 8d85160e..93273867 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -1035,7 +1035,7 @@ static SegmentBuilder setStructPointer(SegmentBuilder segment, CapTableBuilder c }; static SegmentBuilder setListPointer(SegmentBuilder segment, CapTableBuilder capTable, int refOffset, ListReader value) { - int totalSize = roundBitsUpToWords(value.elementCount * value.step); + int totalSize = roundBitsUpToWords((long) value.elementCount * value.step); if (value.step <= Constants.BITS_PER_WORD) { //# List of non-structs. From 58c906f55556495b65c6232b64a5c4c1f80ec019 Mon Sep 17 00:00:00 2001 From: Martin Dindoffer Date: Fri, 6 May 2022 15:01:39 +0200 Subject: [PATCH 236/246] Introduce constant for nesting limit in LayoutTest --- runtime/src/test/java/org/capnproto/LayoutTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime/src/test/java/org/capnproto/LayoutTest.java b/runtime/src/test/java/org/capnproto/LayoutTest.java index a4dd8311..7c3ee1ce 100644 --- a/runtime/src/test/java/org/capnproto/LayoutTest.java +++ b/runtime/src/test/java/org/capnproto/LayoutTest.java @@ -7,6 +7,9 @@ import java.nio.ByteOrder; public class LayoutTest { + + private static final int MAX_NESTING_LIMIT = 0x7fffffff; + private class BareStructReader implements StructReader.Factory { @Override public StructReader constructReader(SegmentReader segment, int data, int pointers, int dataSize, short pointerCount, int nestingLimit) { @@ -25,7 +28,7 @@ public void testSimpleRawDataStruct() { ReaderArena arena = new ReaderArena(new ByteBuffer[]{ buffer }, 0x7fffffffffffffffL); - StructReader reader = WireHelpers.readStructPointer(new BareStructReader(), arena.tryGetSegment(0), null,0, null, 0, 0x7fffffff); + StructReader reader = WireHelpers.readStructPointer(new BareStructReader(), arena.tryGetSegment(0), null, 0, null, 0, MAX_NESTING_LIMIT); Assert.assertEquals(reader._getLongField(0), 0xefcdab8967452301L); Assert.assertEquals(reader._getLongField(1), 0L); @@ -83,7 +86,7 @@ public void readStructPointerShouldThrowDecodeExceptionOnOutOfBoundsStructPointe ReaderArena arena = new ReaderArena(new ByteBuffer[]{ buffer }, 0x7fffffffffffffffL); - StructReader reader = WireHelpers.readStructPointer(new BareStructReader(), arena.tryGetSegment(0), null, 0, null, 0, 0x7fffffff); + StructReader reader = WireHelpers.readStructPointer(new BareStructReader(), arena.tryGetSegment(0), null, 0, null, 0, MAX_NESTING_LIMIT); } @@ -111,7 +114,7 @@ public void readListPointerShouldThrowDecodeExceptionOnOutOfBoundsCompositeListP ReaderArena arena = new ReaderArena(new ByteBuffer[]{buffer}, 0x7fffffffffffffffL); - ListReader reader = WireHelpers.readListPointer(new BareListReader(), arena.tryGetSegment(0), 0, null, 0, (byte) 0, 0x7fffffff); + ListReader reader = WireHelpers.readListPointer(new BareListReader(), arena.tryGetSegment(0), 0, null, 0, (byte) 0, MAX_NESTING_LIMIT); } private class BareStructBuilder implements StructBuilder.Factory { From 04d0692c64206442846b350e64b713ce8724655d Mon Sep 17 00:00:00 2001 From: Martin Dindoffer Date: Fri, 6 May 2022 15:19:54 +0200 Subject: [PATCH 237/246] Fix integer overflow when calculating zeroing range in zeroObject Lists can have up to 29 bits of elements. We multiply that by a constant of 8 (Bytes per word), so basically any element size can cause on overflow. --- runtime/src/main/java/org/capnproto/WireHelpers.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 93273867..2c4f9840 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -256,10 +256,10 @@ static void zeroObject(SegmentBuilder segment, CapTableBuilder capTable, long ta case ElementSize.TWO_BYTES: case ElementSize.FOUR_BYTES: case ElementSize.EIGHT_BYTES: { - memset(segment.buffer, ptr * Constants.BYTES_PER_WORD, (byte)0, - roundBitsUpToWords( - ListPointer.elementCount(tag) * - ElementSize.dataBitsPerElement(ListPointer.elementSize(tag))) * Constants.BYTES_PER_WORD); + memset(segment.buffer, ptr * Constants.BYTES_PER_WORD, (byte) 0, + roundBitsUpToWords( + (long) ListPointer.elementCount(tag) * + ElementSize.dataBitsPerElement(ListPointer.elementSize(tag))) * Constants.BYTES_PER_WORD); break; } case ElementSize.POINTER: { From e8338d826e841e8daff78b51d1a3c32d2b696847 Mon Sep 17 00:00:00 2001 From: Martin Dindoffer Date: Fri, 6 May 2022 23:45:45 +0200 Subject: [PATCH 238/246] Performance-related cleanup * Remove unnecessary bitwise and in WirePointer * Remove always true condition in Serialize * Pre-size segment ArrayList in Serialize * Remove unused local var in Serialize * Remove unnecessary bit shift in PackedOutputStream#write * Make fields final in BuilderArena and Serialize * Make Iterator classes static in DataList and TextList * Pre-size ArrayList in ReaderArena constructor --- runtime/src/main/java/org/capnproto/BuilderArena.java | 2 +- runtime/src/main/java/org/capnproto/DataList.java | 4 ++-- .../main/java/org/capnproto/PackedOutputStream.java | 2 +- runtime/src/main/java/org/capnproto/ReaderArena.java | 2 +- runtime/src/main/java/org/capnproto/Serialize.java | 10 +++------- runtime/src/main/java/org/capnproto/TextList.java | 4 ++-- runtime/src/main/java/org/capnproto/WirePointer.java | 2 +- 7 files changed, 11 insertions(+), 15 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/BuilderArena.java b/runtime/src/main/java/org/capnproto/BuilderArena.java index 1ae46d0e..290a6aac 100644 --- a/runtime/src/main/java/org/capnproto/BuilderArena.java +++ b/runtime/src/main/java/org/capnproto/BuilderArena.java @@ -37,7 +37,7 @@ public enum AllocationStrategy { AllocationStrategy.GROW_HEURISTICALLY; public final ArrayList segments; - private Allocator allocator; + private final Allocator allocator; private final CapTableBuilder localCapTable = new CapTableBuilder() { diff --git a/runtime/src/main/java/org/capnproto/DataList.java b/runtime/src/main/java/org/capnproto/DataList.java index 423561c3..ec4cc7f0 100644 --- a/runtime/src/main/java/org/capnproto/DataList.java +++ b/runtime/src/main/java/org/capnproto/DataList.java @@ -54,7 +54,7 @@ public Data.Reader get(int index) { return _getPointerElement(Data.factory, index); } - public final class Iterator implements java.util.Iterator { + public static final class Iterator implements java.util.Iterator { public Reader list; public int idx = 0; public Iterator(Reader list) { @@ -99,7 +99,7 @@ public final Reader asReader() { java.lang.Integer.MAX_VALUE); } - public final class Iterator implements java.util.Iterator { + public static final class Iterator implements java.util.Iterator { public Builder list; public int idx = 0; public Iterator(Builder list) { diff --git a/runtime/src/main/java/org/capnproto/PackedOutputStream.java b/runtime/src/main/java/org/capnproto/PackedOutputStream.java index 67fefe81..40a0f877 100644 --- a/runtime/src/main/java/org/capnproto/PackedOutputStream.java +++ b/runtime/src/main/java/org/capnproto/PackedOutputStream.java @@ -111,7 +111,7 @@ public int write(ByteBuffer inBuf) throws IOException { out.position(out.position() + bit7 - 1); inPtr += 1; - byte tag = (byte)((bit0 << 0) | (bit1 << 1) | (bit2 << 2) | (bit3 << 3) | + byte tag = (byte)((bit0) | (bit1 << 1) | (bit2 << 2) | (bit3 << 3) | (bit4 << 4) | (bit5 << 5) | (bit6 << 6) | (bit7 << 7)); out.put(tagPos, tag); diff --git a/runtime/src/main/java/org/capnproto/ReaderArena.java b/runtime/src/main/java/org/capnproto/ReaderArena.java index c4994017..94972df3 100644 --- a/runtime/src/main/java/org/capnproto/ReaderArena.java +++ b/runtime/src/main/java/org/capnproto/ReaderArena.java @@ -33,7 +33,7 @@ public final class ReaderArena implements Arena { public ReaderArena(ByteBuffer[] segmentSlices, long traversalLimitInWords) { this.limit = traversalLimitInWords; - this.segments = new ArrayList(); + this.segments = new ArrayList<>(segmentSlices.length); for(int ii = 0; ii < segmentSlices.length; ++ii) { this.segments.add(new SegmentReader(segmentSlices[ii], this)); } diff --git a/runtime/src/main/java/org/capnproto/Serialize.java b/runtime/src/main/java/org/capnproto/Serialize.java index 4329dfcc..5b8ae75f 100644 --- a/runtime/src/main/java/org/capnproto/Serialize.java +++ b/runtime/src/main/java/org/capnproto/Serialize.java @@ -43,7 +43,7 @@ static ByteBuffer makeByteBuffer(int bytes) { return result; } - static int MAX_SEGMENT_WORDS = (1 << 28) - 1; + static final int MAX_SEGMENT_WORDS = (1 << 28) - 1; static ByteBuffer makeByteBufferForWords(int words) throws IOException { if (words > MAX_SEGMENT_WORDS) { @@ -79,10 +79,7 @@ public static MessageReader read(ReadableByteChannel bc, ReaderOptions options) int segmentCount = 1 + rawSegmentCount; - int segment0Size = 0; - if (segmentCount > 0) { - segment0Size = firstWord.getInt(4); - } + int segment0Size = firstWord.getInt(4); if (segment0Size < 0) { throw new DecodeException("segment 0 has more than 2^31 words, which is unsupported"); @@ -91,7 +88,7 @@ public static MessageReader read(ReadableByteChannel bc, ReaderOptions options) long totalWords = segment0Size; // in words - ArrayList moreSizes = new ArrayList(); + ArrayList moreSizes = new ArrayList<>(segmentCount -1); if (segmentCount > 1) { ByteBuffer moreSizesRaw = makeByteBuffer(4 * (segmentCount & ~1)); @@ -118,7 +115,6 @@ public static MessageReader read(ReadableByteChannel bc, ReaderOptions options) fillBuffer(segmentSlices[0], bc); segmentSlices[0].rewind(); - int offset = segment0Size; for (int ii = 1; ii < segmentCount; ++ii) { segmentSlices[ii] = makeByteBufferForWords(moreSizes.get(ii - 1)); fillBuffer(segmentSlices[ii], bc); diff --git a/runtime/src/main/java/org/capnproto/TextList.java b/runtime/src/main/java/org/capnproto/TextList.java index a56b3827..f827bd7c 100644 --- a/runtime/src/main/java/org/capnproto/TextList.java +++ b/runtime/src/main/java/org/capnproto/TextList.java @@ -54,7 +54,7 @@ public Text.Reader get(int index) { return _getPointerElement(Text.factory, index); } - public final class Iterator implements java.util.Iterator { + public static final class Iterator implements java.util.Iterator { public Reader list; public int idx = 0; public Iterator(Reader list) { @@ -99,7 +99,7 @@ public final Reader asReader() { java.lang.Integer.MAX_VALUE); } - public final class Iterator implements java.util.Iterator { + public static final class Iterator implements java.util.Iterator { public Builder list; public int idx = 0; public Iterator(Builder list) { diff --git a/runtime/src/main/java/org/capnproto/WirePointer.java b/runtime/src/main/java/org/capnproto/WirePointer.java index 4d9b547d..5e75c951 100644 --- a/runtime/src/main/java/org/capnproto/WirePointer.java +++ b/runtime/src/main/java/org/capnproto/WirePointer.java @@ -34,7 +34,7 @@ public static boolean isNull(long wirePointer) { } public static int offsetAndKind(long wirePointer) { - return (int)(wirePointer & 0xffffffff); + return (int) wirePointer; } public static byte kind(long wirePointer) { From 2094289256798df81d77426ddbbd8c63786c48c8 Mon Sep 17 00:00:00 2001 From: Martin Dindoffer Date: Mon, 6 Jun 2022 17:48:06 +0200 Subject: [PATCH 239/246] Avoid duplicate bitwise operations when reading primitive list pointers --- runtime/src/main/java/org/capnproto/WireHelpers.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/WireHelpers.java b/runtime/src/main/java/org/capnproto/WireHelpers.java index 2c4f9840..8192f77d 100644 --- a/runtime/src/main/java/org/capnproto/WireHelpers.java +++ b/runtime/src/main/java/org/capnproto/WireHelpers.java @@ -1297,8 +1297,8 @@ static T readListPointer(ListReader.Factory factory, //# lists can also be interpreted as struct lists. We //# need to compute the data size and pointer count for //# such structs. - int dataSize = ElementSize.dataBitsPerElement(ListPointer.elementSize(resolved.ref)); - int pointerCount = ElementSize.pointersPerElement(ListPointer.elementSize(resolved.ref)); + int dataSize = ElementSize.dataBitsPerElement(elementSize); + int pointerCount = ElementSize.pointersPerElement(elementSize); int elementCount = ListPointer.elementCount(resolved.ref); int step = dataSize + pointerCount * Constants.BITS_PER_POINTER; @@ -1337,7 +1337,7 @@ static T readListPointer(ListReader.Factory factory, return factory.constructReader(resolved.segment, capTable, resolved.ptr * Constants.BYTES_PER_WORD, - ListPointer.elementCount(resolved.ref), + elementCount, step, dataSize, (short)pointerCount, From ee0d727ade29f03e63f2fb614ea075b80dd31fc9 Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Mon, 8 Aug 2022 15:00:32 +0100 Subject: [PATCH 240/246] pass null captable in ListReader test --- runtime/src/test/java/org/capnproto/LayoutTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/test/java/org/capnproto/LayoutTest.java b/runtime/src/test/java/org/capnproto/LayoutTest.java index 7c3ee1ce..7f937683 100644 --- a/runtime/src/test/java/org/capnproto/LayoutTest.java +++ b/runtime/src/test/java/org/capnproto/LayoutTest.java @@ -114,7 +114,7 @@ public void readListPointerShouldThrowDecodeExceptionOnOutOfBoundsCompositeListP ReaderArena arena = new ReaderArena(new ByteBuffer[]{buffer}, 0x7fffffffffffffffL); - ListReader reader = WireHelpers.readListPointer(new BareListReader(), arena.tryGetSegment(0), 0, null, 0, (byte) 0, MAX_NESTING_LIMIT); + ListReader reader = WireHelpers.readListPointer(new BareListReader(), arena.tryGetSegment(0), 0, null, null, 0, (byte) 0, MAX_NESTING_LIMIT); } private class BareStructBuilder implements StructBuilder.Factory { From e3f447d4c73d04b5a34c39634372592e1ae860f2 Mon Sep 17 00:00:00 2001 From: octeep Date: Fri, 5 Aug 2022 01:02:02 +0800 Subject: [PATCH 241/246] use java nio AsynchronousByteChannel instead for Serialize --- .../main/java/org/capnproto/EzRpcClient.java | 4 +- .../main/java/org/capnproto/EzRpcServer.java | 20 +++- .../java/org/capnproto/TwoPartyClient.java | 8 +- .../java/org/capnproto/TwoPartyServer.java | 12 +- .../org/capnproto/TwoPartyVatNetwork.java | 6 +- .../AsynchronousByteListenChannel.java | 8 ++ .../main/java/org/capnproto/Serialize.java | 107 +----------------- 7 files changed, 43 insertions(+), 122 deletions(-) create mode 100644 runtime/src/main/java/org/capnproto/AsynchronousByteListenChannel.java diff --git a/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java b/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java index cb72660c..64ba8306 100644 --- a/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java +++ b/runtime-rpc/src/main/java/org/capnproto/EzRpcClient.java @@ -1,6 +1,6 @@ package org.capnproto; -import java.nio.channels.AsynchronousSocketChannel; +import java.nio.channels.AsynchronousByteChannel; import java.util.concurrent.CompletableFuture; public class EzRpcClient { @@ -8,7 +8,7 @@ public class EzRpcClient { private final TwoPartyClient twoPartyRpc; private final Capability.Client client; - public EzRpcClient(AsynchronousSocketChannel socket) { + public EzRpcClient(AsynchronousByteChannel socket) { this.twoPartyRpc = new TwoPartyClient(socket); this.client = this.twoPartyRpc.bootstrap(); } diff --git a/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java b/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java index ccd313f4..21001bd1 100644 --- a/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java +++ b/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java @@ -2,8 +2,7 @@ import java.io.IOException; import java.net.InetSocketAddress; -import java.nio.channels.AsynchronousChannelGroup; -import java.nio.channels.AsynchronousServerSocketChannel; +import java.nio.channels.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executors; @@ -32,6 +31,21 @@ public int getPort() { } public CompletableFuture start() { - return this.twoPartyRpc.listen(this.serverAcceptSocket); + return this.twoPartyRpc.listen(new AsynchronousByteListenChannel() { + @Override + public void accept(A attachment, CompletionHandler handler) { + serverAcceptSocket.accept(attachment, new CompletionHandler<>() { + @Override + public void completed(AsynchronousSocketChannel result, A attachment) { + handler.completed(result, attachment); + } + + @Override + public void failed(Throwable exc, A attachment) { + handler.failed(exc, attachment); + } + }); + } + }); } } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java index 5c21a48f..f1296cb0 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyClient.java @@ -1,6 +1,6 @@ package org.capnproto; -import java.nio.channels.AsynchronousSocketChannel; +import java.nio.channels.AsynchronousByteChannel; import java.util.concurrent.CompletableFuture; public class TwoPartyClient { @@ -8,15 +8,15 @@ public class TwoPartyClient { private final TwoPartyVatNetwork network; private final RpcSystem rpcSystem; - public TwoPartyClient(AsynchronousSocketChannel channel) { + public TwoPartyClient(AsynchronousByteChannel channel) { this(channel, null); } - public TwoPartyClient(AsynchronousSocketChannel channel, Capability.Client bootstrapInterface) { + public TwoPartyClient(AsynchronousByteChannel channel, Capability.Client bootstrapInterface) { this(channel, bootstrapInterface, RpcTwoPartyProtocol.Side.CLIENT); } - public TwoPartyClient(AsynchronousSocketChannel channel, + public TwoPartyClient(AsynchronousByteChannel channel, Capability.Client bootstrapInterface, RpcTwoPartyProtocol.Side side) { this.network = new TwoPartyVatNetwork(channel, side); diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java index 7f39f16a..aaf59c09 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java @@ -8,11 +8,11 @@ public class TwoPartyServer { private class AcceptedConnection { - private final AsynchronousSocketChannel connection; + private final AsynchronousByteChannel connection; private final TwoPartyVatNetwork network; private final RpcSystem rpcSystem; - AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousSocketChannel connection) { + AcceptedConnection(Capability.Client bootstrapInterface, AsynchronousByteChannel connection) { this.connection = connection; this.network = new TwoPartyVatNetwork(this.connection, RpcTwoPartyProtocol.Side.SERVER); this.rpcSystem = new RpcSystem<>(network, bootstrapInterface); @@ -31,7 +31,7 @@ public TwoPartyServer(Capability.Server bootstrapServer) { this(new Capability.Client(bootstrapServer)); } - public void accept(AsynchronousSocketChannel channel) { + public void accept(AsynchronousByteChannel channel) { var connection = new AcceptedConnection(this.bootstrapInterface, channel); this.connections.add(connection); connection.network.onDisconnect().whenComplete((x, exc) -> { @@ -39,11 +39,11 @@ public void accept(AsynchronousSocketChannel channel) { }); } - public CompletableFuture listen(AsynchronousServerSocketChannel listener) { - var result = new CompletableFuture(); + public CompletableFuture listen(AsynchronousByteListenChannel listener) { + var result = new CompletableFuture(); listener.accept(null, new CompletionHandler<>() { @Override - public void completed(AsynchronousSocketChannel channel, Object attachment) { + public void completed(AsynchronousByteChannel channel, Object attachment) { accept(channel); result.complete(null); } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 70ee22a6..33441478 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -1,7 +1,7 @@ package org.capnproto; import java.io.FileDescriptor; -import java.nio.channels.AsynchronousSocketChannel; +import java.nio.channels.AsynchronousByteChannel; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -11,12 +11,12 @@ public class TwoPartyVatNetwork private CompletableFuture previousWrite = CompletableFuture.completedFuture(null); private final CompletableFuture disconnectPromise = new CompletableFuture<>(); - private final AsynchronousSocketChannel channel; + private final AsynchronousByteChannel channel; private final RpcTwoPartyProtocol.Side side; private final MessageBuilder peerVatId = new MessageBuilder(4); private boolean accepted; - public TwoPartyVatNetwork(AsynchronousSocketChannel channel, RpcTwoPartyProtocol.Side side) { + public TwoPartyVatNetwork(AsynchronousByteChannel channel, RpcTwoPartyProtocol.Side side) { this.channel = channel; this.side = side; this.peerVatId.initRoot(RpcTwoPartyProtocol.VatId.factory).setSide( diff --git a/runtime/src/main/java/org/capnproto/AsynchronousByteListenChannel.java b/runtime/src/main/java/org/capnproto/AsynchronousByteListenChannel.java new file mode 100644 index 00000000..99161acc --- /dev/null +++ b/runtime/src/main/java/org/capnproto/AsynchronousByteListenChannel.java @@ -0,0 +1,8 @@ +package org.capnproto; + +import java.nio.channels.AsynchronousByteChannel; +import java.nio.channels.CompletionHandler; + +public interface AsynchronousByteListenChannel { + public abstract void accept(A attachment, CompletionHandler handler); +} diff --git a/runtime/src/main/java/org/capnproto/Serialize.java b/runtime/src/main/java/org/capnproto/Serialize.java index 5b8ae75f..bcd3a779 100644 --- a/runtime/src/main/java/org/capnproto/Serialize.java +++ b/runtime/src/main/java/org/capnproto/Serialize.java @@ -338,51 +338,10 @@ private void readSegments(int totalWords, int segmentCount, int segment0Size, in abstract void read(int bytes, Consumer consumer); } - static class AsyncSocketReader extends AsyncMessageReader { - private final AsynchronousSocketChannel channel; - private final long timeout; - private final TimeUnit timeUnit; - - AsyncSocketReader(AsynchronousSocketChannel channel, ReaderOptions options, long timeout, TimeUnit timeUnit) { - super(options); - this.channel = channel; - this.timeout = timeout; - this.timeUnit = timeUnit; - } - - void read(int bytes, Consumer consumer) { - var buffer = Serialize.makeByteBuffer(bytes); - var handler = new CompletionHandler() { - @Override - public void completed(Integer result, Object attachment) { - //System.out.println(channel.toString() + ": read " + result + " bytes"); - if (result <= 0) { - var text = result == 0 - ? "Read zero bytes. Is the channel in non-blocking mode?" - : "Premature EOF"; - readCompleted.completeExceptionally(new IOException(text)); - } else if (buffer.hasRemaining()) { - // partial read - channel.read(buffer, timeout, timeUnit, null, this); - } else { - consumer.accept(buffer); - } - } - - @Override - public void failed(Throwable exc, Object attachment) { - readCompleted.completeExceptionally(exc); - } - }; - - this.channel.read(buffer, this.timeout, this.timeUnit, null, handler); - } - } - - static class AsyncByteChannelReader extends AsyncMessageReader { + static class AsynchronousByteChannelReader extends AsyncMessageReader { private final AsynchronousByteChannel channel; - AsyncByteChannelReader(AsynchronousByteChannel channel, ReaderOptions options) { + AsynchronousByteChannelReader(AsynchronousByteChannel channel, ReaderOptions options) { super(options); this.channel = channel; } @@ -421,23 +380,7 @@ public static CompletableFuture readAsync(AsynchronousByteChannel } public static CompletableFuture readAsync(AsynchronousByteChannel channel, ReaderOptions options) { - return new AsyncByteChannelReader(channel, options).getMessage(); - } - - public static CompletableFuture readAsync(AsynchronousSocketChannel channel) { - return readAsync(channel, ReaderOptions.DEFAULT_READER_OPTIONS, Long.MAX_VALUE, TimeUnit.SECONDS); - } - - public static CompletableFuture readAsync(AsynchronousSocketChannel channel, ReaderOptions options) { - return readAsync(channel, options, Long.MAX_VALUE, TimeUnit.SECONDS); - } - - public static CompletableFuture readAsync(AsynchronousSocketChannel channel, long timeout, TimeUnit timeUnit) { - return readAsync(channel, ReaderOptions.DEFAULT_READER_OPTIONS, timeout, timeUnit); - } - - public static CompletableFuture readAsync(AsynchronousSocketChannel channel, ReaderOptions options, long timeout, TimeUnit timeUnit) { - return new AsyncSocketReader(channel, options, timeout, timeUnit).getMessage(); + return new AsynchronousByteChannelReader(channel, options).getMessage(); } public static CompletableFuture writeAsync(AsynchronousByteChannel outputChannel, MessageBuilder message) { @@ -477,50 +420,6 @@ public void failed(Throwable exc, Integer attachment) { return writeCompleted; } - public static CompletableFuture writeAsync(AsynchronousSocketChannel outputChannel, MessageBuilder message) { - return writeAsync(outputChannel, message, Long.MAX_VALUE, TimeUnit.SECONDS); - } - - public static CompletableFuture writeAsync(AsynchronousSocketChannel outputChannel, MessageBuilder message, long timeout, TimeUnit timeUnit) { - var writeCompleted = new CompletableFuture(); - var segments = message.getSegmentsForOutput(); - var header = getHeaderForOutput(segments); - long totalBytes = header.remaining(); - - // TODO avoid this copy? - var allSegments = new ByteBuffer[segments.length+1]; - allSegments[0] = header; - for (int ii = 0; ii < segments.length; ++ii) { - var segment = segments[ii]; - allSegments[ii+1] = segment; - totalBytes += segment.remaining(); - } - - outputChannel.write(allSegments, 0, allSegments.length, timeout, timeUnit, totalBytes, new CompletionHandler<>() { - @Override - public void completed(Long result, Long totalBytes) { - //System.out.println(outputChannel.toString() + ": Wrote " + result + "/" + totalBytes + " bytes"); - if (result < 0) { - writeCompleted.completeExceptionally(new IOException("Write failed")); - } - else if (result < totalBytes) { - // partial write - outputChannel.write(allSegments, 0, allSegments.length, timeout, timeUnit, totalBytes - result, this); - } - else { - writeCompleted.complete(null); - } - } - - @Override - public void failed(Throwable exc, Long attachment) { - writeCompleted.completeExceptionally(exc); - } - }); - - return writeCompleted; - } - private static ByteBuffer getHeaderForOutput(ByteBuffer[] segments) { assert segments.length > 0: "Empty message"; int tableSize = (segments.length + 2) & (~1); From ca7ceed32f341c3dc984f45a73936de178a7576b Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Tue, 9 Aug 2022 10:42:32 +0100 Subject: [PATCH 242/246] remove AsynchronousByteListenChannel --- .../main/java/org/capnproto/EzRpcServer.java | 17 +---------------- .../main/java/org/capnproto/TwoPartyServer.java | 6 +++--- .../java/org/capnproto/TwoPartyVatNetwork.java | 5 ++++- .../AsynchronousByteListenChannel.java | 8 -------- 4 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 runtime/src/main/java/org/capnproto/AsynchronousByteListenChannel.java diff --git a/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java b/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java index 21001bd1..f8116c12 100644 --- a/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java +++ b/runtime-rpc/src/main/java/org/capnproto/EzRpcServer.java @@ -31,21 +31,6 @@ public int getPort() { } public CompletableFuture start() { - return this.twoPartyRpc.listen(new AsynchronousByteListenChannel() { - @Override - public void accept(A attachment, CompletionHandler handler) { - serverAcceptSocket.accept(attachment, new CompletionHandler<>() { - @Override - public void completed(AsynchronousSocketChannel result, A attachment) { - handler.completed(result, attachment); - } - - @Override - public void failed(Throwable exc, A attachment) { - handler.failed(exc, attachment); - } - }); - } - }); + return this.twoPartyRpc.listen(this.serverAcceptSocket); } } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java index aaf59c09..b4df3399 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyServer.java @@ -39,11 +39,11 @@ public void accept(AsynchronousByteChannel channel) { }); } - public CompletableFuture listen(AsynchronousByteListenChannel listener) { - var result = new CompletableFuture(); + public CompletableFuture listen(AsynchronousServerSocketChannel listener) { + var result = new CompletableFuture(); listener.accept(null, new CompletionHandler<>() { @Override - public void completed(AsynchronousByteChannel channel, Object attachment) { + public void completed(AsynchronousSocketChannel channel, Object attachment) { accept(channel); result.complete(null); } diff --git a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java index 33441478..615318f0 100644 --- a/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java +++ b/runtime-rpc/src/main/java/org/capnproto/TwoPartyVatNetwork.java @@ -2,6 +2,7 @@ import java.io.FileDescriptor; import java.nio.channels.AsynchronousByteChannel; +import java.nio.channels.AsynchronousSocketChannel; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -71,7 +72,9 @@ public CompletableFuture shutdown() { var result = this.previousWrite.whenComplete((void_, exc) -> { try { - this.channel.shutdownOutput(); + if (this.channel instanceof AsynchronousSocketChannel) { + ((AsynchronousSocketChannel)this.channel).shutdownOutput(); + } } catch (Exception ignored) { } diff --git a/runtime/src/main/java/org/capnproto/AsynchronousByteListenChannel.java b/runtime/src/main/java/org/capnproto/AsynchronousByteListenChannel.java deleted file mode 100644 index 99161acc..00000000 --- a/runtime/src/main/java/org/capnproto/AsynchronousByteListenChannel.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.capnproto; - -import java.nio.channels.AsynchronousByteChannel; -import java.nio.channels.CompletionHandler; - -public interface AsynchronousByteListenChannel { - public abstract void accept(A attachment, CompletionHandler handler); -} From 1a36fd894d163fc4279fb8b77a1bc4dc19c8182f Mon Sep 17 00:00:00 2001 From: Vaci Date: Sun, 27 Nov 2022 17:50:02 +0000 Subject: [PATCH 243/246] Update README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 2384c007..8f9b5b84 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,10 @@ This repository clone adds an implementation of the RPC framework for Java. Promise pipelining is provided via java.util.concurrent.CompletableFuture. Unlike the KJ asynchronous model, which completes promises only when they are waited upon, a CompletableFuture can complete immediately. This may break E-ordering, as the C++ implementation -relies on kj::evalLater() to defer method calls, and there is no obvious (to me, anyway) way to replicate the behaviour of -kj::evalLater() with CompletableFutures. +relies on kj::evalLater() to defer method calls and this implementation may have subtle differences. Most of the C++ RPC test cases have been ported to this implementation, which gives me some comfort that the implementation logic is correct, but more extensive testing is required. This implementation does not support generic interfaces. Extending the schema compiler to output code for generic interfaces is an exercise I leave to the reader. - - From 8c741741790f5298f132d561e45d1a00bc391190 Mon Sep 17 00:00:00 2001 From: Sebastian Bergt Date: Thu, 24 Jul 2025 20:54:44 +0200 Subject: [PATCH 244/246] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f9b5b84..2123a2f3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # capnproto-java: Cap'n Proto for Java -[![Build Status](https://github.com/vaci/capnproto-java-rpc/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/vaci/capnproto-java-rpc/actions?query=workflow%3ACI) +[![Build Status](https://github.com/capnproto/capnproto-java/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/capnproto/capnproto-java/actions?query=workflow%3ACI) [Cap'n Proto](http://capnproto.org) is an extremely efficient protocol for sharing data and capabilities, and capnproto-java is a pure Java implementation. From e7c91caaefd2f552bcac790e28a2d8226a56a40b Mon Sep 17 00:00:00 2001 From: Sebastian Bergt Date: Thu, 24 Jul 2025 20:11:54 +0000 Subject: [PATCH 245/246] downgrade versions except for examples --- compiler/pom.xml | 4 ++-- .../java/org/capnproto/test/EncodingTest.java | 11 +++++----- examples/pom.xml | 10 ++++----- .../capnproto/examples/CalculatorServer.java | 22 ++++++++++++++----- runtime-rpc/pom.xml | 6 ++--- 5 files changed, 30 insertions(+), 23 deletions(-) diff --git a/compiler/pom.xml b/compiler/pom.xml index 86f13516..f6cb60c9 100644 --- a/compiler/pom.xml +++ b/compiler/pom.xml @@ -31,8 +31,8 @@ UTF-8 - 14 - 14 + 1.8 + 1.8 diff --git a/compiler/src/test/java/org/capnproto/test/EncodingTest.java b/compiler/src/test/java/org/capnproto/test/EncodingTest.java index 1e3e8135..1d3ce095 100644 --- a/compiler/src/test/java/org/capnproto/test/EncodingTest.java +++ b/compiler/src/test/java/org/capnproto/test/EncodingTest.java @@ -1,6 +1,5 @@ package org.capnproto.test; -import org.capnproto.test.Test; import org.capnproto.*; import org.capnproto.Void; import org.junit.jupiter.api.Assertions; @@ -904,24 +903,24 @@ public void testSetWithCaveats() { TestUtil.checkTestMessage(listReader.get(1)); } - @org.junit.Test + @Test public void testAnyStruct() { MessageBuilder builder = new MessageBuilder(); - var root = builder.initRoot(Test.TestAnyOthers.factory); + var root = builder.initRoot(org.capnproto.test.Test.TestAnyOthers.factory); var anyStruct = root.initAnyStructField(); } - @org.junit.Test + @Test public void testCopyAnyPointer() { MessageBuilder message1 = new MessageBuilder(); - Test.TestAllTypes.Builder root1 = message1.initRoot(Test.TestAllTypes.factory); + org.capnproto.test.Test.TestAllTypes.Builder root1 = message1.initRoot(org.capnproto.test.Test.TestAllTypes.factory); TestUtil.initTestMessage(root1); MessageBuilder message2 = new MessageBuilder(); AnyPointer.Builder root2 = message2.initRoot(AnyPointer.factory); root2.setAs(AnyPointer.factory, message1.getRoot(AnyPointer.factory).asReader()); - TestUtil.checkTestMessage(root2.getAs(Test.TestAllTypes.factory)); + TestUtil.checkTestMessage(root2.getAs(org.capnproto.test.Test.TestAllTypes.factory)); } @Test diff --git a/examples/pom.xml b/examples/pom.xml index 7aeba0bb..1b5df474 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -31,9 +31,9 @@ UTF-8 - 14 - 14 - 14 + 10 + 10 + 10 @@ -45,7 +45,7 @@ org.capnproto runtime-rpc - 0.1.14-SNAPSHOT + 0.1.17-SNAPSHOT @@ -63,8 +63,6 @@ maven-compiler-plugin 3.3 - 14 - 14 -Xlint:unchecked diff --git a/examples/src/main/java/org/capnproto/examples/CalculatorServer.java b/examples/src/main/java/org/capnproto/examples/CalculatorServer.java index 94828c9a..b40bbf39 100644 --- a/examples/src/main/java/org/capnproto/examples/CalculatorServer.java +++ b/examples/src/main/java/org/capnproto/examples/CalculatorServer.java @@ -123,12 +123,22 @@ protected CompletableFuture call(CallContext x + y; - case SUBTRACT -> x - y; - case MULTIPLY -> x * y; - case DIVIDE -> x / y; - default -> Double.NaN; + double result; + switch (op) { + case ADD: + result = x + y; + break; + case SUBTRACT: + result = x - y; + break; + case MULTIPLY: + result = x * y; + break; + case DIVIDE: + result = x / y; + break; + default: + result = Double.NaN; }; context.getResults().setValue(result); diff --git a/runtime-rpc/pom.xml b/runtime-rpc/pom.xml index aed08152..057fbe11 100644 --- a/runtime-rpc/pom.xml +++ b/runtime-rpc/pom.xml @@ -5,7 +5,7 @@ runtime-rpc jar runtime-rpc - 0.1.14-SNAPSHOT + 0.1.17-SNAPSHOT Cap'n Proto RPC runtime library org.capnproto @@ -49,12 +49,12 @@ org.capnproto runtime - 0.1.14-SNAPSHOT + 0.1.17-SNAPSHOT org.capnproto compiler - 0.1.14-SNAPSHOT + 0.1.17-SNAPSHOT From aeb56e07d7118462d453cae3a5fa0c9db564c0e7 Mon Sep 17 00:00:00 2001 From: Sebastian Bergt Date: Fri, 25 Jul 2025 10:14:45 +0200 Subject: [PATCH 246/246] restore CI --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 365fbe06..bfa00e90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,3 +46,4 @@ jobs: run: | env PATH="${PATH}:/home/runner/bin" env PATH="${PATH}:/home/runner/bin" mvn -e -X test +