annotate OrthancFramework/Sources/IDynamicObject.h @ 5640:f7adfb22e20e

updated copyright, as Orthanc Team now replaces Osimis
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 May 2024 21:19:57 +0200
parents 48b8dae6dc77
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
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
5640
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5485
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
139
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * 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
10 * 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
11 * 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
12 * the License, or (at your option) any later version.
139
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * 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
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * 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
17 * Lesser General Public License for more details.
139
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
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
19 * 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
20 * 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
21 * <http://www.gnu.org/licenses/>.
139
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
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #pragma once
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
27 #include "OrthancFramework.h"
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
28
139
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include <boost/noncopyable.hpp>
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 namespace Orthanc
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 /**
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 * 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
35 * determined at the runtime, and that can be dynamically allocated.
140
4d863c7b2f44 message queues
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
36 * Being a child of IDynamicObject only implies the existence of a
4d863c7b2f44 message queues
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
37 * virtual destructor.
139
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 **/
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
39 class ORTHANC_PUBLIC IDynamicObject : public boost::noncopyable
139
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 {
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 public:
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 virtual ~IDynamicObject()
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 {
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 }
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 };
2989
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2858
diff changeset
46
2858
39b171502059 added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents: 2447
diff changeset
47
39b171502059 added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents: 2447
diff changeset
48 /**
2989
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2858
diff changeset
49 * This class is a simple implementation of a IDynamicObject that
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2858
diff changeset
50 * 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
51 */
39b171502059 added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents: 2447
diff changeset
52 template <typename T>
2989
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2858
diff changeset
53 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
54 {
39b171502059 added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents: 2447
diff changeset
55 private:
2989
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2858
diff changeset
56 T value_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2858
diff changeset
57
2858
39b171502059 added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents: 2447
diff changeset
58 public:
2989
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2858
diff changeset
59 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
60 value_(value)
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 }
39b171502059 added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents: 2447
diff changeset
63
39b171502059 added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents: 2447
diff changeset
64 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
65 {
2989
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2858
diff changeset
66 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
67 }
4871
55469ccfb384 added SingleValueObject::SetValue()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4870
diff changeset
68
55469ccfb384 added SingleValueObject::SetValue()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4870
diff changeset
69 void SetValue(const T& value)
55469ccfb384 added SingleValueObject::SetValue()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4870
diff changeset
70 {
55469ccfb384 added SingleValueObject::SetValue()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4870
diff changeset
71 value_ = value;
55469ccfb384 added SingleValueObject::SetValue()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4870
diff changeset
72 }
2858
39b171502059 added SingleValueObject: a simple implementation of a IDynamicObject that stores a single typed value
am@osimis.io
parents: 2447
diff changeset
73 };
139
3ad78369fcc4 start threaded messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 }