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( ...@@ -36,6 +36,9 @@ kj::Own<const ClientHook> ObjectPointer::Reader::getPipelinedCap(
for (auto& op: ops) { for (auto& op: ops) {
switch (op.type) { switch (op.type) {
case PipelineOp::Type::NOOP:
break;
case PipelineOp::Type::GET_POINTER_FIELD: case PipelineOp::Type::GET_POINTER_FIELD:
pointer = pointer.getStruct(nullptr).getPointerField(op.pointerIndex * POINTERS); pointer = pointer.getStruct(nullptr).getPointerField(op.pointerIndex * POINTERS);
break; break;
......
...@@ -47,6 +47,8 @@ struct PipelineOp { ...@@ -47,6 +47,8 @@ struct PipelineOp {
// Corresponds to rpc.capnp's PromisedAnswer.Op. // Corresponds to rpc.capnp's PromisedAnswer.Op.
enum Type { enum Type {
NOOP, // for convenience
GET_POINTER_FIELD GET_POINTER_FIELD
// There may be other types in the future... // There may be other types in the future...
......
...@@ -55,6 +55,13 @@ struct PointerHelpers<T, Kind::STRUCT> { ...@@ -55,6 +55,13 @@ struct PointerHelpers<T, Kind::STRUCT> {
static inline Orphan<T> disown(PointerBuilder builder) { static inline Orphan<T> disown(PointerBuilder builder) {
return Orphan<T>(builder.disown()); 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> 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