Merge lp:~zorba-coders/zorba/bug-1210677-autoptr into lp:zorba
- bug-1210677-autoptr
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Paul J. Lucas | ||||
Approved revision: | 11605 | ||||
Merged at revision: | 11627 | ||||
Proposed branch: | lp:~zorba-coders/zorba/bug-1210677-autoptr | ||||
Merge into: | lp:zorba | ||||
Diff against target: |
4274 lines (+431/-711) 104 files modified
NOTICE.txt (+0/-32) NOTICE.xml (+0/-30) bin/debugger/command.h (+2/-3) bin/debugger/main.cpp (+4/-3) bin/zorbacmd.cpp (+5/-5) doc/cxx/examples/context.cpp (+5/-5) doc/cxx/examples/execution_plans.cpp (+2/-1) doc/cxx/examples/external_functions.cpp (+6/-5) doc/cxx/examples/module_import_check.cpp (+1/-1) doc/cxx/examples/uri_resolvers.cpp (+2/-1) include/zorba/dynamic_context.h (+0/-1) include/zorba/zorba_string.h (+0/-1) modules/http-client/json/http-client.xq.src/http_client.cpp (+6/-5) modules/http-client/json/http-client.xq.src/http_response_parser.cpp (+2/-1) modules/http-client/json/http-client.xq.src/request_parser.cpp (+2/-1) modules/org/expath/ns/file.xq.src/file.cpp (+0/-1) modules/zorba-query/zorba-query.xq.src/zorba-query.cpp (+8/-6) src/api/auditimpl.cpp (+2/-3) src/api/uri_resolver_wrappers.cpp (+3/-2) src/api/xqueryimpl.cpp (+3/-2) src/capi/cdynamic_context.cpp (+9/-7) src/capi/cexpression.cpp (+3/-3) src/capi/cexternal_function.cpp (+2/-1) src/capi/cimplementation.cpp (+19/-21) src/capi/cimplementation.h (+2/-1) src/capi/csequence.cpp (+2/-1) src/capi/cstatic_context.cpp (+4/-2) src/capi/zorbac.cpp (+2/-1) src/compiler/api/compiler_api.cpp (+2/-3) src/compiler/api/compiler_api.h (+2/-2) src/compiler/api/compiler_api_impl.h (+1/-1) src/compiler/codegen/plan_visitor.cpp (+8/-7) src/compiler/dewey/dewey.cpp (+2/-2) src/compiler/expression/fo_expr.cpp (+3/-1) src/compiler/parser/jsoniq_parser.cpp (+3/-5) src/compiler/parser/parser.y (+3/-3) src/compiler/parser/parser_y_includes.h (+1/-0) src/compiler/parser/xquery_parser.cpp (+3/-6) src/compiler/rewriter/rules/flwor_rules.cpp (+1/-1) src/compiler/translator/translator.cpp (+11/-10) src/context/default_uri_mappers.h (+0/-1) src/context/default_url_resolvers.cpp (+2/-1) src/context/default_url_resolvers.h (+0/-1) src/context/dynamic_loader.cpp (+3/-2) src/context/static_context.cpp (+21/-12) src/context/static_context.h (+6/-7) src/context/uri_resolver.h (+0/-2) src/debugger/debugger_communicator.cpp (+2/-1) src/debugger/debugger_event_listener.cpp (+2/-3) src/debugger/debugger_runtime.cpp (+0/-1) src/functions/library.cpp (+0/-1) src/precompiled/stdafx.h (+0/-1) src/runtime/collections/collections_impl.cpp (+20/-19) src/runtime/context/context_impl.cpp (+5/-6) src/runtime/core/arithmetic_impl.cpp (+24/-22) src/runtime/core/flwor_iterator.cpp (+2/-1) src/runtime/core/gflwor/groupby_iterator.cpp (+3/-1) src/runtime/core/gflwor/tuplestream_iterator.cpp (+3/-1) src/runtime/durations_dates_times/DurationsDatesTimesImpl.cpp (+5/-4) src/runtime/eval/eval.h (+4/-2) src/runtime/fetch/fetch_impl.cpp (+7/-6) src/runtime/fnput/fnput_impl.cpp (+2/-1) src/runtime/full_text/apply.cpp (+2/-1) src/runtime/full_text/ft_module_impl.cpp (+3/-2) src/runtime/full_text/ft_stop_words_set.cpp (+2/-1) src/runtime/full_text/ftcontains_visitor.cpp (+0/-1) src/runtime/hof/fn_hof_functions_impl.cpp (+2/-1) src/runtime/hof/function_item.cpp (+1/-1) src/runtime/hof/function_item.h (+3/-1) src/runtime/hof/function_item_iter.cpp (+2/-2) src/runtime/json/jsoniq_functions_impl.cpp (+2/-1) src/runtime/parsing_and_serializing/parsing_and_serializing_impl.cpp (+6/-4) src/runtime/sequences/SequencesImpl.h (+0/-1) src/runtime/sequences/pregenerated/sequences.h (+2/-1) src/runtime/sequences/sequences_impl.cpp (+5/-5) src/runtime/spec/sequences/sequences.xml (+2/-1) src/runtime/store/documents_impl.cpp (+3/-1) src/runtime/store/maps_impl.cpp (+7/-5) src/runtime/update/update.cpp (+5/-4) src/runtime/util/plan_wrapper_holder.h (+2/-2) src/runtime/xqdoc/xqdoc_impl.cpp (+0/-1) src/store/naive/node_items.cpp (+2/-2) src/store/naive/node_updates.cpp (+2/-1) src/store/naive/pul_primitives.cpp (+2/-1) src/store/naive/simple_item_factory.cpp (+3/-2) src/store/naive/store.cpp (+2/-2) src/system/globalenv.cpp (+1/-1) src/system/globalenv.h (+1/-1) src/system/properties.h (+2/-2) src/types/casting.cpp (+13/-12) src/types/schema/XercesParseUtils.cpp (+39/-38) src/types/schema/schema.cpp (+4/-3) src/util/auto_vector.h (+0/-266) src/util/singleton.h (+2/-1) src/util/zorba_regex_engine.cpp (+6/-5) src/zorbatypes/collation_manager.cpp (+1/-2) src/zorbatypes/datetime/datetimetype.cpp (+31/-31) src/zorbatypes/datetime/duration.cpp (+2/-3) test/api/userdefined_uri_resolution.cpp (+0/-1) test/apitest.cpp (+4/-4) test/driver/testdriver.cpp (+6/-5) test/driver/testdriver_mt.cpp (+6/-5) test/driver/updtestdriver.cpp (+2/-1) test/rbkt/modules/link.xq.src/link.cpp (+4/-3) |
||||
To merge this branch: | bzr merge lp:~zorba-coders/zorba/bug-1210677-autoptr | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul J. Lucas | Approve | ||
Chris Hillery | Approve | ||
Review via email: mp+180455@code.launchpad.net |
Commit message
Replace all instances of auto_ptr<> with unique_ptr<>. Add std::move() where
necessary. Remove #include <memory> where no longer necessary. Removed auto_vector.
Description of the change
https:/
https:/
https:/
https:/
Chris Hillery (ceejatec) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "ZorbaVQ" failed.
Check console output at http://
- 11599. By Chris Hillery
-
Merge from trunk.
Paul J. Lucas (paul-lucas) wrote : | # |
Approving, but you might want to fix the following:
* s/an unique_ptr/a unique_ptr/
* There are places where a unique_ptr variable is explicitly initialized with NULL. This is unnecessary.
- 11600. By Chris Hillery
-
s/an unique_ptr/a unique_ptr/
Don't initial unique_ptrs with NULL.
Chris Hillery (ceejatec) wrote : | # |
Changes made as suggested.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "ZorbaVQ" failed.
Check console output at http://
- 11601. By Chris Hillery
-
Merge from trunk.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "BuildZorbaUbuntu" failed.
Check compiler output at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
https:/
https:/
https:/
https:/
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting criteria failed for the following merge proposals:
https:/
Votes: {'Approve': 1}
https:/
Votes: {'Approve': 1}
https:/
Votes: {'Approve': 1}
https:/
Votes: {'Approve': 1}
https:/
Votes: {'Approve': 1}
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "CommitZorba" failed.
Check console output at http://
- 11602. By Chris Hillery
-
Merge from trunk.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "BuildZorbaUbuntu" failed.
Check compiler output at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
https:/
https:/
https:/
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting criteria failed for the following merge proposals:
https:/
Votes: {'Approve': 1}
https:/
Votes: {'Approve': 1}
https:/
Votes: {'Approve': 1}
https:/
Votes: {'Approve': 1}
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "CommitZorba" failed.
Check console output at http://
Paul J. Lucas (paul-lucas) wrote : | # |
There don't seem to be enough #include <zorba/
- 11603. By Chris Hillery
-
Add explicit #include <zorba/
internal/ unique_ ptr.h> wherever desirable.
Paul J. Lucas (paul-lucas) wrote : | # |
This MP is touching .csv files.
Chris Hillery (ceejatec) wrote : | # |
Well, crap. Didn't see that with all the other changes. Now what...
- 11604. By Chris Hillery
-
Merge from trunk.
- 11605. By Chris Hillery
-
Fixed warning.
Paul J. Lucas (paul-lucas) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
https:/
https:/
https:/
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue succeeded - proposal merged!
Preview Diff
1 | === modified file 'NOTICE.txt' |
2 | --- NOTICE.txt 2013-08-23 11:15:04 +0000 |
3 | +++ NOTICE.txt 2013-09-17 23:08:54 +0000 |
4 | @@ -137,38 +137,6 @@ |
5 | |
6 | ---------------------------------------------------- |
7 | |
8 | -src/util/auto_vector.h (has been modified) |
9 | - |
10 | -Copyright: 2003 Reliable Software |
11 | - |
12 | - |
13 | - Redistribution and use in source and binary forms, with or without |
14 | - modification, are permitted provided that the following conditions are met: |
15 | - |
16 | - o Redistributions of source code must retain the above copyright notice, |
17 | - this list of conditions and the following disclaimer. |
18 | - |
19 | - o Redistributions in binary form must reproduce the above copyright |
20 | - notice, this list of conditions and the following disclaimer in the |
21 | - documentation and/or other materials provided with the distribution. |
22 | - |
23 | - o The name of the author may not be used to endorse or promote products |
24 | - derived from this software without specific prior written permission. |
25 | - |
26 | - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
27 | - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
28 | - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
29 | - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
30 | - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
31 | - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
32 | - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
33 | - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
34 | - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
35 | - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
36 | - POSSIBILITY OF SUCH DAMAGE. |
37 | - |
38 | ----------------------------------------------------- |
39 | - |
40 | cmake_modules/FindBoost.cmake |
41 | |
42 | Copyright: |
43 | |
44 | === modified file 'NOTICE.xml' |
45 | --- NOTICE.xml 2013-08-14 04:28:02 +0000 |
46 | +++ NOTICE.xml 2013-09-17 23:08:54 +0000 |
47 | @@ -121,36 +121,6 @@ |
48 | </foreign-notice> |
49 | </foreign-files> |
50 | <foreign-files> |
51 | - <file is-modified="true">src/util/auto_vector.h</file> |
52 | - <copyright>2003 Reliable Software</copyright> |
53 | - <foreign-notice> |
54 | - Redistribution and use in source and binary forms, with or without |
55 | - modification, are permitted provided that the following conditions are met: |
56 | - |
57 | - o Redistributions of source code must retain the above copyright notice, |
58 | - this list of conditions and the following disclaimer. |
59 | - |
60 | - o Redistributions in binary form must reproduce the above copyright |
61 | - notice, this list of conditions and the following disclaimer in the |
62 | - documentation and/or other materials provided with the distribution. |
63 | - |
64 | - o The name of the author may not be used to endorse or promote products |
65 | - derived from this software without specific prior written permission. |
66 | - |
67 | - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
68 | - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
69 | - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
70 | - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
71 | - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
72 | - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
73 | - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
74 | - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
75 | - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
76 | - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
77 | - POSSIBILITY OF SUCH DAMAGE. |
78 | - </foreign-notice> |
79 | - </foreign-files> |
80 | - <foreign-files> |
81 | <file>cmake_modules/FindBoost.cmake</file> |
82 | <copyright> |
83 | 2006-2008 Andreas Schneider <mail@cynapses.org> |
84 | |
85 | === modified file 'bin/debugger/command.h' |
86 | --- bin/debugger/command.h 2013-02-07 17:24:36 +0000 |
87 | +++ bin/debugger/command.h 2013-09-17 23:08:54 +0000 |
88 | @@ -23,11 +23,10 @@ |
89 | #include <set> |
90 | #include <map> |
91 | #include <sstream> |
92 | -#include <memory> |
93 | #include <typeinfo> |
94 | |
95 | #include <zorba/config.h> |
96 | - |
97 | +#include <zorba/internal/unique_ptr.h> |
98 | #include "command_arg.h" |
99 | #include "tuple.h" |
100 | |
101 | @@ -252,7 +251,7 @@ |
102 | return false; |
103 | } |
104 | const CommandArg<Tuple>& arg = *(pos->second); |
105 | - std::auto_ptr<CommandArgInstance<Tuple> > instance; |
106 | + std::unique_ptr<CommandArgInstance<Tuple> > instance; |
107 | if (arg.isVoid()) { |
108 | instance.reset(arg.parse("1")); |
109 | } else { |
110 | |
111 | === modified file 'bin/debugger/main.cpp' |
112 | --- bin/debugger/main.cpp 2013-02-07 17:24:36 +0000 |
113 | +++ bin/debugger/main.cpp 2013-09-17 23:08:54 +0000 |
114 | @@ -25,6 +25,7 @@ |
115 | #include <vector> |
116 | |
117 | #include <zorba/config.h> |
118 | +#include <zorba/internal/unique_ptr.h> |
119 | |
120 | #include "xqdb_client.h" |
121 | #include "process_listener.h" |
122 | @@ -34,7 +35,7 @@ |
123 | using namespace zorba::debugger; |
124 | |
125 | |
126 | -std::auto_ptr<XqdbClient> theClient; |
127 | +std::unique_ptr<XqdbClient> theClient; |
128 | |
129 | // this will make sure the xqdb process will not quit when Ctrl-C is pressed |
130 | #ifdef WIN32 |
131 | @@ -73,7 +74,7 @@ |
132 | |
133 | |
134 | int |
135 | -startZorba(std::string& aExec, std::vector<std::string>& aArgs, std::auto_ptr<ProcessListener>& aProcessListener) |
136 | +startZorba(std::string& aExec, std::vector<std::string>& aArgs, std::unique_ptr<ProcessListener>& aProcessListener) |
137 | { |
138 | #ifdef WIN32 |
139 | // ************************** |
140 | @@ -343,7 +344,7 @@ |
141 | // start a zorba |
142 | |
143 | // This is a process listener used to watch the Zorba process termination. |
144 | - std::auto_ptr<ProcessListener> lProcessListener; |
145 | + std::unique_ptr<ProcessListener> lProcessListener; |
146 | |
147 | if (!lStandalone) { |
148 | int lResult = startZorba(lZorbaExec, lZorbaArgs, lProcessListener); |
149 | |
150 | === modified file 'bin/zorbacmd.cpp' |
151 | --- bin/zorbacmd.cpp 2013-08-14 02:10:00 +0000 |
152 | +++ bin/zorbacmd.cpp 2013-09-17 23:08:54 +0000 |
153 | @@ -16,7 +16,6 @@ |
154 | |
155 | #include "zorbacmdproperties.h" |
156 | |
157 | -#include <memory> |
158 | #include <iostream> |
159 | #include <fstream> |
160 | #include <sstream> |
161 | @@ -42,6 +41,7 @@ |
162 | #include <zorba/audit_scoped.h> |
163 | #include <zorba/store_manager.h> |
164 | #include <zorba/util/fs_util.h> |
165 | +#include <zorba/internal/unique_ptr.h> |
166 | |
167 | //#define DO_AUDIT |
168 | |
169 | @@ -657,7 +657,7 @@ |
170 | std::ostringstream lOut; |
171 | Zorba_CompilerHints lHints; |
172 | |
173 | - std::auto_ptr<std::fstream> planFile; |
174 | + std::unique_ptr<std::fstream> planFile; |
175 | std::fstream* planFilep = NULL; |
176 | |
177 | if (qfilepath.rfind(".jq") == qfilepath.size() - 3) |
178 | @@ -979,7 +979,7 @@ |
179 | bool compileOnly = (properties.compileOnly() || properties.libModule() ); |
180 | |
181 | // write to file or standard out |
182 | - std::auto_ptr<std::ostream> |
183 | + std::unique_ptr<std::ostream> |
184 | lFileStream( |
185 | #ifdef ZORBA_WITH_FILE_ACCESS |
186 | properties.outputFile().size() > 0 ? |
187 | @@ -1068,7 +1068,7 @@ |
188 | std::string fname = parseFileURI (properties.asFiles (), fURI); |
189 | std::string path( fname ); |
190 | bool asFile = !fname.empty(); |
191 | - std::auto_ptr<std::istream> qfile; |
192 | + std::unique_ptr<std::istream> qfile; |
193 | |
194 | if (asFile) |
195 | { |
196 | @@ -1235,7 +1235,7 @@ |
197 | return 8; |
198 | } |
199 | |
200 | - std::auto_ptr<std::istream> lXQ(new std::ifstream(path.c_str())); |
201 | + std::unique_ptr<std::istream> lXQ(new std::ifstream(path.c_str())); |
202 | std::string lFileName(path); |
203 | |
204 | zorba::XQuery_t lQuery; |
205 | |
206 | === modified file 'doc/cxx/examples/context.cpp' |
207 | --- doc/cxx/examples/context.cpp 2013-08-09 09:20:54 +0000 |
208 | +++ doc/cxx/examples/context.cpp 2013-09-17 23:08:54 +0000 |
209 | @@ -22,7 +22,7 @@ |
210 | #include <zorba/store_manager.h> |
211 | #include <zorba/uri_resolvers.h> |
212 | #include <zorba/xquery_exception.h> |
213 | - |
214 | +#include <zorba/internal/unique_ptr.h> |
215 | |
216 | using namespace zorba; |
217 | |
218 | @@ -120,10 +120,10 @@ |
219 | std::ostringstream outStream1; |
220 | std::ostringstream outStream2; |
221 | |
222 | - std::auto_ptr<std::istream> lDocStream1( |
223 | + std::unique_ptr<std::istream> lDocStream1( |
224 | new std::stringstream("<books><book>Book 1</book><book>Book 2</book></books>")); |
225 | |
226 | - std::auto_ptr<std::istream> lDocStream2( |
227 | + std::unique_ptr<std::istream> lDocStream2( |
228 | new std::stringstream("<books><book>Book 1.1</book><book>Book 2.2</book></books>")); |
229 | |
230 | try |
231 | @@ -183,7 +183,7 @@ |
232 | context_example_5(Zorba* aZorba) |
233 | { |
234 | |
235 | - std::auto_ptr<std::istream> lDocStream( |
236 | + std::unique_ptr<std::istream> lDocStream( |
237 | new std::stringstream("<books><book>Book 1</book><book>Book 2</book></books>")); |
238 | |
239 | XQuery_t lQuery = aZorba->compileQuery("declare variable $var external; .//book"); |
240 | @@ -372,7 +372,7 @@ |
241 | aUrl == "http://zorba.io/mymodule") |
242 | { |
243 | // we have only one module |
244 | - std::auto_ptr<std::stringstream> lQuery(new std::stringstream()); |
245 | + std::unique_ptr<std::stringstream> lQuery(new std::stringstream()); |
246 | (*lQuery) |
247 | << "module namespace mymodule = 'http://zorba.io/mymodule';" << std::endl |
248 | << "import module namespace dml = 'http://www.zorba-xquery.com/modules/store/static/collections/dml';" << std::endl |
249 | |
250 | === modified file 'doc/cxx/examples/execution_plans.cpp' |
251 | --- doc/cxx/examples/execution_plans.cpp 2013-05-28 00:58:27 +0000 |
252 | +++ doc/cxx/examples/execution_plans.cpp 2013-09-17 23:08:54 +0000 |
253 | @@ -25,6 +25,7 @@ |
254 | #include <zorba/serialization_callback.h> |
255 | #include <zorba/store_manager.h> |
256 | #include <zorba/zorba_exception.h> |
257 | +#include <zorba/internal/unique_ptr.h> |
258 | |
259 | using namespace zorba; |
260 | |
261 | @@ -80,7 +81,7 @@ |
262 | } |
263 | iter->close(); |
264 | } |
265 | - // transfer ownership of the IteratorBackedItemSequence to Zorba (using an auto_ptr) |
266 | + // transfer ownership of the IteratorBackedItemSequence to Zorba (using a unique_ptr) |
267 | return ItemSequence_t(new IteratorBackedItemSequence(vec)); |
268 | } |
269 | |
270 | |
271 | === modified file 'doc/cxx/examples/external_functions.cpp' |
272 | --- doc/cxx/examples/external_functions.cpp 2013-08-09 09:04:36 +0000 |
273 | +++ doc/cxx/examples/external_functions.cpp 2013-09-17 23:08:54 +0000 |
274 | @@ -29,6 +29,7 @@ |
275 | #include <zorba/store_manager.h> |
276 | #include <zorba/xquery_exception.h> |
277 | #include <zorba/diagnostic_list.h> |
278 | +#include <zorba/internal/unique_ptr.h> |
279 | |
280 | using namespace zorba; |
281 | |
282 | @@ -141,7 +142,7 @@ |
283 | iter->close(); |
284 | } |
285 | |
286 | - // transfer ownership of the IteratorBackedItemSequence to Zorba (using an auto_ptr) |
287 | + // transfer ownership of the IteratorBackedItemSequence to Zorba (using a unique_ptr) |
288 | return ItemSequence_t(new IteratorBackedItemSequence(vec)); |
289 | } |
290 | |
291 | @@ -253,7 +254,7 @@ |
292 | |
293 | ItemSequence_t evaluate(const Arguments_t& args) const |
294 | { |
295 | - // transfer ownership of the IteratorBackedItemSequence to Zorba (using an auto_ptr) |
296 | + // transfer ownership of the IteratorBackedItemSequence to Zorba (using a unique_ptr) |
297 | return ItemSequence_t(new LazyConcatItemSequence(args)); |
298 | } |
299 | |
300 | @@ -395,7 +396,7 @@ |
301 | |
302 | ItemSequence_t evaluate(const ExternalFunction::Arguments_t& args) const |
303 | { |
304 | - // transfer ownership of the IteratorBackedItemSequence to Zorba (using an auto_ptr) |
305 | + // transfer ownership of the IteratorBackedItemSequence to Zorba (using a unique_ptr) |
306 | return ItemSequence_t(new LazyErrorReportingItemSequence(args)); |
307 | } |
308 | |
309 | @@ -634,7 +635,7 @@ |
310 | aUrl == "http://zorba.io/mymodule") |
311 | { |
312 | // we have only one module |
313 | - std::auto_ptr<std::istream> lQuery |
314 | + std::unique_ptr<std::istream> lQuery |
315 | (new std::istringstream |
316 | ("module namespace lm = 'http://zorba.io/mymodule'; " |
317 | "declare function lm:foo() { 'foo' }; " |
318 | @@ -713,7 +714,7 @@ |
319 | |
320 | ItemSequence_t evaluate(const ExternalFunction::Arguments_t& args) const |
321 | { |
322 | - // transfer ownership of the IteratorBackedItemSequence to Zorba (using an auto_ptr) |
323 | + // transfer ownership of the IteratorBackedItemSequence to Zorba (using a unique_ptr) |
324 | return ItemSequence_t(new VectorItemSequence(theItems)); |
325 | } |
326 | }; |
327 | |
328 | === modified file 'doc/cxx/examples/module_import_check.cpp' |
329 | --- doc/cxx/examples/module_import_check.cpp 2013-02-07 17:24:36 +0000 |
330 | +++ doc/cxx/examples/module_import_check.cpp 2013-09-17 23:08:54 +0000 |
331 | @@ -14,7 +14,6 @@ |
332 | * limitations under the License. |
333 | */ |
334 | |
335 | -#include <memory> |
336 | #include <sstream> |
337 | #include <iostream> |
338 | |
339 | @@ -23,6 +22,7 @@ |
340 | #include <zorba/diagnostic_list.h> |
341 | #include <zorba/uri_resolvers.h> |
342 | #include <zorba/zorba_exception.h> |
343 | +#include <zorba/internal/unique_ptr.h> |
344 | |
345 | using namespace zorba; |
346 | |
347 | |
348 | === modified file 'doc/cxx/examples/uri_resolvers.cpp' |
349 | --- doc/cxx/examples/uri_resolvers.cpp 2013-08-09 09:04:36 +0000 |
350 | +++ doc/cxx/examples/uri_resolvers.cpp 2013-09-17 23:08:54 +0000 |
351 | @@ -23,6 +23,7 @@ |
352 | #include <zorba/serialization_callback.h> |
353 | #include <zorba/uri_resolvers.h> |
354 | #include <zorba/zorba_exception.h> |
355 | +#include <zorba/internal/unique_ptr.h> |
356 | |
357 | using namespace zorba; |
358 | |
359 | @@ -68,7 +69,7 @@ |
360 | aUrl == "http://zorba.io/mymodule") |
361 | { |
362 | // we have only one module |
363 | - std::auto_ptr<std::istream> lModule |
364 | + std::unique_ptr<std::istream> lModule |
365 | (new std::istringstream |
366 | ("module namespace lm = 'http://zorba.io/mymodule'; " |
367 | "declare function lm:foo() { 'foo' };")); |
368 | |
369 | === modified file 'include/zorba/dynamic_context.h' |
370 | --- include/zorba/dynamic_context.h 2013-08-01 07:58:48 +0000 |
371 | +++ include/zorba/dynamic_context.h 2013-09-17 23:08:54 +0000 |
372 | @@ -18,7 +18,6 @@ |
373 | |
374 | #include <time.h> |
375 | #include <istream> |
376 | -#include <memory> |
377 | |
378 | #include <zorba/config.h> |
379 | #include <zorba/api_shared_types.h> |
380 | |
381 | === modified file 'include/zorba/zorba_string.h' |
382 | --- include/zorba/zorba_string.h 2013-08-12 22:13:18 +0000 |
383 | +++ include/zorba/zorba_string.h 2013-09-17 23:08:54 +0000 |
384 | @@ -18,7 +18,6 @@ |
385 | #define ZORBA_STRING_API_H |
386 | |
387 | #include <iterator> |
388 | -#include <memory> |
389 | #include <string> |
390 | |
391 | #include <zorba/config.h> |
392 | |
393 | === modified file 'modules/http-client/json/http-client.xq.src/http_client.cpp' |
394 | --- modules/http-client/json/http-client.xq.src/http_client.cpp 2013-07-09 10:54:49 +0000 |
395 | +++ modules/http-client/json/http-client.xq.src/http_client.cpp 2013-09-17 23:08:54 +0000 |
396 | @@ -21,6 +21,7 @@ |
397 | #include <zorba/function.h> |
398 | #include <zorba/empty_sequence.h> |
399 | #include <zorba/user_exception.h> |
400 | +#include <zorba/internal/unique_ptr.h> |
401 | |
402 | #include "http_request_handler.h" |
403 | #include "request_parser.h" |
404 | @@ -178,8 +179,8 @@ |
405 | |
406 | std::string lData; |
407 | |
408 | - std::auto_ptr<HttpRequestHandler> lHandler; |
409 | - std::auto_ptr<RequestParser> lParser; |
410 | + std::unique_ptr<HttpRequestHandler> lHandler; |
411 | + std::unique_ptr<RequestParser> lParser; |
412 | struct curl_slist* lHeaderList = 0; |
413 | |
414 | ErrorThrower thrower(aFactory, &lHeaderList,aTheModuleURI); |
415 | @@ -202,7 +203,7 @@ |
416 | bool lStatusOnly = |
417 | lHandler.get() == NULL ? false : (lHandler->isStatusOnly() || lHandler->isHeadRequest()); |
418 | // This gives the ownership of lCurl to the HttpResponseParser |
419 | - std::auto_ptr<HttpResponseParser> lRespParser(new HttpResponseParser(lRespHandler, lCURL, thrower, |
420 | + std::unique_ptr<HttpResponseParser> lRespParser(new HttpResponseParser(lRespHandler, lCURL, thrower, |
421 | lOverrideContentType.c_str(), lStatusOnly)); |
422 | int lRetCode = lRespParser->parse(); |
423 | |
424 | @@ -215,9 +216,9 @@ |
425 | |
426 | // If the Parser is "self contained", that means it didn't create any |
427 | // objects with a lifecycle longer than itself; therefore we should free |
428 | - // it (by letting auto_ptr delete it). If the Parser is not self contained, |
429 | + // it (by letting unique_ptr delete it). If the Parser is not self contained, |
430 | // then it will have arranged for some other memory manager to free it |
431 | - // later when appropriate; therefore we should NOT let auto_ptr delete it |
432 | + // later when appropriate; therefore we should NOT let unique_ptr delete it |
433 | // now. |
434 | if ( ! lRespParser->selfContained()) { |
435 | lRespParser.release(); |
436 | |
437 | === modified file 'modules/http-client/json/http-client.xq.src/http_response_parser.cpp' |
438 | --- modules/http-client/json/http-client.xq.src/http_response_parser.cpp 2013-08-26 07:24:04 +0000 |
439 | +++ modules/http-client/json/http-client.xq.src/http_response_parser.cpp 2013-09-17 23:08:54 +0000 |
440 | @@ -32,6 +32,7 @@ |
441 | #include <zorba/xquery_exception.h> |
442 | #include <zorba/xquery_exception.h> |
443 | #include <zorba/xquery_functions.h> |
444 | +#include <zorba/internal/unique_ptr.h> |
445 | |
446 | #include "http_response_parser.h" |
447 | #include "http_request_handler.h" |
448 | @@ -141,7 +142,7 @@ |
449 | ); |
450 | } |
451 | |
452 | - std::auto_ptr<std::istream> lStream; |
453 | + std::unique_ptr<std::istream> lStream; |
454 | try { |
455 | if ( !theCurrentCharset.empty() && |
456 | transcode::is_necessary( theCurrentCharset.c_str() ) ) { |
457 | |
458 | === modified file 'modules/http-client/json/http-client.xq.src/request_parser.cpp' |
459 | --- modules/http-client/json/http-client.xq.src/request_parser.cpp 2013-07-24 07:04:10 +0000 |
460 | +++ modules/http-client/json/http-client.xq.src/request_parser.cpp 2013-09-17 23:08:54 +0000 |
461 | @@ -30,6 +30,7 @@ |
462 | #include <zorba/vector_item_sequence.h> |
463 | #include <zorba/xquery_functions.h> |
464 | #include <zorba/util/transcode_stream.h> |
465 | +#include <zorba/internal/unique_ptr.h> |
466 | |
467 | namespace zorba |
468 | { |
469 | @@ -205,7 +206,7 @@ |
470 | getString(aItem,"src",false,lSrc); |
471 | |
472 | std::vector<Item> lItems; |
473 | - std::auto_ptr<VectorItemSequence> lSequence(new VectorItemSequence(lItems)); |
474 | + std::unique_ptr<VectorItemSequence> lSequence(new VectorItemSequence(lItems)); |
475 | theHandler->beginBody(lMediaType, lSrc, lSequence.get()); |
476 | |
477 | Item lContentI; |
478 | |
479 | === modified file 'modules/org/expath/ns/file.xq.src/file.cpp' |
480 | --- modules/org/expath/ns/file.xq.src/file.cpp 2013-08-09 23:05:46 +0000 |
481 | +++ modules/org/expath/ns/file.xq.src/file.cpp 2013-09-17 23:08:54 +0000 |
482 | @@ -18,7 +18,6 @@ |
483 | |
484 | // standard |
485 | #include <fstream> |
486 | -#include <memory> |
487 | #include <sstream> |
488 | #include <stdexcept> |
489 | |
490 | |
491 | === modified file 'modules/zorba-query/zorba-query.xq.src/zorba-query.cpp' |
492 | --- modules/zorba-query/zorba-query.xq.src/zorba-query.cpp 2013-08-13 19:19:44 +0000 |
493 | +++ modules/zorba-query/zorba-query.xq.src/zorba-query.cpp 2013-09-17 23:08:54 +0000 |
494 | @@ -8,6 +8,8 @@ |
495 | #include <zorba/vector_item_sequence.h> |
496 | #include <zorba/serializer.h> |
497 | #include <zorba/xquery.h> |
498 | +#include <zorba/internal/unique_ptr.h> |
499 | + |
500 | #include <time.h> |
501 | #include <stdio.h> |
502 | #include <zorba/util/uuid.h> |
503 | @@ -473,8 +475,8 @@ |
504 | |
505 | StaticContext_t ltempSctx = lZorba->createStaticContext(); |
506 | |
507 | - std::auto_ptr<ZorbaQueryURLResolver> lResolver; |
508 | - std::auto_ptr<ZorbaQueryURIMapper> lMapper; |
509 | + std::unique_ptr<ZorbaQueryURLResolver> lResolver; |
510 | + std::unique_ptr<ZorbaQueryURIMapper> lMapper; |
511 | |
512 | if ( aArgs.size() > 2 ) |
513 | { |
514 | @@ -991,7 +993,7 @@ |
515 | |
516 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
517 | |
518 | - std::auto_ptr<std::stringstream> lExcPlan; |
519 | + std::unique_ptr<std::stringstream> lExcPlan; |
520 | lExcPlan.reset(new std::stringstream()); |
521 | if (!lQuery->saveExecutionPlan(*lExcPlan.get())) |
522 | { |
523 | @@ -1025,9 +1027,9 @@ |
524 | |
525 | Zorba* lZorba = Zorba::getInstance(0); |
526 | XQuery_t lQuery; |
527 | - |
528 | - std::auto_ptr<ZorbaQueryURLResolver> lResolver; |
529 | - std::auto_ptr<ZorbaQueryURIMapper> lMapper; |
530 | + |
531 | + std::unique_ptr<ZorbaQueryURLResolver> lResolver; |
532 | + std::unique_ptr<ZorbaQueryURIMapper> lMapper; |
533 | try |
534 | { |
535 | lQuery = lZorba->createQuery(); |
536 | |
537 | === modified file 'src/api/auditimpl.cpp' |
538 | --- src/api/auditimpl.cpp 2013-04-03 22:52:25 +0000 |
539 | +++ src/api/auditimpl.cpp 2013-09-17 23:08:54 +0000 |
540 | @@ -16,12 +16,11 @@ |
541 | #include "stdafx.h" |
542 | |
543 | #include "api/auditimpl.h" |
544 | - |
545 | +#include <zorba/internal/unique_ptr.h> |
546 | #include <iostream> |
547 | #include <stdexcept> |
548 | #include <cassert> |
549 | #include <cstring> |
550 | -#include <memory> |
551 | |
552 | namespace zorba { |
553 | namespace audit { |
554 | @@ -197,7 +196,7 @@ |
555 | void ConfigurationImpl::enableAudit(const String& aPropertyName) { |
556 | DynPropsMap::const_iterator it = m_dyn_props.find(aPropertyName); |
557 | if (it == m_dyn_props.end()) { |
558 | - std::auto_ptr<PropertyImpl> lImpl(new PropertyImpl(aPropertyName)); |
559 | + std::unique_ptr<PropertyImpl> lImpl(new PropertyImpl(aPropertyName)); |
560 | m_dyn_props[aPropertyName] = lImpl.release(); |
561 | } |
562 | } |
563 | |
564 | === modified file 'src/api/uri_resolver_wrappers.cpp' |
565 | --- src/api/uri_resolver_wrappers.cpp 2013-02-07 17:24:36 +0000 |
566 | +++ src/api/uri_resolver_wrappers.cpp 2013-09-17 23:08:54 +0000 |
567 | @@ -16,6 +16,7 @@ |
568 | #include "stdafx.h" |
569 | |
570 | #include <zorba/thesaurus.h> |
571 | +#include <zorba/internal/unique_ptr.h> |
572 | |
573 | #include "runtime/full_text/thesaurus.h" |
574 | |
575 | @@ -82,7 +83,7 @@ |
576 | static_context const& aSctx, |
577 | std::vector<zstring>& oUris) |
578 | { |
579 | - std::auto_ptr<const EntityDataWrapper> lDataWrap |
580 | + std::unique_ptr<const EntityDataWrapper> lDataWrap |
581 | (EntityDataWrapper::create(aEntityData)); |
582 | if (lDataWrap.get() == NULL) { |
583 | return; |
584 | @@ -127,7 +128,7 @@ |
585 | (const zstring& aUrl, |
586 | internal::EntityData const* aEntityData) |
587 | { |
588 | - std::auto_ptr<const EntityDataWrapper> lDataWrap |
589 | + std::unique_ptr<const EntityDataWrapper> lDataWrap |
590 | (EntityDataWrapper::create(aEntityData)); |
591 | if (lDataWrap.get() == NULL) { |
592 | return NULL; |
593 | |
594 | === modified file 'src/api/xqueryimpl.cpp' |
595 | --- src/api/xqueryimpl.cpp 2013-08-01 17:38:35 +0000 |
596 | +++ src/api/xqueryimpl.cpp 2013-09-17 23:08:54 +0000 |
597 | @@ -28,6 +28,7 @@ |
598 | #include <zorba/sax2.h> |
599 | #include <zorba/audit_scoped.h> |
600 | #include <zorba/module_info.h> |
601 | +#include <zorba/internal/unique_ptr.h> |
602 | |
603 | #include <zorbatypes/URI.h> |
604 | |
605 | @@ -758,7 +759,7 @@ |
606 | { |
607 | // this object is only need to construct the StaticCollectionManagerImpl |
608 | // but it's not used after the construction anymore |
609 | - std::auto_ptr<StaticContextImpl> lCtx( |
610 | + std::unique_ptr<StaticContextImpl> lCtx( |
611 | new StaticContextImpl(lIter->second.getp(), theDiagnosticHandler)); |
612 | |
613 | lMgrs.push_back(new StaticCollectionManagerImpl(lCtx.get(), |
614 | @@ -1569,7 +1570,7 @@ |
615 | checkNotClosed(); |
616 | checkCompiled(); |
617 | |
618 | - std::auto_ptr<IterPrinter> lPrinter; |
619 | + std::unique_ptr<IterPrinter> lPrinter; |
620 | if (aDotFormat) |
621 | lPrinter.reset(new DOTIterPrinter(aStream)); |
622 | else |
623 | |
624 | === modified file 'src/capi/cdynamic_context.cpp' |
625 | --- src/capi/cdynamic_context.cpp 2013-02-07 17:24:36 +0000 |
626 | +++ src/capi/cdynamic_context.cpp 2013-09-17 23:08:54 +0000 |
627 | @@ -21,6 +21,8 @@ |
628 | #include <sstream> |
629 | #include <string.h> |
630 | #include <zorba/zorba.h> |
631 | +#include <zorba/internal/unique_ptr.h> |
632 | + |
633 | #include "capi/csequence.h" |
634 | #include "capi/error.h" |
635 | #include "capi/single_item_sequence.h" |
636 | @@ -113,11 +115,11 @@ |
637 | if (! me->theContext->getContextItem(lItem)) { |
638 | return XQC_NO_CURRENT_ITEM; |
639 | } |
640 | - std::auto_ptr<SingleItemSequence> lItemSeq(new SingleItemSequence(lItem)); |
641 | + std::unique_ptr<SingleItemSequence> lItemSeq(new SingleItemSequence(lItem)); |
642 | // Wrap in a CSequence to produce an XQC_Sequence. We pass |
643 | // "true" to make CSequence assume memory-management |
644 | // responsibility for the SingleItemSequence. |
645 | - std::auto_ptr<CSequence> lSeq(new CSequence(lItemSeq.get(), true, NULL)); |
646 | + std::unique_ptr<CSequence> lSeq(new CSequence(lItemSeq.get(), true, NULL)); |
647 | lItemSeq.release(); |
648 | (*value) = lSeq.release()->getXQC(); |
649 | return XQC_NO_ERROR; |
650 | @@ -136,7 +138,7 @@ |
651 | // std::stringstream* lStream = new std::stringstream(); |
652 | // CAPIUtil::getIStream(document, *lStream); // must not throw |
653 | |
654 | -// lContext->setContextItemAsDocument(doc_uri, std::auto_ptr<std::istream>(lStream)); |
655 | +// lContext->setContextItemAsDocument(doc_uri, std::unique_ptr<std::istream>(lStream)); |
656 | // DC_CATCH |
657 | // } |
658 | |
659 | @@ -182,12 +184,12 @@ |
660 | // We could have gotten a single Item or an Iterator. We assume |
661 | // the Item takes precedence if not null. |
662 | if (! lItem.isNull()) { |
663 | - std::auto_ptr<SingleItemSequence> lItemSeq |
664 | + std::unique_ptr<SingleItemSequence> lItemSeq |
665 | (new SingleItemSequence(lItem)); |
666 | // Wrap in a CSequence to produce an XQC_Sequence. We pass |
667 | // "true" to make CSequence assume memory-management |
668 | // responsibility for the SingleItemSequence. |
669 | - std::auto_ptr<CSequence> lSeq |
670 | + std::unique_ptr<CSequence> lSeq |
671 | (new CSequence(lItemSeq.get(), true, NULL)); |
672 | |
673 | lItemSeq.release(); |
674 | @@ -196,7 +198,7 @@ |
675 | } |
676 | |
677 | // Otherwise, the Iterator must be the value. |
678 | - std::auto_ptr<CSequence> lSeq (new CSequence(lIter, me->theErrorHandler)); |
679 | + std::unique_ptr<CSequence> lSeq (new CSequence(lIter, me->theErrorHandler)); |
680 | (*seq) = lSeq.release()->getXQC(); |
681 | return XQC_NO_ERROR; |
682 | } |
683 | @@ -215,7 +217,7 @@ |
684 | // CAPIUtil::getIStream(document, *lStream); // must not throw |
685 | |
686 | // lContext->setVariableAsDocument(var_qname, doc_uri, |
687 | -// std::auto_ptr<std::istream>(lStream)); // transfer ownership here |
688 | +// std::unique_ptr<std::istream>(lStream)); // transfer ownership here |
689 | // DC_CATCH |
690 | // } |
691 | |
692 | |
693 | === modified file 'src/capi/cexpression.cpp' |
694 | --- src/capi/cexpression.cpp 2013-02-07 17:24:36 +0000 |
695 | +++ src/capi/cexpression.cpp 2013-09-17 23:08:54 +0000 |
696 | @@ -17,12 +17,12 @@ |
697 | |
698 | #include "capi/cexpression.h" |
699 | |
700 | -#include <memory> |
701 | #include <cassert> |
702 | #include <sstream> |
703 | |
704 | #include <zorba/zorba.h> |
705 | #include <zorba/iterator.h> |
706 | +#include <zorba/internal/unique_ptr.h> |
707 | |
708 | #include "cdynamic_context.h" |
709 | #include "csequence.h" |
710 | @@ -90,7 +90,7 @@ |
711 | // one later. |
712 | XQuery_t lClone = me->theMasterQuery->clone(); |
713 | DynamicContext* lContext = lClone->getDynamicContext(); |
714 | - std::auto_ptr<CDynamicContext> lCCtx |
715 | + std::unique_ptr<CDynamicContext> lCCtx |
716 | (new CDynamicContext(lContext, lClone, me->theErrorHandler)); |
717 | (*context) = lCCtx.release()->getXQC(); |
718 | } |
719 | @@ -209,7 +209,7 @@ |
720 | else { |
721 | lHandler = me->theErrorHandler; |
722 | } |
723 | - std::auto_ptr<CSequence> lSeq(new CSequence(lIter, lHandler)); |
724 | + std::unique_ptr<CSequence> lSeq(new CSequence(lIter, lHandler)); |
725 | |
726 | (*sequence) = lSeq.release()->getXQC(); |
727 | } |
728 | |
729 | === modified file 'src/capi/cexternal_function.cpp' |
730 | --- src/capi/cexternal_function.cpp 2013-02-07 17:24:36 +0000 |
731 | +++ src/capi/cexternal_function.cpp 2013-09-17 23:08:54 +0000 |
732 | @@ -19,6 +19,7 @@ |
733 | #include "capi/csequence.h" |
734 | #include "capi/user_item_sequence.h" |
735 | #include <zorba/item_sequence.h> |
736 | +#include <zorba/internal/unique_ptr.h> |
737 | |
738 | using namespace zorba; |
739 | |
740 | @@ -68,7 +69,7 @@ |
741 | // the Zorba engine, so we request that CSequence NOT free them |
742 | // when the CSequence is deleted. |
743 | for (unsigned int i = 0; i < lSequencesSize; ++i) { |
744 | - std::auto_ptr<CSequence> lSeq(new CSequence(args[i], false, NULL)); |
745 | + std::unique_ptr<CSequence> lSeq(new CSequence(args[i], false, NULL)); |
746 | lSequences[i] = lSeq.release()->getXQC(); |
747 | } |
748 | |
749 | |
750 | === modified file 'src/capi/cimplementation.cpp' |
751 | --- src/capi/cimplementation.cpp 2013-08-05 11:24:53 +0000 |
752 | +++ src/capi/cimplementation.cpp 2013-09-17 23:08:54 +0000 |
753 | @@ -18,8 +18,6 @@ |
754 | #include "capi/cimplementation.h" |
755 | |
756 | #include <sstream> |
757 | -#include <memory> |
758 | - |
759 | #include "capi/cexpression.h" |
760 | #include "capi/cstatic_context.h" |
761 | #include "capi/csequence.h" |
762 | @@ -149,17 +147,17 @@ |
763 | */ |
764 | void |
765 | CImplementation::create_sequence |
766 | - (std::auto_ptr<CrSeqData> data, XQC_Sequence** seq) |
767 | + (std::unique_ptr<CrSeqData> data, XQC_Sequence** seq) |
768 | { |
769 | // Create a UserItemSequence to return the data in order as items. |
770 | - std::auto_ptr<UserItemSequence> lItemSeq |
771 | + std::unique_ptr<UserItemSequence> lItemSeq |
772 | (new UserItemSequence(NULL, 0, &crseq_init, &crseq_next, &crseq_free, |
773 | data.get(), theZorba->getItemFactory(), NULL)); |
774 | |
775 | // Wrap in a CSequence to produce an XQC_Sequence. We pass "true" |
776 | // to make CSequence assume memory-management responsibility for |
777 | // the UserItemSequence. |
778 | - std::auto_ptr<CSequence> lSeq (new CSequence(lItemSeq.get(), true, NULL)); |
779 | + std::unique_ptr<CSequence> lSeq (new CSequence(lItemSeq.get(), true, NULL)); |
780 | |
781 | lItemSeq.release(); |
782 | data.release(); |
783 | @@ -275,7 +273,7 @@ |
784 | // Create a C++ StaticContext, wrap in a CStaticContext, then |
785 | // return the inner XQC_StaticContext |
786 | StaticContext_t lContext = me->theZorba->createStaticContext(); |
787 | - std::auto_ptr<CStaticContext> lCCtx |
788 | + std::unique_ptr<CStaticContext> lCCtx |
789 | (new CStaticContext(lContext, me->theZorba, NULL)); |
790 | (*context) = lCCtx.release()->getXQC(); |
791 | } |
792 | @@ -301,7 +299,7 @@ |
793 | lQuery = me->theZorba->compileQuery(query_string); |
794 | } |
795 | |
796 | - std::auto_ptr<CExpression> lExpr(new CExpression(lQuery, handler)); |
797 | + std::unique_ptr<CExpression> lExpr(new CExpression(lQuery, handler)); |
798 | (*expr) = lExpr.release()->getXQC(); |
799 | } |
800 | CIMPL_CATCH; |
801 | @@ -331,7 +329,7 @@ |
802 | lQuery = me->theZorba->compileQuery(lStream); |
803 | } |
804 | |
805 | - std::auto_ptr<CExpression> lExpr(new CExpression(lQuery, handler)); |
806 | + std::unique_ptr<CExpression> lExpr(new CExpression(lQuery, handler)); |
807 | (*expr) = lExpr.release()->getXQC(); |
808 | } |
809 | CIMPL_CATCH; |
810 | @@ -361,7 +359,7 @@ |
811 | lQuery = me->theZorba->compileQuery(lStream); |
812 | } |
813 | |
814 | - std::auto_ptr<CExpression> lExpr(new CExpression(lQuery, handler)); |
815 | + std::unique_ptr<CExpression> lExpr(new CExpression(lQuery, handler)); |
816 | (*expr) = lExpr.release()->getXQC(); |
817 | } |
818 | CIMPL_CATCH; |
819 | @@ -376,11 +374,11 @@ |
820 | return XQC_INTERNAL_ERROR; |
821 | } |
822 | |
823 | - std::auto_ptr<SingleItemSequence> lItemSeq(new SingleItemSequence(lDoc)); |
824 | + std::unique_ptr<SingleItemSequence> lItemSeq(new SingleItemSequence(lDoc)); |
825 | // Wrap in a CSequence to produce an XQC_Sequence. We pass "true" |
826 | // to make CSequence assume memory-management responsibility for |
827 | // the SingleItemSequence. |
828 | - std::auto_ptr<CSequence> lSeq(new CSequence(lItemSeq.get(), true, NULL)); |
829 | + std::unique_ptr<CSequence> lSeq(new CSequence(lItemSeq.get(), true, NULL)); |
830 | |
831 | lItemSeq.release(); |
832 | (*seq) = lSeq.release()->getXQC(); |
833 | @@ -434,9 +432,9 @@ |
834 | { |
835 | CIMPL_TRY { |
836 | // Create a CrSeqData representing no data at all. |
837 | - std::auto_ptr<CrSeqData> lData (new CrSeqData(0, XQC_DOUBLE_TYPE, false)); |
838 | + std::unique_ptr<CrSeqData> lData (new CrSeqData(0, XQC_DOUBLE_TYPE, false)); |
839 | lData->theDoubles = NULL; |
840 | - me->create_sequence(lData, seq); |
841 | + me->create_sequence(std::move(lData), seq); |
842 | } |
843 | CIMPL_CATCH; |
844 | } |
845 | @@ -447,9 +445,9 @@ |
846 | { |
847 | CIMPL_TRY { |
848 | // Create a CrSeqData to hold the user's data. |
849 | - std::auto_ptr<CrSeqData> lData(new CrSeqData(1, type, true)); |
850 | + std::unique_ptr<CrSeqData> lData(new CrSeqData(1, type, true)); |
851 | lData->theString = value; |
852 | - me->create_sequence(lData, seq); |
853 | + me->create_sequence(std::move(lData), seq); |
854 | } |
855 | CIMPL_CATCH; |
856 | } |
857 | @@ -460,10 +458,10 @@ |
858 | { |
859 | CIMPL_TRY { |
860 | // Create a CrSeqData to hold the user's data. |
861 | - std::auto_ptr<CrSeqData> lData |
862 | + std::unique_ptr<CrSeqData> lData |
863 | (new CrSeqData(count, XQC_STRING_TYPE, false)); |
864 | lData->theStrings = values; |
865 | - me->create_sequence(lData, seq); |
866 | + me->create_sequence(std::move(lData), seq); |
867 | } |
868 | CIMPL_CATCH; |
869 | } |
870 | @@ -474,10 +472,10 @@ |
871 | { |
872 | CIMPL_TRY { |
873 | // Create a CrSeqData to hold the user's data. |
874 | - std::auto_ptr<CrSeqData> lData |
875 | + std::unique_ptr<CrSeqData> lData |
876 | (new CrSeqData(count, XQC_DECIMAL_TYPE, false)); |
877 | lData->theInts = values; |
878 | - me->create_sequence(lData, seq); |
879 | + me->create_sequence(std::move(lData), seq); |
880 | } |
881 | CIMPL_CATCH; |
882 | } |
883 | @@ -488,10 +486,10 @@ |
884 | { |
885 | CIMPL_TRY { |
886 | // Create a CrSeqData to hold the user's data. |
887 | - std::auto_ptr<CrSeqData> lData |
888 | + std::unique_ptr<CrSeqData> lData |
889 | (new CrSeqData(count, XQC_DOUBLE_TYPE, false)); |
890 | lData->theDoubles = values; |
891 | - me->create_sequence(lData, seq); |
892 | + me->create_sequence(std::move(lData), seq); |
893 | } |
894 | CIMPL_CATCH; |
895 | } |
896 | |
897 | === modified file 'src/capi/cimplementation.h' |
898 | --- src/capi/cimplementation.h 2013-08-05 11:24:53 +0000 |
899 | +++ src/capi/cimplementation.h 2013-09-17 23:08:54 +0000 |
900 | @@ -20,6 +20,7 @@ |
901 | #include <xqc.h> |
902 | #include <zorba/zorbac.h> |
903 | #include <zorba/zorba.h> |
904 | +#include <zorba/internal/unique_ptr.h> |
905 | |
906 | using namespace zorba; |
907 | |
908 | @@ -98,7 +99,7 @@ |
909 | private: |
910 | |
911 | void |
912 | - create_sequence(std::auto_ptr<CrSeqData> data, XQC_Sequence** seq); |
913 | + create_sequence(std::unique_ptr<CrSeqData> data, XQC_Sequence** seq); |
914 | |
915 | XQC_Error |
916 | parse_istream(std::istream& aStream, XQC_Sequence** seq); |
917 | |
918 | === modified file 'src/capi/csequence.cpp' |
919 | --- src/capi/csequence.cpp 2013-07-01 18:59:06 +0000 |
920 | +++ src/capi/csequence.cpp 2013-09-17 23:08:54 +0000 |
921 | @@ -24,6 +24,7 @@ |
922 | #include <zorba/diagnostic_list.h> |
923 | #include <zorba/iterator.h> |
924 | #include <zorba/store_consts.h> |
925 | +#include <zorba/internal/unique_ptr.h> |
926 | |
927 | #include "util/string_util.h" |
928 | #include "zorbamisc/ns_consts.h" |
929 | @@ -468,7 +469,7 @@ |
930 | if ( ! lItem.isNode() ) { |
931 | return XQC_NOT_NODE; |
932 | } |
933 | - std::auto_ptr<Item> lNodeName(new Item()); |
934 | + std::unique_ptr<Item> lNodeName(new Item()); |
935 | if ( ! lItem.getNodeName(*lNodeName) ) { |
936 | return XQC_INTERNAL_ERROR; |
937 | } |
938 | |
939 | === modified file 'src/capi/cstatic_context.cpp' |
940 | --- src/capi/cstatic_context.cpp 2013-06-18 23:53:59 +0000 |
941 | +++ src/capi/cstatic_context.cpp 2013-09-17 23:08:54 +0000 |
942 | @@ -20,6 +20,8 @@ |
943 | #include <cassert> |
944 | #include <string.h> |
945 | #include <zorba/zorba.h> |
946 | +#include <zorba/internal/unique_ptr.h> |
947 | + |
948 | #include "capi/external_module.h" |
949 | #include "capi/cexternal_function.h" |
950 | #include "capi/error.h" |
951 | @@ -138,7 +140,7 @@ |
952 | { |
953 | SC_TRY { |
954 | StaticContext_t lChild = me->theContext.get()->createChildContext(); |
955 | - std::auto_ptr<CStaticContext> lCtx |
956 | + std::unique_ptr<CStaticContext> lCtx |
957 | (new CStaticContext(lChild, me->theZorba, me->theErrorHandler)); |
958 | (*child_context) = lCtx.release()->getXQC(); |
959 | } |
960 | @@ -646,7 +648,7 @@ |
961 | me->theContext.get()->registerModule(lModule); |
962 | } |
963 | |
964 | - std::auto_ptr<CExternalFunction> lFunc |
965 | + std::unique_ptr<CExternalFunction> lFunc |
966 | (new CExternalFunction(uri, localname, init_fn, next_fn, free_fn, |
967 | function_user_data, me->theZorba->getItemFactory(), |
968 | me->theErrorHandler)); |
969 | |
970 | === modified file 'src/capi/zorbac.cpp' |
971 | --- src/capi/zorbac.cpp 2013-02-07 17:24:36 +0000 |
972 | +++ src/capi/zorbac.cpp 2013-09-17 23:08:54 +0000 |
973 | @@ -17,6 +17,7 @@ |
974 | |
975 | #include <zorba/zorba.h> |
976 | #include <zorba/zorbac.h> |
977 | +#include <zorba/internal/unique_ptr.h> |
978 | |
979 | #include "capi/cimplementation.h" |
980 | #include "capi/error.h" |
981 | @@ -32,7 +33,7 @@ |
982 | Zorba* lZorba = |
983 | Zorba::getInstance(static_cast<zorba::store::Store*>(store)); |
984 | |
985 | - std::auto_ptr<CImplementation> lImpl(new CImplementation(lZorba)); |
986 | + std::unique_ptr<CImplementation> lImpl(new CImplementation(lZorba)); |
987 | |
988 | // Don't call anything that might throw an exception after this point |
989 | (*impl) = lImpl.release()->getXQC(); |
990 | |
991 | === modified file 'src/compiler/api/compiler_api.cpp' |
992 | --- src/compiler/api/compiler_api.cpp 2013-04-17 18:08:27 +0000 |
993 | +++ src/compiler/api/compiler_api.cpp 2013-09-17 23:08:54 +0000 |
994 | @@ -16,7 +16,6 @@ |
995 | #include "stdafx.h" |
996 | |
997 | #include <istream> |
998 | -#include <memory> |
999 | |
1000 | #include "compiler/api/compiler_api.h" |
1001 | #include "diagnostics/xquery_diagnostics.h" |
1002 | @@ -555,9 +554,9 @@ |
1003 | } |
1004 | |
1005 | |
1006 | -std::auto_ptr<XQueryCompilerSubsystem> XQueryCompilerSubsystem::create() |
1007 | +std::unique_ptr<XQueryCompilerSubsystem> XQueryCompilerSubsystem::create() |
1008 | { |
1009 | - return std::auto_ptr<XQueryCompilerSubsystem>(new XQueryCompilerSubsystemImpl()); |
1010 | + return std::unique_ptr<XQueryCompilerSubsystem>(new XQueryCompilerSubsystemImpl()); |
1011 | } |
1012 | |
1013 | } |
1014 | |
1015 | === modified file 'src/compiler/api/compiler_api.h' |
1016 | --- src/compiler/api/compiler_api.h 2013-04-10 10:13:31 +0000 |
1017 | +++ src/compiler/api/compiler_api.h 2013-09-17 23:08:54 +0000 |
1018 | @@ -17,11 +17,11 @@ |
1019 | #ifndef ZORBA_COMPILER_API_H |
1020 | #define ZORBA_COMPILER_API_H |
1021 | |
1022 | -#include <memory> |
1023 | #include "zorbatypes/schema_types.h" |
1024 | |
1025 | #include "common/shared_types.h" |
1026 | #include <zorba/api_shared_types.h> |
1027 | +#include <zorba/internal/unique_ptr.h> |
1028 | |
1029 | namespace zorba |
1030 | { |
1031 | @@ -98,7 +98,7 @@ |
1032 | virtual Rewriter* getDefaultOptimizingRewriter() = 0; |
1033 | |
1034 | private: |
1035 | - static std::auto_ptr<XQueryCompilerSubsystem> create(); |
1036 | + static std::unique_ptr<XQueryCompilerSubsystem> create(); |
1037 | }; |
1038 | |
1039 | |
1040 | |
1041 | === modified file 'src/compiler/api/compiler_api_impl.h' |
1042 | --- src/compiler/api/compiler_api_impl.h 2013-02-07 17:24:36 +0000 |
1043 | +++ src/compiler/api/compiler_api_impl.h 2013-09-17 23:08:54 +0000 |
1044 | @@ -26,7 +26,7 @@ |
1045 | friend class XQueryCompilerSubsystem; |
1046 | |
1047 | private: |
1048 | - std::auto_ptr<Rewriter> m_defaultOptimizer; |
1049 | + std::unique_ptr<Rewriter> m_defaultOptimizer; |
1050 | |
1051 | public: |
1052 | ~XQueryCompilerSubsystemImpl(); |
1053 | |
1054 | === modified file 'src/compiler/codegen/plan_visitor.cpp' |
1055 | --- src/compiler/codegen/plan_visitor.cpp 2013-08-30 14:50:21 +0000 |
1056 | +++ src/compiler/codegen/plan_visitor.cpp 2013-09-17 23:08:54 +0000 |
1057 | @@ -23,6 +23,7 @@ |
1058 | #include <zorba/config.h> |
1059 | #include <zorba/diagnostic_list.h> |
1060 | #include "diagnostics/assert.h" |
1061 | +#include <zorba/internal/unique_ptr.h> |
1062 | |
1063 | #include "util/hashmap32.h" |
1064 | #include "util/stl_util.h" |
1065 | @@ -571,7 +572,7 @@ |
1066 | CODEGEN_TRACE_OUT(""); |
1067 | std::vector<PlanIter_t> argv; |
1068 | argv.push_back(pop_itstack()); |
1069 | - std::auto_ptr<FunctionTraceIterator> lDummyIter( |
1070 | + std::unique_ptr<FunctionTraceIterator> lDummyIter( |
1071 | new FunctionTraceIterator(sctx, qloc, argv)); |
1072 | lDummyIter->setFunctionName(v.getFunctionName()); |
1073 | lDummyIter->setFunctionArity(v.getFunctionArity()); |
1074 | @@ -1639,8 +1640,8 @@ |
1075 | |
1076 | PlanIter_t domainIter = pop_itstack(); |
1077 | |
1078 | - std::auto_ptr<flwor::StartClause> start_clause; |
1079 | - std::auto_ptr<flwor::EndClause> end_clause; |
1080 | + std::unique_ptr<flwor::StartClause> start_clause; |
1081 | + std::unique_ptr<flwor::EndClause> end_clause; |
1082 | const flwor_wincond* cond; |
1083 | ulong varPos = 1; |
1084 | |
1085 | @@ -1802,9 +1803,9 @@ |
1086 | { |
1087 | flwor::FLWORIterator* flworIter; |
1088 | PlanIter_t returnIter; |
1089 | - std::auto_ptr<flwor::OrderByClause> orderClause(NULL); |
1090 | - std::auto_ptr<flwor::GroupByClause> groupClause(NULL); |
1091 | - std::auto_ptr<flwor::MaterializeClause> materializeClause(NULL); |
1092 | + std::unique_ptr<flwor::OrderByClause> orderClause; |
1093 | + std::unique_ptr<flwor::GroupByClause> groupClause; |
1094 | + std::unique_ptr<flwor::MaterializeClause> materializeClause; |
1095 | PlanIter_t whereIter; |
1096 | std::vector<flwor::ForLetClause> forletClauses; |
1097 | |
1098 | @@ -2316,7 +2317,7 @@ |
1099 | reverse(argvEvalIter.begin(), argvEvalIter.end()); |
1100 | |
1101 | // get the debugger iterator from the debugger stack |
1102 | - std::auto_ptr<DebugIterator> lDebugIterator(theDebuggerStack.top()); |
1103 | + std::unique_ptr<DebugIterator> lDebugIterator(theDebuggerStack.top()); |
1104 | theDebuggerStack.pop(); |
1105 | |
1106 | // set the children of the debugger iterator |
1107 | |
1108 | === modified file 'src/compiler/dewey/dewey.cpp' |
1109 | --- src/compiler/dewey/dewey.cpp 2013-02-07 17:24:36 +0000 |
1110 | +++ src/compiler/dewey/dewey.cpp 2013-09-17 23:08:54 +0000 |
1111 | @@ -17,7 +17,7 @@ |
1112 | #include "compiler/dewey/dewey.h" |
1113 | |
1114 | #include <cassert> |
1115 | -#include <memory> |
1116 | +#include <zorba/internal/unique_ptr.h> |
1117 | |
1118 | using namespace std; |
1119 | |
1120 | @@ -38,7 +38,7 @@ |
1121 | { |
1122 | DeweyClassification lVisitor; |
1123 | aNode.accept(lVisitor); |
1124 | - auto_ptr<Node> lRoot(lVisitor.getRoot()); |
1125 | + unique_ptr<Node> lRoot(lVisitor.getRoot()); |
1126 | if(lRoot.get() != 0) |
1127 | { |
1128 | lRoot->accept(&lVisitor); |
1129 | |
1130 | === modified file 'src/compiler/expression/fo_expr.cpp' |
1131 | --- src/compiler/expression/fo_expr.cpp 2013-06-27 15:54:27 +0000 |
1132 | +++ src/compiler/expression/fo_expr.cpp 2013-09-17 23:08:54 +0000 |
1133 | @@ -17,6 +17,8 @@ |
1134 | |
1135 | #include <vector> |
1136 | |
1137 | +#include <zorba/internal/unique_ptr.h> |
1138 | + |
1139 | #include "compiler/expression/fo_expr.h" |
1140 | #include "compiler/expression/expr_visitor.h" |
1141 | #include "compiler/expression/expr_manager.h" |
1142 | @@ -64,7 +66,7 @@ |
1143 | { |
1144 | function* f = GENV_FUNC_LIB->getFunction(FunctionConsts::OP_CONCATENATE_N); |
1145 | |
1146 | - std::auto_ptr<fo_expr> fo(ccb->theEM->create_fo_expr(sctx, udf, loc, f)); |
1147 | + std::unique_ptr<fo_expr> fo(ccb->theEM->create_fo_expr(sctx, udf, loc, f)); |
1148 | |
1149 | return fo.release(); |
1150 | } |
1151 | |
1152 | === modified file 'src/compiler/parser/jsoniq_parser.cpp' |
1153 | --- src/compiler/parser/jsoniq_parser.cpp 2013-09-13 14:41:06 +0000 |
1154 | +++ src/compiler/parser/jsoniq_parser.cpp 2013-09-17 23:08:54 +0000 |
1155 | @@ -3389,7 +3389,7 @@ |
1156 | /* Line 661 of lalr1.cc */ |
1157 | #line 1788 "/Users/zorba/Code/zorba/release/src/compiler/parser/jsoniq_parser.y" |
1158 | { |
1159 | - std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(4) - (2)].varnametype))); |
1160 | + std::unique_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(4) - (2)].varnametype))); |
1161 | |
1162 | (yyval.node) = new GlobalVarDecl(LOC((yyloc)), |
1163 | nt->theName, |
1164 | @@ -3406,8 +3406,7 @@ |
1165 | /* Line 661 of lalr1.cc */ |
1166 | #line 1802 "/Users/zorba/Code/zorba/release/src/compiler/parser/jsoniq_parser.y" |
1167 | { |
1168 | - std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(3) - (2)].varnametype))); |
1169 | - |
1170 | + std::unique_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(3) - (2)].varnametype))); |
1171 | (yyval.node) = new GlobalVarDecl(LOC((yyloc)), |
1172 | nt->theName, |
1173 | nt->theType, |
1174 | @@ -3423,8 +3422,7 @@ |
1175 | /* Line 661 of lalr1.cc */ |
1176 | #line 1816 "/Users/zorba/Code/zorba/release/src/compiler/parser/jsoniq_parser.y" |
1177 | { |
1178 | - std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(5) - (2)].varnametype))); |
1179 | - |
1180 | + std::unique_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(5) - (2)].varnametype))); |
1181 | (yyval.node) = new GlobalVarDecl(LOC((yyloc)), |
1182 | nt->theName, |
1183 | nt->theType, |
1184 | |
1185 | === modified file 'src/compiler/parser/parser.y' |
1186 | --- src/compiler/parser/parser.y 2013-09-13 14:21:33 +0000 |
1187 | +++ src/compiler/parser/parser.y 2013-09-17 23:08:54 +0000 |
1188 | @@ -1763,7 +1763,7 @@ |
1189 | VarDecl : |
1190 | DECLARE VarNameAndType GETS ExprSingle |
1191 | { |
1192 | - std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>($2)); |
1193 | + std::unique_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>($2)); |
1194 | |
1195 | $$ = new GlobalVarDecl(LOC(@$), |
1196 | nt->theName, |
1197 | @@ -1777,7 +1777,7 @@ |
1198 | | |
1199 | DECLARE VarNameAndType EXTERNAL |
1200 | { |
1201 | - std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>($2)); |
1202 | + std::unique_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>($2)); |
1203 | |
1204 | $$ = new GlobalVarDecl(LOC(@$), |
1205 | nt->theName, |
1206 | @@ -1791,7 +1791,7 @@ |
1207 | | |
1208 | DECLARE VarNameAndType EXTERNAL GETS ExprSingle |
1209 | { |
1210 | - std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>($2)); |
1211 | + std::unique_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>($2)); |
1212 | |
1213 | $$ = new GlobalVarDecl(LOC(@$), |
1214 | nt->theName, |
1215 | |
1216 | === modified file 'src/compiler/parser/parser_y_includes.h' |
1217 | --- src/compiler/parser/parser_y_includes.h 2013-05-10 07:54:13 +0000 |
1218 | +++ src/compiler/parser/parser_y_includes.h 2013-09-17 23:08:54 +0000 |
1219 | @@ -20,6 +20,7 @@ |
1220 | #include <list> |
1221 | #include <string> |
1222 | #include <vector> |
1223 | +#include <zorba/internal/unique_ptr.h> |
1224 | |
1225 | #include "compiler/parsetree/parsenodes.h" |
1226 | #include "compiler/parser/zorba_parser_error.h" |
1227 | |
1228 | === modified file 'src/compiler/parser/xquery_parser.cpp' |
1229 | --- src/compiler/parser/xquery_parser.cpp 2013-09-12 15:23:33 +0000 |
1230 | +++ src/compiler/parser/xquery_parser.cpp 2013-09-17 23:08:54 +0000 |
1231 | @@ -3321,8 +3321,7 @@ |
1232 | /* Line 661 of lalr1.cc */ |
1233 | #line 1707 "/Users/zorba/Code/zorba/release/src/compiler/parser/xquery_parser.y" |
1234 | { |
1235 | - std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(4) - (2)].varnametype))); |
1236 | - |
1237 | + std::unique_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(4) - (2)].varnametype))); |
1238 | (yyval.node) = new GlobalVarDecl(LOC((yyloc)), |
1239 | nt->theName, |
1240 | nt->theType, |
1241 | @@ -3338,8 +3337,7 @@ |
1242 | /* Line 661 of lalr1.cc */ |
1243 | #line 1721 "/Users/zorba/Code/zorba/release/src/compiler/parser/xquery_parser.y" |
1244 | { |
1245 | - std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(3) - (2)].varnametype))); |
1246 | - |
1247 | + std::unique_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(3) - (2)].varnametype))); |
1248 | (yyval.node) = new GlobalVarDecl(LOC((yyloc)), |
1249 | nt->theName, |
1250 | nt->theType, |
1251 | @@ -3355,8 +3353,7 @@ |
1252 | /* Line 661 of lalr1.cc */ |
1253 | #line 1735 "/Users/zorba/Code/zorba/release/src/compiler/parser/xquery_parser.y" |
1254 | { |
1255 | - std::auto_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(5) - (2)].varnametype))); |
1256 | - |
1257 | + std::unique_ptr<VarNameAndType> nt(dynamic_cast<VarNameAndType *>((yysemantic_stack_[(5) - (2)].varnametype))); |
1258 | (yyval.node) = new GlobalVarDecl(LOC((yyloc)), |
1259 | nt->theName, |
1260 | nt->theType, |
1261 | |
1262 | === modified file 'src/compiler/rewriter/rules/flwor_rules.cpp' |
1263 | --- src/compiler/rewriter/rules/flwor_rules.cpp 2013-09-12 07:54:03 +0000 |
1264 | +++ src/compiler/rewriter/rules/flwor_rules.cpp 2013-09-17 23:08:54 +0000 |
1265 | @@ -38,8 +38,8 @@ |
1266 | #include "system/properties.h" |
1267 | |
1268 | #include "zorbatypes/integer.h" |
1269 | +#include <zorba/internal/unique_ptr.h> |
1270 | |
1271 | -#include <memory> |
1272 | #include <iterator> |
1273 | |
1274 | namespace zorba |
1275 | |
1276 | === modified file 'src/compiler/translator/translator.cpp' |
1277 | --- src/compiler/translator/translator.cpp 2013-09-12 09:54:44 +0000 |
1278 | +++ src/compiler/translator/translator.cpp 2013-09-17 23:08:54 +0000 |
1279 | @@ -24,6 +24,7 @@ |
1280 | |
1281 | #include <zorba/config.h> |
1282 | #include <zorba/diagnostic_list.h> |
1283 | +#include <zorba/internal/unique_ptr.h> |
1284 | |
1285 | |
1286 | #include "common/common.h" |
1287 | @@ -684,7 +685,7 @@ |
1288 | |
1289 | std::stack<bool> theInWhileStack; |
1290 | |
1291 | - std::auto_ptr<AnnotationList> theAnnotations; |
1292 | + std::unique_ptr<AnnotationList> theAnnotations; |
1293 | |
1294 | IndexDecl_t theIndexDecl; |
1295 | bool theIsInIndexDomain; |
1296 | @@ -1647,7 +1648,7 @@ |
1297 | inlineFuncExpr->add_variable(fiVar, fiSubstVar); |
1298 | |
1299 | // Create the inline udf obj. |
1300 | - std::auto_ptr<user_function> inlineUDF( |
1301 | + std::unique_ptr<user_function> inlineUDF( |
1302 | new user_function(loc, |
1303 | signature(function_item_expr::create_inline_fname(loc), |
1304 | funcType->get_param_types(), |
1305 | @@ -1998,7 +1999,7 @@ |
1306 | #ifdef ZORBA_WITH_DEBUGGER |
1307 | if (theCCB->theDebuggerCommons != NULL) |
1308 | { |
1309 | - std::auto_ptr<debugger_expr> lExpr(theExprManager-> |
1310 | + std::unique_ptr<debugger_expr> lExpr(theExprManager-> |
1311 | create_debugger_expr(theSctx, |
1312 | theUDF, |
1313 | aLoc, |
1314 | @@ -2236,7 +2237,7 @@ |
1315 | |
1316 | try |
1317 | { |
1318 | - std::auto_ptr<internal::Resource> lSchema; |
1319 | + std::unique_ptr<internal::Resource> lSchema; |
1320 | internal::StreamResource* lStream = NULL; |
1321 | zstring lErrorMessage; |
1322 | |
1323 | @@ -3507,7 +3508,7 @@ |
1324 | // rather than using compURI directly, because we want the version |
1325 | // fragment to be passed to the mappers. |
1326 | zstring errorMsg; |
1327 | - std::auto_ptr<internal::Resource> resource; |
1328 | + std::unique_ptr<internal::Resource> resource; |
1329 | internal::StreamResource* streamResource = NULL; |
1330 | |
1331 | try |
1332 | @@ -12602,7 +12603,7 @@ |
1333 | const QueryLoc& loc) |
1334 | { |
1335 | xqtref_t type; |
1336 | - std::auto_ptr<user_function> udf; |
1337 | + std::unique_ptr<user_function> udf; |
1338 | expr* body; |
1339 | |
1340 | function_item_expr* fiExpr = |
1341 | @@ -13042,7 +13043,7 @@ |
1342 | } |
1343 | |
1344 | // Create the udf obj. |
1345 | - std::auto_ptr<user_function> udf( |
1346 | + std::unique_ptr<user_function> udf( |
1347 | new user_function(loc, |
1348 | signature(function_item_expr::create_inline_fname(loc), |
1349 | paramTypes, |
1350 | @@ -16052,7 +16053,7 @@ |
1351 | #ifndef ZORBA_NO_FULL_TEXT |
1352 | zstring const &uri = v.get_uri(); |
1353 | zstring error_msg; |
1354 | - std::auto_ptr<internal::Resource> rsrc( |
1355 | + std::unique_ptr<internal::Resource> rsrc( |
1356 | theSctx->resolve_uri( uri, internal::EntityData::THESAURUS, error_msg ) |
1357 | ); |
1358 | if ( !rsrc.get() ) |
1359 | @@ -16325,7 +16326,7 @@ |
1360 | bool isLibModule, |
1361 | StaticContextConsts::xquery_version_t maxLibModuleVersion) |
1362 | { |
1363 | - std::auto_ptr<TranslatorImpl> t(new TranslatorImpl(rootTranslator, |
1364 | + std::unique_ptr<TranslatorImpl> t(new TranslatorImpl(rootTranslator, |
1365 | rootSctx, |
1366 | rootSctxId, |
1367 | minfo, |
1368 | @@ -16382,7 +16383,7 @@ |
1369 | |
1370 | ModulesInfo minfo(ccb); |
1371 | |
1372 | - std::auto_ptr<TranslatorImpl> t(new TranslatorImpl(NULL, |
1373 | + std::unique_ptr<TranslatorImpl> t(new TranslatorImpl(NULL, |
1374 | sctx, |
1375 | ccb->theSctxMap.size(), |
1376 | &minfo, |
1377 | |
1378 | === modified file 'src/context/default_uri_mappers.h' |
1379 | --- src/context/default_uri_mappers.h 2013-02-07 17:24:36 +0000 |
1380 | +++ src/context/default_uri_mappers.h 2013-09-17 23:08:54 +0000 |
1381 | @@ -24,7 +24,6 @@ |
1382 | * module-versioning and automatic filesystem URIMappers. |
1383 | */ |
1384 | |
1385 | -#include <memory> |
1386 | #include <istream> |
1387 | #include <zorbatypes/zstring.h> |
1388 | #include "context/uri_resolver.h" |
1389 | |
1390 | === modified file 'src/context/default_url_resolvers.cpp' |
1391 | --- src/context/default_url_resolvers.cpp 2013-06-01 00:47:53 +0000 |
1392 | +++ src/context/default_url_resolvers.cpp 2013-09-17 23:08:54 +0000 |
1393 | @@ -16,6 +16,7 @@ |
1394 | #include "stdafx.h" |
1395 | |
1396 | #include <zorba/internal/cxx_util.h> |
1397 | +#include <zorba/internal/unique_ptr.h> |
1398 | |
1399 | #include "context/default_url_resolvers.h" |
1400 | #include "util/uri_util.h" |
1401 | @@ -86,7 +87,7 @@ |
1402 | return nullptr; |
1403 | } |
1404 | try { |
1405 | - std::auto_ptr<HttpStream> lStream(new HttpStream(aUrl)); |
1406 | + std::unique_ptr<HttpStream> lStream(new HttpStream(aUrl)); |
1407 | lStream->init(); |
1408 | // Take ownership of the istream and pass it to the StreamResource |
1409 | StreamResource* lResource = |
1410 | |
1411 | === modified file 'src/context/default_url_resolvers.h' |
1412 | --- src/context/default_url_resolvers.h 2013-02-07 17:24:36 +0000 |
1413 | +++ src/context/default_url_resolvers.h 2013-09-17 23:08:54 +0000 |
1414 | @@ -24,7 +24,6 @@ |
1415 | * module-versioning and automatic filesystem URIMappers. |
1416 | */ |
1417 | |
1418 | -#include <memory> |
1419 | #include <istream> |
1420 | #include <zorbatypes/zstring.h> |
1421 | #include "context/uri_resolver.h" |
1422 | |
1423 | === modified file 'src/context/dynamic_loader.cpp' |
1424 | --- src/context/dynamic_loader.cpp 2013-06-14 23:46:26 +0000 |
1425 | +++ src/context/dynamic_loader.cpp 2013-09-17 23:08:54 +0000 |
1426 | @@ -38,6 +38,7 @@ |
1427 | #include <zorba/zorba_string.h> |
1428 | #include <context/get_current_lib_suffix.h> |
1429 | #include <zorba/util/error_util.h> |
1430 | +#include <zorba/internal/unique_ptr.h> |
1431 | |
1432 | namespace zorba { |
1433 | |
1434 | @@ -221,7 +222,7 @@ |
1435 | std::vector<zstring> lLibPath; |
1436 | aSctx.get_full_lib_path(lLibPath); |
1437 | |
1438 | - std::auto_ptr<std::istream> modfile(0); // result file |
1439 | + std::unique_ptr<std::istream> modfile(0); // result file |
1440 | |
1441 | if (lLibPath.size() != 0) |
1442 | { |
1443 | @@ -256,7 +257,7 @@ |
1444 | potentialModuleFile.append(lLibraryName); |
1445 | potentialModuleFileDebug.append(lLibraryNameDebug); |
1446 | |
1447 | - std::auto_ptr<std::istream> modfile |
1448 | + std::unique_ptr<std::istream> modfile |
1449 | (new std::ifstream(potentialModuleFile.c_str())); |
1450 | |
1451 | if (!modfile->good()) |
1452 | |
1453 | === modified file 'src/context/static_context.cpp' |
1454 | --- src/context/static_context.cpp 2013-09-09 23:47:17 +0000 |
1455 | +++ src/context/static_context.cpp 2013-09-17 23:08:54 +0000 |
1456 | @@ -17,7 +17,6 @@ |
1457 | |
1458 | #include <assert.h> |
1459 | #include <algorithm> |
1460 | -#include <memory> |
1461 | |
1462 | #include <zorba/external_module.h> |
1463 | #include <zorba/serialization_callback.h> |
1464 | @@ -841,6 +840,16 @@ |
1465 | #if 0 |
1466 | std::cout << "Deallocating SCTX : " << this << std::endl; |
1467 | #endif |
1468 | + for (std::vector<internal::URIMapper*>::const_iterator mapper = |
1469 | + theURIMappers.begin(); |
1470 | + mapper != theURIMappers.end(); mapper++) { |
1471 | + delete *mapper; |
1472 | + } |
1473 | + for (std::vector<internal::URLResolver*>::const_iterator resolver = |
1474 | + theURLResolvers.begin(); |
1475 | + resolver != theURLResolvers.end(); resolver++) { |
1476 | + delete *resolver; |
1477 | + } |
1478 | |
1479 | if (theExternalModulesMap) |
1480 | { |
1481 | @@ -1595,7 +1604,7 @@ |
1482 | ********************************************************************************/ |
1483 | void static_context::add_uri_mapper(internal::URIMapper* aMapper) |
1484 | { |
1485 | - theURIMappers.push_back(std::auto_ptr<internal::URIMapper>(aMapper)); |
1486 | + theURIMappers.push_back(aMapper); |
1487 | } |
1488 | |
1489 | |
1490 | @@ -1604,14 +1613,14 @@ |
1491 | ********************************************************************************/ |
1492 | void static_context::add_url_resolver(internal::URLResolver* aResolver) |
1493 | { |
1494 | - theURLResolvers.push_back(std::auto_ptr<internal::URLResolver>(aResolver)); |
1495 | + theURLResolvers.push_back(aResolver); |
1496 | } |
1497 | |
1498 | |
1499 | /***************************************************************************//** |
1500 | |
1501 | ********************************************************************************/ |
1502 | -std::auto_ptr<internal::Resource> static_context::resolve_uri( |
1503 | +std::unique_ptr<internal::Resource> static_context::resolve_uri( |
1504 | zstring const& aUri, |
1505 | internal::EntityData::Kind aEntityKind, |
1506 | zstring& oErrorMessage) const |
1507 | @@ -1621,7 +1630,7 @@ |
1508 | return this->resolve_uri(aUri, lData, oErrorMessage); |
1509 | } |
1510 | |
1511 | -std::auto_ptr<internal::Resource> static_context::resolve_uri( |
1512 | +std::unique_ptr<internal::Resource> static_context::resolve_uri( |
1513 | zstring const& aUri, |
1514 | internal::EntityData const& aEntityData, |
1515 | zstring& oErrorMessage) const |
1516 | @@ -1629,10 +1638,10 @@ |
1517 | std::vector<zstring> lUris; |
1518 | apply_uri_mappers(aUri, &aEntityData, internal::URIMapper::CANDIDATE, lUris); |
1519 | |
1520 | - std::auto_ptr<internal::Resource> lRetval; |
1521 | + std::unique_ptr<internal::Resource> lRetval; |
1522 | apply_url_resolvers(lUris, &aEntityData, lRetval, oErrorMessage); |
1523 | |
1524 | - return lRetval; |
1525 | + return std::move(lRetval); |
1526 | } |
1527 | |
1528 | void static_context::get_component_uris( |
1529 | @@ -1683,12 +1692,12 @@ |
1530 | sctx != NULL; sctx = sctx->theParent) |
1531 | { |
1532 | // Iterate through all available mappers on this static_context... |
1533 | - for (ztd::auto_vector<internal::URIMapper>::const_iterator mapper = |
1534 | + for (std::vector<internal::URIMapper*>::const_iterator mapper = |
1535 | sctx->theURIMappers.begin(); |
1536 | mapper != sctx->theURIMappers.end(); mapper++) |
1537 | { |
1538 | // Only call mappers of the appropriate kind |
1539 | - if ((*mapper)->mapperKind() != aMapperKind) |
1540 | + if ((**mapper).mapperKind() != aMapperKind) |
1541 | { |
1542 | continue; |
1543 | } |
1544 | @@ -1754,7 +1763,7 @@ |
1545 | void static_context::apply_url_resolvers( |
1546 | std::vector<zstring>& aUrls, |
1547 | internal::EntityData const* aEntityData, |
1548 | - std::auto_ptr<internal::Resource>& oResource, |
1549 | + std::unique_ptr<internal::Resource>& oResource, |
1550 | zstring& oErrorMessage) const |
1551 | { |
1552 | oErrorMessage.clear(); |
1553 | @@ -1778,14 +1787,14 @@ |
1554 | sctx != NULL; sctx = sctx->theParent) |
1555 | { |
1556 | // Iterate through all available resolvers on this static_context... |
1557 | - for (ztd::auto_vector<internal::URLResolver>::const_iterator resolver = |
1558 | + for (std::vector<internal::URLResolver*>::const_iterator resolver = |
1559 | sctx->theURLResolvers.begin(); |
1560 | resolver != sctx->theURLResolvers.end(); resolver++) |
1561 | { |
1562 | try |
1563 | { |
1564 | // Take ownership of returned Resource (if any) |
1565 | - oResource.reset((*resolver)->resolveURL(*url, aEntityData)); |
1566 | + oResource.reset((**resolver).resolveURL(*url, aEntityData)); |
1567 | if (oResource.get() != NULL) |
1568 | { |
1569 | // Populate the URL used to load this Resource |
1570 | |
1571 | === modified file 'src/context/static_context.h' |
1572 | --- src/context/static_context.h 2013-09-09 23:47:17 +0000 |
1573 | +++ src/context/static_context.h 2013-09-17 23:08:54 +0000 |
1574 | @@ -19,7 +19,6 @@ |
1575 | |
1576 | #include <deque> |
1577 | #include <map> |
1578 | -#include <memory> |
1579 | #include <set> |
1580 | #include <vector> |
1581 | |
1582 | @@ -28,6 +27,7 @@ |
1583 | #include <zorba/function.h> |
1584 | #include <zorba/error.h> |
1585 | #include <zorba/diagnostic_list.h> |
1586 | +#include <zorba/internal/unique_ptr.h> |
1587 | |
1588 | #ifdef WIN32 |
1589 | #include "store/api/item.h" |
1590 | @@ -47,7 +47,6 @@ |
1591 | #include "common/shared_types.h" |
1592 | |
1593 | #include "util/stl_util.h" |
1594 | -#include "util/auto_vector.h" |
1595 | |
1596 | |
1597 | namespace zorba |
1598 | @@ -592,9 +591,9 @@ |
1599 | |
1600 | BaseUriInfo * theBaseUriInfo; |
1601 | |
1602 | - ztd::auto_vector<internal::URIMapper> theURIMappers; |
1603 | + std::vector<internal::URIMapper*> theURIMappers; |
1604 | |
1605 | - ztd::auto_vector<internal::URLResolver> theURLResolvers; |
1606 | + std::vector<internal::URLResolver*> theURLResolvers; |
1607 | |
1608 | checked_vector<zstring> theURIPath; |
1609 | |
1610 | @@ -776,7 +775,7 @@ |
1611 | * Given a URI, return a Resource for that URI. |
1612 | * @param aEntityKind the expected kind of entity expected at this aUri |
1613 | */ |
1614 | - std::auto_ptr<internal::Resource> resolve_uri( |
1615 | + std::unique_ptr<internal::Resource> resolve_uri( |
1616 | const zstring& aUri, |
1617 | internal::EntityData::Kind aEntityKind, |
1618 | zstring& oErrorMessage) const; |
1619 | @@ -785,7 +784,7 @@ |
1620 | * Given a URI, return a Resource for that URI. |
1621 | * @param aEntityData an EntityData object to pass to the mappers/resolvers. |
1622 | */ |
1623 | - std::auto_ptr<internal::Resource> resolve_uri( |
1624 | + std::unique_ptr<internal::Resource> resolve_uri( |
1625 | const zstring& aUri, |
1626 | const internal::EntityData& aEntityData, |
1627 | zstring& oErrorMessage) const; |
1628 | @@ -1171,7 +1170,7 @@ |
1629 | void apply_url_resolvers( |
1630 | std::vector<zstring>& aUrls, |
1631 | internal::EntityData const* aEntityData, |
1632 | - std::auto_ptr<internal::Resource>& oResource, |
1633 | + std::unique_ptr<internal::Resource>& oResource, |
1634 | zstring& oErrorMessage) const; |
1635 | }; |
1636 | |
1637 | |
1638 | === modified file 'src/context/uri_resolver.h' |
1639 | --- src/context/uri_resolver.h 2013-06-11 23:38:49 +0000 |
1640 | +++ src/context/uri_resolver.h 2013-09-17 23:08:54 +0000 |
1641 | @@ -28,10 +28,8 @@ |
1642 | * default_url_resolvers.h/cpp and default_uri_mappers.h/cpp. |
1643 | */ |
1644 | |
1645 | -#include <memory> |
1646 | #include <istream> |
1647 | #include <zorbatypes/zstring.h> |
1648 | -#include <util/auto_vector.h> |
1649 | #include <store/api/shared_types.h> |
1650 | #include <zorba/streams.h> |
1651 | #include <zorba/util/locale.h> |
1652 | |
1653 | === modified file 'src/debugger/debugger_communicator.cpp' |
1654 | --- src/debugger/debugger_communicator.cpp 2013-02-07 17:24:36 +0000 |
1655 | +++ src/debugger/debugger_communicator.cpp 2013-09-17 23:08:54 +0000 |
1656 | @@ -24,6 +24,7 @@ |
1657 | |
1658 | #include <zorba/error.h> |
1659 | #include <zorba/diagnostic_list.h> |
1660 | +#include <zorba/internal/unique_ptr.h> |
1661 | |
1662 | #include "socket.h" |
1663 | #include "zorbautils/synchronous_logger.h" |
1664 | @@ -86,7 +87,7 @@ |
1665 | for (int i = 0; i < TIMEOUT && !theSocket; i++) { |
1666 | try { |
1667 | // Connect to the client on the given host and port |
1668 | - std::auto_ptr<TCPSocket> lSocket(new TCPSocket(theHost, thePort)); |
1669 | + std::unique_ptr<TCPSocket> lSocket(new TCPSocket(theHost, thePort)); |
1670 | theSocket = lSocket.release(); |
1671 | theSocketInStream = new SocketStreambuf(*theSocket); |
1672 | theSocketOutStream = new SocketStreambuf(*theSocket); |
1673 | |
1674 | === modified file 'src/debugger/debugger_event_listener.cpp' |
1675 | --- src/debugger/debugger_event_listener.cpp 2013-02-07 17:24:36 +0000 |
1676 | +++ src/debugger/debugger_event_listener.cpp 2013-09-17 23:08:54 +0000 |
1677 | @@ -16,8 +16,6 @@ |
1678 | |
1679 | #include "debugger_event_listener.h" |
1680 | |
1681 | -#include <memory> |
1682 | - |
1683 | #include "api/unmarshaller.h" |
1684 | |
1685 | #include "debugger/socket.h" |
1686 | @@ -29,6 +27,7 @@ |
1687 | #include "zorbautils/synchronous_logger.h" |
1688 | |
1689 | #include "util/ascii_util.h" |
1690 | +#include <zorba/internal/unique_ptr.h> |
1691 | |
1692 | namespace zorba { |
1693 | |
1694 | @@ -51,7 +50,7 @@ |
1695 | try { |
1696 | theSocket = theClient->theEventServerSocket->accept(); |
1697 | while (theClient->getExecutionStatus() != QUERY_TERMINATED) { |
1698 | - std::auto_ptr<AbstractMessage> lMessage(MessageFactory::buildMessage(theSocket)); |
1699 | + std::unique_ptr<AbstractMessage> lMessage(MessageFactory::buildMessage(theSocket)); |
1700 | SuspendedEvent* lSuspendedMsg; |
1701 | EvaluatedEvent* lEvaluatedEvent; |
1702 | if ((lSuspendedMsg = dynamic_cast<SuspendedEvent*> (lMessage.get()))) { |
1703 | |
1704 | === modified file 'src/debugger/debugger_runtime.cpp' |
1705 | --- src/debugger/debugger_runtime.cpp 2013-02-07 17:24:36 +0000 |
1706 | +++ src/debugger/debugger_runtime.cpp 2013-09-17 23:08:54 +0000 |
1707 | @@ -18,7 +18,6 @@ |
1708 | |
1709 | #include "debugger_runtime.h" |
1710 | |
1711 | -#include <memory> |
1712 | #include <vector> |
1713 | #include <sstream> |
1714 | #include <iomanip> |
1715 | |
1716 | === modified file 'src/functions/library.cpp' |
1717 | --- src/functions/library.cpp 2013-08-21 23:52:57 +0000 |
1718 | +++ src/functions/library.cpp 2013-09-17 23:08:54 +0000 |
1719 | @@ -16,7 +16,6 @@ |
1720 | #include "stdafx.h" |
1721 | |
1722 | #include <iostream> |
1723 | -#include <memory> |
1724 | |
1725 | #include "zorbamisc/ns_consts.h" |
1726 | |
1727 | |
1728 | === modified file 'src/precompiled/stdafx.h' |
1729 | --- src/precompiled/stdafx.h 2013-06-12 00:21:05 +0000 |
1730 | +++ src/precompiled/stdafx.h 2013-09-17 23:08:54 +0000 |
1731 | @@ -21,7 +21,6 @@ |
1732 | #include <stdexcept> |
1733 | #include <cassert> |
1734 | #include <cstring> |
1735 | - #include <memory> |
1736 | |
1737 | #include <sstream> |
1738 | #include <istream> |
1739 | |
1740 | === modified file 'src/runtime/collections/collections_impl.cpp' |
1741 | --- src/runtime/collections/collections_impl.cpp 2013-07-25 14:09:47 +0000 |
1742 | +++ src/runtime/collections/collections_impl.cpp 2013-09-17 23:08:54 +0000 |
1743 | @@ -20,6 +20,7 @@ |
1744 | #include "diagnostics/assert.h" |
1745 | #include "diagnostics/util_macros.h" |
1746 | #include "diagnostics/xquery_diagnostics.h" |
1747 | +#include <zorba/internal/unique_ptr.h> |
1748 | |
1749 | #include "zorbatypes/URI.h" |
1750 | #include "zorbatypes/numconversions.h" |
1751 | @@ -178,7 +179,7 @@ |
1752 | { |
1753 | store::Item_t uriItem; |
1754 | store::Collection_t coll; |
1755 | - std::auto_ptr<internal::Resource> resource; |
1756 | + std::unique_ptr<internal::Resource> resource; |
1757 | internal::CollectionResource* collResource; |
1758 | zstring resolvedURI; |
1759 | zstring errorMessage; |
1760 | @@ -489,7 +490,7 @@ |
1761 | const StaticallyKnownCollection* collectionDecl; |
1762 | store::Item_t node; |
1763 | store::Item_t copyNode; |
1764 | - std::auto_ptr<store::PUL> pul; |
1765 | + std::unique_ptr<store::PUL> pul; |
1766 | |
1767 | PlanIteratorState* state; |
1768 | DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState); |
1769 | @@ -605,7 +606,7 @@ |
1770 | { |
1771 | store::Item_t name; |
1772 | store::Collection_t collection; |
1773 | - std::auto_ptr<store::PUL> pul; |
1774 | + std::unique_ptr<store::PUL> pul; |
1775 | |
1776 | PlanIteratorState* state; |
1777 | DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState); |
1778 | @@ -636,7 +637,7 @@ |
1779 | PlanState& planState) const |
1780 | { |
1781 | std::vector<store::Item_t> nodes; |
1782 | - std::auto_ptr<store::PUL> pul; |
1783 | + std::unique_ptr<store::PUL> pul; |
1784 | store::Item_t name; |
1785 | |
1786 | PlanIteratorState* state; |
1787 | @@ -708,7 +709,7 @@ |
1788 | PlanState& planState) const |
1789 | { |
1790 | std::vector<store::Item_t> nodes; |
1791 | - std::auto_ptr<store::PUL> pul; |
1792 | + std::unique_ptr<store::PUL> pul; |
1793 | store::Item_t name; |
1794 | |
1795 | PlanIteratorState* state; |
1796 | @@ -794,7 +795,7 @@ |
1797 | PlanState& planState) const |
1798 | { |
1799 | std::vector<store::Item_t> nodes; |
1800 | - std::auto_ptr<store::PUL> pul; |
1801 | + std::unique_ptr<store::PUL> pul; |
1802 | store::Item_t name; |
1803 | |
1804 | PlanIteratorState* state; |
1805 | @@ -873,7 +874,7 @@ |
1806 | store::Item_t targetNode; |
1807 | store::Item_t node; |
1808 | std::vector<store::Item_t> nodes; |
1809 | - std::auto_ptr<store::PUL> pul; |
1810 | + std::unique_ptr<store::PUL> pul; |
1811 | |
1812 | PlanIteratorState* state; |
1813 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1814 | @@ -959,7 +960,7 @@ |
1815 | { |
1816 | store::Item_t name; |
1817 | std::vector<store::Item_t> nodes; |
1818 | - std::auto_ptr<store::PUL> pul; |
1819 | + std::unique_ptr<store::PUL> pul; |
1820 | store::Item_t targetNode; |
1821 | |
1822 | store::CopyMode lCopyMode; |
1823 | @@ -1061,7 +1062,7 @@ |
1824 | store::Item_t& result, |
1825 | PlanState& planState) const |
1826 | { |
1827 | - std::auto_ptr<store::PUL> pul; |
1828 | + std::unique_ptr<store::PUL> pul; |
1829 | std::vector<store::Item_t> nodes; |
1830 | store::Item_t name; |
1831 | |
1832 | @@ -1146,7 +1147,7 @@ |
1833 | store::Item_t& result, |
1834 | PlanState& planState) const |
1835 | { |
1836 | - std::auto_ptr<store::PUL> pul; |
1837 | + std::unique_ptr<store::PUL> pul; |
1838 | std::vector<store::Item_t> nodes; |
1839 | store::Item_t name; |
1840 | |
1841 | @@ -1230,7 +1231,7 @@ |
1842 | store::Item_t& result, |
1843 | PlanState& planState) const |
1844 | { |
1845 | - std::auto_ptr<store::PUL> pul; |
1846 | + std::unique_ptr<store::PUL> pul; |
1847 | std::vector<store::Item_t> nodes; |
1848 | store::Item_t name; |
1849 | |
1850 | @@ -1314,7 +1315,7 @@ |
1851 | store::Item_t& result, |
1852 | PlanState& planState) const |
1853 | { |
1854 | - std::auto_ptr<store::PUL> pul; |
1855 | + std::unique_ptr<store::PUL> pul; |
1856 | std::vector<store::Item_t> nodes; |
1857 | store::Item_t name; |
1858 | store::Item_t targetNode; |
1859 | @@ -1403,7 +1404,7 @@ |
1860 | store::Item_t& result, |
1861 | PlanState& planState) const |
1862 | { |
1863 | - std::auto_ptr<store::PUL> pul; |
1864 | + std::unique_ptr<store::PUL> pul; |
1865 | std::vector<store::Item_t> nodes; |
1866 | store::Item_t name; |
1867 | store::Item_t targetNode; |
1868 | @@ -1479,7 +1480,7 @@ |
1869 | store::Item_t name; |
1870 | store::Item_t node; |
1871 | std::vector<store::Item_t> nodes; |
1872 | - std::auto_ptr<store::PUL> pul; |
1873 | + std::unique_ptr<store::PUL> pul; |
1874 | |
1875 | PlanIteratorState* state; |
1876 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1877 | @@ -1583,7 +1584,7 @@ |
1878 | store::Item_t numNodesItem; |
1879 | xs_integer numNodes( 1 ); |
1880 | std::vector<store::Item_t> nodes; |
1881 | - std::auto_ptr<store::PUL> pul; |
1882 | + std::unique_ptr<store::PUL> pul; |
1883 | |
1884 | PlanIteratorState* state; |
1885 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1886 | @@ -1674,7 +1675,7 @@ |
1887 | store::Item_t numNodesItem; |
1888 | xs_integer numNodes( 1 ); |
1889 | std::vector<store::Item_t> nodes; |
1890 | - std::auto_ptr<store::PUL> pul; |
1891 | + std::unique_ptr<store::PUL> pul; |
1892 | |
1893 | PlanIteratorState* state; |
1894 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1895 | @@ -1774,7 +1775,7 @@ |
1896 | store::Item_t content; |
1897 | store::CopyMode lCopyMode; |
1898 | |
1899 | - std::auto_ptr<store::PUL> pul; |
1900 | + std::unique_ptr<store::PUL> pul; |
1901 | |
1902 | PlanIteratorState* state; |
1903 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1904 | @@ -1890,7 +1891,7 @@ |
1905 | { |
1906 | store::Collection_t collection; |
1907 | store::Item_t collectionName; |
1908 | - std::auto_ptr<store::PUL> pul; |
1909 | + std::unique_ptr<store::PUL> pul; |
1910 | |
1911 | PlanIteratorState* state; |
1912 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1913 | @@ -2514,7 +2515,7 @@ |
1914 | { |
1915 | store::Item_t lURI, resolvedURIItem, lIte; |
1916 | store::Collection_t coll; |
1917 | - std::auto_ptr<internal::Resource> lResource; |
1918 | + std::unique_ptr<internal::Resource> lResource; |
1919 | internal::CollectionResource* lCollResource; |
1920 | zstring resolvedURIString; |
1921 | zstring lErrorMessage; |
1922 | |
1923 | === modified file 'src/runtime/context/context_impl.cpp' |
1924 | --- src/runtime/context/context_impl.cpp 2013-02-07 17:24:36 +0000 |
1925 | +++ src/runtime/context/context_impl.cpp 2013-09-17 23:08:54 +0000 |
1926 | @@ -15,8 +15,6 @@ |
1927 | */ |
1928 | #include "stdafx.h" |
1929 | |
1930 | -#include <memory> |
1931 | - |
1932 | #include "system/globalenv.h" |
1933 | |
1934 | #include "compiler/api/compilercb.h" |
1935 | @@ -31,6 +29,7 @@ |
1936 | |
1937 | #include "store/api/item_factory.h" |
1938 | |
1939 | +#include <zorba/internal/unique_ptr.h> |
1940 | |
1941 | namespace zorba |
1942 | { |
1943 | @@ -53,7 +52,7 @@ |
1944 | CurrentDateIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1945 | { |
1946 | store::Item_t itemRes; |
1947 | - std::auto_ptr<xs_date> d; |
1948 | + std::unique_ptr<xs_date> d; |
1949 | |
1950 | PlanIteratorState* state; |
1951 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1952 | @@ -73,7 +72,7 @@ |
1953 | CurrentTimeIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1954 | { |
1955 | store::Item_t itemRes; |
1956 | - std::auto_ptr<xs_time> t; |
1957 | + std::unique_ptr<xs_time> t; |
1958 | |
1959 | PlanIteratorState* state; |
1960 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1961 | @@ -94,7 +93,7 @@ |
1962 | long secs; |
1963 | bool neg; |
1964 | xs_dayTimeDuration dtd; |
1965 | - std::auto_ptr<Duration> dur; |
1966 | + std::unique_ptr<Duration> dur; |
1967 | |
1968 | PlanIteratorState* state; |
1969 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1970 | @@ -103,7 +102,7 @@ |
1971 | neg = secs < 0; |
1972 | if (neg) |
1973 | secs = -secs; |
1974 | - dur = std::auto_ptr<Duration>(new Duration(Duration::DAYTIMEDURATION_FACET, neg, 0, 0, 0, 0, 0 , secs)); |
1975 | + dur = std::unique_ptr<Duration>(new Duration(Duration::DAYTIMEDURATION_FACET, neg, 0, 0, 0, 0, 0 , secs)); |
1976 | |
1977 | STACK_PUSH( GENV_ITEMFACTORY->createDayTimeDuration(result, dur.get()), state ); |
1978 | |
1979 | |
1980 | === modified file 'src/runtime/core/arithmetic_impl.cpp' |
1981 | --- src/runtime/core/arithmetic_impl.cpp 2013-06-11 05:40:04 +0000 |
1982 | +++ src/runtime/core/arithmetic_impl.cpp 2013-09-17 23:08:54 +0000 |
1983 | @@ -42,6 +42,8 @@ |
1984 | |
1985 | #include "store/api/item_factory.h" |
1986 | |
1987 | +#include <zorba/internal/unique_ptr.h> |
1988 | + |
1989 | namespace zorba { |
1990 | |
1991 | SERIALIZABLE_TEMPLATE_INSTANCE(GenericArithIterator, |
1992 | @@ -342,7 +344,7 @@ |
1993 | const store::Item* i0, |
1994 | const store::Item* i1 ) |
1995 | { |
1996 | - std::auto_ptr<Duration> d(i0->getYearMonthDurationValue() + i1->getYearMonthDurationValue()); |
1997 | + std::unique_ptr<Duration> d(i0->getYearMonthDurationValue() + i1->getYearMonthDurationValue()); |
1998 | return GENV_ITEMFACTORY->createYearMonthDuration(result, d.get()); |
1999 | } |
2000 | |
2001 | @@ -356,7 +358,7 @@ |
2002 | const store::Item* i0, |
2003 | const store::Item* i1 ) |
2004 | { |
2005 | - std::auto_ptr<Duration> d(i0->getDayTimeDurationValue() + i1->getDayTimeDurationValue()); |
2006 | + std::unique_ptr<Duration> d(i0->getDayTimeDurationValue() + i1->getDayTimeDurationValue()); |
2007 | return GENV_ITEMFACTORY->createDayTimeDuration(result, d.get()); |
2008 | } |
2009 | |
2010 | @@ -370,7 +372,7 @@ |
2011 | const store::Item* i0, |
2012 | const store::Item* i1) |
2013 | { |
2014 | - std::auto_ptr<xs_dateTime> d(i0->getDateTimeValue().addDuration(i1->getDurationValue())); |
2015 | + std::unique_ptr<xs_dateTime> d(i0->getDateTimeValue().addDuration(i1->getDurationValue())); |
2016 | return GENV_ITEMFACTORY->createDateTime(result, d.get()); |
2017 | } |
2018 | |
2019 | @@ -384,7 +386,7 @@ |
2020 | const store::Item* i0, |
2021 | const store::Item* i1) |
2022 | { |
2023 | - std::auto_ptr<xs_dateTime> d(i1->getDateTimeValue().addDuration(i0->getDurationValue())); |
2024 | + std::unique_ptr<xs_dateTime> d(i1->getDateTimeValue().addDuration(i0->getDurationValue())); |
2025 | return GENV_ITEMFACTORY->createDateTime(result, d.get()); |
2026 | } |
2027 | |
2028 | @@ -398,7 +400,7 @@ |
2029 | const store::Item* i0, |
2030 | const store::Item* i1) |
2031 | { |
2032 | - std::auto_ptr<xs_date> d(i0->getDateValue().addDuration(i1->getDurationValue())); |
2033 | + std::unique_ptr<xs_date> d(i0->getDateValue().addDuration(i1->getDurationValue())); |
2034 | return GENV_ITEMFACTORY->createDate(result, d.get()); |
2035 | } |
2036 | |
2037 | @@ -412,7 +414,7 @@ |
2038 | const store::Item* i0, |
2039 | const store::Item* i1 ) |
2040 | { |
2041 | - std::auto_ptr<xs_date> d(i1->getDateValue().addDuration(i0->getDurationValue())); |
2042 | + std::unique_ptr<xs_date> d(i1->getDateValue().addDuration(i0->getDurationValue())); |
2043 | return GENV_ITEMFACTORY->createDate (result, d.get()); |
2044 | } |
2045 | |
2046 | @@ -426,7 +428,7 @@ |
2047 | const store::Item* i0, |
2048 | const store::Item* i1 ) |
2049 | { |
2050 | - std::auto_ptr<xs_time> t(i0->getTimeValue().addDuration(i1->getDurationValue())); |
2051 | + std::unique_ptr<xs_time> t(i0->getTimeValue().addDuration(i1->getDurationValue())); |
2052 | return GENV_ITEMFACTORY->createTime (result, t.get()); |
2053 | } |
2054 | |
2055 | @@ -440,7 +442,7 @@ |
2056 | const store::Item* i0, |
2057 | const store::Item* i1 ) |
2058 | { |
2059 | - std::auto_ptr<xs_time> t(i1->getTimeValue().addDuration(i0->getDurationValue())); |
2060 | + std::unique_ptr<xs_time> t(i1->getTimeValue().addDuration(i0->getDurationValue())); |
2061 | return GENV_ITEMFACTORY->createTime (result, t.get()); |
2062 | } |
2063 | |
2064 | @@ -458,7 +460,7 @@ |
2065 | const store::Item* i0, |
2066 | const store::Item* i1 ) |
2067 | { |
2068 | - std::auto_ptr<Duration> d(i0->getYearMonthDurationValue() - |
2069 | + std::unique_ptr<Duration> d(i0->getYearMonthDurationValue() - |
2070 | i1->getYearMonthDurationValue()); |
2071 | |
2072 | return GENV_ITEMFACTORY->createYearMonthDuration(result, d.get()); |
2073 | @@ -474,7 +476,7 @@ |
2074 | const store::Item* i0, |
2075 | const store::Item* i1) |
2076 | { |
2077 | - std::auto_ptr<Duration> d(i0->getDayTimeDurationValue() - |
2078 | + std::unique_ptr<Duration> d(i0->getDayTimeDurationValue() - |
2079 | i1->getDayTimeDurationValue()); |
2080 | |
2081 | return GENV_ITEMFACTORY->createDayTimeDuration(result, d.get()); |
2082 | @@ -490,7 +492,7 @@ |
2083 | const store::Item* i0, |
2084 | const store::Item* i1) |
2085 | { |
2086 | - std::auto_ptr<xs_dateTime> d(i0->getDateTimeValue().subtractDuration(i1->getDurationValue())); |
2087 | + std::unique_ptr<xs_dateTime> d(i0->getDateTimeValue().subtractDuration(i1->getDurationValue())); |
2088 | return GENV_ITEMFACTORY->createDateTime(result, d.get()); |
2089 | } |
2090 | |
2091 | @@ -504,7 +506,7 @@ |
2092 | const store::Item* i0, |
2093 | const store::Item* i1) |
2094 | { |
2095 | - std::auto_ptr<xs_date> d(i0->getDateValue().subtractDuration(i1->getDurationValue())); |
2096 | + std::unique_ptr<xs_date> d(i0->getDateValue().subtractDuration(i1->getDurationValue())); |
2097 | return GENV_ITEMFACTORY->createDate(result, d.get()); |
2098 | } |
2099 | |
2100 | @@ -518,7 +520,7 @@ |
2101 | const store::Item* i0, |
2102 | const store::Item* i1) |
2103 | { |
2104 | - std::auto_ptr<xs_time> t(i0->getTimeValue().subtractDuration(i1->getDurationValue())); |
2105 | + std::unique_ptr<xs_time> t(i0->getTimeValue().subtractDuration(i1->getDurationValue())); |
2106 | return GENV_ITEMFACTORY->createTime(result, t.get()); |
2107 | } |
2108 | |
2109 | @@ -532,7 +534,7 @@ |
2110 | const store::Item* i0, |
2111 | const store::Item* i1) |
2112 | { |
2113 | - std::auto_ptr<Duration> d; |
2114 | + std::unique_ptr<Duration> d; |
2115 | try |
2116 | { |
2117 | d.reset(i0->getDateTimeValue().subtractDateTime(&i1->getDateTimeValue(), |
2118 | @@ -555,7 +557,7 @@ |
2119 | const store::Item* i0, |
2120 | const store::Item* i1) |
2121 | { |
2122 | - std::auto_ptr<Duration> d; |
2123 | + std::unique_ptr<Duration> d; |
2124 | try |
2125 | { |
2126 | d.reset(i0->getTimeValue().subtractDateTime(&i1->getTimeValue(), |
2127 | @@ -578,7 +580,7 @@ |
2128 | const store::Item* i0, |
2129 | const store::Item* i1) |
2130 | { |
2131 | - std::auto_ptr<Duration> d; |
2132 | + std::unique_ptr<Duration> d; |
2133 | try |
2134 | { |
2135 | d.reset(i0->getTimeValue().subtractDateTime(&i1->getTimeValue(), |
2136 | @@ -605,7 +607,7 @@ |
2137 | const store::Item* i0, |
2138 | const store::Item* i1) |
2139 | { |
2140 | - std::auto_ptr<Duration> d; |
2141 | + std::unique_ptr<Duration> d; |
2142 | |
2143 | if ( i1->getDoubleValue().isPosInf() || i1->getDoubleValue().isNegInf() ) |
2144 | throw XQUERY_EXCEPTION( err::FODT0002, ERROR_LOC( loc ) ); |
2145 | @@ -631,7 +633,7 @@ |
2146 | const store::Item* i0, |
2147 | const store::Item* i1) |
2148 | { |
2149 | - std::auto_ptr<Duration> d; |
2150 | + std::unique_ptr<Duration> d; |
2151 | |
2152 | if ( i1->getDoubleValue().isPosInf() || i1->getDoubleValue().isNegInf() ) |
2153 | throw XQUERY_EXCEPTION( err::FODT0002, ERROR_LOC( loc ) ); |
2154 | @@ -687,18 +689,18 @@ |
2155 | const store::Item* i0, |
2156 | const store::Item* i1) |
2157 | { |
2158 | - std::auto_ptr<Duration> d; |
2159 | + std::unique_ptr<Duration> d; |
2160 | |
2161 | if( i1->getDoubleValue().isPosInf() || i1->getDoubleValue().isNegInf() ) |
2162 | { |
2163 | - d = std::auto_ptr<Duration>(new Duration(Duration::YEARMONTHDURATION_FACET)); |
2164 | + d = std::unique_ptr<Duration>(new Duration(Duration::YEARMONTHDURATION_FACET)); |
2165 | } |
2166 | else if ( i1->getDoubleValue().isZero() ) |
2167 | throw XQUERY_EXCEPTION( err::FODT0002, ERROR_LOC( loc ) ); |
2168 | else if ( i1->getDoubleValue().isNaN() ) |
2169 | throw XQUERY_EXCEPTION( err::FOCA0005, ERROR_LOC( loc ) ); |
2170 | else try { |
2171 | - d = std::auto_ptr<Duration>(i0->getYearMonthDurationValue() / i1->getDoubleValue()); |
2172 | + d = std::unique_ptr<Duration>(i0->getYearMonthDurationValue() / i1->getDoubleValue()); |
2173 | } catch (XQueryException& e) { |
2174 | set_source(e, *loc); |
2175 | throw; |
2176 | @@ -717,7 +719,7 @@ |
2177 | const store::Item* i0, |
2178 | const store::Item* i1 ) |
2179 | { |
2180 | - std::auto_ptr<Duration> d; |
2181 | + std::unique_ptr<Duration> d; |
2182 | |
2183 | if( i1->getDoubleValue().isPosInf() || i1->getDoubleValue().isNegInf() ) |
2184 | { |
2185 | |
2186 | === modified file 'src/runtime/core/flwor_iterator.cpp' |
2187 | --- src/runtime/core/flwor_iterator.cpp 2013-05-28 18:20:54 +0000 |
2188 | +++ src/runtime/core/flwor_iterator.cpp 2013-09-17 23:08:54 +0000 |
2189 | @@ -35,6 +35,7 @@ |
2190 | #include "store/api/store.h" |
2191 | #include "store/api/pul.h" |
2192 | #include "store/api/item_factory.h" |
2193 | +#include <zorba/internal/unique_ptr.h> |
2194 | |
2195 | |
2196 | #ifndef WIN32 |
2197 | @@ -1482,7 +1483,7 @@ |
2198 | { |
2199 | ZORBA_ASSERT(theGroupByClause); |
2200 | |
2201 | - std::auto_ptr<GroupTuple> groupTuple(new GroupTuple()); |
2202 | + std::unique_ptr<GroupTuple> groupTuple(new GroupTuple()); |
2203 | std::vector<store::Item_t>& groupTupleItems = groupTuple->theItems; |
2204 | |
2205 | std::vector<GroupingSpec> groupSpecs = theGroupByClause->theGroupingSpecs; |
2206 | |
2207 | === modified file 'src/runtime/core/gflwor/groupby_iterator.cpp' |
2208 | --- src/runtime/core/gflwor/groupby_iterator.cpp 2013-05-28 18:20:54 +0000 |
2209 | +++ src/runtime/core/gflwor/groupby_iterator.cpp 2013-09-17 23:08:54 +0000 |
2210 | @@ -30,6 +30,8 @@ |
2211 | |
2212 | #include "system/globalenv.h" |
2213 | |
2214 | +#include <zorba/internal/unique_ptr.h> |
2215 | + |
2216 | using namespace zorba; |
2217 | |
2218 | namespace zorba |
2219 | @@ -356,7 +358,7 @@ |
2220 | { |
2221 | store::Item_t temp; |
2222 | |
2223 | - std::auto_ptr<GroupTuple> groupTuple(new GroupTuple()); |
2224 | + std::unique_ptr<GroupTuple> groupTuple(new GroupTuple()); |
2225 | std::vector<store::Item_t>& groupTupleItems = groupTuple->theItems; |
2226 | |
2227 | csize numVars = theGroupingSpecs.size(); |
2228 | |
2229 | === modified file 'src/runtime/core/gflwor/tuplestream_iterator.cpp' |
2230 | --- src/runtime/core/gflwor/tuplestream_iterator.cpp 2013-02-07 17:24:36 +0000 |
2231 | +++ src/runtime/core/gflwor/tuplestream_iterator.cpp 2013-09-17 23:08:54 +0000 |
2232 | @@ -26,6 +26,8 @@ |
2233 | #include "store/api/store.h" |
2234 | #include "store/api/item_factory.h" |
2235 | |
2236 | +#include <zorba/internal/unique_ptr.h> |
2237 | + |
2238 | using namespace zorba; |
2239 | |
2240 | namespace zorba |
2241 | @@ -60,7 +62,7 @@ |
2242 | //theChild1 == ReturnClause |
2243 | bool TupleStreamIterator::nextImpl(store::Item_t& aResult, PlanState& aPlanState) const |
2244 | { |
2245 | - std::auto_ptr<store::PUL> pul; |
2246 | + std::unique_ptr<store::PUL> pul; |
2247 | store::Item_t lTuple; |
2248 | |
2249 | PlanIteratorState* lState; |
2250 | |
2251 | === modified file 'src/runtime/durations_dates_times/DurationsDatesTimesImpl.cpp' |
2252 | --- src/runtime/durations_dates_times/DurationsDatesTimesImpl.cpp 2013-03-26 20:23:10 +0000 |
2253 | +++ src/runtime/durations_dates_times/DurationsDatesTimesImpl.cpp 2013-09-17 23:08:54 +0000 |
2254 | @@ -23,6 +23,7 @@ |
2255 | #include "zorbatypes/datetime/parse.h" |
2256 | #include "util/ascii_util.h" |
2257 | #include "util/string_util.h" |
2258 | +#include <zorba/internal/unique_ptr.h> |
2259 | |
2260 | #include "system/globalenv.h" |
2261 | |
2262 | @@ -97,7 +98,7 @@ |
2263 | { |
2264 | store::Item_t item0; |
2265 | store::Item_t item1; |
2266 | - std::auto_ptr<DateTime> dt; |
2267 | + std::unique_ptr<DateTime> dt; |
2268 | |
2269 | PlanIteratorState* state; |
2270 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2271 | @@ -111,7 +112,7 @@ |
2272 | { |
2273 | try |
2274 | { |
2275 | - dt = std::auto_ptr<DateTime>(item0->getDateTimeValue().adjustToTimeZone( |
2276 | + dt = std::unique_ptr<DateTime>(item0->getDateTimeValue().adjustToTimeZone( |
2277 | planState.theLocalDynCtx->get_implicit_timezone())); |
2278 | } |
2279 | catch (InvalidTimezoneException const &e) |
2280 | @@ -147,7 +148,7 @@ |
2281 | store::Item_t item0; |
2282 | store::Item_t item1; |
2283 | bool s1; |
2284 | - std::auto_ptr<DateTime> dt; |
2285 | + std::unique_ptr<DateTime> dt; |
2286 | |
2287 | PlanIteratorState* state; |
2288 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2289 | @@ -161,7 +162,7 @@ |
2290 | s1 = consumeNext(item1, theChild1.getp(), planState); |
2291 | try |
2292 | { |
2293 | - dt = std::auto_ptr<DateTime>(item0->getDateTimeValue().adjustToTimeZone(!s1 ? NULL : &item1->getDayTimeDurationValue())); |
2294 | + dt = std::unique_ptr<DateTime>(item0->getDateTimeValue().adjustToTimeZone(!s1 ? NULL : &item1->getDayTimeDurationValue())); |
2295 | } |
2296 | catch (InvalidTimezoneException const &e) |
2297 | { |
2298 | |
2299 | === modified file 'src/runtime/eval/eval.h' |
2300 | --- src/runtime/eval/eval.h 2013-07-26 12:45:00 +0000 |
2301 | +++ src/runtime/eval/eval.h 2013-09-17 23:08:54 +0000 |
2302 | @@ -23,6 +23,8 @@ |
2303 | |
2304 | #include "runtime/base/narybase.h" |
2305 | |
2306 | +#include <zorba/internal/unique_ptr.h> |
2307 | + |
2308 | namespace zorba { |
2309 | |
2310 | |
2311 | @@ -31,8 +33,8 @@ |
2312 | public: |
2313 | PlanIter_t thePlan; |
2314 | PlanWrapper_t thePlanWrapper; |
2315 | - std::auto_ptr<CompilerCB> ccb; |
2316 | - std::auto_ptr<dynamic_context> dctx; |
2317 | + std::unique_ptr<CompilerCB> ccb; |
2318 | + std::unique_ptr<dynamic_context> dctx; |
2319 | |
2320 | public: |
2321 | EvalIteratorState(); |
2322 | |
2323 | === modified file 'src/runtime/fetch/fetch_impl.cpp' |
2324 | --- src/runtime/fetch/fetch_impl.cpp 2013-06-11 23:38:49 +0000 |
2325 | +++ src/runtime/fetch/fetch_impl.cpp 2013-09-17 23:08:54 +0000 |
2326 | @@ -16,6 +16,7 @@ |
2327 | #include "stdafx.h" |
2328 | |
2329 | #include <zorba/util/transcode_stream.h> |
2330 | +#include <zorba/internal/unique_ptr.h> |
2331 | |
2332 | #include "diagnostics/assert.h" |
2333 | #include "diagnostics/xquery_diagnostics.h" |
2334 | @@ -32,7 +33,7 @@ |
2335 | |
2336 | /******************************************************************************* |
2337 | ********************************************************************************/ |
2338 | -std::auto_ptr<internal::StreamResource> |
2339 | +std::unique_ptr<internal::StreamResource> |
2340 | getFetchResource( |
2341 | const store::Item_t& aUri, |
2342 | const store::Item_t& aKind, |
2343 | @@ -72,12 +73,12 @@ |
2344 | // me a resource of specified kind |
2345 | zstring lErrorMessage; |
2346 | |
2347 | - std::auto_ptr<internal::Resource> lRes = aSctx->resolve_uri( |
2348 | + std::unique_ptr<internal::Resource> lRes = aSctx->resolve_uri( |
2349 | aUri->getStringValue(), |
2350 | lKind, |
2351 | lErrorMessage); |
2352 | |
2353 | - std::auto_ptr<internal::StreamResource> lStreamRes( |
2354 | + std::unique_ptr<internal::StreamResource> lStreamRes( |
2355 | dynamic_cast<internal::StreamResource*>(lRes.get())); |
2356 | |
2357 | if ( !lStreamRes.get() ) |
2358 | @@ -94,7 +95,7 @@ |
2359 | |
2360 | lRes.release(); |
2361 | |
2362 | - return lStreamRes; |
2363 | + return std::move(lStreamRes); |
2364 | |
2365 | } catch (ZorbaException const& e) { |
2366 | throw XQUERY_EXCEPTION( |
2367 | @@ -122,7 +123,7 @@ |
2368 | store::Item_t lEntityKind; |
2369 | store::Item_t lEncoding; |
2370 | zstring lEncodingStr; |
2371 | - std::auto_ptr<internal::StreamResource> lRes; |
2372 | + std::unique_ptr<internal::StreamResource> lRes; |
2373 | |
2374 | PlanIteratorState* state; |
2375 | DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState); |
2376 | @@ -180,7 +181,7 @@ |
2377 | { |
2378 | store::Item_t lUri; |
2379 | store::Item_t lEntityKind; |
2380 | - std::auto_ptr<internal::StreamResource> lRes; |
2381 | + std::unique_ptr<internal::StreamResource> lRes; |
2382 | |
2383 | PlanIteratorState* state; |
2384 | DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState); |
2385 | |
2386 | === modified file 'src/runtime/fnput/fnput_impl.cpp' |
2387 | --- src/runtime/fnput/fnput_impl.cpp 2013-02-07 17:24:36 +0000 |
2388 | +++ src/runtime/fnput/fnput_impl.cpp 2013-09-17 23:08:54 +0000 |
2389 | @@ -27,6 +27,7 @@ |
2390 | #include "store/api/item_factory.h" |
2391 | #include "store/api/copymode.h" |
2392 | #include "zorbatypes/URI.h" |
2393 | +#include <zorba/internal/unique_ptr.h> |
2394 | |
2395 | |
2396 | namespace zorba |
2397 | @@ -43,7 +44,7 @@ |
2398 | zstring resolvedUriString; |
2399 | URI lTargetUri; |
2400 | store::Item_t resolvedUriItem; |
2401 | - std::auto_ptr<store::PUL> pul; |
2402 | + std::unique_ptr<store::PUL> pul; |
2403 | |
2404 | PlanIteratorState* state; |
2405 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2406 | |
2407 | === modified file 'src/runtime/full_text/apply.cpp' |
2408 | --- src/runtime/full_text/apply.cpp 2013-08-07 01:18:50 +0000 |
2409 | +++ src/runtime/full_text/apply.cpp 2013-09-17 23:08:54 +0000 |
2410 | @@ -20,6 +20,7 @@ |
2411 | #include <vector> |
2412 | |
2413 | #include <zorba/internal/cxx_util.h> |
2414 | +#include <zorba/internal/unique_ptr.h> |
2415 | #include <zorba/tokenizer.h> |
2416 | |
2417 | #include "compiler/expression/ftnode.h" |
2418 | @@ -1224,7 +1225,7 @@ |
2419 | zstring const &uri = t_id.get_uri(); |
2420 | |
2421 | zstring error_msg; |
2422 | - auto_ptr<internal::Resource> rsrc = static_ctx_.resolve_uri( |
2423 | + unique_ptr<internal::Resource> rsrc = static_ctx_.resolve_uri( |
2424 | uri, internal::EntityData::THESAURUS, error_msg |
2425 | ); |
2426 | ZORBA_ASSERT( rsrc.get() ); |
2427 | |
2428 | === modified file 'src/runtime/full_text/ft_module_impl.cpp' |
2429 | --- src/runtime/full_text/ft_module_impl.cpp 2013-08-02 18:33:17 +0000 |
2430 | +++ src/runtime/full_text/ft_module_impl.cpp 2013-09-17 23:08:54 +0000 |
2431 | @@ -29,6 +29,7 @@ |
2432 | #include <typeinfo> |
2433 | |
2434 | #include <zorba/diagnostic_list.h> |
2435 | +#include <zorba/internal/unique_ptr.h> |
2436 | |
2437 | #include "api/unmarshaller.h" |
2438 | |
2439 | @@ -368,7 +369,7 @@ |
2440 | static_context const *const sctx = getStaticContext(); |
2441 | ZORBA_ASSERT( sctx ); |
2442 | zstring error_msg; |
2443 | - auto_ptr<internal::Resource> rsrc = sctx->resolve_uri( |
2444 | + unique_ptr<internal::Resource> rsrc = sctx->resolve_uri( |
2445 | uri, internal::EntityData::THESAURUS, error_msg |
2446 | ); |
2447 | if ( !rsrc.get() ) |
2448 | @@ -503,7 +504,7 @@ |
2449 | zstring error_msg; |
2450 | store::Item_t item; |
2451 | iso639_1::type lang; |
2452 | - auto_ptr<internal::Resource> rsrc; |
2453 | + unique_ptr<internal::Resource> rsrc; |
2454 | zstring uri = "##default"; |
2455 | static_context const *sctx; |
2456 | zstring synonym; |
2457 | |
2458 | === modified file 'src/runtime/full_text/ft_stop_words_set.cpp' |
2459 | --- src/runtime/full_text/ft_stop_words_set.cpp 2013-08-02 18:33:02 +0000 |
2460 | +++ src/runtime/full_text/ft_stop_words_set.cpp 2013-09-17 23:08:54 +0000 |
2461 | @@ -17,6 +17,7 @@ |
2462 | |
2463 | #include <zorba/config.h> |
2464 | #include <zorba/internal/cxx_util.h> |
2465 | +#include <zorba/internal/unique_ptr.h> |
2466 | |
2467 | #include "context/static_context.h" |
2468 | #include "context/uri_resolver.h" |
2469 | @@ -126,7 +127,7 @@ |
2470 | } |
2471 | |
2472 | zstring error_msg; |
2473 | - std::auto_ptr<internal::Resource> rsrc = |
2474 | + std::unique_ptr<internal::Resource> rsrc = |
2475 | sctx.resolve_uri( uri, internal::EntityData::STOP_WORDS, error_msg ); |
2476 | internal::StreamResource *const stream_rsrc = |
2477 | dynamic_cast<internal::StreamResource*>( rsrc.get() ); |
2478 | |
2479 | === modified file 'src/runtime/full_text/ftcontains_visitor.cpp' |
2480 | --- src/runtime/full_text/ftcontains_visitor.cpp 2013-06-01 00:30:39 +0000 |
2481 | +++ src/runtime/full_text/ftcontains_visitor.cpp 2013-09-17 23:08:54 +0000 |
2482 | @@ -17,7 +17,6 @@ |
2483 | |
2484 | #include <cmath> /* for fabs(3) */ |
2485 | #include <limits> |
2486 | -#include <memory> |
2487 | |
2488 | #include <zorba/internal/cxx_util.h> |
2489 | |
2490 | |
2491 | === modified file 'src/runtime/hof/fn_hof_functions_impl.cpp' |
2492 | --- src/runtime/hof/fn_hof_functions_impl.cpp 2013-07-02 21:32:23 +0000 |
2493 | +++ src/runtime/hof/fn_hof_functions_impl.cpp 2013-09-17 23:08:54 +0000 |
2494 | @@ -48,6 +48,7 @@ |
2495 | #include "compiler/expression/expr_manager.h" |
2496 | #include "compiler/expression/var_expr.h" |
2497 | |
2498 | +#include <zorba/internal/unique_ptr.h> |
2499 | |
2500 | |
2501 | namespace zorba { |
2502 | @@ -111,7 +112,7 @@ |
2503 | static_context_t impSctx = theSctx->create_child_context(); |
2504 | ccb->theSctxMap[ccb->theSctxMap.size() + 1] = impSctx; |
2505 | |
2506 | - std::auto_ptr<dynamic_context> fiDctx; |
2507 | + std::unique_ptr<dynamic_context> fiDctx; |
2508 | fiDctx.reset(new dynamic_context(planState.theGlobalDynCtx)); |
2509 | |
2510 | if (ctxItem) |
2511 | |
2512 | === modified file 'src/runtime/hof/function_item.cpp' |
2513 | --- src/runtime/hof/function_item.cpp 2013-08-16 13:00:06 +0000 |
2514 | +++ src/runtime/hof/function_item.cpp 2013-09-17 23:08:54 +0000 |
2515 | @@ -16,7 +16,7 @@ |
2516 | #include "stdafx.h" |
2517 | |
2518 | // This include needs to be kept in order to make sure the |
2519 | -// auto_ptr<dynamic_context> manages to dealocate the |
2520 | +// unique_ptr<dynamic_context> manages to dealocate the |
2521 | // dynamic_context object. |
2522 | #include "context/dynamic_context.h" |
2523 | |
2524 | |
2525 | === modified file 'src/runtime/hof/function_item.h' |
2526 | --- src/runtime/hof/function_item.h 2013-08-16 13:00:06 +0000 |
2527 | +++ src/runtime/hof/function_item.h 2013-09-17 23:08:54 +0000 |
2528 | @@ -22,6 +22,8 @@ |
2529 | |
2530 | #include "store/api/item.h" |
2531 | |
2532 | +#include "context/dynamic_context.h" |
2533 | +#include <zorba/internal/unique_ptr.h> |
2534 | |
2535 | namespace zorba |
2536 | { |
2537 | @@ -184,7 +186,7 @@ |
2538 | |
2539 | csize theArity; |
2540 | |
2541 | - std::auto_ptr<dynamic_context> theClosureDctx; |
2542 | + std::unique_ptr<dynamic_context> theClosureDctx; |
2543 | |
2544 | std::vector<PlanIter_t> theArgValues; |
2545 | |
2546 | |
2547 | === modified file 'src/runtime/hof/function_item_iter.cpp' |
2548 | --- src/runtime/hof/function_item_iter.cpp 2013-04-24 01:35:58 +0000 |
2549 | +++ src/runtime/hof/function_item_iter.cpp 2013-09-17 23:08:54 +0000 |
2550 | @@ -16,7 +16,7 @@ |
2551 | #include "stdafx.h" |
2552 | |
2553 | // This include needs to be kept in order to make sure the |
2554 | -// auto_ptr<dynamic_context> manages to dealocate the |
2555 | +// unique_ptr<dynamic_context> manages to dealocate the |
2556 | // dynamic_context object. |
2557 | #include "context/dynamic_context.h" |
2558 | |
2559 | @@ -74,7 +74,7 @@ |
2560 | |
2561 | if (numOuterVars > 0) |
2562 | { |
2563 | - std::auto_ptr<dynamic_context> evalDctx; |
2564 | + std::unique_ptr<dynamic_context> evalDctx; |
2565 | evalDctx.reset(new dynamic_context(planState.theGlobalDynCtx)); |
2566 | |
2567 | for (csize i = 0; i < numOuterVars; ++i) |
2568 | |
2569 | === modified file 'src/runtime/json/jsoniq_functions_impl.cpp' |
2570 | --- src/runtime/json/jsoniq_functions_impl.cpp 2013-08-21 10:25:42 +0000 |
2571 | +++ src/runtime/json/jsoniq_functions_impl.cpp 2013-09-17 23:08:54 +0000 |
2572 | @@ -59,6 +59,7 @@ |
2573 | |
2574 | #include <zorba/store_consts.h> |
2575 | #include <zorbatypes/URI.h> |
2576 | +#include <zorba/internal/unique_ptr.h> |
2577 | |
2578 | #include "json_loader.h" |
2579 | |
2580 | @@ -648,7 +649,7 @@ |
2581 | } |
2582 | |
2583 | // and now serialize |
2584 | - std::auto_ptr<std::stringstream> lResultStream(new std::stringstream()); |
2585 | + std::unique_ptr<std::stringstream> lResultStream(new std::stringstream()); |
2586 | lItemIt->open(); |
2587 | lSerializer.serialize(lItemIt, *lResultStream.get()); |
2588 | lItemIt->close(); |
2589 | |
2590 | === modified file 'src/runtime/parsing_and_serializing/parsing_and_serializing_impl.cpp' |
2591 | --- src/runtime/parsing_and_serializing/parsing_and_serializing_impl.cpp 2013-07-25 14:10:17 +0000 |
2592 | +++ src/runtime/parsing_and_serializing/parsing_and_serializing_impl.cpp 2013-09-17 23:08:54 +0000 |
2593 | @@ -39,6 +39,8 @@ |
2594 | #include "types/schema/validate.h" |
2595 | #include "util/stream_util.h" |
2596 | |
2597 | +#include <zorba/internal/unique_ptr.h> |
2598 | + |
2599 | namespace zorba |
2600 | { |
2601 | |
2602 | @@ -52,7 +54,7 @@ |
2603 | zstring baseUri; |
2604 | URI lValidatedBaseUri; |
2605 | zstring docUri; |
2606 | - std::auto_ptr<std::istringstream> iss; |
2607 | + std::unique_ptr<std::istringstream> iss; |
2608 | std::istream* is; |
2609 | |
2610 | PlanIteratorState* state; |
2611 | @@ -63,11 +65,11 @@ |
2612 | |
2613 | if (result->isStreamable()) |
2614 | { |
2615 | - // The "iss" auto_ptr can NOT be used since it will delete the stream that, |
2616 | + // The "iss" unique_ptr can NOT be used since it will delete the stream that, |
2617 | // in this case, is a data member inside another object and not dynamically |
2618 | // allocated. |
2619 | // |
2620 | - // We can't replace "iss" with "is" since we still need the auto_ptr for |
2621 | + // We can't replace "iss" with "is" since we still need the unique_ptr for |
2622 | // the case when the result is not streamable. |
2623 | is = &result->getStream(); |
2624 | } |
2625 | @@ -249,7 +251,7 @@ |
2626 | |
2627 | { |
2628 | // and now serialize |
2629 | - std::auto_ptr<std::stringstream> lResultStream(new std::stringstream()); |
2630 | + std::unique_ptr<std::stringstream> lResultStream(new std::stringstream()); |
2631 | lSerializer.serialize(lIterWrapper, *lResultStream.get()); |
2632 | GENV_ITEMFACTORY->createStreamableString(aResult, *lResultStream.release(), FnSerializeIterator::streamReleaser, true); |
2633 | } |
2634 | |
2635 | === modified file 'src/runtime/sequences/SequencesImpl.h' |
2636 | --- src/runtime/sequences/SequencesImpl.h 2013-02-07 17:24:36 +0000 |
2637 | +++ src/runtime/sequences/SequencesImpl.h 2013-09-17 23:08:54 +0000 |
2638 | @@ -17,7 +17,6 @@ |
2639 | #ifndef ZORBA_SEQUENCES_IMPL_H |
2640 | #define ZORBA_SEQUENCES_IMPL_H |
2641 | |
2642 | -#include <memory> |
2643 | #include <vector> |
2644 | #include <stack> |
2645 | |
2646 | |
2647 | === modified file 'src/runtime/sequences/pregenerated/sequences.h' |
2648 | --- src/runtime/sequences/pregenerated/sequences.h 2013-05-08 20:14:47 +0000 |
2649 | +++ src/runtime/sequences/pregenerated/sequences.h 2013-09-17 23:08:54 +0000 |
2650 | @@ -29,6 +29,7 @@ |
2651 | |
2652 | |
2653 | #include "runtime/base/narybase.h" |
2654 | +#include <zorba/internal/unique_ptr.h> |
2655 | #include "runtime/base/narybase.h" |
2656 | #include "runtime/core/path_iterators.h" |
2657 | #include "zorbatypes/integer.h" |
2658 | @@ -235,7 +236,7 @@ |
2659 | { |
2660 | public: |
2661 | bool theHasNaN; //indicates whether NaN was found in the sequence |
2662 | - std::auto_ptr<AtomicItemHandleHashSet> theAlreadySeenMap; //hashmap for doing the duplicate elimination |
2663 | + std::unique_ptr<AtomicItemHandleHashSet> theAlreadySeenMap; //hashmap for doing the duplicate elimination |
2664 | |
2665 | FnDistinctValuesIteratorState(); |
2666 | |
2667 | |
2668 | === modified file 'src/runtime/sequences/sequences_impl.cpp' |
2669 | --- src/runtime/sequences/sequences_impl.cpp 2013-07-12 14:15:52 +0000 |
2670 | +++ src/runtime/sequences/sequences_impl.cpp 2013-09-17 23:08:54 +0000 |
2671 | @@ -1968,7 +1968,7 @@ |
2672 | // Resolve URI to a stream |
2673 | zstring lErrorMessage; |
2674 | |
2675 | - std::auto_ptr<internal::Resource> lResource = |
2676 | + std::unique_ptr<internal::Resource> lResource = |
2677 | aSctx->resolve_uri(lNormUri, internal::EntityData::DOCUMENT, lErrorMessage); |
2678 | |
2679 | internal::StreamResource* lStreamResource = |
2680 | @@ -2139,7 +2139,7 @@ |
2681 | |
2682 | //Check for a fragment identifier |
2683 | //Create a zorba::URI for validating if it contains a fragment |
2684 | - std::auto_ptr<zorba::URI> lUri(new zorba::URI(lNormUri)); |
2685 | + std::unique_ptr<zorba::URI> lUri(new zorba::URI(lNormUri)); |
2686 | if (lUri->get_encoded_fragment() != "") |
2687 | { |
2688 | throw XQUERY_EXCEPTION(err::FOUT1170, ERROR_PARAMS(aUri), ERROR_LOC(loc)); |
2689 | @@ -2147,7 +2147,7 @@ |
2690 | |
2691 | //Resolve URI to stream |
2692 | zstring lErrorMessage; |
2693 | - std::auto_ptr<internal::Resource> lResource = aSctx->resolve_uri |
2694 | + std::unique_ptr<internal::Resource> lResource = aSctx->resolve_uri |
2695 | (lNormUri, internal::EntityData::SOME_CONTENT, lErrorMessage); |
2696 | |
2697 | internal::StreamResource* lStreamResource = |
2698 | @@ -2275,9 +2275,9 @@ |
2699 | zstring encodingString("UTF-8"); |
2700 | zstring lNormUri; |
2701 | zstring lErrorMessage; |
2702 | - std::auto_ptr<internal::Resource> lResource; |
2703 | + std::unique_ptr<internal::Resource> lResource; |
2704 | StreamReleaser lStreamReleaser; |
2705 | - std::auto_ptr<zorba::URI> lUri; |
2706 | + std::unique_ptr<zorba::URI> lUri; |
2707 | |
2708 | FnUnparsedTextLinesIteratorState* state; |
2709 | DEFAULT_STACK_INIT(FnUnparsedTextLinesIteratorState, state, planState); |
2710 | |
2711 | === modified file 'src/runtime/spec/sequences/sequences.xml' |
2712 | --- src/runtime/spec/sequences/sequences.xml 2013-05-08 20:14:47 +0000 |
2713 | +++ src/runtime/spec/sequences/sequences.xml 2013-09-17 23:08:54 +0000 |
2714 | @@ -16,6 +16,7 @@ |
2715 | <zorba:include form="Quoted">runtime/base/narybase.h</zorba:include> |
2716 | <zorba:include form="Quoted">runtime/core/path_iterators.h</zorba:include> |
2717 | <zorba:include form="Quoted">zorbatypes/integer.h</zorba:include> |
2718 | + <zorba:include form="Angle-bracket">zorba/internal/unique_ptr.h</zorba:include> |
2719 | <zorba:fwd-decl ns="zorba">NodeHandleHashSet</zorba:fwd-decl> |
2720 | <zorba:fwd-decl ns="zorba">AtomicItemHandleHashSet</zorba:fwd-decl> |
2721 | </zorba:header> |
2722 | @@ -242,7 +243,7 @@ |
2723 | brief="indicates whether NaN was found in the sequence"/> |
2724 | |
2725 | <zorba:member name="theAlreadySeenMap" |
2726 | - type="std::auto_ptr<AtomicItemHandleHashSet>" |
2727 | + type="std::unique_ptr<AtomicItemHandleHashSet>" |
2728 | brief="hashmap for doing the duplicate elimination"/> |
2729 | |
2730 | </zorba:state> |
2731 | |
2732 | === modified file 'src/runtime/store/documents_impl.cpp' |
2733 | --- src/runtime/store/documents_impl.cpp 2013-08-01 11:59:51 +0000 |
2734 | +++ src/runtime/store/documents_impl.cpp 2013-09-17 23:08:54 +0000 |
2735 | @@ -33,6 +33,8 @@ |
2736 | #include "store/api/item_factory.h" |
2737 | #include "store/api/iterator.h" |
2738 | |
2739 | +#include <zorba/internal/unique_ptr.h> |
2740 | + |
2741 | namespace zorba { |
2742 | |
2743 | /******************************************************************************* |
2744 | @@ -48,7 +50,7 @@ |
2745 | store::Item_t lUri; |
2746 | store::Item_t lDoc; |
2747 | store::Item_t lResolvedUriItem; |
2748 | - std::auto_ptr<store::PUL> lPul; |
2749 | + std::unique_ptr<store::PUL> lPul; |
2750 | |
2751 | PlanIteratorState* state; |
2752 | DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState); |
2753 | |
2754 | === modified file 'src/runtime/store/maps_impl.cpp' |
2755 | --- src/runtime/store/maps_impl.cpp 2013-09-02 20:58:31 +0000 |
2756 | +++ src/runtime/store/maps_impl.cpp 2013-09-17 23:08:54 +0000 |
2757 | @@ -45,6 +45,8 @@ |
2758 | #include "types/typeops.h" |
2759 | #include "types/casting.h" |
2760 | |
2761 | +#include <zorba/internal/unique_ptr.h> |
2762 | + |
2763 | namespace zorba { |
2764 | |
2765 | /******************************************************************************* |
2766 | @@ -445,7 +447,7 @@ |
2767 | |
2768 | if (lPersistent) |
2769 | { |
2770 | - std::auto_ptr<store::PUL> lPul(GENV_ITEMFACTORY->createPendingUpdateList()); |
2771 | + std::unique_ptr<store::PUL> lPul(GENV_ITEMFACTORY->createPendingUpdateList()); |
2772 | std::vector<zstring> lCollations(lTypes.size()); |
2773 | lPul->addCreateHashMap(&loc, lName, lTypes, lCollations, 0); |
2774 | |
2775 | @@ -493,7 +495,7 @@ |
2776 | |
2777 | if (getMap(lName, loc, aPlanState.theLocalDynCtx, lIndex, false)) |
2778 | { |
2779 | - std::auto_ptr<store::PUL> lPul(GENV_ITEMFACTORY->createPendingUpdateList()); |
2780 | + std::unique_ptr<store::PUL> lPul(GENV_ITEMFACTORY->createPendingUpdateList()); |
2781 | lPul->addDestroyHashMap(&loc, lName); |
2782 | |
2783 | apply_updates( |
2784 | @@ -594,7 +596,7 @@ |
2785 | store::Iterator_t lValue |
2786 | = new PlanIteratorWrapper(theChildren[2], aPlanState); |
2787 | |
2788 | - std::auto_ptr<store::PUL> lPul(GENV_ITEMFACTORY->createPendingUpdateList()); |
2789 | + std::unique_ptr<store::PUL> lPul(GENV_ITEMFACTORY->createPendingUpdateList()); |
2790 | lPul->addInsertIntoHashMap(&loc, lName, lKeyAttrs, lValue); |
2791 | |
2792 | apply_updates( |
2793 | @@ -620,7 +622,7 @@ |
2794 | ERROR_PARAMS(lName->getLocalName(), lType)); |
2795 | } |
2796 | |
2797 | - std::auto_ptr<store::IndexKey> k(new store::IndexKey()); |
2798 | + std::unique_ptr<store::IndexKey> k(new store::IndexKey()); |
2799 | for (size_t i = 0; i < lKeyAttrs.size(); ++i) |
2800 | { |
2801 | k->push_back(lKeyAttrs[i]); |
2802 | @@ -669,7 +671,7 @@ |
2803 | |
2804 | if (lPersistent) |
2805 | { |
2806 | - std::auto_ptr<store::PUL> lPul(GENV_ITEMFACTORY->createPendingUpdateList()); |
2807 | + std::unique_ptr<store::PUL> lPul(GENV_ITEMFACTORY->createPendingUpdateList()); |
2808 | lPul->addRemoveFromHashMap(&loc, lName, lKeyAttrs); |
2809 | |
2810 | apply_updates( |
2811 | |
2812 | === modified file 'src/runtime/update/update.cpp' |
2813 | --- src/runtime/update/update.cpp 2013-06-15 02:57:08 +0000 |
2814 | +++ src/runtime/update/update.cpp 2013-09-17 23:08:54 +0000 |
2815 | @@ -44,6 +44,7 @@ |
2816 | |
2817 | #include "zorbautils/fatal.h" |
2818 | |
2819 | +#include <zorba/internal/unique_ptr.h> |
2820 | |
2821 | namespace zorba |
2822 | { |
2823 | @@ -123,7 +124,7 @@ |
2824 | std::vector<store::Item_t> nodes(16); |
2825 | ulong numAttrs = 0; |
2826 | ulong numNodes = 0; |
2827 | - std::auto_ptr<store::PUL> pul; |
2828 | + std::unique_ptr<store::PUL> pul; |
2829 | store::Item_t temp; |
2830 | |
2831 | store::CopyMode lCopyMode; |
2832 | @@ -316,7 +317,7 @@ |
2833 | DeleteIterator::nextImpl(store::Item_t& result, PlanState& aPlanState) const |
2834 | { |
2835 | store::Item_t target; |
2836 | - std::auto_ptr<store::PUL> pul; |
2837 | + std::unique_ptr<store::PUL> pul; |
2838 | |
2839 | PlanIteratorState* state; |
2840 | DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState); |
2841 | @@ -381,7 +382,7 @@ |
2842 | store::Item_t temp; |
2843 | std::vector<store::Item_t> lNodes(16); |
2844 | ulong lNumNodes = 0; |
2845 | - std::auto_ptr<store::PUL> lPul; |
2846 | + std::unique_ptr<store::PUL> lPul; |
2847 | |
2848 | store::CopyMode lCopyMode; |
2849 | bool typePreserve; |
2850 | @@ -649,7 +650,7 @@ |
2851 | store::Item_t lNewname; |
2852 | store::Item_t qnameItem; |
2853 | store::Item_t temp; |
2854 | - std::auto_ptr<store::PUL> lPul; |
2855 | + std::unique_ptr<store::PUL> lPul; |
2856 | |
2857 | PlanIteratorState* lState; |
2858 | DEFAULT_STACK_INIT(PlanIteratorState, lState, aPlanState); |
2859 | |
2860 | === modified file 'src/runtime/util/plan_wrapper_holder.h' |
2861 | --- src/runtime/util/plan_wrapper_holder.h 2013-02-07 17:24:36 +0000 |
2862 | +++ src/runtime/util/plan_wrapper_holder.h 2013-09-17 23:08:54 +0000 |
2863 | @@ -15,16 +15,16 @@ |
2864 | */ |
2865 | #ifndef ZORBA_RUNTIME_UTIL_PLAN_WRAPPER_HOLDER_H |
2866 | #define ZORBA_RUNTIME_UTIL_PLAN_WRAPPER_HOLDER_H |
2867 | -#include <memory> |
2868 | |
2869 | #include "runtime/api/plan_wrapper.h" |
2870 | +#include <zorba/internal/unique_ptr.h> |
2871 | |
2872 | namespace zorba { |
2873 | |
2874 | // RAII-style class |
2875 | class PlanWrapperHolder |
2876 | { |
2877 | - std::auto_ptr<PlanWrapper> pw; |
2878 | + std::unique_ptr<PlanWrapper> pw; |
2879 | |
2880 | public: |
2881 | PlanWrapperHolder (PlanWrapper *pw_) |
2882 | |
2883 | === modified file 'src/runtime/xqdoc/xqdoc_impl.cpp' |
2884 | --- src/runtime/xqdoc/xqdoc_impl.cpp 2013-03-12 17:03:31 +0000 |
2885 | +++ src/runtime/xqdoc/xqdoc_impl.cpp 2013-09-17 23:08:54 +0000 |
2886 | @@ -19,7 +19,6 @@ |
2887 | #include <iostream> |
2888 | #include <sstream> |
2889 | #include <fstream> |
2890 | -#include <memory> |
2891 | |
2892 | #include "store/api/item_factory.h" |
2893 | #include "store/api/store.h" |
2894 | |
2895 | === modified file 'src/store/naive/node_items.cpp' |
2896 | --- src/store/naive/node_items.cpp 2013-07-11 14:04:33 +0000 |
2897 | +++ src/store/naive/node_items.cpp 2013-09-17 23:08:54 +0000 |
2898 | @@ -15,11 +15,11 @@ |
2899 | */ |
2900 | #include "stdafx.h" |
2901 | |
2902 | -#include <memory> |
2903 | #include <stack> |
2904 | |
2905 | #include <zorba/config.h> |
2906 | #include <zorba/item.h> |
2907 | +#include <zorba/internal/unique_ptr.h> |
2908 | |
2909 | #include "api/unmarshaller.h" |
2910 | #include "diagnostics/assert.h" |
2911 | @@ -2547,7 +2547,7 @@ |
2912 | // default namespace declaration in scope. |
2913 | ZORBA_ASSERT(prefix.empty() || found); |
2914 | |
2915 | - std::auto_ptr<NsBindingsContext> ctx(new NsBindingsContext); |
2916 | + std::unique_ptr<NsBindingsContext> ctx(new NsBindingsContext); |
2917 | |
2918 | if (found) |
2919 | { |
2920 | |
2921 | === modified file 'src/store/naive/node_updates.cpp' |
2922 | --- src/store/naive/node_updates.cpp 2013-02-07 17:24:36 +0000 |
2923 | +++ src/store/naive/node_updates.cpp 2013-09-17 23:08:54 +0000 |
2924 | @@ -16,6 +16,7 @@ |
2925 | #include "stdafx.h" |
2926 | |
2927 | #include <stack> |
2928 | +#include <zorba/internal/unique_ptr.h> |
2929 | |
2930 | #include "system/globalenv.h" |
2931 | #include "diagnostics/xquery_diagnostics.h" |
2932 | @@ -436,7 +437,7 @@ |
2933 | { |
2934 | if (nsContext != NULL) |
2935 | { |
2936 | - std::auto_ptr<NsBindingsContext> ctx(new NsBindingsContext()); |
2937 | + std::unique_ptr<NsBindingsContext> ctx(new NsBindingsContext()); |
2938 | elemNode->getNamespaceBindings(ctx->getBindings()); |
2939 | |
2940 | if (!ctx->empty()) |
2941 | |
2942 | === modified file 'src/store/naive/pul_primitives.cpp' |
2943 | --- src/store/naive/pul_primitives.cpp 2013-06-15 02:57:08 +0000 |
2944 | +++ src/store/naive/pul_primitives.cpp 2013-09-17 23:08:54 +0000 |
2945 | @@ -16,6 +16,7 @@ |
2946 | #include "stdafx.h" |
2947 | |
2948 | #include <exception> |
2949 | +#include <zorba/internal/unique_ptr.h> |
2950 | |
2951 | #include "shared_types.h" |
2952 | #include "store_defs.h" |
2953 | @@ -1905,7 +1906,7 @@ |
2954 | |
2955 | while (theValue->next(lValue)) |
2956 | { |
2957 | - std::auto_ptr<store::IndexKey> lKey(new store::IndexKey()); |
2958 | + std::unique_ptr<store::IndexKey> lKey(new store::IndexKey()); |
2959 | for (std::vector<store::Item_t>::const_iterator lIter = theKey.begin(); |
2960 | lIter != theKey.end(); |
2961 | ++lIter) |
2962 | |
2963 | === modified file 'src/store/naive/simple_item_factory.cpp' |
2964 | --- src/store/naive/simple_item_factory.cpp 2013-07-01 18:59:06 +0000 |
2965 | +++ src/store/naive/simple_item_factory.cpp 2013-09-17 23:08:54 +0000 |
2966 | @@ -41,6 +41,7 @@ |
2967 | #include "util/ascii_util.h" |
2968 | #include "util/stream_util.h" |
2969 | |
2970 | +#include <zorba/internal/unique_ptr.h> |
2971 | |
2972 | namespace zorba { namespace simplestore { |
2973 | |
2974 | @@ -467,7 +468,7 @@ |
2975 | const xs_date* date, |
2976 | const xs_time* time) |
2977 | { |
2978 | - std::auto_ptr<DateTimeItem> dtin(new DateTimeItem(store::XS_DATETIME)); |
2979 | + std::unique_ptr<DateTimeItem> dtin(new DateTimeItem(store::XS_DATETIME)); |
2980 | int err = DateTime::createDateTime(date, time, dtin->theValue); |
2981 | if (err == 0) |
2982 | { |
2983 | @@ -596,7 +597,7 @@ |
2984 | const xs_date* date, |
2985 | const xs_time* time) |
2986 | { |
2987 | - std::auto_ptr<DateTimeItem> dtin(new DateTimeItem(store::XS_DATETIME_STAMP)); |
2988 | + std::unique_ptr<DateTimeItem> dtin(new DateTimeItem(store::XS_DATETIME_STAMP)); |
2989 | int err = DateTime::createDateTime(date, time, dtin->theValue); |
2990 | if (err == 0 && time->hasTimezone()) |
2991 | { |
2992 | |
2993 | === modified file 'src/store/naive/store.cpp' |
2994 | --- src/store/naive/store.cpp 2013-08-05 11:54:06 +0000 |
2995 | +++ src/store/naive/store.cpp 2013-09-17 23:08:54 +0000 |
2996 | @@ -17,11 +17,11 @@ |
2997 | |
2998 | #include <iostream> |
2999 | #include <climits> |
3000 | -#include <memory> |
3001 | |
3002 | #include <libxml/parser.h> |
3003 | |
3004 | #include <zorba/internal/cxx_util.h> |
3005 | +#include <zorba/internal/unique_ptr.h> |
3006 | |
3007 | #include "zorbautils/hashfun.h" |
3008 | #include "zorbautils/fatal.h" |
3009 | @@ -996,7 +996,7 @@ |
3010 | } |
3011 | |
3012 | XQueryDiagnostics lXQueryDiagnostics; |
3013 | - std::auto_ptr<XmlLoader> loader(getXmlLoader(&lXQueryDiagnostics, loadProperties)); |
3014 | + std::unique_ptr<XmlLoader> loader(getXmlLoader(&lXQueryDiagnostics, loadProperties)); |
3015 | |
3016 | root = loader->loadXml(baseUri, docUri, stream); |
3017 | |
3018 | |
3019 | === modified file 'src/system/globalenv.cpp' |
3020 | --- src/system/globalenv.cpp 2013-08-02 18:32:08 +0000 |
3021 | +++ src/system/globalenv.cpp 2013-09-17 23:08:54 +0000 |
3022 | @@ -106,7 +106,7 @@ |
3023 | m_globalEnv->xqueryx_convertor = new XQueryXConvertor; |
3024 | #endif |
3025 | |
3026 | - std::auto_ptr<XQueryCompilerSubsystem> lSubSystem = |
3027 | + std::unique_ptr<XQueryCompilerSubsystem> lSubSystem = |
3028 | XQueryCompilerSubsystem::create(); |
3029 | |
3030 | m_globalEnv->m_compilerSubSys = lSubSystem.release(); |
3031 | |
3032 | === modified file 'src/system/globalenv.h' |
3033 | --- src/system/globalenv.h 2013-08-02 18:32:08 +0000 |
3034 | +++ src/system/globalenv.h 2013-09-17 23:08:54 +0000 |
3035 | @@ -17,8 +17,8 @@ |
3036 | #ifndef ZORBA_GLOBALENV_H |
3037 | #define ZORBA_GLOBALENV_H |
3038 | |
3039 | -#include <memory> |
3040 | #include <zorba/config.h> |
3041 | +#include <zorba/internal/unique_ptr.h> |
3042 | |
3043 | #include "common/common.h" |
3044 | #include "common/shared_types.h" |
3045 | |
3046 | === modified file 'src/system/properties.h' |
3047 | --- src/system/properties.h 2013-02-07 17:24:36 +0000 |
3048 | +++ src/system/properties.h 2013-09-17 23:08:54 +0000 |
3049 | @@ -20,9 +20,9 @@ |
3050 | #include <string> |
3051 | #include <fstream> |
3052 | #include <vector> |
3053 | -#include <memory> |
3054 | |
3055 | #include <zorba/config.h> |
3056 | +#include <zorba/internal/unique_ptr.h> |
3057 | #include "system/zorba_properties.h" |
3058 | |
3059 | namespace zorba { |
3060 | @@ -35,7 +35,7 @@ |
3061 | { |
3062 | protected: |
3063 | std::ostream *debug_stream; |
3064 | - std::auto_ptr<std::ostream> debug_stream_ptr; |
3065 | + std::unique_ptr<std::ostream> debug_stream_ptr; |
3066 | |
3067 | public: |
3068 | static Properties* instance(); |
3069 | |
3070 | === modified file 'src/types/casting.cpp' |
3071 | --- src/types/casting.cpp 2013-08-19 13:00:41 +0000 |
3072 | +++ src/types/casting.cpp 2013-09-17 23:08:54 +0000 |
3073 | @@ -16,6 +16,7 @@ |
3074 | #include "stdafx.h" |
3075 | |
3076 | #include <vector> |
3077 | +#include <zorba/internal/unique_ptr.h> |
3078 | |
3079 | #include "zorbatypes/chartype.h" |
3080 | #include "zorbatypes/datetime.h" |
3081 | @@ -1283,8 +1284,8 @@ |
3082 | |
3083 | T1_TO_T2(dur, yMD) |
3084 | { |
3085 | - std::auto_ptr<Duration> dur = |
3086 | - std::auto_ptr<Duration>(aItem->getDurationValue().toYearMonthDuration()); |
3087 | + std::unique_ptr<Duration> dur = |
3088 | + std::unique_ptr<Duration>(aItem->getDurationValue().toYearMonthDuration()); |
3089 | aFactory->createYearMonthDuration(result, dur.get()); |
3090 | return true; |
3091 | } |
3092 | @@ -1292,8 +1293,8 @@ |
3093 | |
3094 | T1_TO_T2(dur, dTD) |
3095 | { |
3096 | - std::auto_ptr<Duration> dur = |
3097 | - std::auto_ptr<Duration>(aItem->getDurationValue().toDayTimeDuration()); |
3098 | + std::unique_ptr<Duration> dur = |
3099 | + std::unique_ptr<Duration>(aItem->getDurationValue().toDayTimeDuration()); |
3100 | aFactory->createDayTimeDuration(result, dur.get()); |
3101 | return true; |
3102 | } |
3103 | @@ -1315,8 +1316,8 @@ |
3104 | |
3105 | T1_TO_T2(yMD, dur) |
3106 | { |
3107 | - std::auto_ptr<Duration> dur = |
3108 | - std::auto_ptr<Duration>(aItem->getYearMonthDurationValue().toDuration()); |
3109 | + std::unique_ptr<Duration> dur = |
3110 | + std::unique_ptr<Duration>(aItem->getYearMonthDurationValue().toDuration()); |
3111 | aFactory->createDuration(result, dur.get()); |
3112 | return true; |
3113 | } |
3114 | @@ -1324,8 +1325,8 @@ |
3115 | |
3116 | T1_TO_T2(yMD, dTD) |
3117 | { |
3118 | - std::auto_ptr<Duration> dur = |
3119 | - std::auto_ptr<Duration>(aItem->getYearMonthDurationValue().toDayTimeDuration()); |
3120 | + std::unique_ptr<Duration> dur = |
3121 | + std::unique_ptr<Duration>(aItem->getYearMonthDurationValue().toDayTimeDuration()); |
3122 | aFactory->createDayTimeDuration(result, dur.get()); |
3123 | return true; |
3124 | } |
3125 | @@ -1347,8 +1348,8 @@ |
3126 | |
3127 | T1_TO_T2(dTD, dur) |
3128 | { |
3129 | - std::auto_ptr<Duration> dur = |
3130 | - std::auto_ptr<Duration>(aItem->getDayTimeDurationValue().toDuration()); |
3131 | + std::unique_ptr<Duration> dur = |
3132 | + std::unique_ptr<Duration>(aItem->getDayTimeDurationValue().toDuration()); |
3133 | aFactory->createDuration(result, dur.get()); |
3134 | return true; |
3135 | } |
3136 | @@ -1356,8 +1357,8 @@ |
3137 | |
3138 | T1_TO_T2(dTD, yMD) |
3139 | { |
3140 | - std::auto_ptr<Duration> dur = |
3141 | - std::auto_ptr<Duration>(aItem->getDayTimeDurationValue().toYearMonthDuration()); |
3142 | + std::unique_ptr<Duration> dur = |
3143 | + std::unique_ptr<Duration>(aItem->getDayTimeDurationValue().toYearMonthDuration()); |
3144 | aFactory->createYearMonthDuration(result, dur.get()); |
3145 | return true; |
3146 | } |
3147 | |
3148 | === modified file 'src/types/schema/XercesParseUtils.cpp' |
3149 | --- src/types/schema/XercesParseUtils.cpp 2013-06-18 23:53:59 +0000 |
3150 | +++ src/types/schema/XercesParseUtils.cpp 2013-09-17 23:08:54 +0000 |
3151 | @@ -40,6 +40,7 @@ |
3152 | #include "zorbatypes/float.h" |
3153 | #include "zorbatypes/integer.h" |
3154 | #include "zorbatypes/numconversions.h" |
3155 | +#include <zorba/internal/unique_ptr.h> |
3156 | |
3157 | using namespace std; |
3158 | XERCES_CPP_NAMESPACE_USE; |
3159 | @@ -56,7 +57,7 @@ |
3160 | XSValue::DataType datatype = XSValue::dt_boolean; |
3161 | XSValue::Status status = XSValue::st_Init;; |
3162 | |
3163 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3164 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3165 | XMLString::release(&content); |
3166 | |
3167 | if ( status==XSValue::st_Init ) |
3168 | @@ -84,7 +85,7 @@ |
3169 | XSValue::DataType datatype = XSValue::dt_integer; |
3170 | XSValue::Status status = XSValue::st_Init;; |
3171 | |
3172 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3173 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3174 | XMLString::release(&content); |
3175 | |
3176 | if ( status==XSValue::st_Init ) |
3177 | @@ -112,7 +113,7 @@ |
3178 | XSValue::DataType datatype = XSValue::dt_positiveInteger; |
3179 | XSValue::Status status = XSValue::st_Init;; |
3180 | |
3181 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3182 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3183 | XMLString::release(&content); |
3184 | |
3185 | if ( status==XSValue::st_Init ) |
3186 | @@ -140,7 +141,7 @@ |
3187 | XSValue::DataType datatype = XSValue::dt_nonPositiveInteger; |
3188 | XSValue::Status status = XSValue::st_Init;; |
3189 | |
3190 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3191 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3192 | XMLString::release(&content); |
3193 | |
3194 | if ( status==XSValue::st_Init ) |
3195 | @@ -168,7 +169,7 @@ |
3196 | XSValue::DataType datatype = XSValue::dt_negativeInteger; |
3197 | XSValue::Status status = XSValue::st_Init;; |
3198 | |
3199 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3200 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3201 | XMLString::release(&content); |
3202 | |
3203 | if ( status==XSValue::st_Init ) |
3204 | @@ -196,7 +197,7 @@ |
3205 | XSValue::DataType datatype = XSValue::dt_nonNegativeInteger; |
3206 | XSValue::Status status = XSValue::st_Init;; |
3207 | |
3208 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3209 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3210 | XMLString::release(&content); |
3211 | |
3212 | if ( status==XSValue::st_Init ) |
3213 | @@ -224,7 +225,7 @@ |
3214 | XSValue::DataType datatype = XSValue::dt_unsignedByte; |
3215 | XSValue::Status status = XSValue::st_Init;; |
3216 | |
3217 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3218 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3219 | XMLString::release(&content); |
3220 | |
3221 | if ( status==XSValue::st_Init ) |
3222 | @@ -252,7 +253,7 @@ |
3223 | XSValue::DataType datatype = XSValue::dt_unsignedShort; |
3224 | XSValue::Status status = XSValue::st_Init;; |
3225 | |
3226 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3227 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3228 | XMLString::release(&content); |
3229 | |
3230 | if ( status==XSValue::st_Init ) |
3231 | @@ -280,7 +281,7 @@ |
3232 | XSValue::DataType datatype = XSValue::dt_unsignedInt; |
3233 | XSValue::Status status = XSValue::st_Init;; |
3234 | |
3235 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3236 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3237 | XMLString::release(&content); |
3238 | |
3239 | if ( status==XSValue::st_Init ) |
3240 | @@ -308,7 +309,7 @@ |
3241 | XSValue::DataType datatype = XSValue::dt_unsignedLong; |
3242 | XSValue::Status status = XSValue::st_Init;; |
3243 | |
3244 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3245 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3246 | XMLString::release(&content); |
3247 | |
3248 | if ( status==XSValue::st_Init ) |
3249 | @@ -336,7 +337,7 @@ |
3250 | XSValue::DataType datatype = XSValue::dt_byte; |
3251 | XSValue::Status status = XSValue::st_Init;; |
3252 | |
3253 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3254 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3255 | XMLString::release(&content); |
3256 | |
3257 | if ( status==XSValue::st_Init ) |
3258 | @@ -364,7 +365,7 @@ |
3259 | XSValue::DataType datatype = XSValue::dt_short; |
3260 | XSValue::Status status = XSValue::st_Init;; |
3261 | |
3262 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3263 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3264 | XMLString::release(&content); |
3265 | |
3266 | if ( status==XSValue::st_Init ) |
3267 | @@ -392,7 +393,7 @@ |
3268 | XSValue::DataType datatype = XSValue::dt_int; |
3269 | XSValue::Status status = XSValue::st_Init;; |
3270 | |
3271 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3272 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3273 | XMLString::release(&content); |
3274 | |
3275 | if ( status==XSValue::st_Init ) |
3276 | @@ -420,7 +421,7 @@ |
3277 | XSValue::DataType datatype = XSValue::dt_long; |
3278 | XSValue::Status status = XSValue::st_Init;; |
3279 | |
3280 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3281 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3282 | XMLString::release(&content); |
3283 | |
3284 | if ( status==XSValue::st_Init ) |
3285 | @@ -448,7 +449,7 @@ |
3286 | XSValue::DataType datatype = XSValue::dt_float; |
3287 | XSValue::Status status = XSValue::st_Init;; |
3288 | |
3289 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3290 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3291 | XMLString::release(&content); |
3292 | |
3293 | if ( status==XSValue::st_Init ) |
3294 | @@ -487,7 +488,7 @@ |
3295 | XSValue::DataType datatype = XSValue::dt_double; |
3296 | XSValue::Status status = XSValue::st_Init;; |
3297 | |
3298 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3299 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3300 | XMLString::release(&content); |
3301 | |
3302 | if ( status==XSValue::st_Init ) |
3303 | @@ -525,7 +526,7 @@ |
3304 | XSValue::DataType datatype = XSValue::dt_decimal; |
3305 | XSValue::Status status = XSValue::st_Init;; |
3306 | |
3307 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3308 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3309 | XMLString::release(&content); |
3310 | |
3311 | if ( status==XSValue::st_Init ) |
3312 | @@ -585,7 +586,7 @@ |
3313 | XSValue::DataType datatype = XSValue::dt_token; |
3314 | XSValue::Status status = XSValue::st_Init; |
3315 | |
3316 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3317 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3318 | XMLString::release(&content); |
3319 | |
3320 | if ( status==XSValue::st_NoActVal ) |
3321 | @@ -613,7 +614,7 @@ |
3322 | XSValue::DataType datatype = XSValue::dt_NMTOKEN; |
3323 | XSValue::Status status = XSValue::st_Init; |
3324 | |
3325 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3326 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3327 | XMLString::release(&content); |
3328 | |
3329 | if ( status==XSValue::st_NoActVal ) |
3330 | @@ -641,7 +642,7 @@ |
3331 | XSValue::DataType datatype = XSValue::dt_Name; |
3332 | XSValue::Status status = XSValue::st_Init; |
3333 | |
3334 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3335 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3336 | XMLString::release(&content); |
3337 | |
3338 | if ( status==XSValue::st_NoActVal ) |
3339 | @@ -670,7 +671,7 @@ |
3340 | XSValue::DataType datatype = XSValue::dt_NCName; |
3341 | XSValue::Status status = XSValue::st_Init; |
3342 | |
3343 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3344 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3345 | XMLString::release(&content); |
3346 | |
3347 | if ( status==XSValue::st_NoActVal ) |
3348 | @@ -698,7 +699,7 @@ |
3349 | XSValue::DataType datatype = XSValue::dt_ID; |
3350 | XSValue::Status status = XSValue::st_Init; |
3351 | |
3352 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3353 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3354 | XMLString::release(&content); |
3355 | |
3356 | if ( status==XSValue::st_NoActVal ) |
3357 | @@ -726,7 +727,7 @@ |
3358 | XSValue::DataType datatype = XSValue::dt_IDREF; |
3359 | XSValue::Status status = XSValue::st_Init; |
3360 | |
3361 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3362 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3363 | XMLString::release(&content); |
3364 | |
3365 | if ( status==XSValue::st_NoActVal ) |
3366 | @@ -754,7 +755,7 @@ |
3367 | XSValue::DataType datatype = XSValue::dt_ENTITY; |
3368 | XSValue::Status status = XSValue::st_Init; |
3369 | |
3370 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3371 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3372 | XMLString::release(&content); |
3373 | |
3374 | if ( status==XSValue::st_NoActVal ) |
3375 | @@ -782,7 +783,7 @@ |
3376 | XSValue::DataType datatype = XSValue::dt_NOTATION; |
3377 | XSValue::Status status = XSValue::st_Init; |
3378 | |
3379 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3380 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3381 | XMLString::release(&content); |
3382 | |
3383 | if ( status==XSValue::st_NoActVal ) |
3384 | @@ -808,7 +809,7 @@ |
3385 | XSValue::DataType datatype = XSValue::dt_dateTime; |
3386 | XSValue::Status status = XSValue::st_Init; |
3387 | |
3388 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3389 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3390 | XMLString::release(&content); |
3391 | |
3392 | if ( status==XSValue::st_Init ) |
3393 | @@ -857,7 +858,7 @@ |
3394 | XSValue::DataType datatype = XSValue::dt_date; |
3395 | XSValue::Status status = XSValue::st_Init; |
3396 | |
3397 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3398 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3399 | XMLString::release(&content); |
3400 | |
3401 | if ( status==XSValue::st_Init ) |
3402 | @@ -897,7 +898,7 @@ |
3403 | XSValue::DataType datatype = XSValue::dt_time; |
3404 | XSValue::Status status = XSValue::st_Init; |
3405 | |
3406 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3407 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3408 | XMLString::release(&content); |
3409 | |
3410 | if ( status==XSValue::st_Init ) |
3411 | @@ -941,7 +942,7 @@ |
3412 | XSValue::DataType datatype = XSValue::dt_gYearMonth; |
3413 | XSValue::Status status = XSValue::st_Init; |
3414 | |
3415 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3416 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3417 | XMLString::release(&content); |
3418 | |
3419 | if ( status==XSValue::st_Init ) |
3420 | @@ -976,7 +977,7 @@ |
3421 | XSValue::DataType datatype = XSValue::dt_gYear; |
3422 | XSValue::Status status = XSValue::st_Init; |
3423 | |
3424 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3425 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3426 | XMLString::release(&content); |
3427 | |
3428 | if ( status==XSValue::st_Init ) |
3429 | @@ -1010,7 +1011,7 @@ |
3430 | XSValue::DataType datatype = XSValue::dt_gMonthDay; |
3431 | XSValue::Status status = XSValue::st_Init; |
3432 | |
3433 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3434 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3435 | XMLString::release(&content); |
3436 | |
3437 | if ( status==XSValue::st_Init ) |
3438 | @@ -1044,7 +1045,7 @@ |
3439 | XSValue::DataType datatype = XSValue::dt_gDay; |
3440 | XSValue::Status status = XSValue::st_Init; |
3441 | |
3442 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3443 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3444 | XMLString::release(&content); |
3445 | |
3446 | if ( status==XSValue::st_Init ) |
3447 | @@ -1077,7 +1078,7 @@ |
3448 | XSValue::DataType datatype = XSValue::dt_gMonth; |
3449 | XSValue::Status status = XSValue::st_Init; |
3450 | |
3451 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3452 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3453 | XMLString::release(&content); |
3454 | |
3455 | if ( status==XSValue::st_Init ) |
3456 | @@ -1110,7 +1111,7 @@ |
3457 | XSValue::DataType datatype = XSValue::dt_duration; |
3458 | XSValue::Status status = XSValue::st_Init; |
3459 | |
3460 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3461 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3462 | XMLString::release(&content); |
3463 | |
3464 | if ( status==XSValue::st_Init ) |
3465 | @@ -1201,7 +1202,7 @@ |
3466 | XSValue::DataType datatype = XSValue::dt_base64Binary; |
3467 | XSValue::Status status = XSValue::st_Init; |
3468 | |
3469 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3470 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3471 | XMLString::release(&content); |
3472 | |
3473 | if ( status==XSValue::st_Init ) |
3474 | @@ -1229,7 +1230,7 @@ |
3475 | XSValue::DataType datatype = XSValue::dt_hexBinary; |
3476 | XSValue::Status status = XSValue::st_Init; |
3477 | |
3478 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3479 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3480 | XMLString::release(&content); |
3481 | |
3482 | if ( status==XSValue::st_Init ) |
3483 | @@ -1255,7 +1256,7 @@ |
3484 | XSValue::DataType datatype = XSValue::dt_anyURI; |
3485 | XSValue::Status status = XSValue::st_Init; |
3486 | |
3487 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3488 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3489 | XMLString::release(&content); |
3490 | |
3491 | if ( status==XSValue::st_NoActVal ) |
3492 | @@ -1281,7 +1282,7 @@ |
3493 | XSValue::DataType datatype = XSValue::dt_QName; |
3494 | XSValue::Status status = XSValue::st_Init; |
3495 | |
3496 | - auto_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3497 | + unique_ptr<XSValue> xsval (XSValue::getActualValue(content, datatype, status)); |
3498 | XMLString::release(&content); |
3499 | |
3500 | if ( status==XSValue::st_NoActVal ) |
3501 | |
3502 | === modified file 'src/types/schema/schema.cpp' |
3503 | --- src/types/schema/schema.cpp 2013-07-01 18:59:06 +0000 |
3504 | +++ src/types/schema/schema.cpp 2013-09-17 23:08:54 +0000 |
3505 | @@ -41,6 +41,7 @@ |
3506 | #include "util/utf8_util.h" |
3507 | #include "types/schema/xercesIncludes.h" |
3508 | #include "zorbatypes/URI.h" |
3509 | +#include <zorba/internal/unique_ptr.h> |
3510 | |
3511 | #ifndef ZORBA_NO_XMLSCHEMA |
3512 | # include <xercesc/util/XercesVersion.hpp> |
3513 | @@ -216,7 +217,7 @@ |
3514 | isSystemId = true; |
3515 | } |
3516 | |
3517 | - std::auto_ptr<internal::Resource> lResource; |
3518 | + std::unique_ptr<internal::Resource> lResource; |
3519 | |
3520 | zstring lStrId = StrX(lId).localForm(); |
3521 | zstring lResolved; |
3522 | @@ -435,7 +436,7 @@ |
3523 | internal::StreamResource* stream, |
3524 | const QueryLoc& loc) |
3525 | { |
3526 | - std::auto_ptr<SAX2XMLReader> parser; |
3527 | + std::unique_ptr<SAX2XMLReader> parser; |
3528 | |
3529 | TRACE("url=" << xsdURL << " loc=" << loc); |
3530 | |
3531 | @@ -1708,7 +1709,7 @@ |
3532 | try |
3533 | { |
3534 | // Create grammar resolver and string pool that we pass to the scanner |
3535 | - std::auto_ptr<GrammarResolver> fGrammarResolver( |
3536 | + std::unique_ptr<GrammarResolver> fGrammarResolver( |
3537 | new GrammarResolver(theGrammarPool)); |
3538 | |
3539 | fGrammarResolver->useCachedGrammarInParse(true); |
3540 | |
3541 | === removed file 'src/util/auto_vector.h' |
3542 | --- src/util/auto_vector.h 2013-02-07 17:24:36 +0000 |
3543 | +++ src/util/auto_vector.h 1970-01-01 00:00:00 +0000 |
3544 | @@ -1,266 +0,0 @@ |
3545 | -#pragma once |
3546 | -#if !defined AUTO_VECTOR_H |
3547 | -#define AUTO_VECTOR_H |
3548 | -//------------------------------------ |
3549 | -// Reliable Software (c) 2003 |
3550 | -// www.relisoft.com |
3551 | -// Any use, commercial or noncommercial of this code |
3552 | -// is hereby granted, under the condition |
3553 | -// that this copyright notice be not removed. |
3554 | -//------------------------------------ |
3555 | - |
3556 | -#include <memory> |
3557 | -#include <vector> |
3558 | -#include <cassert> |
3559 | -#include <algorithm> |
3560 | - |
3561 | -//--------------------------------- |
3562 | -// Dynamic array of owned pointers. |
3563 | -// Ownership transfer semantics. |
3564 | -//--------------------------------- |
3565 | - |
3566 | -namespace zorba { |
3567 | -namespace ztd { |
3568 | - |
3569 | -template <class T> |
3570 | -class auto_vector |
3571 | -{ |
3572 | -public: |
3573 | - class auto_lvalue |
3574 | - { |
3575 | - public: |
3576 | - auto_lvalue (T * & p) : _p (p) {} |
3577 | - operator T * () const { return _p; } |
3578 | - T * operator-> () const { return _p; } |
3579 | - auto_lvalue & operator= (std::auto_ptr<T> ap) |
3580 | - { |
3581 | - delete _p; |
3582 | - _p = ap.release (); |
3583 | - return *this; |
3584 | - } |
3585 | - private: |
3586 | - T * & _p; |
3587 | - }; |
3588 | -public: |
3589 | - |
3590 | - explicit auto_vector (size_t capacity = 0); |
3591 | - ~auto_vector (); |
3592 | - |
3593 | - // memory management |
3594 | - size_t size () const { return _arr.size (); } |
3595 | - size_t capacity () const { return _arr.capacity (); } |
3596 | - void reserve (size_t count); |
3597 | - void resize (unsigned int newSize); |
3598 | - void erase (size_t idx); |
3599 | - void clear (); |
3600 | - void compact (); |
3601 | - void swap (auto_vector<T> & other) |
3602 | - { |
3603 | - _arr.swap (other._arr); |
3604 | - } |
3605 | - // array access |
3606 | - T const * operator [] (size_t i) const { return _arr [i]; } |
3607 | - auto_lvalue operator [] (size_t i) |
3608 | - { |
3609 | - return auto_lvalue (_arr [i]); |
3610 | - } |
3611 | - void assign (size_t i, std::auto_ptr<T> p); |
3612 | - void assign_direct (size_t i, T * p); |
3613 | - void insert (size_t idx, std::auto_ptr<T> p); |
3614 | - // stack access |
3615 | - void push_back (std::auto_ptr<T> p); |
3616 | - std::auto_ptr<T> pop_back (); // non-standard |
3617 | - T * back () { return _arr.back (); } |
3618 | - T const * back () const { return _arr.back (); } |
3619 | - T * front () { return _arr.front (); } |
3620 | - T const * front () const { return _arr.front (); } |
3621 | - // iterators |
3622 | - typedef typename std::vector<T*>::iterator iterator; |
3623 | - typedef typename std::vector<T*>::const_iterator const_iterator; |
3624 | - typedef typename std::vector<T*>::reverse_iterator reverse_iterator; |
3625 | - typedef typename std::vector<T*>::const_reverse_iterator const_reverse_iterator; |
3626 | - |
3627 | - |
3628 | - iterator begin () { return _arr.begin (); } |
3629 | - iterator end () { return _arr.end (); } |
3630 | - const_iterator begin () const { return _arr.begin (); } |
3631 | - const_iterator end () const { return _arr.end (); } |
3632 | - reverse_iterator rbegin() { return _arr.rbegin (); } |
3633 | - reverse_iterator rend() { return _arr.rend (); } |
3634 | - const_reverse_iterator rbegin() const { return _arr.rbegin (); } |
3635 | - const_reverse_iterator rend() const { return _arr.rend (); } |
3636 | - |
3637 | - iterator erase (iterator it); |
3638 | - |
3639 | - // iterator/index conversion |
3640 | - size_t ToIndex (iterator const & it); |
3641 | - size_t ToIndex (reverse_iterator const & rit); |
3642 | - iterator ToIter (size_t idx); |
3643 | - reverse_iterator ToRIter (size_t idx); |
3644 | - |
3645 | - // Copy-constructor - much like auto_ptr<>'s copy constructor, this does |
3646 | - // NOT implement copy semantics, but instead transfers ownership of all |
3647 | - // items in src to this new auto_vector. |
3648 | - auto_vector (auto_vector<T> const & src); |
3649 | - |
3650 | -private: |
3651 | - auto_vector<T> & operator= (auto_vector<T> const & src); |
3652 | - |
3653 | - std::vector<T*> _arr; |
3654 | -}; |
3655 | - |
3656 | -template <class T> |
3657 | -auto_vector<T>::auto_vector (size_t capacity) |
3658 | -{ |
3659 | - _arr.reserve (capacity); |
3660 | -} |
3661 | - |
3662 | -template <class T> |
3663 | -auto_vector<T>::auto_vector (auto_vector<T> const & src) |
3664 | -{ |
3665 | - _arr = src._arr; |
3666 | - const_cast<auto_vector<T> &>(src)._arr.clear(); |
3667 | -} |
3668 | - |
3669 | -template <class T> |
3670 | -auto_vector<T>::~auto_vector () |
3671 | -{ |
3672 | - clear (); |
3673 | -} |
3674 | - |
3675 | -template <class T> |
3676 | -void auto_vector<T>::push_back (std::auto_ptr<T> ptr) |
3677 | -{ |
3678 | - _arr.push_back (ptr.get ()); |
3679 | - ptr.release (); |
3680 | -} |
3681 | - |
3682 | -template <class T> |
3683 | -inline std::auto_ptr<T> auto_vector<T>::pop_back () |
3684 | -{ |
3685 | - assert (size () != 0); |
3686 | - T * p = _arr.back (); |
3687 | - _arr.pop_back (); |
3688 | - return std::auto_ptr<T> (p); |
3689 | -} |
3690 | - |
3691 | -template <class T> |
3692 | -class DeletePtr |
3693 | -{ |
3694 | -public: |
3695 | - void operator () (T * p) |
3696 | - { |
3697 | - delete p; |
3698 | - } |
3699 | -}; |
3700 | - |
3701 | -template <class T> |
3702 | -void auto_vector<T>::clear () |
3703 | -{ |
3704 | - std::for_each (begin (), end (), DeletePtr<T> ()); |
3705 | - _arr.clear (); |
3706 | -} |
3707 | - |
3708 | -template <class T> |
3709 | -inline void auto_vector<T>::assign_direct (size_t i, T * p) |
3710 | -{ |
3711 | - assert (i < size ()); |
3712 | - if (_arr [i] != p) |
3713 | - delete _arr [i]; |
3714 | - _arr [i] = p; |
3715 | -} |
3716 | - |
3717 | -template <class T> |
3718 | -inline void auto_vector<T>::assign (size_t i, std::auto_ptr<T> p) |
3719 | -{ |
3720 | - assert (i < size ()); |
3721 | - if (_arr [i] != p.get ()) |
3722 | - delete _arr [i]; |
3723 | - _arr [i] = p.release (); |
3724 | -} |
3725 | - |
3726 | -template <class T> |
3727 | -void auto_vector<T>::erase (size_t idx) |
3728 | -{ |
3729 | - assert (idx < size ()); |
3730 | - // Delete item |
3731 | - delete _arr [idx]; |
3732 | - // Compact array |
3733 | - _arr.erase (ToIter (idx)); |
3734 | -} |
3735 | - |
3736 | -template <class T> |
3737 | -typename auto_vector<T>::iterator auto_vector<T>::erase (typename auto_vector<T>::iterator it) |
3738 | -{ |
3739 | - assert (it < end ()); |
3740 | - delete *it; |
3741 | - return _arr.erase (it); |
3742 | -} |
3743 | - |
3744 | -template <class T> |
3745 | -void auto_vector<T>::compact () |
3746 | -{ |
3747 | - // move null pointers to the end |
3748 | - T * null = 0; |
3749 | - iterator pos = std::remove (begin (), end (), null); |
3750 | - _arr.resize (pos - begin ()); |
3751 | -} |
3752 | - |
3753 | -template <class T> |
3754 | -size_t auto_vector<T>::ToIndex (iterator const & it) |
3755 | -{ |
3756 | - assert (it - begin () >= 0); |
3757 | - return static_cast<size_t> (it - begin ()); |
3758 | -} |
3759 | - |
3760 | -template <class T> |
3761 | -size_t auto_vector<T>::ToIndex (reverse_iterator const & rit) |
3762 | -{ |
3763 | - iterator it = rit.base (); |
3764 | - --it; |
3765 | - assert (it - begin () >= 0); |
3766 | - return static_cast<size_t> (it - begin ()); |
3767 | -} |
3768 | - |
3769 | -template <class T> |
3770 | -typename auto_vector<T>::iterator auto_vector<T>::ToIter (size_t idx) |
3771 | -{ |
3772 | - return begin () + idx; |
3773 | -} |
3774 | - |
3775 | -template <class T> |
3776 | -typename auto_vector<T>::reverse_iterator auto_vector<T>::ToRIter (size_t idx) |
3777 | -{ |
3778 | - ++idx; |
3779 | - return reverse_iterator (ToIter (idx)); |
3780 | -} |
3781 | - |
3782 | - |
3783 | -template <class T> |
3784 | -inline void auto_vector <T>::reserve (size_t count) |
3785 | -{ |
3786 | - _arr.reserve (count); |
3787 | -} |
3788 | - |
3789 | -template <class T> |
3790 | -inline void auto_vector<T>::resize (unsigned int newSize) |
3791 | -{ |
3792 | - if (newSize < size ()) |
3793 | - std::for_each (ToIter (newSize), end (), DeletePtr<T> ()); |
3794 | - _arr.resize (newSize); |
3795 | -} |
3796 | - |
3797 | -template <class T> |
3798 | -void auto_vector<T>::insert (size_t idx, std::auto_ptr<T> p) |
3799 | -{ |
3800 | - assert (idx <= size ()); |
3801 | - _arr.insert (ToIter (idx), p.get ()); |
3802 | - p.release (); |
3803 | -} |
3804 | - |
3805 | -} /* namespace ztd */ |
3806 | -} /* namespace zorba */ |
3807 | - |
3808 | -#endif |
3809 | - |
3810 | -/* vim:set et sw=2 ts=2: */ |
3811 | |
3812 | === modified file 'src/util/singleton.h' |
3813 | --- src/util/singleton.h 2013-02-07 17:24:36 +0000 |
3814 | +++ src/util/singleton.h 2013-09-17 23:08:54 +0000 |
3815 | @@ -31,6 +31,7 @@ |
3816 | #include <vector> |
3817 | #include <list> |
3818 | #include <memory> |
3819 | +#include <zorba/internal/unique_ptr.h> |
3820 | |
3821 | #ifdef _MSC_VER |
3822 | #define LOKI_C_CALLING_CONVENTION_QUALIFIER __cdecl |
3823 | @@ -160,7 +161,7 @@ |
3824 | pTrackerArray = new TrackerArray; |
3825 | |
3826 | // automatically delete the ConcreteLifetimeTracker object when a exception is thrown |
3827 | - std::auto_ptr<LifetimeTracker> |
3828 | + std::unique_ptr<LifetimeTracker> |
3829 | p( new ConcreteLifetimeTracker<T, Destroyer>(pDynObject, longevity, d) ); |
3830 | |
3831 | // Find correct position |
3832 | |
3833 | === modified file 'src/util/zorba_regex_engine.cpp' |
3834 | --- src/util/zorba_regex_engine.cpp 2013-04-25 02:05:20 +0000 |
3835 | +++ src/util/zorba_regex_engine.cpp 2013-09-17 23:08:54 +0000 |
3836 | @@ -25,6 +25,7 @@ |
3837 | #include "utf8_string.h" |
3838 | #include "zorba_regex_engine.h" |
3839 | #include "zorbatypes/chartype.h" |
3840 | +#include <zorba/internal/unique_ptr.h> |
3841 | |
3842 | namespace zorba { |
3843 | namespace regex_engine{ |
3844 | @@ -127,7 +128,7 @@ |
3845 | *regex_len = 0; |
3846 | int branch_len; |
3847 | regex_depth++; |
3848 | - std::auto_ptr<CRegexXQuery_regex> regex(new CRegexXQuery_regex(current_regex)); |
3849 | + std::unique_ptr<CRegexXQuery_regex> regex(new CRegexXQuery_regex(current_regex)); |
3850 | if(!current_regex) |
3851 | current_regex = regex.get(); |
3852 | if(regex_depth >= 2) |
3853 | @@ -172,7 +173,7 @@ |
3854 | { |
3855 | int piece_len; |
3856 | |
3857 | - std::auto_ptr<CRegexXQuery_branch> branch(new CRegexXQuery_branch(current_regex)); |
3858 | + std::unique_ptr<CRegexXQuery_branch> branch(new CRegexXQuery_branch(current_regex)); |
3859 | CRegexXQuery_piece *piece; |
3860 | *branch_len = 0; |
3861 | while(pattern[*branch_len] && (pattern[*branch_len] != '|') && (pattern[*branch_len] != ')')) |
3862 | @@ -198,7 +199,7 @@ |
3863 | //piece = atom + quantifier |
3864 | CRegexXQuery_piece* CRegexXQuery_parser::parse_piece(const char *pattern, int *piece_len) |
3865 | { |
3866 | - std::auto_ptr<CRegexXQuery_piece> piece(new CRegexXQuery_piece); |
3867 | + std::unique_ptr<CRegexXQuery_piece> piece(new CRegexXQuery_piece); |
3868 | IRegexAtom *atom; |
3869 | *piece_len = 0; |
3870 | |
3871 | @@ -767,7 +768,7 @@ |
3872 | break; |
3873 | } |
3874 | /* |
3875 | - std::auto_ptr<CRegexXQuery_chargroup> chargroup(new CRegexXQuery_chargroup(current_regex)); |
3876 | + std::unique_ptr<CRegexXQuery_chargroup> chargroup(new CRegexXQuery_chargroup(current_regex)); |
3877 | if(multichar_type) |
3878 | chargroup->addMultiChar(c, multichar_type); |
3879 | else if(is_end_line) |
3880 | @@ -787,7 +788,7 @@ |
3881 | //charRange ::= seRange | XmlCharIncDash |
3882 | CRegexXQuery_chargroup* CRegexXQuery_parser::readchargroup(const char *pattern, int *chargroup_len) |
3883 | { |
3884 | - std::auto_ptr<CRegexXQuery_chargroup> chargroup; |
3885 | + std::unique_ptr<CRegexXQuery_chargroup> chargroup; |
3886 | *chargroup_len = 0; |
3887 | if(pattern[*chargroup_len] == '^')//negative group |
3888 | { |
3889 | |
3890 | === modified file 'src/zorbatypes/collation_manager.cpp' |
3891 | --- src/zorbatypes/collation_manager.cpp 2013-02-07 17:24:36 +0000 |
3892 | +++ src/zorbatypes/collation_manager.cpp 2013-09-17 23:08:54 +0000 |
3893 | @@ -23,7 +23,6 @@ |
3894 | |
3895 | #include <vector> |
3896 | #include <iostream> |
3897 | -#include <memory> |
3898 | #include <assert.h> |
3899 | #include <cstring> |
3900 | #include <cstdlib> |
3901 | @@ -33,7 +32,7 @@ |
3902 | namespace zorba { |
3903 | |
3904 | /** |
3905 | - * Method splits the passed string into tokes. |
3906 | + * Method splits the passed string into tokens. |
3907 | * Delimiters are all characters passed in the variable delims. |
3908 | */ |
3909 | std::vector<std::string> std_string_tokenize( |
3910 | |
3911 | === modified file 'src/zorbatypes/datetime/datetimetype.cpp' |
3912 | --- src/zorbatypes/datetime/datetimetype.cpp 2013-05-22 16:12:01 +0000 |
3913 | +++ src/zorbatypes/datetime/datetimetype.cpp 2013-09-17 23:08:54 +0000 |
3914 | @@ -20,7 +20,6 @@ |
3915 | #include <string> |
3916 | #include <exception> |
3917 | #include <cassert> |
3918 | -#include <memory> |
3919 | |
3920 | #ifndef WIN32 |
3921 | #include <sys/time.h> |
3922 | @@ -41,6 +40,7 @@ |
3923 | |
3924 | #include "util/ascii_util.h" |
3925 | #include "util/time_util.h" |
3926 | +#include <zorba/internal/unique_ptr.h> |
3927 | |
3928 | |
3929 | namespace zorba |
3930 | @@ -396,7 +396,7 @@ |
3931 | if (dt.data[HOUR_DATA] == 24) |
3932 | { |
3933 | dt.data[HOUR_DATA] = 0; |
3934 | - std::auto_ptr<DateTime> tmp(dt.addDuration(Duration(Duration::DAYTIMEDURATION_FACET, |
3935 | + std::unique_ptr<DateTime> tmp(dt.addDuration(Duration(Duration::DAYTIMEDURATION_FACET, |
3936 | false, 0, 0, 1, 0, 0, 0))); |
3937 | dt = *tmp; |
3938 | } |
3939 | @@ -1045,8 +1045,8 @@ |
3940 | |
3941 | int DateTime::compare(const DateTime* dt, long timezone_seconds) const |
3942 | { |
3943 | - std::auto_ptr<DateTime> d1_t; |
3944 | - std::auto_ptr<DateTime> d2_t; |
3945 | + std::unique_ptr<DateTime> d1_t; |
3946 | + std::unique_ptr<DateTime> d2_t; |
3947 | |
3948 | d1_t.reset(normalizeTimeZone(timezone_seconds)); |
3949 | d2_t.reset(dt->normalizeTimeZone(timezone_seconds)); |
3950 | @@ -1085,7 +1085,7 @@ |
3951 | uint32_t DateTime::hash(int implicit_timezone_seconds) const |
3952 | { |
3953 | uint32_t hval = 0; |
3954 | - std::auto_ptr<DateTime> dt(normalizeTimeZone(implicit_timezone_seconds)); |
3955 | + std::unique_ptr<DateTime> dt(normalizeTimeZone(implicit_timezone_seconds)); |
3956 | |
3957 | hval = hashfun::h32<int>((int)dt->facet, hval); |
3958 | hval = hashfun::h32<int>(dt->data[YEAR_DATA], hval); |
3959 | @@ -1216,7 +1216,7 @@ |
3960 | |
3961 | DateTime* DateTime::subtractDuration(const Duration& d, bool adjust_facet) const |
3962 | { |
3963 | - std::auto_ptr<Duration> negD(d.toNegDuration()); |
3964 | + std::unique_ptr<Duration> negD(d.toNegDuration()); |
3965 | return addDuration(*negD, adjust_facet); |
3966 | } |
3967 | |
3968 | @@ -1225,10 +1225,10 @@ |
3969 | const DateTime* dt, |
3970 | int implicit_timezone_seconds) const |
3971 | { |
3972 | - std::auto_ptr<DateTime> dt1(normalizeTimeZone(implicit_timezone_seconds)); |
3973 | - std::auto_ptr<DateTime> dt2(dt->normalizeTimeZone(implicit_timezone_seconds)); |
3974 | - std::auto_ptr<Duration> dur1(dt1->toDayTimeDuration()); |
3975 | - std::auto_ptr<Duration> dur2(dt2->toDayTimeDuration()); |
3976 | + std::unique_ptr<DateTime> dt1(normalizeTimeZone(implicit_timezone_seconds)); |
3977 | + std::unique_ptr<DateTime> dt2(dt->normalizeTimeZone(implicit_timezone_seconds)); |
3978 | + std::unique_ptr<Duration> dur1(dt1->toDayTimeDuration()); |
3979 | + std::unique_ptr<Duration> dur2(dt2->toDayTimeDuration()); |
3980 | return *dur1 - *dur2; |
3981 | } |
3982 | |
3983 | @@ -1262,18 +1262,18 @@ |
3984 | |
3985 | DateTime* DateTime::adjustToTimeZone(int tz_seconds) const |
3986 | { |
3987 | - std::auto_ptr<Duration> dtduration; |
3988 | - std::auto_ptr<Duration> context_tz; |
3989 | - std::auto_ptr<DateTime> dt; |
3990 | + std::unique_ptr<Duration> dtduration; |
3991 | + std::unique_ptr<Duration> context_tz; |
3992 | + std::unique_ptr<DateTime> dt; |
3993 | |
3994 | // validate timezone value (-14 .. +14 H) |
3995 | if (tz_seconds > 14*3600 || tz_seconds < -14*3600) |
3996 | throw InvalidTimezoneException( tz_seconds ); |
3997 | |
3998 | // If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context. |
3999 | - context_tz = std::auto_ptr<Duration>(new Duration(Duration::DAYTIMEDURATION_FACET, (tz_seconds<0), 0, 0, 0, 0, 0, tz_seconds, 0)); |
4000 | + context_tz = std::unique_ptr<Duration>(new Duration(Duration::DAYTIMEDURATION_FACET, (tz_seconds<0), 0, 0, 0, 0, 0, tz_seconds, 0)); |
4001 | |
4002 | - dt = std::auto_ptr<DateTime>(new DateTime(*this)); |
4003 | + dt = std::unique_ptr<DateTime>(new DateTime(*this)); |
4004 | |
4005 | // If $arg does not have a timezone component and $timezone is not the empty sequence, |
4006 | // then the result is $arg with $timezone as the timezone component. |
4007 | @@ -1288,7 +1288,7 @@ |
4008 | { |
4009 | // If $arg has a timezone component and $timezone is not the empty sequence, then |
4010 | // the result is an xs:dateTime value with a timezone component of $timezone that is equal to $arg. |
4011 | - dtduration = std::auto_ptr<Duration>(new Duration(Duration::DAYTIMEDURATION_FACET, |
4012 | + dtduration = std::unique_ptr<Duration>(new Duration(Duration::DAYTIMEDURATION_FACET, |
4013 | the_time_zone < 0, |
4014 | 0, 0, 0, |
4015 | the_time_zone.getHours(), |
4016 | @@ -1296,8 +1296,8 @@ |
4017 | 0, |
4018 | 0)); |
4019 | |
4020 | - dtduration = std::auto_ptr<Duration>(*context_tz - *dtduration); |
4021 | - dt = std::auto_ptr<DateTime>(dt->addDuration(*dtduration)); |
4022 | + dtduration = std::unique_ptr<Duration>(*context_tz - *dtduration); |
4023 | + dt = std::unique_ptr<DateTime>(dt->addDuration(*dtduration)); |
4024 | dt->the_time_zone = TimeZone( |
4025 | context_tz->getHours(), |
4026 | context_tz->getMinutes() |
4027 | @@ -1310,14 +1310,14 @@ |
4028 | |
4029 | DateTime* DateTime::adjustToTimeZone(const Duration* d) const |
4030 | { |
4031 | - std::auto_ptr<Duration> dtduration; |
4032 | - std::auto_ptr<const Duration> context_tz; |
4033 | - std::auto_ptr<DateTime> dt; |
4034 | + std::unique_ptr<Duration> dtduration; |
4035 | + std::unique_ptr<const Duration> context_tz; |
4036 | + std::unique_ptr<DateTime> dt; |
4037 | |
4038 | // A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H |
4039 | // or greater than PT14H or if does not contain an integral number of minutes. |
4040 | |
4041 | - dt = std::auto_ptr<DateTime>(new DateTime(*this)); |
4042 | + dt = std::unique_ptr<DateTime>(new DateTime(*this)); |
4043 | |
4044 | if (d == NULL) |
4045 | { |
4046 | @@ -1345,19 +1345,19 @@ |
4047 | { |
4048 | // If $arg has a timezone component and $timezone is not the empty sequence, then |
4049 | // the result is an xs:dateTime value with a timezone component of $timezone that is equal to $arg. |
4050 | - dtduration = std::auto_ptr<Duration>(new Duration(Duration::DAYTIMEDURATION_FACET, |
4051 | - the_time_zone < 0, |
4052 | - 0, 0, 0, |
4053 | - the_time_zone.getHours(), |
4054 | - the_time_zone.getMinutes(), |
4055 | - 0, |
4056 | - 0)); |
4057 | + dtduration.reset(new Duration(Duration::DAYTIMEDURATION_FACET, |
4058 | + the_time_zone < 0, |
4059 | + 0, 0, 0, |
4060 | + the_time_zone.getHours(), |
4061 | + the_time_zone.getMinutes(), |
4062 | + 0, |
4063 | + 0)); |
4064 | |
4065 | - context_tz = std::auto_ptr<Duration>(new Duration(*d)); |
4066 | + context_tz.reset(new Duration(*d)); |
4067 | if (context_tz.get() == NULL) |
4068 | assert(0); |
4069 | |
4070 | - dtduration = std::auto_ptr<Duration>(*context_tz - *dtduration); |
4071 | + dtduration.reset(*context_tz - *dtduration); |
4072 | dt.reset(dt->addDuration(*dtduration)); |
4073 | |
4074 | dt->the_time_zone = TimeZone( |
4075 | |
4076 | === modified file 'src/zorbatypes/datetime/duration.cpp' |
4077 | --- src/zorbatypes/datetime/duration.cpp 2013-05-22 02:22:35 +0000 |
4078 | +++ src/zorbatypes/datetime/duration.cpp 2013-09-17 23:08:54 +0000 |
4079 | @@ -16,7 +16,6 @@ |
4080 | #include "stdafx.h" |
4081 | |
4082 | #include <cmath> |
4083 | -#include <memory> |
4084 | #include <string> |
4085 | |
4086 | #include "zorbatypes/datetime.h" |
4087 | @@ -31,7 +30,7 @@ |
4088 | #include "diagnostics/xquery_diagnostics.h" |
4089 | |
4090 | #include "util/ascii_util.h" |
4091 | - |
4092 | +#include <zorba/internal/unique_ptr.h> |
4093 | |
4094 | namespace zorba |
4095 | { |
4096 | @@ -724,7 +723,7 @@ |
4097 | |
4098 | Duration* Duration::operator-(const Duration& d) const |
4099 | { |
4100 | - std::auto_ptr<Duration> temp = std::auto_ptr<Duration>(d.toNegDuration()); |
4101 | + std::unique_ptr<Duration> temp = std::unique_ptr<Duration>(d.toNegDuration()); |
4102 | return operator+(*temp); |
4103 | } |
4104 | |
4105 | |
4106 | === modified file 'test/api/userdefined_uri_resolution.cpp' |
4107 | --- test/api/userdefined_uri_resolution.cpp 2013-06-20 11:05:03 +0000 |
4108 | +++ test/api/userdefined_uri_resolution.cpp 2013-09-17 23:08:54 +0000 |
4109 | @@ -17,7 +17,6 @@ |
4110 | #include <iostream> |
4111 | #include <sstream> |
4112 | #include <vector> |
4113 | -#include <memory> |
4114 | #include <zorba/zorba.h> |
4115 | #include <zorba/store_manager.h> |
4116 | #include <zorba/zorba_exception.h> |
4117 | |
4118 | === modified file 'test/apitest.cpp' |
4119 | --- test/apitest.cpp 2013-08-14 00:39:44 +0000 |
4120 | +++ test/apitest.cpp 2013-09-17 23:08:54 +0000 |
4121 | @@ -20,7 +20,6 @@ |
4122 | #include <iostream> |
4123 | #include <iomanip> |
4124 | #include <sstream> |
4125 | -#include <memory> |
4126 | |
4127 | // tests are allowed to use internals |
4128 | #include "api/unmarshaller.h" |
4129 | @@ -30,6 +29,7 @@ |
4130 | #include <zorba/iterator.h> |
4131 | #include <zorba/util/fs_util.h> |
4132 | #include <zorba/xquery_exception.h> |
4133 | +#include <zorba/internal/unique_ptr.h> |
4134 | |
4135 | // Global variable g_abort_on_error is used to generate an abort() when an |
4136 | // error is encountered, to aid debugging |
4137 | @@ -121,14 +121,14 @@ |
4138 | } |
4139 | |
4140 | // output file (either a file or the standard out if no file is specified) |
4141 | - auto_ptr<ostream> outputFile (lProp->resultFile ().empty () |
4142 | + unique_ptr<ostream> outputFile (lProp->resultFile ().empty () |
4143 | ? NULL : new ofstream (lProp->resultFile().c_str())); |
4144 | ostream *resultFile = outputFile.get (); |
4145 | if (resultFile == NULL) |
4146 | resultFile = &cout; |
4147 | |
4148 | // input file (either from a file or given as parameter) |
4149 | - auto_ptr<istream> qfile; |
4150 | + unique_ptr<istream> qfile; |
4151 | std::string path; |
4152 | |
4153 | if (! lProp->inlineQuery()) |
4154 | @@ -273,7 +273,7 @@ |
4155 | //if you want to print the plan into a file |
4156 | if( ! lProp->dotPlanFile().empty () ) |
4157 | { |
4158 | - auto_ptr<ostream> planFile (new ofstream (lProp->dotPlanFile().c_str())); |
4159 | + unique_ptr<ostream> planFile (new ofstream (lProp->dotPlanFile().c_str())); |
4160 | ostream *printPlanFile = planFile.get (); |
4161 | |
4162 | query->printPlan(*printPlanFile, true); |
4163 | |
4164 | === modified file 'test/driver/testdriver.cpp' |
4165 | --- test/driver/testdriver.cpp 2013-08-13 23:32:22 +0000 |
4166 | +++ test/driver/testdriver.cpp 2013-09-17 23:08:54 +0000 |
4167 | @@ -37,6 +37,7 @@ |
4168 | |
4169 | #include <zorba/static_context.h> |
4170 | #include <zorba/util/fs_util.h> |
4171 | +#include <zorba/internal/unique_ptr.h> |
4172 | |
4173 | #include "zorbatypes/URI.h" |
4174 | #include "util/ascii_util.h" |
4175 | @@ -157,11 +158,11 @@ |
4176 | bool isW3Ctest = isW3CFTtest || isW3CXQTStest; |
4177 | std::string lQueryWithoutSuffix = |
4178 | std::string(argv[i]).substr( 0, std::string(argv[i]).rfind('.') ); |
4179 | - std::auto_ptr<zorba::TestSchemaURIMapper> smapper; |
4180 | - std::auto_ptr<zorba::TestModuleURIMapper> mmapper; |
4181 | - std::auto_ptr<zorba::TestCollectionURIMapper> cmapper; |
4182 | - std::auto_ptr<zorba::TestSchemeURIMapper> dmapper; |
4183 | - std::auto_ptr<zorba::TestURLResolver> tresolver; |
4184 | + std::unique_ptr<zorba::TestSchemaURIMapper> smapper; |
4185 | + std::unique_ptr<zorba::TestModuleURIMapper> mmapper; |
4186 | + std::unique_ptr<zorba::TestCollectionURIMapper> cmapper; |
4187 | + std::unique_ptr<zorba::TestSchemeURIMapper> dmapper; |
4188 | + std::unique_ptr<zorba::TestURLResolver> tresolver; |
4189 | |
4190 | // Create the static context. If this is a w3c query, install special uri |
4191 | // resolvers in the static context. |
4192 | |
4193 | === modified file 'test/driver/testdriver_mt.cpp' |
4194 | --- test/driver/testdriver_mt.cpp 2013-08-09 08:27:30 +0000 |
4195 | +++ test/driver/testdriver_mt.cpp 2013-09-17 23:08:54 +0000 |
4196 | @@ -27,6 +27,7 @@ |
4197 | #include <zorba/zorba.h> |
4198 | #include <zorba/diagnostic_handler.h> |
4199 | #include <zorba/zorba_exception.h> |
4200 | +#include <zorba/internal/unique_ptr.h> |
4201 | |
4202 | #include <zorbatypes/URI.h> |
4203 | |
4204 | @@ -405,12 +406,12 @@ |
4205 | std::string mod_map_file = rbkt_src_dir + w3cDataDir + "module.txt"; |
4206 | std::string col_map_file = rbkt_src_dir + w3cDataDir + "collection.txt"; |
4207 | |
4208 | - std::auto_ptr<zorba::TestSchemaURIMapper> smapper; |
4209 | - std::auto_ptr<zorba::TestModuleURIMapper> mmapper; |
4210 | - std::auto_ptr<zorba::TestCollectionURIMapper> cmapper; |
4211 | + std::unique_ptr<zorba::TestSchemaURIMapper> smapper; |
4212 | + std::unique_ptr<zorba::TestModuleURIMapper> mmapper; |
4213 | + std::unique_ptr<zorba::TestCollectionURIMapper> cmapper; |
4214 | |
4215 | - std::auto_ptr<zorba::TestSchemeURIMapper> dmapper; |
4216 | - std::auto_ptr<zorba::TestURLResolver> tresolver; |
4217 | + std::unique_ptr<zorba::TestSchemeURIMapper> dmapper; |
4218 | + std::unique_ptr<zorba::TestURLResolver> tresolver; |
4219 | |
4220 | DriverContext driverContext(zorba); |
4221 | driverContext.theRbktSourceDir = rbkt_src_dir; |
4222 | |
4223 | === modified file 'test/driver/updtestdriver.cpp' |
4224 | --- test/driver/updtestdriver.cpp 2013-08-09 08:27:30 +0000 |
4225 | +++ test/driver/updtestdriver.cpp 2013-09-17 23:08:54 +0000 |
4226 | @@ -35,6 +35,7 @@ |
4227 | #include <zorba/zorba_string.h> |
4228 | #include <zorba/static_context_consts.h> |
4229 | #include <zorba/store_consts.h> |
4230 | +#include <zorba/internal/unique_ptr.h> |
4231 | |
4232 | #include "util/ascii_util.h" |
4233 | #include "util/fs_util.h" |
4234 | @@ -274,7 +275,7 @@ |
4235 | Zorba_SerializerOptions lSerOptions; |
4236 | lSerOptions.omit_xml_declaration = ZORBA_OMIT_XML_DECLARATION_YES; |
4237 | |
4238 | - std::auto_ptr<zorba::TestSchemaURIMapper> smapper; |
4239 | + std::unique_ptr<zorba::TestSchemaURIMapper> smapper; |
4240 | |
4241 | ulong numQueries = (ulong)lSpec.theStates.size(); |
4242 | |
4243 | |
4244 | === modified file 'test/rbkt/modules/link.xq.src/link.cpp' |
4245 | --- test/rbkt/modules/link.xq.src/link.cpp 2013-02-07 17:24:36 +0000 |
4246 | +++ test/rbkt/modules/link.xq.src/link.cpp 2013-09-17 23:08:54 +0000 |
4247 | @@ -16,6 +16,7 @@ |
4248 | #include "link.h" |
4249 | #include <zorba/item_factory.h> |
4250 | #include <zorba/singleton_item_sequence.h> |
4251 | +#include <zorba/internal/unique_ptr.h> |
4252 | |
4253 | #include <xercesc/util/XMLDouble.hpp> |
4254 | #include "../ourlib/ourlib.h" |
4255 | @@ -68,8 +69,8 @@ |
4256 | doub1[0] = '1'; |
4257 | doub2[0] = '2'; |
4258 | doub1[1] = doub2[1] = '\0'; |
4259 | - std::auto_ptr<XMLDouble> xdoub1(new XMLDouble(doub1)); |
4260 | - std::auto_ptr<XMLDouble> xdoub2(new XMLDouble(doub2)); |
4261 | + std::unique_ptr<XMLDouble> xdoub1(new XMLDouble(doub1)); |
4262 | + std::unique_ptr<XMLDouble> xdoub2(new XMLDouble(doub2)); |
4263 | int lComp = XMLDouble::compareValues(xdoub1.get(), xdoub2.get()); |
4264 | zorba::Item lStr = |
4265 | Zorba::getInstance(0)->getItemFactory()->createInteger(lComp); |
4266 | @@ -86,7 +87,7 @@ |
4267 | zorba::StaticContext const* aSctx, zorba::DynamicContext const* aDctx) const |
4268 | { |
4269 | // Silly test case |
4270 | - std::auto_ptr<Ourlib> lOurlib(new Ourlib(55)); |
4271 | + std::unique_ptr<Ourlib> lOurlib(new Ourlib(55)); |
4272 | int lVal = lOurlib->ourfunc(); |
4273 | zorba::Item lStr = |
4274 | Zorba::getInstance(0)->getItemFactory()->createInteger(lVal); |
Validation queue starting for the following merge proposals: /code.launchpad .net/~zorba- coders/ zorba/bug- 1210677- autoptr/ +merge/ 180455
https:/
Progress dashboard at http:// jenkins. lambda. nu/view/ ValidationQueue