Commit 352bb995 authored by Kenton Varda's avatar Kenton Varda

Level 2 RPC: Define 'Persistent' interface, get rid of 'Save' RPC protocol message.

parent 6c5a3509
......@@ -90,7 +90,8 @@ public_capnpc_inputs = \
src/capnp/c++.capnp \
src/capnp/schema.capnp \
src/capnp/rpc.capnp \
src/capnp/rpc-twoparty.capnp
src/capnp/rpc-twoparty.capnp \
src/capnp/persistent.capnp
capnpc_inputs = \
$(public_capnpc_inputs) \
......@@ -106,6 +107,8 @@ capnpc_outputs = \
src/capnp/rpc.capnp.h \
src/capnp/rpc-twoparty.capnp.c++ \
src/capnp/rpc-twoparty.capnp.h \
src/capnp/persistent.capnp.c++ \
src/capnp/persistent.capnp.h \
src/capnp/compiler/lexer.capnp.c++ \
src/capnp/compiler/lexer.capnp.h \
src/capnp/compiler/grammar.capnp.c++ \
......@@ -179,6 +182,7 @@ includecapnp_HEADERS = \
src/capnp/rpc-twoparty.h \
src/capnp/rpc.capnp.h \
src/capnp/rpc-twoparty.capnp.h \
src/capnp/persistent.capnp.h \
src/capnp/ez-rpc.h
if LITE_MODE
......@@ -255,6 +259,7 @@ libcapnp_rpc_la_SOURCES= \
src/capnp/rpc.capnp.c++ \
src/capnp/rpc-twoparty.c++ \
src/capnp/rpc-twoparty.capnp.c++ \
src/capnp/persistent.capnp.c++ \
src/capnp/ez-rpc.c++
# -lpthread is here to work around https://bugzilla.redhat.com/show_bug.cgi?id=661333
......
......@@ -7,4 +7,4 @@ export PATH=$PWD/bin:$PWD:$PATH
capnp compile -Isrc --no-standard-import --src-prefix=src -oc++:src \
src/capnp/c++.capnp src/capnp/schema.capnp \
src/capnp/compiler/lexer.capnp src/capnp/compiler/grammar.capnp \
src/capnp/rpc.capnp src/capnp/rpc-twoparty.capnp
src/capnp/rpc.capnp src/capnp/rpc-twoparty.capnp src/capnp/persistent.capnp
......@@ -63,6 +63,7 @@ set(capnp-rpc_sources
rpc.capnp.c++
rpc-twoparty.c++
rpc-twoparty.capnp.c++
persistent.capnp.c++
ez-rpc.c++
)
set(capnp-rpc_headers
......@@ -71,6 +72,7 @@ set(capnp-rpc_headers
rpc-twoparty.h
rpc.capnp.h
rpc-twoparty.capnp.h
persistent.capnp.h
ez-rpc.h
)
if(NOT CAPNP_LITE)
......@@ -98,6 +100,7 @@ set(capnpc_headers
schema.capnp
rpc.capnp
rpc-twoparty.capnp
persistent.capnp
)
if(NOT CAPNP_LITE)
add_library(capnpc ${capnpc_sources})
......
......@@ -52,7 +52,7 @@ fi
mkdir -p tmp/capnp/bootstrap-test-tmp
INPUTS="capnp/c++.capnp capnp/schema.capnp capnp/compiler/lexer.capnp capnp/compiler/grammar.capnp \
capnp/rpc.capnp capnp/rpc-twoparty.capnp"
capnp/rpc.capnp capnp/rpc-twoparty.capnp capnp/persistent.capnp"
SRC_INPUTS=""
for file in $INPUTS; do
......
# Copyright (c) 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.
@0xb8630836983feed7;
$import "/capnp/c++.capnp".namespace("capnp");
interface Persistent@0xc8cb212fcd9f5691(SturdyRef) {
# Interface implemented by capabilities that outlive a single connection. A client may save()
# the capability, producing a SturdyRef. The SturdyRef can be stored to disk, then later used to
# obtain a new reference to the capability on a future connection.
#
# The exact format of SturdyRef depends on the "realm" in which the SturdyRef appears. A "realm"
# is an abstract space in which all SturdyRefs have the same format and refer to the same set of
# resources. Every vat is in exactly one realm. All capability clients within that vat must
# produce SturdyRefs of the format appropriate for the realm.
#
# Similarly, every VatNetwork also resides in a particular realm. Usually, a vat's "realm"
# corresponds to the realm of its main VatNetwork. However, a Vat can in fact communicate over
# a VatNetwork in a different realm -- in this case, all SturdyRefs need to be transformed when
# coming or going through said VatNetwork. The RPC system has hooks for registering
# transformation callbacks for this purpose.
#
# Since the format of SturdyRef is realm-dependent, it is not defined here. An application should
# choose an appropriate realm for itself as part of its design. Note that under Sandstorm, every
# application exists in its own realm and is therefore free to define its own SturdyRef format;
# the Sandstorm platform handles translating between realms.
#
# Note that whether a capability is persistent is often orthogonal to its type. In these cases,
# the capability's interface should NOT inherit `Persistent`; instead, just perform a cast at
# runtime. It's not type-safe, but trying to be type-safe in these cases will likely lead to
# tears. In cases where a particular interface only makes sense on persistent capabilities, it
# *might* make sense to explicitly inherit it. But, even in these cases, you probably don't want
# to specify the `SturdyRef` parameter, since this type may differ from app to app or even host
# to host.
save @0 () -> (sturdyRef :SturdyRef);
# Save a capability persistently so that it can be restored by a future connection. Not all
# capabilities can be saved -- application interfaces should define which capabilities support
# this and which do not.
}
// Generated by Cap'n Proto compiler, DO NOT EDIT
// source: persistent.capnp
#include "persistent.capnp.h"
namespace capnp {
namespace schemas {
static const ::capnp::_::AlignedData<44> b_c8cb212fcd9f5691 = {
{ 0, 0, 0, 0, 5, 0, 6, 0,
145, 86, 159, 205, 47, 33, 203, 200,
23, 0, 0, 0, 3, 0, 0, 0,
215, 238, 63, 152, 54, 8, 99, 184,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0,
21, 0, 0, 0, 18, 1, 0, 0,
37, 0, 0, 0, 7, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
33, 0, 0, 0, 71, 0, 0, 0,
113, 0, 0, 0, 7, 0, 0, 0,
113, 0, 0, 0, 15, 0, 0, 0,
99, 97, 112, 110, 112, 47, 112, 101,
114, 115, 105, 115, 116, 101, 110, 116,
46, 99, 97, 112, 110, 112, 58, 80,
101, 114, 115, 105, 115, 116, 101, 110,
116, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
4, 0, 0, 0, 3, 0, 5, 0,
0, 0, 0, 0, 0, 0, 0, 0,
246, 251, 127, 14, 96, 3, 134, 201,
15, 169, 183, 122, 200, 49, 216, 248,
17, 0, 0, 0, 42, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
12, 0, 0, 0, 0, 0, 1, 0,
28, 0, 0, 0, 0, 0, 1, 0,
45, 0, 0, 0, 7, 0, 0, 0,
115, 97, 118, 101, 0, 0, 0, 0,
1, 0, 0, 0, 31, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
145, 86, 159, 205, 47, 33, 203, 200,
1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 31, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
145, 86, 159, 205, 47, 33, 203, 200,
1, 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, 1, 0, 1, 0,
4, 0, 0, 0, 0, 0, 1, 0,
1, 0, 0, 0, 82, 0, 0, 0,
83, 116, 117, 114, 100, 121, 82, 101,
102, 0, 0, 0, 0, 0, 0, 0, }
};
::capnp::word const* const bp_c8cb212fcd9f5691 = b_c8cb212fcd9f5691.words;
#if !CAPNP_LITE
static const ::capnp::_::RawSchema* const d_c8cb212fcd9f5691[] = {
&s_c98603600e7ffbf6,
&s_f8d831c87ab7a90f,
};
static const uint16_t m_c8cb212fcd9f5691[] = {0};
const ::capnp::_::RawBrandedSchema::Dependency bd_c8cb212fcd9f5691[] = {
{ 33554432, ::capnp::Persistent<>::SaveParams::_capnpPrivate::brand },
{ 50331648, ::capnp::Persistent<>::SaveResults::_capnpPrivate::brand },
};
const ::capnp::_::RawSchema s_c8cb212fcd9f5691 = {
0xc8cb212fcd9f5691, b_c8cb212fcd9f5691.words, 44, d_c8cb212fcd9f5691, m_c8cb212fcd9f5691,
2, 1, nullptr, nullptr, nullptr, { &s_c8cb212fcd9f5691, nullptr, bd_c8cb212fcd9f5691, 0, sizeof(bd_c8cb212fcd9f5691) / sizeof(bd_c8cb212fcd9f5691[0]), nullptr }
};
#endif // !CAPNP_LITE
static const ::capnp::_::AlignedData<18> b_c98603600e7ffbf6 = {
{ 0, 0, 0, 0, 5, 0, 6, 0,
246, 251, 127, 14, 96, 3, 134, 201,
34, 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, 1, 0, 0, 0,
21, 0, 0, 0, 114, 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, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
99, 97, 112, 110, 112, 47, 112, 101,
114, 115, 105, 115, 116, 101, 110, 116,
46, 99, 97, 112, 110, 112, 58, 80,
101, 114, 115, 105, 115, 116, 101, 110,
116, 46, 115, 97, 118, 101, 36, 80,
97, 114, 97, 109, 115, 0, 0, 0, }
};
::capnp::word const* const bp_c98603600e7ffbf6 = b_c98603600e7ffbf6.words;
#if !CAPNP_LITE
const ::capnp::_::RawBrandedSchema::Dependency bd_c98603600e7ffbf6[] = {
};
const ::capnp::_::RawSchema s_c98603600e7ffbf6 = {
0xc98603600e7ffbf6, b_c98603600e7ffbf6.words, 18, nullptr, nullptr,
0, 0, nullptr, nullptr, nullptr, { &s_c98603600e7ffbf6, nullptr, bd_c98603600e7ffbf6, 0, sizeof(bd_c98603600e7ffbf6) / sizeof(bd_c98603600e7ffbf6[0]), nullptr }
};
#endif // !CAPNP_LITE
static const ::capnp::_::AlignedData<35> b_f8d831c87ab7a90f = {
{ 0, 0, 0, 0, 5, 0, 6, 0,
15, 169, 183, 122, 200, 49, 216, 248,
34, 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, 1, 0, 0, 0,
21, 0, 0, 0, 122, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
33, 0, 0, 0, 63, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
99, 97, 112, 110, 112, 47, 112, 101,
114, 115, 105, 115, 116, 101, 110, 116,
46, 99, 97, 112, 110, 112, 58, 80,
101, 114, 115, 105, 115, 116, 101, 110,
116, 46, 115, 97, 118, 101, 36, 82,
101, 115, 117, 108, 116, 115, 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, 82, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
12, 0, 0, 0, 3, 0, 1, 0,
24, 0, 0, 0, 2, 0, 1, 0,
115, 116, 117, 114, 100, 121, 82, 101,
102, 0, 0, 0, 0, 0, 0, 0,
18, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0,
145, 86, 159, 205, 47, 33, 203, 200,
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_f8d831c87ab7a90f = b_f8d831c87ab7a90f.words;
#if !CAPNP_LITE
static const uint16_t m_f8d831c87ab7a90f[] = {0};
static const uint16_t i_f8d831c87ab7a90f[] = {0};
const ::capnp::_::RawBrandedSchema::Dependency bd_f8d831c87ab7a90f[] = {
};
const ::capnp::_::RawSchema s_f8d831c87ab7a90f = {
0xf8d831c87ab7a90f, b_f8d831c87ab7a90f.words, 35, nullptr, m_f8d831c87ab7a90f,
0, 1, i_f8d831c87ab7a90f, nullptr, nullptr, { &s_f8d831c87ab7a90f, nullptr, bd_f8d831c87ab7a90f, 0, sizeof(bd_f8d831c87ab7a90f) / sizeof(bd_f8d831c87ab7a90f[0]), nullptr }
};
#endif // !CAPNP_LITE
} // namespace schemas
} // namespace capnp
// Generated by Cap'n Proto compiler, DO NOT EDIT
// source: persistent.capnp
#ifndef CAPNP_INCLUDED_b8630836983feed7_
#define CAPNP_INCLUDED_b8630836983feed7_
#include <capnp/generated-header-support.h>
#if !CAPNP_LITE
#include <capnp/capability.h>
#endif // !CAPNP_LITE
#if CAPNP_VERSION != 5000
#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(c8cb212fcd9f5691);
CAPNP_DECLARE_SCHEMA(c98603600e7ffbf6);
CAPNP_DECLARE_SCHEMA(f8d831c87ab7a90f);
} // namespace schemas
} // namespace capnp
namespace capnp {
template <typename SturdyRef = ::capnp::AnyPointer>
struct Persistent {
Persistent() = delete;
#if !CAPNP_LITE
class Client;
class Server;
#endif // !CAPNP_LITE
struct SaveParams;
struct SaveResults;
CAPNP_DECLARE_TEMPLATE_INTERFACE(c8cb212fcd9f5691, SturdyRef);
};
template <typename SturdyRef>
struct Persistent<SturdyRef>::SaveParams {
SaveParams() = delete;
class Reader;
class Builder;
class Pipeline;
CAPNP_DECLARE_TEMPLATE_STRUCT(c98603600e7ffbf6, 0, 0, SturdyRef);
};
template <typename SturdyRef>
struct Persistent<SturdyRef>::SaveResults {
SaveResults() = delete;
class Reader;
class Builder;
class Pipeline;
CAPNP_DECLARE_TEMPLATE_STRUCT(f8d831c87ab7a90f, 0, 1, SturdyRef);
};
// =======================================================================================
#if !CAPNP_LITE
template <typename SturdyRef>
class Persistent<SturdyRef>::Client
: public virtual ::capnp::Capability::Client {
public:
typedef Persistent<SturdyRef> Calls;
typedef Persistent<SturdyRef> Reads;
Client(decltype(nullptr));
explicit Client(::kj::Own< ::capnp::ClientHook>&& hook);
template <typename _t, typename = ::kj::EnableIf< ::kj::canConvert<_t*, Server*>()>>
Client(::kj::Own<_t>&& server);
template <typename _t, typename = ::kj::EnableIf< ::kj::canConvert<_t*, Client*>()>>
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<typename ::capnp::Persistent<SturdyRef>::SaveParams, typename ::capnp::Persistent<SturdyRef>::SaveResults> saveRequest(
::kj::Maybe< ::capnp::MessageSize> sizeHint = nullptr);
protected:
Client() = default;
};
template <typename SturdyRef>
class Persistent<SturdyRef>::Server
: public virtual ::capnp::Capability::Server {
public:
typedef Persistent<SturdyRef> Serves;
::kj::Promise<void> dispatchCall(uint64_t interfaceId, uint16_t methodId,
::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context)
override;
protected:
typedef typename ::capnp::Persistent<SturdyRef>::SaveParams SaveParams;
typedef typename ::capnp::Persistent<SturdyRef>::SaveResults SaveResults;
typedef ::capnp::CallContext<SaveParams, SaveResults> SaveContext;
virtual ::kj::Promise<void> save(SaveContext context);
::kj::Promise<void> dispatchCallInternal(uint16_t methodId,
::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context);
};
#endif // !CAPNP_LITE
template <typename SturdyRef>
class Persistent<SturdyRef>::SaveParams::Reader {
public:
typedef SaveParams 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 <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
template <typename, ::capnp::Kind>
friend struct ::capnp::_::PointerHelpers;
template <typename, ::capnp::Kind>
friend struct ::capnp::List;
friend class ::capnp::MessageBuilder;
friend class ::capnp::Orphanage;
};
template <typename SturdyRef>
class Persistent<SturdyRef>::SaveParams::Builder {
public:
typedef SaveParams 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 <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
friend class ::capnp::Orphanage;
};
#if !CAPNP_LITE
template <typename SturdyRef>
class Persistent<SturdyRef>::SaveParams::Pipeline {
public:
typedef SaveParams Pipelines;
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
: _typeless(kj::mv(typeless)) {}
private:
::capnp::AnyPointer::Pipeline _typeless;
template <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
};
#endif // !CAPNP_LITE
template <typename SturdyRef>
class Persistent<SturdyRef>::SaveResults::Reader {
public:
typedef SaveResults 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 hasSturdyRef() const;
inline ::capnp::ReaderFor<SturdyRef> getSturdyRef() const;
private:
::capnp::_::StructReader _reader;
template <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
template <typename, ::capnp::Kind>
friend struct ::capnp::_::PointerHelpers;
template <typename, ::capnp::Kind>
friend struct ::capnp::List;
friend class ::capnp::MessageBuilder;
friend class ::capnp::Orphanage;
};
template <typename SturdyRef>
class Persistent<SturdyRef>::SaveResults::Builder {
public:
typedef SaveResults 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 hasSturdyRef();
inline ::capnp::BuilderFor<SturdyRef> getSturdyRef();
inline void setSturdyRef( ::capnp::ReaderFor<SturdyRef> value);
inline ::capnp::BuilderFor<SturdyRef> initSturdyRef();
inline ::capnp::BuilderFor<SturdyRef> initSturdyRef(unsigned int size);
inline void adoptSturdyRef(::capnp::Orphan<SturdyRef>&& value);
inline ::capnp::Orphan<SturdyRef> disownSturdyRef();
private:
::capnp::_::StructBuilder _builder;
template <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
friend class ::capnp::Orphanage;
};
#if !CAPNP_LITE
template <typename SturdyRef>
class Persistent<SturdyRef>::SaveResults::Pipeline {
public:
typedef SaveResults Pipelines;
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
: _typeless(kj::mv(typeless)) {}
inline ::capnp::PipelineFor<SturdyRef> getSturdyRef();
private:
::capnp::AnyPointer::Pipeline _typeless;
template <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
};
#endif // !CAPNP_LITE
// =======================================================================================
#if !CAPNP_LITE
template <typename SturdyRef>
inline Persistent<SturdyRef>::Client::Client(decltype(nullptr))
: ::capnp::Capability::Client(nullptr) {}
template <typename SturdyRef>
inline Persistent<SturdyRef>::Client::Client(
::kj::Own< ::capnp::ClientHook>&& hook)
: ::capnp::Capability::Client(::kj::mv(hook)) {}
template <typename SturdyRef>
template <typename _t, typename>
inline Persistent<SturdyRef>::Client::Client(::kj::Own<_t>&& server)
: ::capnp::Capability::Client(::kj::mv(server)) {}
template <typename SturdyRef>
template <typename _t, typename>
inline Persistent<SturdyRef>::Client::Client(::kj::Promise<_t>&& promise)
: ::capnp::Capability::Client(::kj::mv(promise)) {}
template <typename SturdyRef>
inline Persistent<SturdyRef>::Client::Client(::kj::Exception&& exception)
: ::capnp::Capability::Client(::kj::mv(exception)) {}
template <typename SturdyRef>
inline typename ::capnp::Persistent<SturdyRef>::Client& Persistent<SturdyRef>::Client::operator=(Client& other) {
::capnp::Capability::Client::operator=(other);
return *this;
}
template <typename SturdyRef>
inline typename ::capnp::Persistent<SturdyRef>::Client& Persistent<SturdyRef>::Client::operator=(Client&& other) {
::capnp::Capability::Client::operator=(kj::mv(other));
return *this;
}
#endif // !CAPNP_LITE
CAPNP_DEFINE_TEMPLATE_STRUCT(Persistent<SturdyRef>::SaveParams, template <typename SturdyRef>
, c98603600e7ffbf6, {
{ 0xc8cb212fcd9f5691 CAPNP_COMMA brandBindings + 0 CAPNP_COMMA 1 CAPNP_COMMA false} CAPNP_COMMA
}, {
::capnp::_::brandBindingFor<SturdyRef>() CAPNP_COMMA
}, {
});
template <typename SturdyRef>
inline bool Persistent<SturdyRef>::SaveResults::Reader::hasSturdyRef() const {
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
}
template <typename SturdyRef>
inline bool Persistent<SturdyRef>::SaveResults::Builder::hasSturdyRef() {
return !_builder.getPointerField(0 * ::capnp::POINTERS).isNull();
}
template <typename SturdyRef>
inline ::capnp::ReaderFor<SturdyRef> Persistent<SturdyRef>::SaveResults::Reader::getSturdyRef() const {
return ::capnp::_::PointerHelpers<SturdyRef>::get(
_reader.getPointerField(0 * ::capnp::POINTERS));
}
template <typename SturdyRef>
inline ::capnp::BuilderFor<SturdyRef> Persistent<SturdyRef>::SaveResults::Builder::getSturdyRef() {
return ::capnp::_::PointerHelpers<SturdyRef>::get(
_builder.getPointerField(0 * ::capnp::POINTERS));
}
#if !CAPNP_LITE
template <typename SturdyRef>
inline ::capnp::PipelineFor<SturdyRef> Persistent<SturdyRef>::SaveResults::Pipeline::getSturdyRef() {
return ::capnp::PipelineFor<SturdyRef>(_typeless.getPointerField(0));
}
#endif // !CAPNP_LITE
template <typename SturdyRef>
inline void Persistent<SturdyRef>::SaveResults::Builder::setSturdyRef( ::capnp::ReaderFor<SturdyRef> value) {
::capnp::_::PointerHelpers<SturdyRef>::set(
_builder.getPointerField(0 * ::capnp::POINTERS), value);
}
template <typename SturdyRef>
inline ::capnp::BuilderFor<SturdyRef> Persistent<SturdyRef>::SaveResults::Builder::initSturdyRef() {
return ::capnp::_::PointerHelpers<SturdyRef>::init(
_builder.getPointerField(0 * ::capnp::POINTERS));
}
template <typename SturdyRef>
inline ::capnp::BuilderFor<SturdyRef> Persistent<SturdyRef>::SaveResults::Builder::initSturdyRef(unsigned int size) {
return ::capnp::_::PointerHelpers<SturdyRef>::init(
_builder.getPointerField(0 * ::capnp::POINTERS), size);
}
template <typename SturdyRef>
inline void Persistent<SturdyRef>::SaveResults::Builder::adoptSturdyRef(
::capnp::Orphan<SturdyRef>&& value) {
::capnp::_::PointerHelpers<SturdyRef>::adopt(
_builder.getPointerField(0 * ::capnp::POINTERS), kj::mv(value));
}
template <typename SturdyRef>
inline ::capnp::Orphan<SturdyRef> Persistent<SturdyRef>::SaveResults::Builder::disownSturdyRef() {
return ::capnp::_::PointerHelpers<SturdyRef>::disown(
_builder.getPointerField(0 * ::capnp::POINTERS));
}
CAPNP_DEFINE_TEMPLATE_STRUCT(Persistent<SturdyRef>::SaveResults, template <typename SturdyRef>
, f8d831c87ab7a90f, {
{ 0xc8cb212fcd9f5691 CAPNP_COMMA brandBindings + 0 CAPNP_COMMA 1 CAPNP_COMMA false} CAPNP_COMMA
}, {
::capnp::_::brandBindingFor<SturdyRef>() CAPNP_COMMA
}, {
});
#if !CAPNP_LITE
template <typename SturdyRef>
::capnp::Request<typename ::capnp::Persistent<SturdyRef>::SaveParams, typename ::capnp::Persistent<SturdyRef>::SaveResults>
Persistent<SturdyRef>::Client::saveRequest(::kj::Maybe< ::capnp::MessageSize> sizeHint) {
return newCall<typename ::capnp::Persistent<SturdyRef>::SaveParams, typename ::capnp::Persistent<SturdyRef>::SaveResults>(
0xc8cb212fcd9f5691ull, 0, sizeHint);
}
template <typename SturdyRef>
::kj::Promise<void> Persistent<SturdyRef>::Server::save(SaveContext) {
return ::capnp::Capability::Server::internalUnimplemented(
"capnp/persistent.capnp:Persistent", "save",
0xc8cb212fcd9f5691ull, 0);
}
template <typename SturdyRef>
::kj::Promise<void> Persistent<SturdyRef>::Server::dispatchCall(
uint64_t interfaceId, uint16_t methodId,
::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) {
switch (interfaceId) {
case 0xc8cb212fcd9f5691ull:
return dispatchCallInternal(methodId, context);
default:
return internalUnimplemented("capnp/persistent.capnp:Persistent", interfaceId);
}
}
template <typename SturdyRef>
::kj::Promise<void> Persistent<SturdyRef>::Server::dispatchCallInternal(
uint16_t methodId,
::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) {
switch (methodId) {
case 0:
return save(::capnp::Capability::Server::internalGetTypedContext<
typename ::capnp::Persistent<SturdyRef>::SaveParams, typename ::capnp::Persistent<SturdyRef>::SaveResults>(context));
default:
return ::capnp::Capability::Server::internalUnimplemented(
"capnp/persistent.capnp:Persistent",
0xc8cb212fcd9f5691ull, methodId);
}
}
#endif // !CAPNP_LITE
CAPNP_DEFINE_TEMPLATE_INTERFACE(Persistent<SturdyRef>, template <typename SturdyRef>
, c8cb212fcd9f5691, {
{ 0xc8cb212fcd9f5691 CAPNP_COMMA brandBindings + 0 CAPNP_COMMA 1 CAPNP_COMMA false} CAPNP_COMMA
}, {
::capnp::_::brandBindingFor<SturdyRef>() CAPNP_COMMA
}, {
{ 33554432 CAPNP_COMMA ::capnp::Persistent<SturdyRef>::SaveParams::_capnpPrivate::brand } CAPNP_COMMA
{ 50331648 CAPNP_COMMA ::capnp::Persistent<SturdyRef>::SaveResults::_capnpPrivate::brand } CAPNP_COMMA
});
} // namespace
#endif // CAPNP_INCLUDED_b8630836983feed7_
......@@ -254,11 +254,14 @@ struct Message {
# Level 2 features -----------------------------------------------
save @7 :Save; # Save a capability persistently.
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.
deprecatedDelete @9 :AnyPointer;
# Deprecated way to delete a SturdyRef. This was never implemented, therefore it has been
# reduted to AnyPointer.
obsoleteDelete @9 :AnyPointer;
# Obsolete way to delete a SturdyRef. This was never implemented, therefore it has been
# reduted to AnyPointer. This operation was never implemented.
# Level 3 features -----------------------------------------------
......@@ -745,29 +748,7 @@ struct Disembargo {
# Level 2 message types ----------------------------------------------
struct Save {
# **(level 2)**
#
# Message type sent to save a capability persistently so that it can be restored by a future
# connection. Not all capabilities can be saved -- application interfaces should define which
# capabilities support this and which do not.
#
# The reason this is part of the protocol rather than a regular method on the object is because
# low-level Cap'n Proto infrastructure like proxies are likely to need to special-case `Save`
# requests while other message types are merely passed through. Relatedly, the result of a `Save`
# depends on the network interface on which it is issued -- an application which is connected
# to two separate VatNetworks needs to think about which one a given capability originated from
# when it saves a SturdyRef, whereas for the purpose of any application-level method it wouldn't
# make a difference. Thus, it's likely that the language-level interface to `Save` will look
# different from a regular method anyway.
questionId @0 :QuestionId;
# A new question ID identifying this request, which will eventually receive a Return
# message whose `results` is a SturdyRef.
target @1 :MessageTarget;
# What is to be saved.
}
# See persistent.capnp.
# Level 3 message types ----------------------------------------------
......
......@@ -75,21 +75,21 @@ static const ::capnp::_::AlignedData<232> b_91b79f1f808db032 = {
9, 0, 248, 255, 0, 0, 0, 0,
0, 0, 1, 0, 7, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
153, 1, 0, 0, 42, 0, 0, 0,
153, 1, 0, 0, 106, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
148, 1, 0, 0, 3, 0, 1, 0,
160, 1, 0, 0, 2, 0, 1, 0,
152, 1, 0, 0, 3, 0, 1, 0,
164, 1, 0, 0, 2, 0, 1, 0,
2, 0, 247, 255, 0, 0, 0, 0,
0, 0, 1, 0, 8, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
157, 1, 0, 0, 82, 0, 0, 0,
161, 1, 0, 0, 82, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
156, 1, 0, 0, 3, 0, 1, 0,
168, 1, 0, 0, 2, 0, 1, 0,
160, 1, 0, 0, 3, 0, 1, 0,
172, 1, 0, 0, 2, 0, 1, 0,
10, 0, 246, 255, 0, 0, 0, 0,
0, 0, 1, 0, 9, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
165, 1, 0, 0, 138, 0, 0, 0,
169, 1, 0, 0, 122, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
168, 1, 0, 0, 3, 0, 1, 0,
180, 1, 0, 0, 2, 0, 1, 0,
......@@ -178,12 +178,13 @@ static const ::capnp::_::AlignedData<232> b_91b79f1f808db032 = {
16, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
115, 97, 118, 101, 0, 0, 0, 0,
16, 0, 0, 0, 0, 0, 0, 0,
44, 136, 46, 176, 180, 240, 14, 228,
111, 98, 115, 111, 108, 101, 116, 101,
83, 97, 118, 101, 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,
16, 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,
98, 111, 111, 116, 115, 116, 114, 97,
......@@ -195,9 +196,8 @@ static const ::capnp::_::AlignedData<232> b_91b79f1f808db032 = {
16, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
100, 101, 112, 114, 101, 99, 97, 116,
101, 100, 68, 101, 108, 101, 116, 101,
0, 0, 0, 0, 0, 0, 0, 0,
111, 98, 115, 111, 108, 101, 116, 101,
68, 101, 108, 101, 116, 101, 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,
......@@ -251,18 +251,17 @@ static const ::capnp::_::RawSchema* const d_91b79f1f808db032[] = {
&s_d37d2eb2c2f80e63,
&s_d4c9b56290554016,
&s_d625b7063acf691a,
&s_e40ef0b4b02e882c,
&s_e94ccf8031176ec4,
&s_f964368b0fbd3711,
&s_fbe1980490e001af,
};
static const uint16_t m_91b79f1f808db032[] = {1, 11, 8, 2, 9, 13, 4, 12, 10, 6, 5, 3, 7, 0};
static const uint16_t m_91b79f1f808db032[] = {1, 11, 8, 2, 13, 4, 12, 9, 7, 10, 6, 5, 3, 0};
static const uint16_t i_91b79f1f808db032[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
const ::capnp::_::RawBrandedSchema::Dependency bd_91b79f1f808db032[] = {
};
const ::capnp::_::RawSchema s_91b79f1f808db032 = {
0x91b79f1f808db032, b_91b79f1f808db032.words, 232, d_91b79f1f808db032, m_91b79f1f808db032,
13, 14, i_91b79f1f808db032, nullptr, nullptr, { &s_91b79f1f808db032, nullptr, bd_91b79f1f808db032, 0, sizeof(bd_91b79f1f808db032) / sizeof(bd_91b79f1f808db032[0]), nullptr }
12, 14, i_91b79f1f808db032, nullptr, nullptr, { &s_91b79f1f808db032, nullptr, bd_91b79f1f808db032, 0, sizeof(bd_91b79f1f808db032) / sizeof(bd_91b79f1f808db032[0]), nullptr }
};
#endif // !CAPNP_LITE
static const ::capnp::_::AlignedData<51> b_e94ccf8031176ec4 = {
......@@ -1074,70 +1073,6 @@ const ::capnp::_::RawSchema s_d562b4df655bdd4d = {
1, 4, i_d562b4df655bdd4d, nullptr, nullptr, { &s_d562b4df655bdd4d, nullptr, bd_d562b4df655bdd4d, 0, sizeof(bd_d562b4df655bdd4d) / sizeof(bd_d562b4df655bdd4d[0]), nullptr }
};
#endif // !CAPNP_LITE
static const ::capnp::_::AlignedData<48> b_e40ef0b4b02e882c = {
{ 0, 0, 0, 0, 5, 0, 6, 0,
44, 136, 46, 176, 180, 240, 14, 228,
16, 0, 0, 0, 1, 0, 1, 0,
80, 162, 82, 37, 27, 152, 18, 179,
1, 0, 7, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
21, 0, 0, 0, 170, 0, 0, 0,
29, 0, 0, 0, 7, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
25, 0, 0, 0, 119, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
99, 97, 112, 110, 112, 47, 114, 112,
99, 46, 99, 97, 112, 110, 112, 58,
83, 97, 118, 101, 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, 90, 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,
1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
49, 0, 0, 0, 58, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
44, 0, 0, 0, 3, 0, 1, 0,
56, 0, 0, 0, 2, 0, 1, 0,
113, 117, 101, 115, 116, 105, 111, 110,
73, 100, 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,
116, 97, 114, 103, 101, 116, 0, 0,
16, 0, 0, 0, 0, 0, 0, 0,
193, 251, 19, 88, 84, 20, 188, 149,
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_e40ef0b4b02e882c = b_e40ef0b4b02e882c.words;
#if !CAPNP_LITE
static const ::capnp::_::RawSchema* const d_e40ef0b4b02e882c[] = {
&s_95bc14545813fbc1,
};
static const uint16_t m_e40ef0b4b02e882c[] = {0, 1};
static const uint16_t i_e40ef0b4b02e882c[] = {0, 1};
const ::capnp::_::RawBrandedSchema::Dependency bd_e40ef0b4b02e882c[] = {
};
const ::capnp::_::RawSchema s_e40ef0b4b02e882c = {
0xe40ef0b4b02e882c, b_e40ef0b4b02e882c.words, 48, d_e40ef0b4b02e882c, m_e40ef0b4b02e882c,
1, 2, i_e40ef0b4b02e882c, nullptr, nullptr, { &s_e40ef0b4b02e882c, nullptr, bd_e40ef0b4b02e882c, 0, sizeof(bd_e40ef0b4b02e882c) / sizeof(bd_e40ef0b4b02e882c[0]), nullptr }
};
#endif // !CAPNP_LITE
static const ::capnp::_::AlignedData<64> b_9c6a046bfbc1ac5a = {
{ 0, 0, 0, 0, 5, 0, 6, 0,
90, 172, 193, 251, 107, 4, 106, 156,
......@@ -1987,7 +1922,6 @@ CAPNP_DEFINE_STRUCT(Resolve, , bbc29655fa89086e);
CAPNP_DEFINE_STRUCT(Release, , ad1a6c0d7dd07497);
CAPNP_DEFINE_STRUCT(Disembargo, , f964368b0fbd3711);
CAPNP_DEFINE_STRUCT(Disembargo::Context, , d562b4df655bdd4d);
CAPNP_DEFINE_STRUCT(Save, , e40ef0b4b02e882c);
CAPNP_DEFINE_STRUCT(Provide, , 9c6a046bfbc1ac5a);
CAPNP_DEFINE_STRUCT(Accept, , d4c9b56290554016);
CAPNP_DEFINE_STRUCT(Join, , fbe1980490e001af);
......
......@@ -24,7 +24,6 @@ CAPNP_DECLARE_SCHEMA(bbc29655fa89086e);
CAPNP_DECLARE_SCHEMA(ad1a6c0d7dd07497);
CAPNP_DECLARE_SCHEMA(f964368b0fbd3711);
CAPNP_DECLARE_SCHEMA(d562b4df655bdd4d);
CAPNP_DECLARE_SCHEMA(e40ef0b4b02e882c);
CAPNP_DECLARE_SCHEMA(9c6a046bfbc1ac5a);
CAPNP_DECLARE_SCHEMA(d4c9b56290554016);
CAPNP_DECLARE_SCHEMA(fbe1980490e001af);
......@@ -63,9 +62,9 @@ struct Message {
FINISH,
RESOLVE,
RELEASE,
SAVE,
OBSOLETE_SAVE,
BOOTSTRAP,
DEPRECATED_DELETE,
OBSOLETE_DELETE,
PROVIDE,
ACCEPT,
JOIN,
......@@ -190,16 +189,6 @@ struct Disembargo::Context {
CAPNP_DECLARE_STRUCT(d562b4df655bdd4d, 1, 1);
};
struct Save {
Save() = delete;
class Reader;
class Builder;
class Pipeline;
CAPNP_DECLARE_STRUCT(e40ef0b4b02e882c, 1, 1);
};
struct Provide {
Provide() = delete;
......@@ -367,17 +356,17 @@ public:
inline bool hasRelease() const;
inline ::capnp::rpc::Release::Reader getRelease() const;
inline bool isSave() const;
inline bool hasSave() const;
inline ::capnp::rpc::Save::Reader getSave() const;
inline bool isObsoleteSave() const;
inline bool hasObsoleteSave() const;
inline ::capnp::AnyPointer::Reader getObsoleteSave() const;
inline bool isBootstrap() const;
inline bool hasBootstrap() const;
inline ::capnp::rpc::Bootstrap::Reader getBootstrap() const;
inline bool isDeprecatedDelete() const;
inline bool hasDeprecatedDelete() const;
inline ::capnp::AnyPointer::Reader getDeprecatedDelete() const;
inline bool isObsoleteDelete() const;
inline bool hasObsoleteDelete() const;
inline ::capnp::AnyPointer::Reader getObsoleteDelete() const;
inline bool isProvide() const;
inline bool hasProvide() const;
......@@ -480,13 +469,10 @@ public:
inline void adoptRelease(::capnp::Orphan< ::capnp::rpc::Release>&& value);
inline ::capnp::Orphan< ::capnp::rpc::Release> disownRelease();
inline bool isSave();
inline bool hasSave();
inline ::capnp::rpc::Save::Builder getSave();
inline void setSave( ::capnp::rpc::Save::Reader value);
inline ::capnp::rpc::Save::Builder initSave();
inline void adoptSave(::capnp::Orphan< ::capnp::rpc::Save>&& value);
inline ::capnp::Orphan< ::capnp::rpc::Save> disownSave();
inline bool isObsoleteSave();
inline bool hasObsoleteSave();
inline ::capnp::AnyPointer::Builder getObsoleteSave();
inline ::capnp::AnyPointer::Builder initObsoleteSave();
inline bool isBootstrap();
inline bool hasBootstrap();
......@@ -496,10 +482,10 @@ public:
inline void adoptBootstrap(::capnp::Orphan< ::capnp::rpc::Bootstrap>&& value);
inline ::capnp::Orphan< ::capnp::rpc::Bootstrap> disownBootstrap();
inline bool isDeprecatedDelete();
inline bool hasDeprecatedDelete();
inline ::capnp::AnyPointer::Builder getDeprecatedDelete();
inline ::capnp::AnyPointer::Builder initDeprecatedDelete();
inline bool isObsoleteDelete();
inline bool hasObsoleteDelete();
inline ::capnp::AnyPointer::Builder getObsoleteDelete();
inline ::capnp::AnyPointer::Builder initObsoleteDelete();
inline bool isProvide();
inline bool hasProvide();
......@@ -1417,90 +1403,6 @@ private:
};
#endif // !CAPNP_LITE
class Save::Reader {
public:
typedef Save 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 ::uint32_t getQuestionId() const;
inline bool hasTarget() const;
inline ::capnp::rpc::MessageTarget::Reader getTarget() const;
private:
::capnp::_::StructReader _reader;
template <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
template <typename, ::capnp::Kind>
friend struct ::capnp::_::PointerHelpers;
template <typename, ::capnp::Kind>
friend struct ::capnp::List;
friend class ::capnp::MessageBuilder;
friend class ::capnp::Orphanage;
};
class Save::Builder {
public:
typedef Save 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 ::uint32_t getQuestionId();
inline void setQuestionId( ::uint32_t value);
inline bool hasTarget();
inline ::capnp::rpc::MessageTarget::Builder getTarget();
inline void setTarget( ::capnp::rpc::MessageTarget::Reader value);
inline ::capnp::rpc::MessageTarget::Builder initTarget();
inline void adoptTarget(::capnp::Orphan< ::capnp::rpc::MessageTarget>&& value);
inline ::capnp::Orphan< ::capnp::rpc::MessageTarget> disownTarget();
private:
::capnp::_::StructBuilder _builder;
template <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
friend class ::capnp::Orphanage;
};
#if !CAPNP_LITE
class Save::Pipeline {
public:
typedef Save Pipelines;
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
: _typeless(kj::mv(typeless)) {}
inline ::capnp::rpc::MessageTarget::Pipeline getTarget();
private:
::capnp::AnyPointer::Pipeline _typeless;
template <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
};
#endif // !CAPNP_LITE
class Provide::Reader {
public:
typedef Provide Reads;
......@@ -2772,56 +2674,39 @@ inline ::capnp::Orphan< ::capnp::rpc::Release> Message::Builder::disownRelease()
_builder.getPointerField(0 * ::capnp::POINTERS));
}
inline bool Message::Reader::isSave() const {
return which() == Message::SAVE;
inline bool Message::Reader::isObsoleteSave() const {
return which() == Message::OBSOLETE_SAVE;
}
inline bool Message::Builder::isSave() {
return which() == Message::SAVE;
inline bool Message::Builder::isObsoleteSave() {
return which() == Message::OBSOLETE_SAVE;
}
inline bool Message::Reader::hasSave() const {
if (which() != Message::SAVE) return false;
inline bool Message::Reader::hasObsoleteSave() const {
if (which() != Message::OBSOLETE_SAVE) return false;
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
}
inline bool Message::Builder::hasSave() {
if (which() != Message::SAVE) return false;
inline bool Message::Builder::hasObsoleteSave() {
if (which() != Message::OBSOLETE_SAVE) return false;
return !_builder.getPointerField(0 * ::capnp::POINTERS).isNull();
}
inline ::capnp::rpc::Save::Reader Message::Reader::getSave() const {
KJ_IREQUIRE(which() == Message::SAVE,
inline ::capnp::AnyPointer::Reader Message::Reader::getObsoleteSave() const {
KJ_IREQUIRE(which() == Message::OBSOLETE_SAVE,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::rpc::Save>::get(
return ::capnp::AnyPointer::Reader(
_reader.getPointerField(0 * ::capnp::POINTERS));
}
inline ::capnp::rpc::Save::Builder Message::Builder::getSave() {
KJ_IREQUIRE(which() == Message::SAVE,
inline ::capnp::AnyPointer::Builder Message::Builder::getObsoleteSave() {
KJ_IREQUIRE(which() == Message::OBSOLETE_SAVE,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::rpc::Save>::get(
_builder.getPointerField(0 * ::capnp::POINTERS));
}
inline void Message::Builder::setSave( ::capnp::rpc::Save::Reader value) {
_builder.setDataField<Message::Which>(
0 * ::capnp::ELEMENTS, Message::SAVE);
::capnp::_::PointerHelpers< ::capnp::rpc::Save>::set(
_builder.getPointerField(0 * ::capnp::POINTERS), value);
}
inline ::capnp::rpc::Save::Builder Message::Builder::initSave() {
_builder.setDataField<Message::Which>(
0 * ::capnp::ELEMENTS, Message::SAVE);
return ::capnp::_::PointerHelpers< ::capnp::rpc::Save>::init(
return ::capnp::AnyPointer::Builder(
_builder.getPointerField(0 * ::capnp::POINTERS));
}
inline void Message::Builder::adoptSave(
::capnp::Orphan< ::capnp::rpc::Save>&& value) {
inline ::capnp::AnyPointer::Builder Message::Builder::initObsoleteSave() {
_builder.setDataField<Message::Which>(
0 * ::capnp::ELEMENTS, Message::SAVE);
::capnp::_::PointerHelpers< ::capnp::rpc::Save>::adopt(
_builder.getPointerField(0 * ::capnp::POINTERS), kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::rpc::Save> Message::Builder::disownSave() {
KJ_IREQUIRE(which() == Message::SAVE,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::rpc::Save>::disown(
0 * ::capnp::ELEMENTS, Message::OBSOLETE_SAVE);
auto result = ::capnp::AnyPointer::Builder(
_builder.getPointerField(0 * ::capnp::POINTERS));
result.clear();
return result;
}
inline bool Message::Reader::isBootstrap() const {
......@@ -2876,35 +2761,35 @@ inline ::capnp::Orphan< ::capnp::rpc::Bootstrap> Message::Builder::disownBootstr
_builder.getPointerField(0 * ::capnp::POINTERS));
}
inline bool Message::Reader::isDeprecatedDelete() const {
return which() == Message::DEPRECATED_DELETE;
inline bool Message::Reader::isObsoleteDelete() const {
return which() == Message::OBSOLETE_DELETE;
}
inline bool Message::Builder::isDeprecatedDelete() {
return which() == Message::DEPRECATED_DELETE;
inline bool Message::Builder::isObsoleteDelete() {
return which() == Message::OBSOLETE_DELETE;
}
inline bool Message::Reader::hasDeprecatedDelete() const {
if (which() != Message::DEPRECATED_DELETE) return false;
inline bool Message::Reader::hasObsoleteDelete() const {
if (which() != Message::OBSOLETE_DELETE) return false;
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
}
inline bool Message::Builder::hasDeprecatedDelete() {
if (which() != Message::DEPRECATED_DELETE) return false;
inline bool Message::Builder::hasObsoleteDelete() {
if (which() != Message::OBSOLETE_DELETE) return false;
return !_builder.getPointerField(0 * ::capnp::POINTERS).isNull();
}
inline ::capnp::AnyPointer::Reader Message::Reader::getDeprecatedDelete() const {
KJ_IREQUIRE(which() == Message::DEPRECATED_DELETE,
inline ::capnp::AnyPointer::Reader Message::Reader::getObsoleteDelete() const {
KJ_IREQUIRE(which() == Message::OBSOLETE_DELETE,
"Must check which() before get()ing a union member.");
return ::capnp::AnyPointer::Reader(
_reader.getPointerField(0 * ::capnp::POINTERS));
}
inline ::capnp::AnyPointer::Builder Message::Builder::getDeprecatedDelete() {
KJ_IREQUIRE(which() == Message::DEPRECATED_DELETE,
inline ::capnp::AnyPointer::Builder Message::Builder::getObsoleteDelete() {
KJ_IREQUIRE(which() == Message::OBSOLETE_DELETE,
"Must check which() before get()ing a union member.");
return ::capnp::AnyPointer::Builder(
_builder.getPointerField(0 * ::capnp::POINTERS));
}
inline ::capnp::AnyPointer::Builder Message::Builder::initDeprecatedDelete() {
inline ::capnp::AnyPointer::Builder Message::Builder::initObsoleteDelete() {
_builder.setDataField<Message::Which>(
0 * ::capnp::ELEMENTS, Message::DEPRECATED_DELETE);
0 * ::capnp::ELEMENTS, Message::OBSOLETE_DELETE);
auto result = ::capnp::AnyPointer::Builder(
_builder.getPointerField(0 * ::capnp::POINTERS));
result.clear();
......@@ -3991,57 +3876,6 @@ inline void Disembargo::Context::Builder::setProvide( ::uint32_t value) {
0 * ::capnp::ELEMENTS, value);
}
inline ::uint32_t Save::Reader::getQuestionId() const {
return _reader.getDataField< ::uint32_t>(
0 * ::capnp::ELEMENTS);
}
inline ::uint32_t Save::Builder::getQuestionId() {
return _builder.getDataField< ::uint32_t>(
0 * ::capnp::ELEMENTS);
}
inline void Save::Builder::setQuestionId( ::uint32_t value) {
_builder.setDataField< ::uint32_t>(
0 * ::capnp::ELEMENTS, value);
}
inline bool Save::Reader::hasTarget() const {
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
}
inline bool Save::Builder::hasTarget() {
return !_builder.getPointerField(0 * ::capnp::POINTERS).isNull();
}
inline ::capnp::rpc::MessageTarget::Reader Save::Reader::getTarget() const {
return ::capnp::_::PointerHelpers< ::capnp::rpc::MessageTarget>::get(
_reader.getPointerField(0 * ::capnp::POINTERS));
}
inline ::capnp::rpc::MessageTarget::Builder Save::Builder::getTarget() {
return ::capnp::_::PointerHelpers< ::capnp::rpc::MessageTarget>::get(
_builder.getPointerField(0 * ::capnp::POINTERS));
}
#if !CAPNP_LITE
inline ::capnp::rpc::MessageTarget::Pipeline Save::Pipeline::getTarget() {
return ::capnp::rpc::MessageTarget::Pipeline(_typeless.getPointerField(0));
}
#endif // !CAPNP_LITE
inline void Save::Builder::setTarget( ::capnp::rpc::MessageTarget::Reader value) {
::capnp::_::PointerHelpers< ::capnp::rpc::MessageTarget>::set(
_builder.getPointerField(0 * ::capnp::POINTERS), value);
}
inline ::capnp::rpc::MessageTarget::Builder Save::Builder::initTarget() {
return ::capnp::_::PointerHelpers< ::capnp::rpc::MessageTarget>::init(
_builder.getPointerField(0 * ::capnp::POINTERS));
}
inline void Save::Builder::adoptTarget(
::capnp::Orphan< ::capnp::rpc::MessageTarget>&& value) {
::capnp::_::PointerHelpers< ::capnp::rpc::MessageTarget>::adopt(
_builder.getPointerField(0 * ::capnp::POINTERS), kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::rpc::MessageTarget> Save::Builder::disownTarget() {
return ::capnp::_::PointerHelpers< ::capnp::rpc::MessageTarget>::disown(
_builder.getPointerField(0 * ::capnp::POINTERS));
}
inline ::uint32_t Provide::Reader::getQuestionId() const {
return _reader.getDataField< ::uint32_t>(
0 * ::capnp::ELEMENTS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment