Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
63419b09
authored
Feb 17, 2016
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples: adapted dataflow example for new semantics
parent
4d0f7a62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
doc/examples/dataflow/dataflow_producer-snippet.h
+8
-4
doc/examples/dataflow/dataflow_source_function-snippet.h
+6
-2
No files found.
doc/examples/dataflow/dataflow_producer-snippet.h
View file @
63419b09
...
@@ -3,10 +3,14 @@ class Producer {
...
@@ -3,10 +3,14 @@ class Producer {
public
:
public
:
explicit
Producer
(
int
seed
)
:
seed_
(
seed
),
count_
(
4
)
{}
explicit
Producer
(
int
seed
)
:
seed_
(
seed
),
count_
(
4
)
{}
bool
Run
(
T
&
x
)
{
bool
Run
(
T
&
x
)
{
// produce a new value x
if
(
count_
>=
0
)
{
x
=
SimpleRand
(
seed_
);
// produce a new value x
count_
--
;
x
=
SimpleRand
(
seed_
);
return
count_
>=
0
;
count_
--
;
return
true
;
}
else
{
return
false
;
}
}
}
private
:
private
:
...
...
doc/examples/dataflow/dataflow_source_function-snippet.h
View file @
63419b09
bool
SourceFunction
(
std
::
string
&
str
)
{
bool
SourceFunction
(
std
::
string
&
str
)
{
std
::
getline
(
file
,
str
);
if
(
!
file
.
eof
())
{
return
!
file
.
eof
();
std
::
getline
(
file
,
str
);
return
true
;
}
else
{
return
false
;
}
}
}
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