sofa-framework / sofa

Real-time multi-physics simulation with an emphasis on medical simulation.
https://www.sofa-framework.org
GNU Lesser General Public License v2.1
927 stars 312 forks source link

Clean public API of components: towards more explicit delegation #5020

Open hugtalbot opened 1 month ago

hugtalbot commented 1 month ago

This issue is created further to #4943

This PR proposed to define base class functions as final and override these functions (which are templated) in child classes as a protected function. These changes are breaking but could be done in several steps:

  1. set the function of the abstract class to final
  2. fix the components which were overriding this function #4982
  3. set the functions overriding the templated one as protected (for v25.06 ?)
  4. rename functions with a clear delegate name doFunctionName() + compatibility layer
  5. tests should be fixed to use the public virtual class (access protected functions)
  6. add the check on the component state:
    • first check non-invalidity
    • then, check the validity

This project could have several benefits:

damienmarchal commented 1 month ago

nice