Transition to standard smart pointers, part 4#2929
Merged
SergioRAgostinho merged 3 commits intoPointCloudLibrary:masterfrom Mar 25, 2019
Merged
Transition to standard smart pointers, part 4#2929SergioRAgostinho merged 3 commits intoPointCloudLibrary:masterfrom
SergioRAgostinho merged 3 commits intoPointCloudLibrary:masterfrom
Conversation
Modules: * kepoints * people * stereo * surface * tracking * tutorials
36f7b0e to
dfa703a
Compare
Member
Author
|
This one is ready for review. |
| typename boost::graph_traits<Graph>::adjacency_iterator ai_end; | ||
|
|
||
| boost::shared_ptr < RecognitionModel > current = static_cast<boost::shared_ptr<RecognitionModel> > (graph_id_model_map_[int (v)]); | ||
| auto current = boost::dynamic_pointer_cast<RecognitionModel> (graph_id_model_map_[int (v)]); |
Member
There was a problem hiding this comment.
Is it worth to incur into the dynamic cast runtime penalty here? The subsequent logic is not handling null returns.
Member
Author
There was a problem hiding this comment.
Right, I will replace this with boost::static_pointer_cast.
Member
Author
There was a problem hiding this comment.
I will squash this fix in corresponding commit right away.
| for (boost::tie (ai, ai_end) = boost::adjacent_vertices (v, conflict_graph_); (ai != ai_end) && !a_better_one; ++ai) | ||
| { | ||
| boost::shared_ptr < RecognitionModel > neighbour = static_cast<boost::shared_ptr<RecognitionModel> > (graph_id_model_map_[int (*ai)]); | ||
| auto neighbour = boost::dynamic_pointer_cast<RecognitionModel> (graph_id_model_map_[int (*ai)]); |
| { | ||
| const typename Graph::vertex_descriptor v = boost::add_vertex (recognition_models_[i], conflict_graph_); | ||
| graph_id_model_map_[int (v)] = static_cast<boost::shared_ptr<RecognitionModel> > (recognition_models_[i]); | ||
| graph_id_model_map_[int (v)] = boost::dynamic_pointer_cast<RecognitionModel> (recognition_models_[i]); |
dfa703a to
b5df65f
Compare
For classes: * DecisionTreeTrainerDataProvider * DistanceCoherence * FaceDetectorDataProvider * ISMVoteList * IntegralImage2D * KLDAdaptiveParticleFilterOMPTracker * KLDAdaptiveParticleFilterTracker * OctreePointCloudChangeDetector * ParticleFilterTracker * RecognitionModel
SergioRAgostinho
approved these changes
Mar 25, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partially addresses #2792.