Mercurial > hg > orthanc
comparison Core/DicomNetworking/DicomUserConnection.h @ 3799:320a2d224902
merge
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Wed, 01 Apr 2020 10:15:33 +0200 |
parents | 4fc24b69446a |
children | 3801435e34a1 7f083dfae62b |
comparison
equal
deleted
inserted
replaced
3798:c38b82bb6fd3 | 3799:320a2d224902 |
---|---|
52 { | 52 { |
53 private: | 53 private: |
54 struct PImpl; | 54 struct PImpl; |
55 boost::shared_ptr<PImpl> pimpl_; | 55 boost::shared_ptr<PImpl> pimpl_; |
56 | 56 |
57 enum Mode | |
58 { | |
59 Mode_Generic, | |
60 Mode_ReportStorageCommitment, | |
61 Mode_RequestStorageCommitment | |
62 }; | |
63 | |
57 // Connection parameters | 64 // Connection parameters |
58 std::string preferredTransferSyntax_; | 65 std::string preferredTransferSyntax_; |
59 std::string localAet_; | 66 std::string localAet_; |
60 std::string remoteAet_; | 67 std::string remoteAet_; |
61 std::string remoteHost_; | 68 std::string remoteHost_; |
65 std::list<std::string> reservedStorageSOPClasses_; | 72 std::list<std::string> reservedStorageSOPClasses_; |
66 std::set<std::string> defaultStorageSOPClasses_; | 73 std::set<std::string> defaultStorageSOPClasses_; |
67 | 74 |
68 void CheckIsOpen() const; | 75 void CheckIsOpen() const; |
69 | 76 |
70 void SetupPresentationContexts(const std::string& preferredTransferSyntax); | 77 void SetupPresentationContexts(Mode mode, |
78 const std::string& preferredTransferSyntax); | |
71 | 79 |
72 void MoveInternal(const std::string& targetAet, | 80 void MoveInternal(const std::string& targetAet, |
73 ResourceType level, | 81 ResourceType level, |
74 const DicomMap& fields); | 82 const DicomMap& fields); |
75 | 83 |
76 void ResetStorageSOPClasses(); | 84 void ResetStorageSOPClasses(); |
77 | 85 |
78 void CheckStorageSOPClassesInvariant() const; | 86 void CheckStorageSOPClassesInvariant() const; |
79 | 87 |
80 void DefaultSetup(); | 88 void DefaultSetup(); |
89 | |
90 void OpenInternal(Mode mode); | |
81 | 91 |
82 public: | 92 public: |
83 DicomUserConnection(); | 93 DicomUserConnection(); |
84 | 94 |
85 ~DicomUserConnection(); | 95 ~DicomUserConnection(); |
135 return preferredTransferSyntax_; | 145 return preferredTransferSyntax_; |
136 } | 146 } |
137 | 147 |
138 void AddStorageSOPClass(const char* sop); | 148 void AddStorageSOPClass(const char* sop); |
139 | 149 |
140 void Open(); | 150 void Open() |
151 { | |
152 OpenInternal(Mode_Generic); | |
153 } | |
141 | 154 |
142 void Close(); | 155 void Close(); |
143 | 156 |
144 bool IsOpen() const; | 157 bool IsOpen() const; |
145 | 158 |
146 bool Echo(); | 159 bool Echo(); |
147 | 160 |
148 void Store(const char* buffer, | 161 void Store(std::string& sopClassUid /* out */, |
162 std::string& sopInstanceUid /* out */, | |
163 const char* buffer, | |
149 size_t size, | 164 size_t size, |
150 const std::string& moveOriginatorAET, | 165 const std::string& moveOriginatorAET, |
151 uint16_t moveOriginatorID); | 166 uint16_t moveOriginatorID); |
152 | 167 |
153 void Store(const char* buffer, | 168 void Store(std::string& sopClassUid /* out */, |
169 std::string& sopInstanceUid /* out */, | |
170 const char* buffer, | |
154 size_t size) | 171 size_t size) |
155 { | 172 { |
156 Store(buffer, size, "", 0); // Not a C-Move | 173 Store(sopClassUid, sopInstanceUid, buffer, size, "", 0); // Not a C-Move |
157 } | 174 } |
158 | 175 |
159 void Store(const std::string& buffer, | 176 void Store(std::string& sopClassUid /* out */, |
177 std::string& sopInstanceUid /* out */, | |
178 const std::string& buffer, | |
160 const std::string& moveOriginatorAET, | 179 const std::string& moveOriginatorAET, |
161 uint16_t moveOriginatorID); | 180 uint16_t moveOriginatorID); |
162 | 181 |
163 void Store(const std::string& buffer) | 182 void Store(std::string& sopClassUid /* out */, |
164 { | 183 std::string& sopInstanceUid /* out */, |
165 Store(buffer, "", 0); // Not a C-Move | 184 const std::string& buffer) |
166 } | 185 { |
167 | 186 Store(sopClassUid, sopInstanceUid, buffer, "", 0); // Not a C-Move |
168 void StoreFile(const std::string& path, | 187 } |
188 | |
189 void StoreFile(std::string& sopClassUid /* out */, | |
190 std::string& sopInstanceUid /* out */, | |
191 const std::string& path, | |
169 const std::string& moveOriginatorAET, | 192 const std::string& moveOriginatorAET, |
170 uint16_t moveOriginatorID); | 193 uint16_t moveOriginatorID); |
171 | 194 |
172 void StoreFile(const std::string& path) | 195 void StoreFile(std::string& sopClassUid /* out */, |
173 { | 196 std::string& sopInstanceUid /* out */, |
174 StoreFile(path, "", 0); // Not a C-Move | 197 const std::string& path) |
198 { | |
199 StoreFile(sopClassUid, sopInstanceUid, path, "", 0); // Not a C-Move | |
175 } | 200 } |
176 | 201 |
177 void Find(DicomFindAnswers& result, | 202 void Find(DicomFindAnswers& result, |
178 ResourceType level, | 203 ResourceType level, |
179 const DicomMap& fields, | 204 const DicomMap& fields, |
210 | 235 |
211 static void SetDefaultTimeout(uint32_t seconds); | 236 static void SetDefaultTimeout(uint32_t seconds); |
212 | 237 |
213 bool IsSameAssociation(const std::string& localAet, | 238 bool IsSameAssociation(const std::string& localAet, |
214 const RemoteModalityParameters& remote) const; | 239 const RemoteModalityParameters& remote) const; |
240 | |
241 void ReportStorageCommitment( | |
242 const std::string& transactionUid, | |
243 const std::vector<std::string>& sopClassUids, | |
244 const std::vector<std::string>& sopInstanceUids, | |
245 const std::vector<StorageCommitmentFailureReason>& failureReasons); | |
246 | |
247 // transactionUid: To be generated by Toolbox::GenerateDicomPrivateUniqueIdentifier() | |
248 void RequestStorageCommitment( | |
249 const std::string& transactionUid, | |
250 const std::vector<std::string>& sopClassUids, | |
251 const std::vector<std::string>& sopInstanceUids); | |
215 }; | 252 }; |
216 } | 253 } |