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

[All] Plugins: Deprecate entrypoint getModuleComponentList() #4795

Merged

Conversation

fredroy
Copy link
Contributor

@fredroy fredroy commented Jun 27, 2024

99% of the modules/plugins implements getModuleComponentList() with

const char* getModuleComponentList()
{
    /// string containing the names of the classes provided by the plugin
    static std::string classes = core::ObjectFactory::getInstance()->listClassesFromTarget(MODULE_NAME);
    return classes.c_str();
}

And the rest either omitted to implement it, or just forgot to update the list. (e.g MultiThreading)

IMO getModuleComponentList() does not have really a meaning anymore and one should just use ObjectFactory::listClassesFromTarget() directly.
AFAIK, the only piece of code in the SOFA codebase using this entrypoint is Gui.Qt widget, displaying the component list for each loaded plugin.

This PR:

  • removes all the entrypoints from Sofa.Component.* (+MultiThreading)
  • deprecates getModuleComponentList() calls
  • Sofa.Gui.Qt: calls directly listClassesFromTarget(), but still tests if getModuleComponentList() needs to be called
  • warns at runtime if one plugin do implement getModuleComponentList()

By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@fredroy fredroy added pr: status to review To notify reviewers to review this pull-request pr: clean Cleaning the code labels Jun 27, 2024
@alxbilger
Copy link
Contributor

There are unit tests to fix (or remove)

@fredroy
Copy link
Contributor Author

fredroy commented Jun 28, 2024

[ci-build][with-all-tests]

Copy link
Contributor

@bakpaul bakpaul left a comment

Choose a reason for hiding this comment

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

LGTM

@hugtalbot hugtalbot added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Jul 3, 2024
@fredroy fredroy force-pushed the replace_getallcomponentlist branch from 6baf2f1 to 5a7a744 Compare July 3, 2024 23:02
@hugtalbot hugtalbot merged commit 95e66ec into sofa-framework:master Jul 4, 2024
3 checks passed
@hugtalbot hugtalbot deleted the replace_getallcomponentlist branch July 4, 2024 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: clean Cleaning the code pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants