Commit eda17e08 authored by Kenton Varda's avatar Kenton Varda

RPC protocol implementation WIP.

parent edea0aab
......@@ -36,6 +36,9 @@ kj::Own<const ClientHook> ObjectPointer::Reader::getPipelinedCap(
for (auto& op: ops) {
switch (op.type) {
case PipelineOp::Type::NOOP:
break;
case PipelineOp::Type::GET_POINTER_FIELD:
pointer = pointer.getStruct(nullptr).getPointerField(op.pointerIndex * POINTERS);
break;
......
......@@ -47,6 +47,8 @@ struct PipelineOp {
// Corresponds to rpc.capnp's PromisedAnswer.Op.
enum Type {
NOOP, // for convenience
GET_POINTER_FIELD
// There may be other types in the future...
......
......@@ -55,6 +55,13 @@ struct PointerHelpers<T, Kind::STRUCT> {
static inline Orphan<T> disown(PointerBuilder builder) {
return Orphan<T>(builder.disown());
}
static inline _::StructReader getInternalReader(const typename T::Reader& reader) {
// TODO(cleanup): This is used by RpcSystem::Connect, but perhaps it should be used more
// broadly so that we can reduce the number of friends declared by every Reader type.
return reader._reader;
}
};
template <typename T>
......
This diff is collapsed.
This diff is collapsed.
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