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
6e335427
Commit
6e335427
authored
May 14, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark some methods const. Eventually they should all be const, but that's a TODO...
parent
150ce1b6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
dynamic.c++
c++/src/capnproto/dynamic.c++
+2
-2
dynamic.h
c++/src/capnproto/dynamic.h
+8
-8
No files found.
c++/src/capnproto/dynamic.c++
View file @
6e335427
...
@@ -925,7 +925,7 @@ Data::Builder DynamicStruct::Builder::initFieldAsDataImpl(
...
@@ -925,7 +925,7 @@ Data::Builder DynamicStruct::Builder::initFieldAsDataImpl(
// =======================================================================================
// =======================================================================================
DynamicValue
::
Reader
DynamicList
::
Reader
::
operator
[](
uint
index
)
{
DynamicValue
::
Reader
DynamicList
::
Reader
::
operator
[](
uint
index
)
const
{
PRECOND
(
index
<
size
(),
"List index out-of-bounds."
);
PRECOND
(
index
<
size
(),
"List index out-of-bounds."
);
switch
(
schema
.
whichElementType
())
{
switch
(
schema
.
whichElementType
())
{
...
@@ -980,7 +980,7 @@ DynamicValue::Reader DynamicList::Reader::operator[](uint index) {
...
@@ -980,7 +980,7 @@ DynamicValue::Reader DynamicList::Reader::operator[](uint index) {
return
DynamicValue
::
Reader
();
return
DynamicValue
::
Reader
();
}
}
DynamicValue
::
Builder
DynamicList
::
Builder
::
operator
[](
uint
index
)
{
DynamicValue
::
Builder
DynamicList
::
Builder
::
operator
[](
uint
index
)
const
{
PRECOND
(
index
<
size
(),
"List index out-of-bounds."
);
PRECOND
(
index
<
size
(),
"List index out-of-bounds."
);
switch
(
schema
.
whichElementType
())
{
switch
(
schema
.
whichElementType
())
{
...
...
c++/src/capnproto/dynamic.h
View file @
6e335427
...
@@ -397,14 +397,14 @@ public:
...
@@ -397,14 +397,14 @@ public:
// Try to convert to any List<T>, Data, or Text. Throws an exception if the underlying data
// Try to convert to any List<T>, Data, or Text. Throws an exception if the underlying data
// can't possibly represent the requested type.
// can't possibly represent the requested type.
inline
ListSchema
getSchema
()
{
return
schema
;
}
inline
ListSchema
getSchema
()
const
{
return
schema
;
}
inline
uint
size
()
{
return
reader
.
size
()
/
ELEMENTS
;
}
inline
uint
size
()
const
{
return
reader
.
size
()
/
ELEMENTS
;
}
DynamicValue
::
Reader
operator
[](
uint
index
);
DynamicValue
::
Reader
operator
[](
uint
index
)
const
;
typedef
internal
::
IndexingIterator
<
Reader
,
DynamicValue
::
Reader
>
iterator
;
typedef
internal
::
IndexingIterator
<
Reader
,
DynamicValue
::
Reader
>
iterator
;
inline
iterator
begin
()
{
return
iterator
(
this
,
0
);
}
inline
iterator
begin
()
const
{
return
iterator
(
this
,
0
);
}
inline
iterator
end
()
{
return
iterator
(
this
,
size
());
}
inline
iterator
end
()
const
{
return
iterator
(
this
,
size
());
}
private
:
private
:
ListSchema
schema
;
ListSchema
schema
;
...
@@ -435,10 +435,10 @@ public:
...
@@ -435,10 +435,10 @@ public:
// Try to convert to any List<T>, Data, or Text. Throws an exception if the underlying data
// Try to convert to any List<T>, Data, or Text. Throws an exception if the underlying data
// can't possibly represent the requested type.
// can't possibly represent the requested type.
inline
ListSchema
getSchema
()
{
return
schema
;
}
inline
ListSchema
getSchema
()
const
{
return
schema
;
}
inline
uint
size
()
{
return
builder
.
size
()
/
ELEMENTS
;
}
inline
uint
size
()
const
{
return
builder
.
size
()
/
ELEMENTS
;
}
DynamicValue
::
Builder
operator
[](
uint
index
);
DynamicValue
::
Builder
operator
[](
uint
index
)
const
;
void
set
(
uint
index
,
DynamicValue
::
Reader
value
);
void
set
(
uint
index
,
DynamicValue
::
Reader
value
);
DynamicValue
::
Builder
init
(
uint
index
,
uint
size
);
DynamicValue
::
Builder
init
(
uint
index
,
uint
size
);
...
...
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