remove non-`const`List:Record::event() etc?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 160
- Forks
- 113
- Avg merge
- 12d 15h
- Merged PRs (30d)
- 1
Description
we currently have const and non-const members for ListRecord`
https://github.com/UCL/STIR/blob/0d11904982fd482ff8927c22d810427737c929c6/src/include/stir/listmode/ListRecord.h#L63-L66
Both need to return references (or pointers) as ListEvent etc are abstract base classes. However, returning a non-const reference is fraught with difficulties, as it forces the derived classes to be able to return a reference to something that is modifiable. It could lead the user to think they can modify the listmode data itself that way as well.
We're not actually using them as far I know. Get rid of them? It would break backwards compatibility, but in a fairly harmless way (we can leave them in derived classes that do support it).
@danieldeidda what do you think?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/include/stir/listmode/ListRecord.h at lines 63-66 and inspect the derived ListRecord implementations for uses of the non-const event accessors. Determine whether the non-const members can be removed without affecting required interfaces, while accounting for the stated backward-compatibility concern. Done means the unused non-const members are removed or the compatibility decision is documented in the affected declarations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100