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
e80357ef
Commit
e80357ef
authored
Jan 26, 2015
by
Jason Paryani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix stylistic problems with DynamicStruct::as commit
parent
0e7f7116
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
any-test.c++
c++/src/capnp/any-test.c++
+5
-5
any.h
c++/src/capnp/any.h
+2
-2
No files found.
c++/src/capnp/any-test.c++
View file @
e80357ef
...
...
@@ -114,11 +114,11 @@ TEST(Any, AnyStruct) {
checkTestMessage
(
root
.
getAnyPointerField
().
getAs
<
TestAllTypes
>
());
checkTestMessage
(
root
.
asReader
().
getAnyPointerField
().
getAs
<
TestAllTypes
>
());
auto
all
_t
ypes
=
root
.
getAnyPointerField
().
getAs
<
AnyStruct
>
().
as
<
TestAllTypes
>
();
auto
all
_types_r
eader
=
root
.
getAnyPointerField
().
getAs
<
AnyStruct
>
().
asReader
().
as
<
TestAllTypes
>
();
all
_t
ypes
.
setInt32Field
(
100
);
EXPECT_EQ
(
100
,
all
_t
ypes
.
getInt32Field
());
EXPECT_EQ
(
100
,
all
_types_r
eader
.
getInt32Field
());
auto
all
T
ypes
=
root
.
getAnyPointerField
().
getAs
<
AnyStruct
>
().
as
<
TestAllTypes
>
();
auto
all
TypesR
eader
=
root
.
getAnyPointerField
().
getAs
<
AnyStruct
>
().
asReader
().
as
<
TestAllTypes
>
();
all
T
ypes
.
setInt32Field
(
100
);
EXPECT_EQ
(
100
,
all
T
ypes
.
getInt32Field
());
EXPECT_EQ
(
100
,
all
TypesR
eader
.
getInt32Field
());
EXPECT_EQ
(
48
,
root
.
getAnyPointerField
().
getAs
<
AnyStruct
>
().
getDataSection
().
size
());
EXPECT_EQ
(
20
,
root
.
getAnyPointerField
().
getAs
<
AnyStruct
>
().
getPointerSection
().
size
());
...
...
c++/src/capnp/any.h
View file @
e80357ef
...
...
@@ -437,9 +437,9 @@ public:
template
<
typename
T
>
ReaderFor
<
T
>
as
()
const
{
// T must be a struct type.
return
typename
T
::
Reader
(
_reader
);
}
// T must be a struct type.
private
:
_
::
StructReader
_reader
;
...
...
@@ -470,9 +470,9 @@ public:
template
<
typename
T
>
BuilderFor
<
T
>
as
()
{
// T must be a struct type.
return
typename
T
::
Builder
(
_builder
);
}
// T must be a struct type.
private
:
_
::
StructBuilder
_builder
;
friend
class
Orphanage
;
...
...
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