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
341eac28
Commit
341eac28
authored
Apr 03, 2015
by
joshuawarner32@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust data section method types & names
parent
67009d41
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
any.c++
c++/src/capnp/any.c++
+1
-1
any.h
c++/src/capnp/any.h
+3
-3
layout.c++
c++/src/capnp/layout.c++
+3
-3
layout.h
c++/src/capnp/layout.h
+7
-7
No files found.
c++/src/capnp/any.c++
View file @
341eac28
...
...
@@ -134,7 +134,7 @@ StructEqualityResult equal(AnyList::Reader left, AnyList::Reader right) {
case
ElementSize
:
:
FOUR_BYTES
:
case
ElementSize
:
:
EIGHT_BYTES
:
if
(
left
.
getElementSize
()
==
right
.
getElementSize
())
{
if
(
memcmp
(
left
.
get
Data
().
begin
(),
right
.
getData
().
begin
(),
left
.
getData
().
size
())
==
0
)
{
if
(
memcmp
(
left
.
get
RawBytes
().
begin
(),
right
.
getRawBytes
().
begin
(),
left
.
getRawBytes
().
size
())
==
0
)
{
return
StructEqualityResult
::
EQUAL
;
}
else
{
return
StructEqualityResult
::
NOT_EQUAL
;
...
...
c++/src/capnp/any.h
View file @
341eac28
...
...
@@ -427,7 +427,7 @@ public:
:
_reader
(
_
::
PointerHelpers
<
FromReader
<
T
>>::
getInternalReader
(
kj
::
fwd
<
T
>
(
value
)))
{}
#endif
Data
::
Reader
getDataSection
()
{
kj
::
ArrayPtr
<
const
byte
>
getDataSection
()
{
return
_reader
.
getDataSectionAsBlob
();
}
List
<
AnyPointer
>::
Reader
getPointerSection
()
{
...
...
@@ -457,7 +457,7 @@ public:
:
_builder
(
_
::
PointerHelpers
<
FromBuilder
<
T
>>::
getInternalBuilder
(
kj
::
fwd
<
T
>
(
value
)))
{}
#endif
inline
Data
::
Builder
getDataSection
()
{
inline
kj
::
ArrayPtr
<
byte
>
getDataSection
()
{
return
_builder
.
getDataSectionAsBlob
();
}
List
<
AnyPointer
>::
Builder
getPointerSection
()
{
...
...
@@ -571,7 +571,7 @@ public:
inline
ElementSize
getElementSize
()
{
return
_reader
.
getElementSize
();
}
inline
uint
size
()
{
return
_reader
.
size
()
/
ELEMENTS
;
}
inline
Data
::
Reader
getData
()
{
return
_reader
.
asDataOfAnySize
();
}
inline
kj
::
ArrayPtr
<
const
byte
>
getRawBytes
()
{
return
_reader
.
asRawBytes
();
}
template
<
typename
T
>
ReaderFor
<
T
>
as
()
{
// T must be List<U>.
...
...
c++/src/capnp/layout.c++
View file @
341eac28
...
...
@@ -2605,13 +2605,13 @@ Data::Reader ListReader::asData() {
return
Data
::
Reader
(
reinterpret_cast
<
const
byte
*>
(
ptr
),
elementCount
/
ELEMENTS
);
}
Data
::
Reader
ListReader
::
asDataOfAnySize
()
{
kj
::
ArrayPtr
<
const
byte
>
ListReader
::
asRawBytes
()
{
KJ_REQUIRE
(
structPointerCount
==
0
*
POINTERS
,
"Expected data only, got pointers."
)
{
return
Data
::
Reader
();
return
kj
::
ArrayPtr
<
const
byte
>
();
}
return
Data
::
Reader
(
reinterpret_cast
<
const
byte
*>
(
ptr
),
structDataSize
*
elementCount
/
ELEMENTS
);
return
kj
::
ArrayPtr
<
const
byte
>
(
reinterpret_cast
<
const
byte
*>
(
ptr
),
structDataSize
*
elementCount
/
ELEMENTS
);
}
...
...
c++/src/capnp/layout.h
View file @
341eac28
...
...
@@ -406,7 +406,7 @@ public:
inline
BitCount
getDataSectionSize
()
const
{
return
dataSize
;
}
inline
WirePointerCount
getPointerSectionSize
()
const
{
return
pointerCount
;
}
inline
Data
::
Builder
getDataSectionAsBlob
();
inline
kj
::
ArrayPtr
<
byte
>
getDataSectionAsBlob
();
inline
_
::
ListBuilder
getPointerSectionAsList
();
template
<
typename
T
>
...
...
@@ -487,7 +487,7 @@ public:
inline
BitCount
getDataSectionSize
()
const
{
return
dataSize
;
}
inline
WirePointerCount
getPointerSectionSize
()
const
{
return
pointerCount
;
}
inline
Data
::
Reader
getDataSectionAsBlob
();
inline
kj
::
ArrayPtr
<
const
byte
>
getDataSectionAsBlob
();
inline
_
::
ListReader
getPointerSectionAsList
();
template
<
typename
T
>
...
...
@@ -654,7 +654,7 @@ public:
Data
::
Reader
asData
();
// Reinterpret the list as a blob. Throws an exception if the elements are not byte-sized.
Data
::
Reader
asDataOfAnySize
();
kj
::
ArrayPtr
<
const
byte
>
asRawBytes
();
template
<
typename
T
>
KJ_ALWAYS_INLINE
(
T
getDataElement
(
ElementCount
index
)
const
);
...
...
@@ -821,8 +821,8 @@ inline PointerReader PointerReader::getRootUnchecked(const word* location) {
// -------------------------------------------------------------------
inline
Data
::
Builder
StructBuilder
::
getDataSectionAsBlob
()
{
return
Data
::
Builder
(
reinterpret_cast
<
byte
*>
(
data
),
dataSize
/
BITS_PER_BYTE
/
BYTES
);
inline
kj
::
ArrayPtr
<
byte
>
StructBuilder
::
getDataSectionAsBlob
()
{
return
kj
::
ArrayPtr
<
byte
>
(
reinterpret_cast
<
byte
*>
(
data
),
dataSize
/
BITS_PER_BYTE
/
BYTES
);
}
inline
_
::
ListBuilder
StructBuilder
::
getPointerSectionAsList
()
{
...
...
@@ -905,8 +905,8 @@ inline PointerBuilder StructBuilder::getPointerField(WirePointerCount ptrIndex)
// -------------------------------------------------------------------
inline
Data
::
Reader
StructReader
::
getDataSectionAsBlob
()
{
return
Data
::
Reader
(
reinterpret_cast
<
const
byte
*>
(
data
),
dataSize
/
BITS_PER_BYTE
/
BYTES
);
inline
kj
::
ArrayPtr
<
const
byte
>
StructReader
::
getDataSectionAsBlob
()
{
return
kj
::
ArrayPtr
<
const
byte
>
(
reinterpret_cast
<
const
byte
*>
(
data
),
dataSize
/
BITS_PER_BYTE
/
BYTES
);
}
inline
_
::
ListReader
StructReader
::
getPointerSectionAsList
()
{
...
...
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