annotate OrthancServer/Database/Compatibility/SetOfResources.cpp @ 3470:9aaf40d504a2

merge
author amazy
date Thu, 11 Jul 2019 11:49:15 +0200
parents 2e1808b6146a
children 94f4a18a79cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1753
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
3060
4e43e67f8ecf preparing for 2019
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * In addition, as a special exception, the copyright holders of this
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * program give permission to link the code of its release with the
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * the linked executables. You must obey the GNU General Public License
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * in all respects for all of the code used other than "OpenSSL". If you
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * modify file(s) with this exception, you may extend this exception to
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * your version of the file(s), but you are not obligated to do so. If
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * you do not wish to do so, delete this exception statement from your
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * version. If you delete this exception statement from all source files
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * in the program, then also delete it here.
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 *
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * This program is distributed in the hope that it will be useful, but
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * General Public License for more details.
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 *
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * You should have received a copy of the GNU General Public License
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 **/
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
3052
c7db469bbe8e new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3050
diff changeset
34 #include "../../PrecompiledHeadersServer.h"
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "SetOfResources.h"
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
3052
c7db469bbe8e new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3050
diff changeset
37 #include "../../../Core/OrthancException.h"
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 namespace Orthanc
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 {
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
42 namespace Compatibility
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 {
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
44 void SetOfResources::Intersect(const std::list<int64_t>& resources)
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 {
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
46 if (resources_.get() == NULL)
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 {
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
48 resources_.reset(new Resources);
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
50 for (std::list<int64_t>::const_iterator
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
51 it = resources.begin(); it != resources.end(); ++it)
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 {
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
53 resources_->insert(*it);
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 }
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 }
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
56 else
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
57 {
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
58 std::auto_ptr<Resources> filtered(new Resources);
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
60 for (std::list<int64_t>::const_iterator
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
61 it = resources.begin(); it != resources.end(); ++it)
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
62 {
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
63 if (resources_->find(*it) != resources_->end())
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
64 {
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
65 filtered->insert(*it);
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
66 }
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
67 }
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
68
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
69 resources_ = filtered;
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
70 }
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 }
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
73
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
74 void SetOfResources::GoDown()
1753
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1751
diff changeset
75 {
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
76 if (level_ == ResourceType_Instance)
1753
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1751
diff changeset
77 {
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
78 throw OrthancException(ErrorCode_BadSequenceOfCalls);
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 }
1753
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1751
diff changeset
80
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
81 if (resources_.get() != NULL)
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
82 {
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
83 std::auto_ptr<Resources> children(new Resources);
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
85 for (Resources::const_iterator it = resources_->begin();
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
86 it != resources_->end(); ++it)
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
87 {
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
88 std::list<int64_t> tmp;
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
89 database_.GetChildrenInternalId(tmp, *it);
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
90
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
91 for (std::list<int64_t>::const_iterator
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
92 child = tmp.begin(); child != tmp.end(); ++child)
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
93 {
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
94 children->insert(*child);
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
95 }
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
96 }
1747
ca69082ab200 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
97
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
98 resources_ = children;
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
99 }
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
100
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
101 switch (level_)
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
102 {
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
103 case ResourceType_Patient:
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
104 level_ = ResourceType_Study;
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
105 break;
1747
ca69082ab200 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
106
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
107 case ResourceType_Study:
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
108 level_ = ResourceType_Series;
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
109 break;
1747
ca69082ab200 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
110
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
111 case ResourceType_Series:
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
112 level_ = ResourceType_Instance;
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
113 break;
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
114
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
115 default:
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
116 throw OrthancException(ErrorCode_InternalError);
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
117 }
1747
ca69082ab200 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
118 }
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
121 void SetOfResources::Flatten(std::list<std::string>& result)
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 {
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
123 result.clear();
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
124
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
125 if (resources_.get() == NULL)
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 {
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
127 // All the resources of this level are part of the filter
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
128 database_.GetAllPublicIds(result, level_);
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
129 }
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
130 else
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
131 {
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
132 for (Resources::const_iterator it = resources_->begin();
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
133 it != resources_->end(); ++it)
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
134 {
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
135 result.push_back(database_.GetPublicId(*it));
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
136 }
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 }
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 }
1750
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
139
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
140
3085
c829758b9ca0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3084
diff changeset
141 void SetOfResources::Flatten(ILookupResources& compatibility,
3084
195ba4cbac3f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
142 std::list<int64_t>& result)
1750
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
143 {
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
144 result.clear();
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
145
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
146 if (resources_.get() == NULL)
1750
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
147 {
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
148 // All the resources of this level are part of the filter
3084
195ba4cbac3f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3061
diff changeset
149 compatibility.GetAllInternalIds(result, level_);
3056
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
150 }
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
151 else
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
152 {
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
153 for (Resources::const_iterator it = resources_->begin();
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
154 it != resources_->end(); ++it)
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
155 {
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
156 result.push_back(*it);
6c5d4281da4a removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3052
diff changeset
157 }
1750
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
158 }
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
159 }
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
160 }
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 }