Actions
Feature #1115
openMake access to dcmdata values "const"
Start date:
2024-03-14
Due date:
% Done:
0%
Estimated time:
4:00 h
Module:
dcmdata
Operating System:
Compiler:
Description
Currently accessing data in dcmdata using DcmElement::getValue() and related/derived methods are not marked as "const". The reason is that internally the accessed value might still be byte-swapped (local byte ordering) or even must be loaded from file if not already in memory.
From a users point of view, this behavior is counterintuitive since he is only accessing a value without any intent to modify it. Also, all methods that build up on those dcmdata methods inherit this fact and therefore cannot be declared "const" either without ugly solutions like applying a "const_cast()".
Therefore it could make sense to declare dcmdata's access methods "const" and to accomplish that, declare certain member variables as "mutable".
Actions