Mercurial > hg > orthanc
annotate OrthancServer/DicomProtocol/DicomUserConnection.h @ 657:5425bb6f1ea5
further cppcheck fixes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 04 Nov 2013 11:46:23 +0100 |
parents | 1b2cdc855bd3 |
children | 70161eb45b5c |
rev | line source |
---|---|
0 | 1 /** |
62 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
399 | 3 * Copyright (C) 2012-2013 Medical Physics Department, CHU of Liege, |
0 | 4 * Belgium |
5 * | |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
136 | 10 * |
11 * In addition, as a special exception, the copyright holders of this | |
12 * program give permission to link the code of its release with the | |
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
14 * that use the same license as the "OpenSSL" library), and distribute | |
15 * the linked executables. You must obey the GNU General Public License | |
16 * in all respects for all of the code used other than "OpenSSL". If you | |
17 * modify file(s) with this exception, you may extend this exception to | |
18 * your version of the file(s), but you are not obligated to do so. If | |
19 * you do not wish to do so, delete this exception statement from your | |
20 * version. If you delete this exception statement from all source files | |
21 * in the program, then also delete it here. | |
0 | 22 * |
23 * This program is distributed in the hope that it will be useful, but | |
24 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
26 * General Public License for more details. | |
27 * | |
28 * You should have received a copy of the GNU General Public License | |
29 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
30 **/ | |
31 | |
32 | |
33 #pragma once | |
34 | |
35 #include "DicomFindAnswers.h" | |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
36 #include "../ServerEnumerations.h" |
0 | 37 |
38 #include <stdint.h> | |
39 #include <boost/shared_ptr.hpp> | |
40 #include <boost/noncopyable.hpp> | |
41 | |
62 | 42 namespace Orthanc |
0 | 43 { |
44 class DicomUserConnection : public boost::noncopyable | |
45 { | |
46 private: | |
47 enum FindRootModel | |
48 { | |
49 FindRootModel_Patient, | |
50 FindRootModel_Study, | |
51 FindRootModel_Series, | |
52 FindRootModel_Instance | |
53 }; | |
54 | |
55 struct PImpl; | |
56 boost::shared_ptr<PImpl> pimpl_; | |
57 | |
58 // Connection parameters | |
59 std::string localAet_; | |
60 std::string distantAet_; | |
61 std::string distantHost_; | |
62 uint16_t distantPort_; | |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
63 ModalityManufacturer manufacturer_; |
0 | 64 |
65 void CheckIsOpen() const; | |
66 | |
67 void SetupPresentationContexts(); | |
68 | |
69 void Find(DicomFindAnswers& result, | |
70 FindRootModel model, | |
71 const DicomMap& fields); | |
72 | |
73 void Move(const std::string& targetAet, | |
74 const DicomMap& fields); | |
75 | |
76 public: | |
77 DicomUserConnection(); | |
78 | |
79 ~DicomUserConnection(); | |
80 | |
81 void CopyParameters(const DicomUserConnection& other); | |
82 | |
83 void SetLocalApplicationEntityTitle(const std::string& aet); | |
84 | |
85 const std::string& GetLocalApplicationEntityTitle() const | |
86 { | |
87 return localAet_; | |
88 } | |
89 | |
90 void SetDistantApplicationEntityTitle(const std::string& aet); | |
91 | |
92 const std::string& GetDistantApplicationEntityTitle() const | |
93 { | |
94 return distantAet_; | |
95 } | |
96 | |
97 void SetDistantHost(const std::string& host); | |
98 | |
99 const std::string& GetDistantHost() const | |
100 { | |
101 return distantHost_; | |
102 } | |
103 | |
104 void SetDistantPort(uint16_t port); | |
105 | |
106 uint16_t GetDistantPort() const | |
107 { | |
108 return distantPort_; | |
109 } | |
110 | |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
111 void SetDistantManufacturer(ModalityManufacturer manufacturer); |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
112 |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
113 ModalityManufacturer GetDistantManufacturer() const |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
114 { |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
115 return manufacturer_; |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
116 } |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
117 |
0 | 118 void Open(); |
119 | |
120 void Close(); | |
121 | |
122 bool IsOpen() const; | |
123 | |
124 bool Echo(); | |
125 | |
126 void Store(const char* buffer, size_t size); | |
127 | |
128 void Store(const std::string& buffer); | |
129 | |
130 void StoreFile(const std::string& path); | |
131 | |
132 void FindPatient(DicomFindAnswers& result, | |
133 const DicomMap& fields); | |
134 | |
135 void FindStudy(DicomFindAnswers& result, | |
136 const DicomMap& fields); | |
137 | |
138 void FindSeries(DicomFindAnswers& result, | |
139 const DicomMap& fields); | |
140 | |
141 void FindInstance(DicomFindAnswers& result, | |
142 const DicomMap& fields); | |
143 | |
144 void MoveSeries(const std::string& targetAet, | |
145 const DicomMap& findResult); | |
146 | |
147 void MoveSeries(const std::string& targetAet, | |
148 const std::string& studyUid, | |
149 const std::string& seriesUid); | |
150 | |
151 void MoveInstance(const std::string& targetAet, | |
152 const DicomMap& findResult); | |
153 | |
154 void MoveInstance(const std::string& targetAet, | |
155 const std::string& studyUid, | |
156 const std::string& seriesUid, | |
157 const std::string& instanceUid); | |
158 | |
159 static void SetConnectionTimeout(uint32_t seconds); | |
160 }; | |
161 } |