1616
1717typedef struct Platform Platform ;
1818typedef struct Environment Environment ;
19- extern Environment * _lf_environment ; // NOLINT
19+ extern Environment * _lf_environment ; // NOLINT
2020
2121struct Environment {
22- Reactor * main ; // The top-level reactor of the program.
23- Scheduler * scheduler ; // The scheduler in charge of executing the reactions.
24- Platform * platform ;
22+ Reactor * main ; // The top-level reactor of the program.
23+ Scheduler * scheduler ; // The scheduler in charge of executing the reactions.
24+ Platform * platform ;
2525 bool has_async_events ; // Whether the program has multiple execution contexts and can receive async events and thus
2626 // need critical sections.
2727 bool fast_mode ; // Whether the program is executing in fast mode where we do not wait for physical time to elapse
2828 // before handling events.
29- BuiltinTrigger * startup ; // A pointer to a startup trigger, if the program has one.
30- BuiltinTrigger * shutdown ; // A pointer to a chain of shutdown triggers, if the program has one.
29+ BuiltinTrigger * startup ; // A pointer to a startup trigger, if the program has one.
30+ BuiltinTrigger * shutdown ; // A pointer to a chain of shutdown triggers, if the program has one.
3131 /**
3232 * @private
3333 * @brief Assemble the program by computing levels for each reaction and setting up the scheduler.
3434 */
35- void (* assemble )(Environment * self );
35+ void (* assemble )(Environment * self );
3636
3737 /**
3838 * @private
3939 * @brief Start the program.
4040 */
41- void (* start )(Environment * self );
41+ void (* start )(Environment * self );
4242
4343 /**
4444 * @private
@@ -50,15 +50,15 @@ struct Environment {
5050 * This function must be called from a critical section.
5151 *
5252 */
53- lf_ret_t (* wait_until )(Environment * self , instant_t wakeup_time );
53+ lf_ret_t (* wait_until )(Environment * self , instant_t wakeup_time );
5454
5555 /**
5656 * @brief Sleep for a duration.
5757 * @param self The environment.
5858 * @param wait_time The time duration to wait
5959 *
6060 */
61- lf_ret_t (* wait_for )(Environment * self , interval_t wait_time );
61+ lf_ret_t (* wait_for )(Environment * self , interval_t wait_time );
6262
6363 /**
6464 * @brief Get the elapsed logical time since the start of the program.
@@ -69,7 +69,7 @@ struct Environment {
6969
7070 * @returns The elapsed logical time.
7171 */
72- interval_t (* get_elapsed_logical_time )(Environment * self );
72+ interval_t (* get_elapsed_logical_time )(Environment * self );
7373
7474 /**
7575 * @brief Get the current logical time of the program.AbstractEvent
@@ -79,7 +79,7 @@ struct Environment {
7979 *
8080 * @returns The current logical time.
8181 */
82- instant_t (* get_logical_time )(Environment * self );
82+ instant_t (* get_logical_time )(Environment * self );
8383
8484 /**
8585 * @brief Get the elapsed physical time since the start of the program.
@@ -90,7 +90,7 @@ struct Environment {
9090 *
9191 * @returns The elapsed physical time.
9292 */
93- interval_t (* get_elapsed_physical_time )(Environment * self );
93+ interval_t (* get_elapsed_physical_time )(Environment * self );
9494
9595 /**
9696 * @brief Get the current physical time.
@@ -101,7 +101,7 @@ struct Environment {
101101 *
102102 * @returns The current physical time.
103103 */
104- instant_t (* get_physical_time )(Environment * self );
104+ instant_t (* get_physical_time )(Environment * self );
105105
106106 /**
107107 * @brief Get the current lag.
@@ -111,7 +111,7 @@ struct Environment {
111111 * current logical time. Deadlines are bounds on the release lag of a reaction.
112112 *
113113 */
114- interval_t (* get_lag )(Environment * self );
114+ interval_t (* get_lag )(Environment * self );
115115
116116 /**
117117 * @brief Request the termination of the program.
@@ -122,7 +122,7 @@ struct Environment {
122122 * If the program is not federated, then the shutdown will occur at the next microstep.
123123 * If the program is federated, then the shutdown tag will be negotiated with the other federates.
124124 */
125- void (* request_shutdown )(Environment * self );
125+ void (* request_shutdown )(Environment * self );
126126
127127 /**
128128 * @private
@@ -134,7 +134,7 @@ struct Environment {
134134 * In a federated setting, we might have to wait before doing this. We might
135135 * wait for a STA offset or send out a coordination message to the upstream.
136136 */
137- lf_ret_t (* acquire_tag )(Environment * self , tag_t tag );
137+ lf_ret_t (* acquire_tag )(Environment * self , tag_t tag );
138138
139139 /**
140140 * @private
@@ -144,13 +144,13 @@ struct Environment {
144144 * This function should only be supplied in a federated environment. It should
145145 * poll all the PolledNetworkChannels that the federate has.
146146 */
147- lf_ret_t (* poll_network_channels )(Environment * self );
147+ lf_ret_t (* poll_network_channels )(Environment * self );
148148};
149149
150- void Environment_ctor (Environment * self , Reactor * main , Scheduler * scheduler , bool fast_mode );
151- void Environment_free (Environment * self );
150+ void Environment_ctor (Environment * self , Reactor * main , Scheduler * scheduler , bool fast_mode );
151+ void Environment_free (Environment * self );
152152
153- void Environment_schedule_startups (const Environment * self , tag_t start_tag );
154- void Environment_schedule_timers (Environment * self , const Reactor * reactor , tag_t start_tag );
153+ void Environment_schedule_startups (const Environment * self , tag_t start_tag );
154+ void Environment_schedule_timers (Environment * self , const Reactor * reactor , tag_t start_tag );
155155
156156#endif
0 commit comments