-
Notifications
You must be signed in to change notification settings - Fork 24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know, for me the whole ownership in csg is unclear.
|
||
/** | ||
* \brief Return a vector of all the beads neighboring the index | ||
**/ | ||
std::vector<T *> getNeighBeads(Index index); | ||
|
||
TOOLS::Graph getGraph(); | ||
tools::Graph getGraph(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it be const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a copy there is no need to make const, and the copy is needs to be mutable so no, but good question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant Graph getGraph() const
not const Graph getGraph()
sorry for the confusion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, unfortunately, it cannot be at this point. The graph is only generated internally when it is needed. When the getGraph method is called it checks to see if the graph is up to date, if it is it does not generate anything, but if it isn't the graph is generated. I could auto update the graph every time a bead is added but this would be expensive, particularly if the graph is never actually needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh okay
Codecov Report
@@ Coverage Diff @@
## master #474 +/- ##
========================================
+ Coverage 61% 61.2% +0.1%
========================================
Files 128 129 +1
Lines 6299 6320 +21
========================================
+ Hits 3847 3868 +21
Misses 2452 2452
Continue to review full report at Codecov.
|
@JensWehner I hope this is more to your liking, I removed the internal pointers, so the beadstructure no longer runs the risk of accessing invalid pointers. |
@JensWehner hey does this satisfy your review? Can you approve? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it is definitely an improvement
Corrected include guard
Added pragma once
Added const correctness to variables
Added comments to method description
Simplified namespace TOOLS to tools
Switched from using pointer to references
Added const method accessor for getting bead