Mercurial > hg > orthanc
annotate OrthancServer/OrthancGetRequestHandler.h @ 3953:620e87e9e816 c-get
c-get: fixing memory with failedUIDs_
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 20 May 2020 09:19:35 +0200 |
parents | 4f78da5613a1 |
children | 67b457283499 |
rev | line source |
---|---|
3818 | 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-2019 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 #pragma once | |
34 | |
35 #include "../Core/DicomNetworking/IGetRequestHandler.h" | |
36 #include "../Core/DicomNetworking/RemoteModalityParameters.h" | |
37 | |
38 #include <dcmtk/dcmnet/dimse.h> | |
39 | |
40 namespace Orthanc | |
41 { | |
42 class ServerContext; | |
43 | |
44 class OrthancGetRequestHandler : public IGetRequestHandler | |
45 { | |
46 private: | |
47 ServerContext& context_; | |
48 std::string localAet_; | |
49 std::vector<std::string> instances_; | |
50 size_t position_; | |
51 RemoteModalityParameters remote_; | |
52 std::string originatorAet_; | |
53 | |
54 unsigned int nRemaining_; | |
55 unsigned int nCompleted_; | |
56 unsigned int warningCount_; | |
57 unsigned int nFailed_; | |
3953
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3818
diff
changeset
|
58 std::string failedUIDs_; |
3818 | 59 |
60 T_DIMSE_Priority priority_; | |
61 DIC_US origMsgId; | |
62 T_ASC_PresentationContextID origPresId; | |
63 | |
64 bool getCancelled_; | |
65 | |
66 bool LookupIdentifiers(std::vector<std::string>& publicIds, | |
67 ResourceType level, | |
68 const DicomMap& input); | |
69 | |
70 OFCondition performGetSubOp(T_ASC_Association *assoc, | |
71 DIC_UI sopClass, | |
72 DIC_UI sopInstance, | |
73 DcmDataset *dataset); | |
74 | |
75 void addFailedUIDInstance(const char *sopInstance); | |
76 | |
77 public: | |
3953
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3818
diff
changeset
|
78 OrthancGetRequestHandler(ServerContext& context); |
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3818
diff
changeset
|
79 |
3818 | 80 bool Handle(const DicomMap& input, |
81 const std::string& originatorIp, | |
82 const std::string& originatorAet, | |
83 const std::string& calledAet); | |
84 | |
3953
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3818
diff
changeset
|
85 virtual Status DoNext(T_ASC_Association *) ORTHANC_OVERRIDE; |
3818 | 86 |
3953
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3818
diff
changeset
|
87 virtual unsigned int GetSubOperationCount() const ORTHANC_OVERRIDE |
3818 | 88 { |
89 return (unsigned int) instances_.size(); | |
90 } | |
91 | |
3953
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3818
diff
changeset
|
92 virtual unsigned int nRemaining() const ORTHANC_OVERRIDE |
3818 | 93 { |
94 return nRemaining_; | |
95 } | |
96 | |
3953
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3818
diff
changeset
|
97 virtual unsigned int nCompleted() const ORTHANC_OVERRIDE |
3818 | 98 { |
99 return nCompleted_; | |
100 } | |
101 | |
3953
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3818
diff
changeset
|
102 virtual unsigned int warningCount() const ORTHANC_OVERRIDE |
3818 | 103 { |
104 return warningCount_; | |
105 } | |
106 | |
3953
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3818
diff
changeset
|
107 virtual unsigned int nFailed() const ORTHANC_OVERRIDE |
3818 | 108 { |
109 return nFailed_; | |
110 } | |
111 | |
3953
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3818
diff
changeset
|
112 virtual const std::string& failedUids() const ORTHANC_OVERRIDE |
3818 | 113 { |
114 return failedUIDs_; | |
3953
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3818
diff
changeset
|
115 } |
3818 | 116 }; |
117 } |