-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2302 from lf-lang/cpp-set-zero
Disambiguate set(0) for C++ ports
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
Submodule reactor-cpp
updated
3 files
+7 −8 | CONTRIBUTING.md | |
+5 −16 | README.md | |
+6 −2 | include/reactor-cpp/port.hh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
target Cpp | ||
|
||
reactor Source { | ||
output out: unsigned | ||
|
||
reaction(startup) -> out {= | ||
out.set(0); | ||
=} | ||
} | ||
|
||
reactor Sink { | ||
input in: unsigned | ||
|
||
reaction(startup, in) {= | ||
if (!in.is_present() || *in.get() != 0) { | ||
std::cerr << "Expected to receive 0\n"; | ||
exit(1); | ||
} | ||
std::cout << "Success!\n"; | ||
=} | ||
} | ||
|
||
main reactor { | ||
source = new Source() | ||
sink = new Sink() | ||
source.out -> sink.in | ||
} |