annotate OrthancServer/Sources/Database/FindResponse.h @ 5671:b4c97c51f9db find-refactoring

added FindResponse::Resource::ChildrenInformation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 06 Jul 2024 13:57:14 +0200
parents aa231c18b9d2
children e300f22a46f0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
5641
3f13db27b399 integration mainline->find-refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
3f13db27b399 integration mainline->find-refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modify it under the terms of the GNU General Public License as
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * License, or (at your option) any later version.
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * General Public License for more details.
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "../../../OrthancFramework/Sources/DicomFormat/DicomMap.h"
5574
5a13483d12c5 find-refactoring: attachments
Alain Mazy <am@orthanc.team>
parents: 5568
diff changeset
27 #include "../../../OrthancFramework/Sources/Enumerations.h"
5a13483d12c5 find-refactoring: attachments
Alain Mazy <am@orthanc.team>
parents: 5568
diff changeset
28 #include "../../../OrthancFramework/Sources/FileStorage/FileInfo.h"
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include "../ServerEnumerations.h"
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include "OrthancIdentifiers.h"
5565
def06a42e5ef Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents: 5554
diff changeset
31 #include "FindRequest.h"
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #include <boost/noncopyable.hpp>
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include <deque>
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include <map>
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 #include <set>
5565
def06a42e5ef Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents: 5554
diff changeset
37 #include <list>
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 namespace Orthanc
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 class FindResponse : public boost::noncopyable
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 {
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
44 private:
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
45 class MainDicomTagsAtLevel : public boost::noncopyable
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
46 {
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
47 private:
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
48 class DicomValue;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
49
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
50 typedef std::map<DicomTag, DicomValue*> MainDicomTags;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
51
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
52 MainDicomTags mainDicomTags_;
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
53
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
54 public:
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
55 ~MainDicomTagsAtLevel();
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
56
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
57 void AddStringDicomTag(uint16_t group,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
58 uint16_t element,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
59 const std::string& value);
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
60
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
61 // The "Null" value could be used in the future to indicate a
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
62 // value that is not available, typically a new "ExtraMainDicomTag"
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
63 void AddNullDicomTag(uint16_t group,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
64 uint16_t element);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
65
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
66 void Export(DicomMap& target) const;
5565
def06a42e5ef Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents: 5554
diff changeset
67 };
def06a42e5ef Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents: 5554
diff changeset
68
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
69 class ChildrenInformation : public boost::noncopyable
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
70 {
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
71 private:
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
72 std::set<std::string> identifiers_;
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
73
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
74 public:
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
75 void AddIdentifier(const std::string& identifier);
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
76
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
77 const std::set<std::string>& GetIdentifiers() const
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
78 {
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
79 return identifiers_;
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
80 }
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
81 };
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
82
5565
def06a42e5ef Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents: 5554
diff changeset
83
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
84 public:
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
85 class Resource : public boost::noncopyable
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 private:
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
88 typedef std::map<MetadataType, std::list<std::string>*> ChildrenMetadata;
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
89
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
90 ResourceType level_;
5606
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
91 int64_t internalId_; // Internal ID of the resource in the database
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
92 std::string identifier_;
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
93 std::unique_ptr<std::string> parentIdentifier_;
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
94 MainDicomTagsAtLevel mainDicomTagsPatient_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
95 MainDicomTagsAtLevel mainDicomTagsStudy_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
96 MainDicomTagsAtLevel mainDicomTagsSeries_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
97 MainDicomTagsAtLevel mainDicomTagsInstance_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
98 std::map<MetadataType, std::string> metadataPatient_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
99 std::map<MetadataType, std::string> metadataStudy_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
100 std::map<MetadataType, std::string> metadataSeries_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
101 std::map<MetadataType, std::string> metadataInstance_;
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
102 ChildrenInformation childrenStudiesInformation_;
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
103 ChildrenInformation childrenSeriesInformation_;
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
104 ChildrenInformation childrenInstancesInformation_;
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
105 std::set<std::string> labels_;
5574
5a13483d12c5 find-refactoring: attachments
Alain Mazy <am@orthanc.team>
parents: 5568
diff changeset
106 std::map<FileContentType, FileInfo> attachments_;
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
107 ChildrenMetadata childrenMetadata_;
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
109 MainDicomTagsAtLevel& GetMainDicomTagsAtLevel(ResourceType level);
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
110
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
111 const MainDicomTagsAtLevel& GetMainDicomTagsAtLevel(ResourceType level) const
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
112 {
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
113 return const_cast<Resource&>(*this).GetMainDicomTagsAtLevel(level);
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
114 }
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
115
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
116 ChildrenInformation& GetChildrenInformation(ResourceType level);
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
117
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
118 const ChildrenInformation& GetChildrenInformation(ResourceType level) const
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
119 {
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
120 return const_cast<Resource&>(*this).GetChildrenInformation(level);
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
121 }
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
122
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 public:
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
124 Resource(ResourceType level,
5606
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
125 int64_t internalId,
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
126 const std::string& identifier) :
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
127 level_(level),
5606
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
128 internalId_(internalId),
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
129 identifier_(identifier)
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 }
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
133 ~Resource();
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
134
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
135 ResourceType GetLevel() const
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
136 {
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
137 return level_;
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
138 }
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
139
5606
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
140 int64_t GetInternalId() const
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
141 {
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
142 return internalId_;
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
143 }
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
144
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
145 const std::string& GetIdentifier() const
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
146 {
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
147 return identifier_;
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
148 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
150 void SetParentIdentifier(const std::string& id);
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
151
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
152 const std::string& GetParentIdentifier() const;
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
153
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
154 bool HasParentIdentifier() const;
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
155
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
156 void AddStringDicomTag(ResourceType level,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
157 uint16_t group,
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
158 uint16_t element,
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
159 const std::string& value)
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
160 {
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
161 GetMainDicomTagsAtLevel(level).AddStringDicomTag(group, element, value);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
162 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
164 void AddNullDicomTag(ResourceType level,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
165 uint16_t group,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
166 uint16_t element)
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
167 {
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
168 GetMainDicomTagsAtLevel(level).AddNullDicomTag(group, element);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
169 }
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
170
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
171 void GetMainDicomTags(DicomMap& target,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
172 ResourceType level) const
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
173 {
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
174 GetMainDicomTagsAtLevel(level).Export(target);
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
175 }
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
176
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
177 void AddMetadata(ResourceType level,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
178 MetadataType metadata,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
179 const std::string& value);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
180
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
181 std::map<MetadataType, std::string>& GetMetadata(ResourceType level);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
182
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
183 const std::map<MetadataType, std::string>& GetMetadata(ResourceType level) const
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
184 {
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
185 return const_cast<Resource&>(*this).GetMetadata(level);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
186 }
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
187
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
188 bool LookupMetadata(std::string& value,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
189 ResourceType level,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
190 MetadataType metadata) const;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
191
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
192 void AddChildIdentifier(ResourceType level,
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
193 const std::string& childId)
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
194 {
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
195 GetChildrenInformation(level).AddIdentifier(childId);;
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
196 }
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
197
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
198 const std::set<std::string>& GetChildrenIdentifiers(ResourceType level) const
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
199 {
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
200 return GetChildrenInformation(level).GetIdentifiers();
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
201 }
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
202
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
203 void AddLabel(const std::string& label);
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
204
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
205 std::set<std::string>& GetLabels()
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
206 {
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
207 return labels_;
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
208 }
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
209
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
210 const std::set<std::string>& GetLabels() const
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
211 {
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
212 return labels_;
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
213 }
5568
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
214
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
215 void AddAttachment(const FileInfo& attachment);
5574
5a13483d12c5 find-refactoring: attachments
Alain Mazy <am@orthanc.team>
parents: 5568
diff changeset
216
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
217 bool LookupAttachment(FileInfo& target,
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
218 FileContentType type) const;
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
219
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
220 const std::map<FileContentType, FileInfo>& GetAttachments() const
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
221 {
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
222 return attachments_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
223 }
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
224
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
225 void AddChildrenMetadata(MetadataType metadata,
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
226 const std::list<std::string>& values);
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
227
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
228 bool LookupChildrenMetadata(std::list<std::string>& values,
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
229 MetadataType metadata) const;
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
230
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
231 const std::string& GetOneInstanceIdentifier() const;
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
232
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
233 bool HasOneInstanceIdentifier() const
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
234 {
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
235 return !GetChildrenIdentifiers(ResourceType_Instance).empty();
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
236 }
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
237
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
238 void DebugExport(Json::Value& target,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
239 const FindRequest& request) const;
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 };
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 private:
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
243 typedef std::map<std::string, Resource*> Index;
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
244
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
245 std::deque<Resource*> items_;
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
246 Index index_;
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 public:
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 ~FindResponse();
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
251 void Add(Resource* item /* takes ownership */);
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 size_t GetSize() const
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 return items_.size();
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 }
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
258 const Resource& GetResourceByIndex(size_t index) const;
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
259
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
260 Resource& GetResourceByIdentifier(const std::string& id);
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
261
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
262 const Resource& GetResourceByIdentifier(const std::string& id) const
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
263 {
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
264 return const_cast<FindResponse&>(*this).GetResourceByIdentifier(id);
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
265 }
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
266
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
267 bool HasResource(const std::string& id) const
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
268 {
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
269 return (index_.find(id) != index_.end());
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
270 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 };
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 }