Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
VABase
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
VABase
Commits
1c6efb27
Commit
1c6efb27
authored
Jun 18, 2019
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a struct iterator example in test
parent
445edd4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
tests/StructTest.cpp
tests/StructTest.cpp
+18
-7
No files found.
tests/StructTest.cpp
View file @
1c6efb27
...
...
@@ -27,13 +27,6 @@ int main()
s
[
"ch1"
]
=
v
;
}
for
(
size_t
i
=
0
;
i
<
10e6
;
i
++
)
{
CVAStruct
s
;
CVAStructValue
v
=
CVAStructValue
(
&
vcSomeData
[
0
],
sizeof
(
char
)
*
vcSomeData
.
size
()
);
s
[
"ch1"
]
=
v
;
}
CVAStruct
s
;
s
[
"a"
]
=
CVAStruct
();
s
[
string
(
"a"
)
][
string
(
"b"
)
]
=
24
;
...
...
@@ -43,6 +36,24 @@ int main()
s
.
GetValue
(
"a/c/d"
,
'/'
);
cout
<<
s
<<
endl
;
// Iteration example
const
CVAStruct
&
t
=
s
[
"a"
];
auto
cit
=
t
.
Begin
();
while
(
cit
!=
t
.
End
()
)
{
std
::
string
sKey
=
cit
->
first
;
const
CVAStructValue
&
oValue
=
cit
->
second
;
cout
<<
sKey
<<
": "
<<
oValue
<<
std
::
endl
;
++
cit
;
}
for
(
size_t
i
=
0
;
i
<
10e2
;
i
++
)
{
CVAStruct
s
;
CVAStructValue
v
=
CVAStructValue
(
&
vcSomeData
[
0
],
sizeof
(
char
)
*
vcSomeData
.
size
()
);
s
[
"ch1"
]
=
v
;
}
CVASampleBuffer
oBuf
(
1024
);
oBuf
.
GetData
()[
0
]
=
-
1.0
f
;
oBuf
.
GetData
()[
1023
]
=
1023.0
f
;
...
...
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