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
bd6f4d58
Commit
bd6f4d58
authored
Jan 29, 2015
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define standard 'persistent' annotation.
parent
3a01c67c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
3 deletions
+48
-3
persistent.capnp
c++/src/capnp/persistent.capnp
+17
-3
persistent.capnp.c++
c++/src/capnp/persistent.capnp.c++
+30
-0
persistent.capnp.h
c++/src/capnp/persistent.capnp.h
+1
-0
No files found.
c++/src/capnp/persistent.capnp
View file @
bd6f4d58
...
...
@@ -48,9 +48,10 @@ interface Persistent@0xc8cb212fcd9f5691(SturdyRef, Owner) {
# 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.
# still should not explicitly inherit Persistent because the `SturdyRef` and `Owner` types will
# vary between realms (they may even be different at the call site than they are on the
# implementation). Instead, mark persistent interfaces with the $persistent annotation (defined
# below).
#
# Sealing
# -------
...
...
@@ -123,3 +124,16 @@ interface RealmGateway(InternalRef, ExternalRef, InternalOwner, ExternalOwner) {
# Given an internal capability, save it and return an external reference. Used when someone
# outside the realm tries to save a capability from inside the realm.
}
annotation persistent(interface, field) :Void;
# Apply this annotation to interfaces for objects that will always be persistent, instead of
# extending the Persistent capability, since the correct type parameters to Persistent depend on
# the realm, which is orthogonal to the interface type and therefore should not be defined
# along-side it.
#
# You may also apply this annotation to a capability-typed field which will always contain a
# persistent capability, but where the capability's interface itself is not already marked
# persistent.
#
# Note that absence of the $persistent annotation doesn't mean a capability of that type isn't
# persistent; it just means not *all* such capabilities are persistent.
c++/src/capnp/persistent.capnp.c++
View file @
bd6f4d58
...
...
@@ -482,5 +482,35 @@ const ::capnp::_::RawSchema s_ecafa18b482da3aa = {
2
,
2
,
i_ecafa18b482da3aa
,
nullptr
,
nullptr
,
{
&
s_ecafa18b482da3aa
,
nullptr
,
bd_ecafa18b482da3aa
,
0
,
sizeof
(
bd_ecafa18b482da3aa
)
/
sizeof
(
bd_ecafa18b482da3aa
[
0
]),
nullptr
}
};
#endif // !CAPNP_LITE
static
const
::
capnp
::
_
::
AlignedData
<
21
>
b_f622595091cafb67
=
{
{
0
,
0
,
0
,
0
,
5
,
0
,
6
,
0
,
103
,
251
,
202
,
145
,
80
,
89
,
34
,
246
,
23
,
0
,
0
,
0
,
5
,
0
,
32
,
1
,
215
,
238
,
63
,
152
,
54
,
8
,
99
,
184
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
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
,
32
,
0
,
0
,
0
,
2
,
0
,
1
,
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
,
112
,
101
,
114
,
115
,
105
,
115
,
116
,
101
,
110
,
116
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
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
,
}
};
::
capnp
::
word
const
*
const
bp_f622595091cafb67
=
b_f622595091cafb67
.
words
;
#if !CAPNP_LITE
const
::
capnp
::
_
::
RawSchema
s_f622595091cafb67
=
{
0xf622595091cafb67
,
b_f622595091cafb67
.
words
,
21
,
nullptr
,
nullptr
,
0
,
0
,
nullptr
,
nullptr
,
nullptr
,
{
&
s_f622595091cafb67
,
nullptr
,
nullptr
,
0
,
0
,
nullptr
}
};
#endif // !CAPNP_LITE
}
// namespace schemas
}
// namespace capnp
c++/src/capnp/persistent.capnp.h
View file @
bd6f4d58
...
...
@@ -23,6 +23,7 @@ CAPNP_DECLARE_SCHEMA(b76848c18c40efbf);
CAPNP_DECLARE_SCHEMA
(
84
ff286cd00a3ed4
);
CAPNP_DECLARE_SCHEMA
(
f0c2cc1d3909574d
);
CAPNP_DECLARE_SCHEMA
(
ecafa18b482da3aa
);
CAPNP_DECLARE_SCHEMA
(
f622595091cafb67
);
}
// namespace schemas
}
// namespace capnp
...
...
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