Mercurial > hg > orthanc
comparison OrthancServer/DicomProtocol/DicomFindAnswers.h @ 1787:1b1d5470233f worklists
refactoring of DicomFindAnswers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 18 Nov 2015 15:50:32 +0100 |
parents | 164d78911382 |
children | bdcc1dba4a53 |
comparison
equal
deleted
inserted
replaced
1786:164d78911382 | 1787:1b1d5470233f |
---|---|
30 **/ | 30 **/ |
31 | 31 |
32 | 32 |
33 #pragma once | 33 #pragma once |
34 | 34 |
35 #include "../../Core/DicomFormat/DicomMap.h" | 35 #include "../ParsedDicomFile.h" |
36 | |
37 #include <vector> | |
38 #include <json/json.h> | |
39 | 36 |
40 namespace Orthanc | 37 namespace Orthanc |
41 { | 38 { |
42 class DicomFindAnswers : public boost::noncopyable | 39 class DicomFindAnswers : public boost::noncopyable |
43 { | 40 { |
44 private: | 41 private: |
45 std::vector<DicomMap*> items_; | 42 std::vector<ParsedDicomFile*> items_; |
46 | 43 |
47 public: | 44 public: |
48 ~DicomFindAnswers() | 45 ~DicomFindAnswers() |
49 { | 46 { |
50 Clear(); | 47 Clear(); |
52 | 49 |
53 void Clear(); | 50 void Clear(); |
54 | 51 |
55 void Reserve(size_t index); | 52 void Reserve(size_t index); |
56 | 53 |
57 void Add(const DicomMap& map) | 54 void Add(const DicomMap& map); |
58 { | 55 |
59 items_.push_back(map.Clone()); | 56 void Add(ParsedDicomFile& dicom); |
60 } | 57 |
58 void Add(const char* dicom, | |
59 size_t size); | |
61 | 60 |
62 size_t GetSize() const | 61 size_t GetSize() const |
63 { | 62 { |
64 return items_.size(); | 63 return items_.size(); |
65 } | 64 } |
66 | 65 |
67 const DicomMap& GetAnswer(size_t index) const | 66 ParsedDicomFile& GetAnswer(size_t index) const; |
68 { | |
69 return *items_.at(index); | |
70 } | |
71 | 67 |
72 void ToJson(Json::Value& target, | 68 void ToJson(Json::Value& target, |
73 bool simplify) const; | 69 bool simplify) const; |
70 | |
71 void ToJson(Json::Value& target, | |
72 size_t index, | |
73 bool simplify) const; | |
74 }; | 74 }; |
75 } | 75 } |