Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
eae03397
Commit
eae03397
authored
May 06, 2015
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: Replace use of _::StructReader in RPC interfaces with AnyStruct::Reader.
parent
b8431197
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
rpc-prelude.h
c++/src/capnp/rpc-prelude.h
+3
-5
rpc.c++
c++/src/capnp/rpc.c++
+4
-4
rpc.h
c++/src/capnp/rpc.h
+3
-3
No files found.
c++/src/capnp/rpc-prelude.h
View file @
eae03397
...
...
@@ -61,7 +61,7 @@ public:
virtual
kj
::
Promise
<
void
>
shutdown
()
=
0
;
virtual
AnyStruct
::
Reader
baseGetPeerVatId
()
=
0
;
};
virtual
kj
::
Maybe
<
kj
::
Own
<
Connection
>>
baseConnect
(
_
::
Struct
Reader
vatId
)
=
0
;
virtual
kj
::
Maybe
<
kj
::
Own
<
Connection
>>
baseConnect
(
AnyStruct
::
Reader
vatId
)
=
0
;
virtual
kj
::
Promise
<
kj
::
Own
<
Connection
>>
baseAccept
()
=
0
;
};
...
...
@@ -92,10 +92,8 @@ private:
class
Impl
;
kj
::
Own
<
Impl
>
impl
;
Capability
::
Client
baseBootstrap
(
_
::
StructReader
vatId
);
Capability
::
Client
baseRestore
(
_
::
StructReader
vatId
,
AnyPointer
::
Reader
objectId
);
// TODO(someday): Maybe define a public API called `TypelessStruct` so we don't have to rely
// on `_::StructReader` here?
Capability
::
Client
baseBootstrap
(
AnyStruct
::
Reader
vatId
);
Capability
::
Client
baseRestore
(
AnyStruct
::
Reader
vatId
,
AnyPointer
::
Reader
objectId
);
template
<
typename
>
friend
class
capnp
::
RpcSystem
;
...
...
c++/src/capnp/rpc.c++
View file @
eae03397
...
...
@@ -2628,13 +2628,13 @@ public:
});
}
Capability
::
Client
bootstrap
(
_
::
Struct
Reader
vatId
)
{
Capability
::
Client
bootstrap
(
AnyStruct
::
Reader
vatId
)
{
// For now we delegate to restore() since it's equivalent, but eventually we'll remove restore()
// and implement bootstrap() directly.
return
restore
(
vatId
,
AnyPointer
::
Reader
());
}
Capability
::
Client
restore
(
_
::
Struct
Reader
vatId
,
AnyPointer
::
Reader
objectId
)
{
Capability
::
Client
restore
(
AnyStruct
::
Reader
vatId
,
AnyPointer
::
Reader
objectId
)
{
KJ_IF_MAYBE
(
connection
,
network
.
baseConnect
(
vatId
))
{
auto
&
state
=
getConnectionState
(
kj
::
mv
(
*
connection
));
return
Capability
::
Client
(
state
.
restore
(
objectId
));
...
...
@@ -2726,12 +2726,12 @@ RpcSystemBase::RpcSystemBase(VatNetworkBase& network, SturdyRefRestorerBase& res
RpcSystemBase
::
RpcSystemBase
(
RpcSystemBase
&&
other
)
noexcept
=
default
;
RpcSystemBase
::~
RpcSystemBase
()
noexcept
(
false
)
{}
Capability
::
Client
RpcSystemBase
::
baseBootstrap
(
_
::
Struct
Reader
vatId
)
{
Capability
::
Client
RpcSystemBase
::
baseBootstrap
(
AnyStruct
::
Reader
vatId
)
{
return
impl
->
bootstrap
(
vatId
);
}
Capability
::
Client
RpcSystemBase
::
baseRestore
(
_
::
Struct
Reader
hostId
,
AnyPointer
::
Reader
objectId
)
{
AnyStruct
::
Reader
hostId
,
AnyPointer
::
Reader
objectId
)
{
return
impl
->
restore
(
hostId
,
objectId
);
}
...
...
c++/src/capnp/rpc.h
View file @
eae03397
...
...
@@ -353,7 +353,7 @@ public:
private
:
kj
::
Maybe
<
kj
::
Own
<
_
::
VatNetworkBase
::
Connection
>>
baseConnect
(
_
::
Struct
Reader
hostId
)
override
final
;
baseConnect
(
AnyStruct
::
Reader
hostId
)
override
final
;
kj
::
Promise
<
kj
::
Own
<
_
::
VatNetworkBase
::
Connection
>>
baseAccept
()
override
final
;
};
...
...
@@ -372,8 +372,8 @@ template <typename SturdyRef, typename ProvisionId, typename RecipientId,
typename
ThirdPartyCapId
,
typename
JoinResult
>
kj
::
Maybe
<
kj
::
Own
<
_
::
VatNetworkBase
::
Connection
>>
VatNetwork
<
SturdyRef
,
ProvisionId
,
RecipientId
,
ThirdPartyCapId
,
JoinResult
>::
baseConnect
(
_
::
Struct
Reader
ref
)
{
auto
maybe
=
connect
(
typename
SturdyRef
::
Reader
(
ref
));
baseConnect
(
AnyStruct
::
Reader
ref
)
{
auto
maybe
=
connect
(
ref
.
as
<
SturdyRef
>
(
));
return
maybe
.
map
([](
kj
::
Own
<
Connection
>&
conn
)
->
kj
::
Own
<
_
::
VatNetworkBase
::
Connection
>
{
return
kj
::
mv
(
conn
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment