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 correct Principal #12836
Const correct Principal #12836
Conversation
propagate_const is an C++17 experimental class used to make pointers and pointer like classes have 'deep const' semantics. This is very useful for reasoning about const thread-safety. This is a partial implementation of the proposed standard. We will replace this class once the actual one is in the C++ standard.
The moduleDescription() method should have always been a const member function. This error was found by the use of propagate_const on the code that holds Workers.
Converted all pointer like member data to only point to const objects. Only allow const access to internal data via const member functions. Removed the need for productProvenanceValid_ and instead just use productPRovenancePtr_. This allowed the code to only need one mutable to handle the caching.
Reduced the number of mutable data members used. Switched to using propagate_const<> to make pointer like data members have deep const behavior. Changes the API of a number of internal classes to be properly const or non-const. These changes are meant to make it easier to reason about the thread-safety of the classes.
A new Pull Request was created by @Dr15Jones (Chris Jones) for CMSSW_8_0_X. It involves the following packages: DataFormats/Common @cmsbuild, @smuzaffar, @Dr15Jones, @davidlange6 can you please review it and eventually sign? Thanks. Following commands in first line of a comment are recognized
|
please test |
+1 |
The tests are being triggered in jenkins. |
This pull request is fully signed and it will be integrated in one of the next CMSSW_8_0_X IBs after it passes the integration tests. This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @Degano, @smuzaffar |
-1 >> Compiling edm plugin /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/HLTriggerOffline/JetMET/src/JetMETDQMPostProcessor.cc >> Compiling edm plugin /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/HLTriggerOffline/JetMET/src/SealModule.cc Entering library rule at MuonAnalysis/MuonAssociators >> Compiling /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/L1Trigger/CSCTrackFinder/src/CSCSectorReceiverLUT.cc In file included from /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/HLTriggerOffline/Egamma/src/EmDQMReco.cc:4:0: /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/HLTriggerOffline/Egamma/interface/EmDQMReco.h:211:10: error: 'scoped_ptr' in namespace 'boost' does not name a template type boost::scoped_ptr histReco; ^ /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/HLTriggerOffline/Egamma/interface/EmDQMReco.h:216:10: error: 'scoped_ptr' in namespace 'boost' does not name a template type boost::scoped_ptr histRecoMonpath; ^ you can see the results of the tests here: |
A boost include was coming indirectly from a different header file.
Pull request #12836 was updated. @smuzaffar, @Dr15Jones, @cmsbuild, @deguio, @vanbesien, @davidlange6 can you please check and sign again. |
please test |
+1 |
The tests are being triggered in jenkins. |
@deguio @vanbesien the DQM signature is only because I had to add a |
Improved the const correctness of the internal classes used by Principal. This should help reason about the thread-safety of those classes.
Added our own version of
propagate_const
which is under consideration forC++17
as is in theexperimental
namespace for gcc and clang. This allows one force pointer like objects to only giveconst
access to their pointed to object when using aconst
pointer.