Project

General

Profile

Actions

Feature #1115

open

Make access to dcmdata values "const"

Added by Michael Onken over 1 year ago. Updated about 1 year ago.

Status:
New
Priority:
Normal
Assignee:
Category:
Library
Target version:
-
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 #1

Updated by Jörg Riesmeier about 1 year ago

  • Tracker changed from Bug to Feature
Actions

Also available in: Atom PDF