Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

Const correctness for numerous data provider methods #3291

Closed
wants to merge 1 commit into from

Conversation

nyalldawson
Copy link
Collaborator

This PR marks numerous QgsDataProvider, QgsVectorDataProvider and QgsRasterLayer methods correctly as const.

It partly addresses qgis/qgis4.0_api#48

Note that many individual data provider members have been marked as mutable as a consequence - I think this is acceptable, as it's semantically correct. These methods should be marked const, and it's valid to make any cached variables which are altered as a result mutable.

@nyalldawson nyalldawson added the API Break! Breaks stable API. Proceed with extreme caution!! label Jul 10, 2016
@nyalldawson
Copy link
Collaborator Author

I should add:

  • this has no consequence on PyQGIS code, and it's only a break for 3rd party data providers
  • the biggest advantage is that core code which calls these methods can be const corrected as a result, avoiding the need for some const casting manipulation
  • non const getters look very wrong to me, so this helps me sleep better at night ;)

@nyalldawson
Copy link
Collaborator Author

Any objections if I merge?

@nyalldawson
Copy link
Collaborator Author

Manually pushed as 1bafa80

@nyalldawson nyalldawson deleted the const_provider branch August 6, 2016 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Break! Breaks stable API. Proceed with extreme caution!!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant