Mercurial > hg > orthanc
comparison Core/DicomNetworking/DicomStoreUserConnection.h @ 3825:4570c57668a8
refactoring DicomUserConnection as Dicom[Control|Store]UserConnection
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 10 Apr 2020 16:04:54 +0200 |
parents | |
children | e82bd07c384e |
comparison
equal
deleted
inserted
replaced
3817:37e20bbf25f5 | 3825:4570c57668a8 |
---|---|
1 /** | |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium | |
6 * | |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU General Public License as | |
9 * published by the Free Software Foundation, either version 3 of the | |
10 * License, or (at your option) any later version. | |
11 * | |
12 * In addition, as a special exception, the copyright holders of this | |
13 * program give permission to link the code of its release with the | |
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
15 * that use the same license as the "OpenSSL" library), and distribute | |
16 * the linked executables. You must obey the GNU General Public License | |
17 * in all respects for all of the code used other than "OpenSSL". If you | |
18 * modify file(s) with this exception, you may extend this exception to | |
19 * your version of the file(s), but you are not obligated to do so. If | |
20 * you do not wish to do so, delete this exception statement from your | |
21 * version. If you delete this exception statement from all source files | |
22 * in the program, then also delete it here. | |
23 * | |
24 * This program is distributed in the hope that it will be useful, but | |
25 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
27 * General Public License for more details. | |
28 * | |
29 * You should have received a copy of the GNU General Public License | |
30 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
31 **/ | |
32 | |
33 | |
34 #pragma once | |
35 | |
36 #include "DicomAssociation.h" | |
37 | |
38 | |
39 namespace Orthanc | |
40 { | |
41 /** | |
42 | |
43 Orthanc < 1.7.0: | |
44 | |
45 Input | Output | |
46 -------------+--------------------------------------------- | |
47 Compressed | Same transfer syntax | |
48 Uncompressed | Same transfer syntax, or other uncompressed | |
49 | |
50 Orthanc >= 1.7.0: | |
51 | |
52 Input | Output | |
53 -------------+--------------------------------------------- | |
54 Compressed | Same transfer syntax, or uncompressed | |
55 Uncompressed | Same transfer syntax, or other uncompressed | |
56 | |
57 **/ | |
58 | |
59 | |
60 class DicomStoreUserConnection : public boost::noncopyable | |
61 { | |
62 private: | |
63 typedef std::map<std::string, std::set<DicomTransferSyntax> > StorageClasses; | |
64 | |
65 DicomAssociationParameters parameters_; | |
66 DicomAssociation association_; | |
67 StorageClasses storageClasses_; | |
68 bool proposeCommonClasses_; | |
69 bool proposeUncompressedSyntaxes_; | |
70 bool proposeRetiredBigEndian_; | |
71 | |
72 | |
73 // Return "false" if there is not enough room remaining in the association | |
74 bool ProposeStorageClass(const std::string& sopClassUid, | |
75 const std::set<DicomTransferSyntax>& syntaxes); | |
76 | |
77 bool LookupPresentationContext(uint8_t& presentationContextId, | |
78 const std::string& sopClassUid, | |
79 DicomTransferSyntax transferSyntax); | |
80 | |
81 public: | |
82 DicomStoreUserConnection(const DicomAssociationParameters& params); | |
83 | |
84 const DicomAssociationParameters& GetParameters() const | |
85 { | |
86 return parameters_; | |
87 } | |
88 | |
89 void SetCommonClassesProposed(bool proposed) | |
90 { | |
91 proposeCommonClasses_ = proposed; | |
92 } | |
93 | |
94 bool IsCommonClassesProposed() const | |
95 { | |
96 return proposeCommonClasses_; | |
97 } | |
98 | |
99 void SetUncompressedSyntaxesProposed(bool proposed) | |
100 { | |
101 proposeUncompressedSyntaxes_ = proposed; | |
102 } | |
103 | |
104 bool IsUncompressedSyntaxesProposed() const | |
105 { | |
106 return proposeUncompressedSyntaxes_; | |
107 } | |
108 | |
109 void SetRetiredBigEndianProposed(bool propose) | |
110 { | |
111 proposeRetiredBigEndian_ = propose; | |
112 } | |
113 | |
114 bool IsRetiredBigEndianProposed() const | |
115 { | |
116 return proposeRetiredBigEndian_; | |
117 } | |
118 | |
119 void PrepareStorageClass(const std::string& sopClassUid, | |
120 DicomTransferSyntax syntax); | |
121 | |
122 bool NegotiatePresentationContext(uint8_t& presentationContextId, | |
123 const std::string& sopClassUid, | |
124 DicomTransferSyntax transferSyntax); | |
125 }; | |
126 } |