annotate OrthancFramework/Sources/DicomFormat/DicomElement.cpp @ 4792:434843934307 storage-cache

Added a StorageCache in the StorageAccessor
author Alain Mazy <am@osimis.io>
date Thu, 30 Sep 2021 12:14:19 +0200
parents d9473bd5ed43
children 7053502fbf97
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4297
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
4437
d9473bd5ed43 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4297
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
4297
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public License
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Lesser General Public License for more details.
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * License along with this program. If not, see
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * <http://www.gnu.org/licenses/>.
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #include "../PrecompiledHeaders.h"
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "DicomElement.h"
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 namespace Orthanc
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 DicomElement::DicomElement(uint16_t group,
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 uint16_t element,
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 const DicomValue &value) :
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 tag_(group, element),
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 value_(value.Clone())
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 DicomElement::DicomElement(const DicomTag &tag,
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 const DicomValue &value) :
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 tag_(tag),
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 value_(value.Clone())
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 DicomElement::~DicomElement()
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 delete value_;
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 const DicomTag &DicomElement::GetTag() const
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 return tag_;
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 const DicomValue &DicomElement::GetValue() const
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 return *value_;
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 uint16_t DicomElement::GetTagGroup() const
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 return tag_.GetGroup();
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 uint16_t DicomElement::GetTagElement() const
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 return tag_.GetElement();
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 bool DicomElement::operator<(const DicomElement &other) const
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 {
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 return GetTag() < other.GetTag();
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 }
785a2713323e abi continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 }