|
118 | 118 | #define LF_FEDERATE_CONNECTION_BUNDLE_INSTANCE(ReactorName, OtherName) \ |
119 | 119 | ReactorName##_##OtherName##_Bundle ReactorName##_##OtherName_bundle |
120 | 120 |
|
121 | | -#define LF_FEDERATE_BOOKKEEPING_INSTANCES(NumBundles) \ |
122 | | - LF_REACTOR_BOOKKEEPING_INSTANCES(0, 0, 1); \ |
| 121 | +#define LF_FEDERATE_BOOKKEEPING_INSTANCES(NumBundles, NumOutputs) \ |
| 122 | + LF_REACTOR_BOOKKEEPING_INSTANCES(0, 0, 1 + NumOutputs); \ |
123 | 123 | FederatedConnectionBundle* _bundles[NumBundles]; |
124 | 124 |
|
125 | 125 | #define LF_DEFINE_OUTPUT_STRUCT(ReactorName, PortName, SourceSize, BufferType) \ |
@@ -472,21 +472,19 @@ typedef struct FederatedOutputConnection FederatedOutputConnection; |
472 | 472 | typedef struct { \ |
473 | 473 | FederatedOutputConnection super; \ |
474 | 474 | BufferType payload_buf[1]; \ |
475 | | - bool payload_used_buf[1]; \ |
476 | 475 | } ReactorName##_##OutputName##_conn; |
477 | 476 |
|
478 | 477 | #define LF_DEFINE_FEDERATED_OUTPUT_CONNECTION_STRUCT_ARRAY(ReactorName, OutputName, BufferType, ArrayLength) \ |
479 | 478 | typedef struct { \ |
480 | 479 | FederatedOutputConnection super; \ |
481 | 480 | BufferType payload_buf[1][(ArrayLength)]; \ |
482 | | - bool payload_used_buf[1]; \ |
483 | 481 | } ReactorName##_##OutputName##_conn; |
484 | 482 |
|
485 | 483 | #define LF_DEFINE_FEDERATED_OUTPUT_CONNECTION_CTOR(ReactorName, OutputName, BufferType, DestinationConnId) \ |
486 | 484 | void ReactorName##_##OutputName##_conn_ctor(ReactorName##_##OutputName##_conn* self, Reactor* parent, \ |
487 | 485 | FederatedConnectionBundle* bundle) { \ |
488 | 486 | FederatedOutputConnection_ctor(&self->super, parent, bundle, DestinationConnId, (void*)&self->payload_buf, \ |
489 | | - (bool*)&self->payload_used_buf, sizeof(self->payload_buf[0]), 1); \ |
| 487 | + sizeof(self->payload_buf[0])); \ |
490 | 488 | } |
491 | 489 |
|
492 | 490 | #define LF_FEDERATED_OUTPUT_CONNECTION_INSTANCE(ReactorName, OutputName) ReactorName##_##OutputName##_conn OutputName |
@@ -516,7 +514,11 @@ typedef struct FederatedOutputConnection FederatedOutputConnection; |
516 | 514 |
|
517 | 515 | #define LF_INITIALIZE_FEDERATED_CONNECTION_BUNDLE(ReactorName, OtherName) \ |
518 | 516 | ReactorName##_##OtherName##_Bundle_ctor(&self->ReactorName##_##OtherName##_bundle, &self->super, _bundle_idx); \ |
519 | | - self->_bundles[_bundle_idx++] = &self->ReactorName##_##OtherName##_bundle.super; |
| 517 | + self->_bundles[_bundle_idx] = &self->ReactorName##_##OtherName##_bundle.super; \ |
| 518 | + for (int j = 0; j < self->_bundles[_bundle_idx]->outputs_size; j++) { \ |
| 519 | + self->_children[_child_idx++] = &self->_bundles[_bundle_idx]->outputs[j]->flush_reactor.super; \ |
| 520 | + } \ |
| 521 | + _bundle_idx++; |
520 | 522 |
|
521 | 523 | #define LF_INITIALIZE_FEDERATED_OUTPUT_CONNECTION(ReactorName, OutputName, SerializeFunc) \ |
522 | 524 | ReactorName##_##OutputName##_conn_ctor(&self->OutputName, self->super.parent, &self->super); \ |
|
0 commit comments