-
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.
- Loading branch information
Showing
6 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Submodule reactor-c
updated
19 files
+1 −0 | core/federated/RTI/CMakeLists.txt | |
+25 −167 | core/federated/RTI/rti_remote.c | |
+2 −3 | core/federated/RTI/rti_remote.h | |
+4 −3 | core/federated/clock-sync.c | |
+66 −235 | core/federated/federate.c | |
+1 −1 | core/federated/network/CMakeLists.txt | |
+0 −178 | core/federated/network/net_util.c | |
+404 −0 | core/federated/network/socket_common.c | |
+32 −0 | core/reactor_common.c | |
+1 −1 | core/threaded/reactor_threaded.c | |
+3 −3 | core/utils/util.c | |
+21 −0 | include/api/reaction_macros.h | |
+3 −0 | include/api/reaction_macros_undef.h | |
+0 −53 | include/core/federated/network/net_common.h | |
+3 −121 | include/core/federated/network/net_util.h | |
+243 −0 | include/core/federated/network/socket_common.h | |
+5 −2 | include/core/lf_types.h | |
+21 −0 | include/core/reactor.h | |
+2 −2 | include/core/utils/util.h |
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,16 @@ | ||
target C | ||
|
||
reactor A(x: int = 0) { | ||
reaction(startup) {= | ||
if (self->x != 1) { | ||
lf_print_error_and_exit("x is %d. Should be 1.", self->x); | ||
} | ||
=} | ||
} | ||
|
||
reactor B(x: int = 1) extends A { | ||
} | ||
|
||
main reactor { | ||
b = new B() | ||
} |
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,58 @@ | ||
target C { | ||
build-type: debug | ||
} | ||
|
||
preamble {= | ||
#include <string.h> | ||
=} | ||
|
||
reactor A(parent_bank_index: size_t = 0) { | ||
reaction(startup) {= | ||
const char* name = lf_reactor_full_name(self); | ||
lf_print("name: %s", name); | ||
char buffer[20]; | ||
snprintf(buffer, 20, "ReactorName.b[%zu].a", self->parent_bank_index); | ||
if (strcmp(buffer, name) != 0) { | ||
lf_print_error_and_exit("full name does not match"); | ||
} | ||
name = lf_reactor_name(self); | ||
if (strcmp("a", name) != 0) { | ||
lf_print_error_and_exit("name does not match"); | ||
} | ||
=} | ||
} | ||
|
||
reactor B(bank_index: size_t = 0) { | ||
a = new A(parent_bank_index=bank_index) | ||
|
||
reaction(startup) {= | ||
const char* name = lf_reactor_full_name(self); | ||
lf_print("name: %s", name); | ||
char buffer[20]; | ||
snprintf(buffer, 20, "ReactorName.b[%zu]", self->bank_index); | ||
if (strcmp(buffer, name) != 0) { | ||
lf_print_error_and_exit("full name does not match"); | ||
} | ||
name = lf_reactor_name(self); | ||
snprintf(buffer, 20, "b[%zu]", self->bank_index); | ||
if (strcmp(buffer, name) != 0) { | ||
lf_print_error_and_exit("name does not match"); | ||
} | ||
=} | ||
} | ||
|
||
main reactor { | ||
b = new[3] B() | ||
|
||
reaction(startup) {= | ||
const char* name = lf_reactor_full_name(self); | ||
lf_print("name: %s", name); | ||
if (strcmp("ReactorName", name) != 0) { | ||
lf_print_error_and_exit("full name does not match"); | ||
} | ||
name = lf_reactor_name(self); | ||
if (strcmp("ReactorName", name) != 0) { | ||
lf_print_error_and_exit("name does not match"); | ||
} | ||
=} | ||
} |