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

[SofaKernel/SofaHelper] Add auto-friendly getWriteAccessors/getReadAcessor... #1254

Merged
merged 1 commit into from
Feb 18, 2020

Conversation

damienmarchal
Copy link
Contributor

@damienmarchal damienmarchal commented Feb 10, 2020

In SOFA not using an accessor is really bad (I mean really really bad), but the syntax is not really
friendly and thus discourage ppl to use it.

The PR adds few easing function smooth the syntax.
So you can now type:
auto points = getReadAccessor(d_points);
in place of:
ReadAccessor<Data points = d_points;

In also make code update more manageable, as the whole code based does not need to be changed if the d_points type change.


This PR:

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

Reviewers will merge only if all these checks are true.

…cessor/getWriteOnlyAccessor

Not using an accessor is really bad but the syntax is not really
friendly. So you can use this one which feature implicit typing and thus
is easier:
auto points = getReadAccessor(d_points)
in place of:
ReadAccessor<Data<Vec3> points = d_points;

I also make code update more manageable.

# Conflicts:
#	SofaKernel/modules/SofaHelper/src/sofa/helper/accessor.h
@damienmarchal damienmarchal added the pr: status to review To notify reviewers to review this pull-request label Feb 10, 2020
@hugtalbot hugtalbot added enhancement About a possible enhancement 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 Feb 12, 2020
@adagolodjo adagolodjo merged commit 0931706 into sofa-framework:master Feb 18, 2020
@guparan guparan added this to the v20.06 milestone Jun 16, 2020
@damienmarchal damienmarchal deleted the sofaAddAutoAccessor branch August 25, 2020 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement About a possible enhancement pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants