Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate global sc_event::none and sc_process_handle::non_event to internal fields in sc_simcontext #20

Closed
AndrewGoodrich opened this issue Sep 21, 2021 · 0 comments

Comments

@AndrewGoodrich
Copy link
Contributor

AndrewGoodrich commented Sep 21, 2021

This issue was originally one raised as a public pull request. However the proposed solution was accessing internal fields in sc_simcontext rather than using access methods. Basically the issue to specified in pull request 9 is:

Remove global sc_events (sc_event::none and sc_process_handle::non_event) by converting them to functions returning a reference to an sc_event in the current simulation context. This eases reset of the simulation context, as discussed in #8, as these sc_events no longer contain any reference to the initial simulation context.

The solution I propose is to move the sc_event locations to sc_simcontext using an internal method.
const sc_event& non_event();
This leads to the following two static methods:

static const sc_event& sc_event::none() { return sc_get_curr_simcontext()->null_event(); }

static const sc_event& sc_process_handle::non_event() { return sc_get_curr_simcontext()->null_event(); }

The "null event" will be a field within sc_simcontext.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant