comparison OrthancFramework/Sources/DicomFormat/DicomMap.cpp @ 4296:3b70a2e6a06c

moving inline methods to source files for ABI compatibility
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 05 Nov 2020 15:52:28 +0100
parents 7b011cfda135
children 785a2713323e
comparison
equal deleted inserted replaced
4295:90f91b78d708 4296:3b70a2e6a06c
245 } 245 }
246 246
247 content_.clear(); 247 content_.clear();
248 } 248 }
249 249
250 void DicomMap::SetNullValue(uint16_t group, uint16_t element)
251 {
252 SetValueInternal(group, element, new DicomValue);
253 }
254
255 void DicomMap::SetNullValue(const DicomTag &tag)
256 {
257 SetValueInternal(tag.GetGroup(), tag.GetElement(), new DicomValue);
258 }
259
260 void DicomMap::SetValue(uint16_t group, uint16_t element, const DicomValue &value)
261 {
262 SetValueInternal(group, element, value.Clone());
263 }
264
265 void DicomMap::SetValue(const DicomTag &tag, const DicomValue &value)
266 {
267 SetValueInternal(tag.GetGroup(), tag.GetElement(), value.Clone());
268 }
269
270 void DicomMap::SetValue(const DicomTag &tag, const std::string &str, bool isBinary)
271 {
272 SetValueInternal(tag.GetGroup(), tag.GetElement(), new DicomValue(str, isBinary));
273 }
274
275 void DicomMap::SetValue(uint16_t group, uint16_t element, const std::string &str, bool isBinary)
276 {
277 SetValueInternal(group, element, new DicomValue(str, isBinary));
278 }
279
280 bool DicomMap::HasTag(uint16_t group, uint16_t element) const
281 {
282 return HasTag(DicomTag(group, element));
283 }
284
285 bool DicomMap::HasTag(const DicomTag &tag) const
286 {
287 return content_.find(tag) != content_.end();
288 }
289
290 const DicomValue &DicomMap::GetValue(uint16_t group, uint16_t element) const
291 {
292 return GetValue(DicomTag(group, element));
293 }
294
250 295
251 static void ExtractTags(DicomMap& result, 296 static void ExtractTags(DicomMap& result,
252 const DicomMap::Content& source, 297 const DicomMap::Content& source,
253 const MainDicomTag* tags, 298 const MainDicomTag* tags,
254 size_t count) 299 size_t count)
285 { 330 {
286 ExtractTags(result, content_, INSTANCE_MAIN_DICOM_TAGS, sizeof(INSTANCE_MAIN_DICOM_TAGS) / sizeof(MainDicomTag)); 331 ExtractTags(result, content_, INSTANCE_MAIN_DICOM_TAGS, sizeof(INSTANCE_MAIN_DICOM_TAGS) / sizeof(MainDicomTag));
287 } 332 }
288 333
289 334
335 Orthanc::DicomMap::~DicomMap()
336 {
337 Clear();
338 }
339
340 size_t DicomMap::GetSize() const
341 {
342 return content_.size();
343 }
344
290 345
291 DicomMap* DicomMap::Clone() const 346 DicomMap* DicomMap::Clone() const
292 { 347 {
293 std::unique_ptr<DicomMap> result(new DicomMap); 348 std::unique_ptr<DicomMap> result(new DicomMap);
294 349
322 } 377 }
323 else 378 else
324 { 379 {
325 throw OrthancException(ErrorCode_InexistentTag); 380 throw OrthancException(ErrorCode_InexistentTag);
326 } 381 }
382 }
383
384 const DicomValue *DicomMap::TestAndGetValue(uint16_t group, uint16_t element) const
385 {
386 return TestAndGetValue(DicomTag(group, element));
327 } 387 }
328 388
329 389
330 const DicomValue* DicomMap::TestAndGetValue(const DicomTag& tag) const 390 const DicomValue* DicomMap::TestAndGetValue(const DicomTag& tag) const
331 { 391 {