comparison OrthancFramework/Sources/DicomFormat/DicomArray.cpp @ 4692:e68edf92e5cc

C-MOVE SCP: added possible DIMSE status "Sub-operations Complete - One or more Failures"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 11 Jun 2021 10:48:28 +0200
parents d9473bd5ed43
children 7053502fbf97
comparison
equal deleted inserted replaced
4691:a08ef46c95a1 4692:e68edf92e5cc
20 **/ 20 **/
21 21
22 22
23 #include "../PrecompiledHeaders.h" 23 #include "../PrecompiledHeaders.h"
24 #include "DicomArray.h" 24 #include "DicomArray.h"
25
26 #include "../OrthancException.h"
25 27
26 #include <stdio.h> 28 #include <stdio.h>
27 29
28 namespace Orthanc 30 namespace Orthanc
29 { 31 {
54 } 56 }
55 57
56 58
57 const DicomElement &DicomArray::GetElement(size_t i) const 59 const DicomElement &DicomArray::GetElement(size_t i) const
58 { 60 {
59 return *elements_[i]; 61 if (i >= elements_.size())
62 {
63 throw OrthancException(ErrorCode_ParameterOutOfRange);
64 }
65 else
66 {
67 return *elements_[i];
68 }
60 } 69 }
61 70
62 71
63 void DicomArray::Print(FILE* fp) const 72 void DicomArray::Print(FILE* fp) const
64 { 73 {