Mercurial > hg > orthanc
annotate OrthancFramework/Sources/IDynamicObject.h @ 4528:93a51d228d80
fix segmentation fault during anonymization on big-endian architectures
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 24 Feb 2021 15:07:54 +0100 |
parents | d9473bd5ed43 |
children | 7053502fbf97 |
rev | line source |
---|---|
139
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
4437
d9473bd5ed43
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
139
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public License |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
10 * the License, or (at your option) any later version. |
139
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
15 * Lesser General Public License for more details. |
139
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
18 * License along with this program. If not, see |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
19 * <http://www.gnu.org/licenses/>. |
139
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 **/ |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 #pragma once |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
25 #include "OrthancFramework.h" |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
26 |
139
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 #include <boost/noncopyable.hpp> |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 namespace Orthanc |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 { |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 /** |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 * This class should be the ancestor to any class whose type is |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 * determined at the runtime, and that can be dynamically allocated. |
140 | 34 * Being a child of IDynamicObject only implies the existence of a |
35 * virtual destructor. | |
139
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 **/ |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
37 class ORTHANC_PUBLIC IDynamicObject : public boost::noncopyable |
139
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 { |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 public: |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 virtual ~IDynamicObject() |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 { |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 } |
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 }; |
2989 | 44 |
2858
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
45 |
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
46 /** |
2989 | 47 * This class is a simple implementation of a IDynamicObject that |
48 * stores a single typed value. | |
2858
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
49 */ |
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
50 template <typename T> |
2989 | 51 class SingleValueObject : public IDynamicObject |
2858
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
52 { |
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
53 private: |
2989 | 54 T value_; |
55 | |
2858
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
56 public: |
2989 | 57 explicit SingleValueObject(const T& value) : |
2858
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
58 value_(value) |
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
59 { |
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
60 } |
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
61 |
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
62 const T& GetValue() const |
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
63 { |
2989 | 64 return value_; |
2858
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
65 } |
39b171502059
added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents:
2447
diff
changeset
|
66 }; |
139
3ad78369fcc4
start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 } |