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

RangeLikelihood getters lack const qualifier #2398

Closed
SergioRAgostinho opened this issue Aug 26, 2018 · 4 comments
Closed

RangeLikelihood getters lack const qualifier #2398

SergioRAgostinho opened this issue Aug 26, 2018 · 4 comments
Labels
good first issue Skills/areas of expertise needed to tackle the issue module: simulation

Comments

@SergioRAgostinho
Copy link
Member

All the get methods need a const qualifier.
https://github.com/PointCloudLibrary/pcl/blob/master/simulation/include/pcl/simulation/range_likelihood.h

@SergioRAgostinho SergioRAgostinho added good first issue Skills/areas of expertise needed to tackle the issue module: simulation labels Aug 26, 2018
@JamesGiller
Copy link
Contributor

I'm working on this issue.

FYI there are four get methods that shouldn't take a const qualifier:
getColorBuffer, getDepthBuffer, and getScoreBuffer because they set member variables depth_buffer_dirty_, color_buffer_dirty_, score_buffer_dirty_ respectively.
getPointCloud because it calls getColorBuffer.

@SergioRAgostinho
Copy link
Member Author

No problem. Just apply it to the ones you can. Thanks.

@taketwo
Copy link
Member

taketwo commented Sep 2, 2018

If these member fields are for caching only and do not belong to the observable object state, then they can be marked as mutable and be modified in const-qualified methods. But I am not familiar with the code base, so you need to use your own judging of whether this is appropriate or not.

@SergioRAgostinho
Copy link
Member Author

It's as you pointed out. They are used as a caching mechanism and they have no getters, making them not observable from the outside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Skills/areas of expertise needed to tackle the issue module: simulation
Projects
None yet
Development

No branches or pull requests

3 participants