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

Update the SET, tag and schedule APIs and deprecate old ones #68

Merged
merged 24 commits into from
Apr 25, 2022

Conversation

housengw
Copy link
Contributor

@housengw housengw commented Apr 19, 2022

This PR updates the SET, tag and schedule APIs with new signatures and deprecated out-of-date ones.

Specifically, the following renames are performed:

Format:

  1. old name -> new name means that the API is renamed from old name to new name. old name is still available in the current release, but will be removed in a future release.
  2. old name (deprecated) means that the old name has not been renamed, and will be removed in a future release.
  3. new name (new) means that the API is introduced in the linked PR.
  • SET related APIs:
    • SET -> lf_set
    • SET_ARRAY (deprecated)
    • SET_NEW (deprecated)
    • SET_NEW_ARRAY (deprecated)
    • SET_PRESENT (deprecated)
    • SET_TOKEN -> lf_set_token
    • SET_MODE -> lf_set_mode
    • lf_set_destructor (new)
    • lf_set_copy_constructor (new)
  • schedule related APIs:
    • schedule -> lf_schedule
    • schedule_int -> lf_schedule_int
    • schedule_token -> lf_schedule_token
    • schedule_copy -> lf_schedule_copy
    • schedule_value -> lf_schedule_value
    • check_deadline -> lf_check_deadline
  • tag_t related APIs (WIP):
    • lf_tag() (new)
    • lf_time(lf_time_flag flag) (new)
    • compare_tags -> lf_compare_tags
    • get_elapsed_logical_time -> lf_time(LF_ELAPSED_LOGICAL)
    • get_logical_time -> lf_time(LF_LOGICAL)
    • get_current_tag -> lf_tag
    • get_microstep (deprecated)
    • get_physical_time -> lf_time(LF_PHYSICAL)
    • get_elapsed_physical_time -> lf_time(LF_ELAPSED_PHYSICAL)
    • set_physical_clock_offset -> lf_set_physical_clock_offset
    • get_start_time -> lf_time(LF_START)

These are copied from lf-lang/lingua-franca#1108.
Please refer to that issue for the most up-to-date information

Copy link
Contributor

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nicely done with the _Pragma's for issuing warnings. I didn't know about that trick.

This is a unique opportunity to change the names of all these to something less likely to conflict, like lf_set.

Also, it will be a tedious job, but all the tests and documentation examples will need to be changed.

Let's discuss to settle on the naming.

include/ctarget_end.h Outdated Show resolved Hide resolved
@housengw housengw changed the title Change SET APIs to lowercase and deprecate uppercase variants Update the SET, tag and schedule APIs and deprecate old ones Apr 22, 2022
@housengw housengw merged commit fc7dc8a into token-destructor Apr 25, 2022
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

Successfully merging this pull request may close these issues.

2 participants