File: unique_ptr.patch

package info (click to toggle)
odb-api 0.18.1-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 26,452 kB
  • sloc: cpp: 115,083; ansic: 86,859; f90: 30,318; sql: 12,508; sh: 9,939; yacc: 3,680; python: 2,432; lex: 1,593; perl: 1,116; fortran: 341; csh: 214; makefile: 111; lisp: 17
file content (238 lines) | stat: -rw-r--r-- 10,365 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
Description: Replace auto_ptr with unique_ptr
 auto_ptr is deprecated with C++11 onwards.
Author: Alastair McKinstry <mckinstry@debian.org>
Forwarded: no
Last-Update: 2018-07-02

Index: odb-api-0.18.0/odb_api/src/ecml/data/DataHandleFactory.cc
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/ecml/data/DataHandleFactory.cc
+++ odb-api-0.18.0/odb_api/src/ecml/data/DataHandleFactory.cc
@@ -92,7 +92,7 @@ DataHandle* DataHandleFactory::openForRe
 {
     registerFactories();
     std::pair<std::string,std::string> p (splitPrefix(s));
-    std::auto_ptr<DataHandle> d (makeHandle(p.first, p.second));
+    std::unique_ptr<DataHandle> d (makeHandle(p.first, p.second));
     d->openForRead();
     return d.release();
 }
@@ -101,7 +101,7 @@ DataHandle* DataHandleFactory::openForWr
 {
     registerFactories();
     std::pair<std::string,std::string> p (splitPrefix(s));
-    std::auto_ptr<DataHandle> d (makeHandle(p.first, p.second));
+    std::unique_ptr<DataHandle> d (makeHandle(p.first, p.second));
     d->openForWrite(length);
     return d.release();
 }
Index: odb-api-0.18.0/odb_api/src/ecml/prelude/TryHandler.cc
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/ecml/prelude/TryHandler.cc
+++ odb-api-0.18.0/odb_api/src/ecml/prelude/TryHandler.cc
@@ -36,9 +36,9 @@ TryHandler::TryHandler(const string& nam
 //       finally = (println,values=bye)
 Request TryHandler::handle(const Request request, ExecutionContext& context)
 {
-    auto_ptr<Cell> body (request->valueOrDefault("do", 0));
-    auto_ptr<Cell> _catch (request->valueOrDefault("catch", 0));
-    auto_ptr<Cell> finally (request->valueOrDefault("finally", 0));
+    unique_ptr<Cell> body (request->valueOrDefault("do", 0));
+    unique_ptr<Cell> _catch (request->valueOrDefault("catch", 0));
+    unique_ptr<Cell> finally (request->valueOrDefault("finally", 0));
 
     if (! body.get()) throw eckit::UserError("No 'do' passed to 'try'");
 
Index: odb-api-0.18.0/odb_api/src/odb_api/DataSelect.h
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/DataSelect.h
+++ odb-api-0.18.0/odb_api/src/odb_api/DataSelect.h
@@ -83,7 +83,7 @@ private:
     const std::string statement_;
     const DataSet* const dataset_;
     const DataTable* const table_;
-    std::auto_ptr<internal::DataSelectIterator> begin_;
+    std::unique_ptr<internal::DataSelectIterator> begin_;
     DataColumns columns_;
     ecml::ExecutionContext* context_;
 
Index: odb-api-0.18.0/odb_api/src/odb_api/FastODA2Request.cc
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/FastODA2Request.cc
+++ odb-api-0.18.0/odb_api/src/odb_api/FastODA2Request.cc
@@ -86,7 +86,7 @@ bool FastODA2Request<T>::scanFile(const
 
 	MDR::iterator it = mdReader.begin(), end = mdReader.end();
 
-    std::auto_ptr<MetaData> currentMD(it->columns().clone());
+    std::unique_ptr<MetaData> currentMD(it->columns().clone());
 	rowsNumber_ = currentMD->rowsNumber();
 
     values_ = std::vector<std::set<std::string> >(currentMD->size(), std::set<std::string>());
Index: odb-api-0.18.0/odb_api/src/odb_api/FunctionRLIKE.h
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/FunctionRLIKE.h
+++ odb-api-0.18.0/odb_api/src/odb_api/FunctionRLIKE.h
@@ -37,7 +37,7 @@ private:
 // No copy allowed
 	FunctionRLIKE& operator=(const FunctionRLIKE&);
 
-	std::auto_ptr<eckit::Regex> re_;
+	std::unique_ptr<eckit::Regex> re_;
 
 // -- Overridden methods
 	virtual const odb::sql::type::SQLType* type() const;
Index: odb-api-0.18.0/odb_api/src/odb_api/SQLDistinctOutput.h
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/SQLDistinctOutput.h
+++ odb-api-0.18.0/odb_api/src/odb_api/SQLDistinctOutput.h
@@ -35,7 +35,7 @@ private:
 	virtual const SQLOutputConfig& config();
 	virtual	void config(SQLOutputConfig&);
 // -- Members
-    std::auto_ptr<SQLOutput>   output_;
+    std::unique_ptr<SQLOutput>   output_;
 	std::set<std::vector<double> >  seen_;
 	std::vector<double>        tmp_;
 // -- Overridden methods
Index: odb-api-0.18.0/odb_api/src/odb_api/SQLIndex.cc
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/SQLIndex.cc
+++ odb-api-0.18.0/odb_api/src/odb_api/SQLIndex.cc
@@ -63,7 +63,7 @@ void SQLIndex::update()
 		}
 	}
 
-	auto_ptr<BeDB> db(new BeDB(path,false));
+	unique_ptr<BeDB> db(new BeDB(path,false));
 	db_ = db;
 #endif
 }
Index: odb-api-0.18.0/odb_api/src/odb_api/SQLIndex.h
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/SQLIndex.h
+++ odb-api-0.18.0/odb_api/src/odb_api/SQLIndex.h
@@ -86,7 +86,7 @@ private:
 
 	SQLColumn&           owner_;
 #if 0
-	auto_ptr<BeDB> db_;
+	unique_ptr<BeDB> db_;
 #endif
 	double*              value_;
 
Index: odb-api-0.18.0/odb_api/src/odb_api/SQLOrderOutput.h
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/SQLOrderOutput.h
+++ odb-api-0.18.0/odb_api/src/odb_api/SQLOrderOutput.h
@@ -37,7 +37,7 @@ private:
 	SQLOrderOutput& operator=(const SQLOrderOutput&);
 
 // -- Members
-    std::auto_ptr<SQLOutput> output_;
+    std::unique_ptr<SQLOutput> output_;
 	std::pair<Expressions,std::vector<bool> > by_;
 	
 	typedef std::map<OrderByExpressions, VectorOfExpressions> SortedResults;
Index: odb-api-0.18.0/odb_api/src/odb_api/SQLSelect.h
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/SQLSelect.h
+++ odb-api-0.18.0/odb_api/src/odb_api/SQLSelect.h
@@ -88,12 +88,12 @@ private:
 	std::vector<SQLTable*> tables_;
 	SortedTables sortedTables_;
 
-    std::auto_ptr<odb::sql::expression::SQLExpression> where_;
+    std::unique_ptr<odb::sql::expression::SQLExpression> where_;
 	odb::sql::expression::SQLExpression* simplifiedWhere_;
 
 	Stack env;
 
-    std::auto_ptr<SQLOutput> output_;
+	std::unique_ptr<SQLOutput> output_;
 	Expressions  results_;
 
     typedef std::map<std::vector<std::pair<double,bool> >, expression::Expressions*> AggregatedResults;
Index: odb-api-0.18.0/odb_api/src/odb_api/ecml_verbs/ArchiveHandler.cc
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/ecml_verbs/ArchiveHandler.cc
+++ odb-api-0.18.0/odb_api/src/odb_api/ecml_verbs/ArchiveHandler.cc
@@ -140,7 +140,7 @@ void ArchiveHandler::archive(const eckit
 
     stringstream ss;
     ss << protocol << request;
-    auto_ptr<eckit::DataHandle> mars (DataHandleFactory::openForWrite(ss.str(), eckit::Length(Archiver::fileSize(source))));
+    unique_ptr<eckit::DataHandle> mars (DataHandleFactory::openForWrite(ss.str(), eckit::Length(Archiver::fileSize(source))));
 
     input.saveInto(*mars);
 }
Index: odb-api-0.18.0/odb_api/src/odb_api/tools/LSTool.cc
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/tools/LSTool.cc
+++ odb-api-0.18.0/odb_api/src/odb_api/tools/LSTool.cc
@@ -81,7 +81,7 @@ void LSTool::run()
 
     std::string db = parameters(1);
 
-    std::auto_ptr<std::ofstream> foutPtr;
+    std::unique_ptr<std::ofstream> foutPtr;
 	if (optionIsSet("-o"))
         foutPtr.reset(new std::ofstream(optionArgument("-o", std::string("")).c_str()));
     std::ostream& out = optionIsSet("-o") ? *foutPtr : std::cout;
Index: odb-api-0.18.0/odb_api/src/odb_api/tools/MDSetTool.cc
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/tools/MDSetTool.cc
+++ odb-api-0.18.0/odb_api/src/odb_api/tools/MDSetTool.cc
@@ -40,7 +40,7 @@ void MDSetTool::run()
     }
 
     PathName inFile = parameters(2), outFile = parameters(3);
-    std::auto_ptr<DataHandle> outHandle(ODBAPISettings::instance().writeToFile(outFile));
+    std::unique_ptr<DataHandle> outHandle(ODBAPISettings::instance().writeToFile(outFile));
 
     std::vector<std::string> columns, types, values;
     std::vector<BitfieldDef> bitfieldDefs;
Index: odb-api-0.18.0/odb_api/src/odb_api/tools/SQLTool.cc
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/tools/SQLTool.cc
+++ odb-api-0.18.0/odb_api/src/odb_api/tools/SQLTool.cc
@@ -82,7 +82,7 @@ void SQLTool::run()
                 ? StringTools::join(" ",  params) + ";"
                 // FIXME:
                 : StringTool::readFile(params[0] == "-" ? "/dev/tty" : params[0]) + ";");
-    std::auto_ptr<std::ofstream> foutPtr(optionIsSet("-o")
+    std::unique_ptr<std::ofstream> foutPtr(optionIsSet("-o")
                                 ? new std::ofstream(optionArgument("-o", std::string("")).c_str())
                                 : 0);
     std::ostream& out(foutPtr.get() ? *foutPtr : std::cout);
Index: odb-api-0.18.0/odb_api/src/odb_api/tools/TestRunner.cc
===================================================================
--- odb-api-0.18.0.orig/odb_api/src/odb_api/tools/TestRunner.cc
+++ odb-api-0.18.0/odb_api/src/odb_api/tools/TestRunner.cc
@@ -50,7 +50,7 @@ void TestRunner::run()
 	ASSERT(getenv("ODB_API_TEST_DATA_PATH") && "ODB_API_TEST_DATA_PATH must be set");
 
 	stringstream totalRunningTime;
-	auto_ptr<Timer> allTestsTimer(new Timer("Total", totalRunningTime));
+	unique_ptr<Timer> allTestsTimer(new Timer("Total", totalRunningTime));
 	auto_ptr<TestCases> tests(0);
 	
 	failed_.clear();
@@ -73,7 +73,7 @@ void TestRunner::run()
 			string suiteName = clp_.parameters()[i];
 			ASSERT("Suite does not exist" && suites_.find(suiteName) != suites_.end());
 			vector<string>& suite = suites_[suiteName];
-			auto_ptr<vector<TestCase*> > tsts(AbstractToolFactory::testCases(suite));
+			unique_ptr<vector<TestCase*> > tsts(AbstractToolFactory::testCases(suite));
 
 			runTests(*tsts);
 			tests->insert(tests->end(), tsts->begin(), tsts->end());
@@ -126,7 +126,7 @@ void TestRunner::runTests(const TestCase
 		smslabel(name);
 
 		stringstream runningTime;
-		auto_ptr<Timer> timer(new Timer(name, runningTime));
+		unique_ptr<Timer> timer(new Timer(name, runningTime));
 		try {
 			tst->setUp();
 			tst->test();