Skip to content

Commit 4b4ec93

Browse files
committed
- introduced Poco::Dynamic namespace
- moved/renamed: Poco::DynamicAny => Poco::Dynamic::Var Poco::DynamicAny typedef for backward compatibility (deprecated) DynamicAny.h forwarding header for backward compatibility (deprecated) Poco::DynamicAnyHolder => Poco::Dynamic::VarHolder DynamicAnyHolder.h forwarding header for backward compatibility (deprecated) Poco::DynamicStruct => Poco::Dynamic::Struct Poco::DynamicStruct typedef for backward compatibility (deprecated) DynamicStruct.h forwarding header for backward compatibility (deprecated) - changed FastMutex to Mutex in Data::SessionPool (deadlocking)
1 parent 9d9db7c commit 4b4ec93

52 files changed

Lines changed: 5983 additions & 8163 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Data/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ objects = AbstractBinder AbstractBinding AbstractExtraction AbstractExtractor \
1414
PooledSessionHolder PooledSessionImpl Position \
1515
Range RecordSet Row RowFilter RowFormatter RowIterator \
1616
SimpleRowFormatter Session SessionFactory SessionImpl \
17-
SessionPool SQLChannel Statement StatementCreator StatementImpl Time
17+
SessionPool SessionPoolContainer SQLChannel \
18+
Statement StatementCreator StatementImpl Time
1819

1920
target = PocoData
2021
target_version = $(LIBVERSION)

‎Data/ODBC/testsuite/src/SQLExecutor.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "Poco/Data/BulkExtraction.h"
4444
#include "Poco/Data/BulkBinding.h"
4545
#include "Poco/NumberFormatter.h"
46+
#include "Poco/String.h"
4647
#include "Poco/Exception.h"
4748
#include <iostream>
4849

@@ -187,7 +188,7 @@ class SQLExecutor: public CppUnit::TestCase
187188
try
188189
{
189190
session() <<
190-
format("INSERT INTO MiscTest VALUES (?,%s,?,?,?,?)", blobPlaceholder),
191+
Poco::format("INSERT INTO MiscTest VALUES (?,%s,?,?,?,?)", blobPlaceholder),
191192
use(strings),
192193
use(blobs),
193194
use(ints),
@@ -204,7 +205,7 @@ class SQLExecutor: public CppUnit::TestCase
204205
try
205206
{
206207
session() <<
207-
format("INSERT INTO MiscTest VALUES (?,%s,?,?,?,?)", blobPlaceholder),
208+
Poco::format("INSERT INTO MiscTest VALUES (?,%s,?,?,?,?)", blobPlaceholder),
208209
use(strings, bulk),
209210
use(blobs, bulk),
210211
use(ints, bulk),

‎Data/include/Poco/Data/AbstractBinder.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#include "Poco/Data/BLOB.h"
4747
#include "Poco/DateTime.h"
4848
#include "Poco/Any.h"
49-
#include "Poco/DynamicAny.h"
49+
#include "Poco/Dynamic/Var.h"
5050
#include <vector>
5151
#include <deque>
5252
#include <list>
@@ -326,8 +326,8 @@ class Data_API AbstractBinder
326326
void bind(std::size_t pos, const Any& val, Direction dir = PD_IN);
327327
/// Binds an Any.
328328

329-
void bind(std::size_t pos, const DynamicAny& val, Direction dir = PD_IN);
330-
/// Binds a DynamicAny.
329+
void bind(std::size_t pos, const Poco::Dynamic::Var& val, Direction dir = PD_IN);
330+
/// Binds a Var.
331331

332332
virtual void reset();
333333
/// Resets a binder. No-op by default. Implement for binders that cache data.

‎Data/include/Poco/Data/AbstractExtractor.h‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ namespace Poco {
5454

5555
class DateTime;
5656
class Any;
57-
class DynamicAny;
5857

58+
namespace Dynamic {
59+
class Var;
60+
}
5961

6062
namespace Data {
6163

@@ -306,17 +308,17 @@ class Data_API AbstractExtractor
306308
virtual bool extract(std::size_t pos, std::list<Any>& val);
307309
/// Extracts an Any list.
308310

309-
virtual bool extract(std::size_t pos, DynamicAny& val) = 0;
310-
/// Extracts a DynamicAny. Returns false if null was received.
311+
virtual bool extract(std::size_t pos, Poco::Dynamic::Var& val) = 0;
312+
/// Extracts a Var. Returns false if null was received.
311313

312-
virtual bool extract(std::size_t pos, std::vector<DynamicAny>& val);
313-
/// Extracts a DynamicAny vector.
314+
virtual bool extract(std::size_t pos, std::vector<Poco::Dynamic::Var>& val);
315+
/// Extracts a Var vector.
314316

315-
virtual bool extract(std::size_t pos, std::deque<DynamicAny>& val);
316-
/// Extracts a DynamicAny deque.
317+
virtual bool extract(std::size_t pos, std::deque<Poco::Dynamic::Var>& val);
318+
/// Extracts a Var deque.
317319

318-
virtual bool extract(std::size_t pos, std::list<DynamicAny>& val);
319-
/// Extracts a DynamicAny list.
320+
virtual bool extract(std::size_t pos, std::list<Poco::Dynamic::Var>& val);
321+
/// Extracts a Var list.
320322

321323
virtual bool isNull(std::size_t col, std::size_t row = POCO_DATA_INVALID_ROW) = 0;
322324
/// Returns true if the value at [col,row] position is null.

‎Data/include/Poco/Data/AbstractPreparation.h‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ namespace Poco {
5353

5454
class DateTime;
5555
class Any;
56-
class DynamicAny;
56+
57+
namespace Dynamic {
58+
class Var;
59+
}
5760

5861

5962
namespace Data {
@@ -310,17 +313,17 @@ class Data_API AbstractPreparation: public Poco::RefCountedObject
310313
virtual void prepare(std::size_t pos, const std::list<Any>& val);
311314
/// Prepares an Any list.
312315

313-
virtual void prepare(std::size_t pos, const DynamicAny&) = 0;
314-
/// Prepares a DynamicAny.
316+
virtual void prepare(std::size_t pos, const Poco::Dynamic::Var&) = 0;
317+
/// Prepares a Var.
315318

316-
virtual void prepare(std::size_t pos, const std::vector<DynamicAny>& val);
317-
/// Prepares a DynamicAny vector.
319+
virtual void prepare(std::size_t pos, const std::vector<Poco::Dynamic::Var>& val);
320+
/// Prepares a Var vector.
318321

319-
virtual void prepare(std::size_t pos, const std::deque<DynamicAny>& val);
320-
/// Prepares a DynamicAny deque.
322+
virtual void prepare(std::size_t pos, const std::deque<Poco::Dynamic::Var>& val);
323+
/// Prepares a Var deque.
321324

322-
virtual void prepare(std::size_t pos, const std::list<DynamicAny>& val);
323-
/// Prepares a DynamicAny list.
325+
virtual void prepare(std::size_t pos, const std::list<Poco::Dynamic::Var>& val);
326+
/// Prepares a Var list.
324327

325328
void setLength(Poco::UInt32 length);
326329
/// Sets the length of prepared data.

‎Data/include/Poco/Data/ArchiveStrategy.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#include "Poco/Data/Session.h"
4545
#include "Poco/DateTime.h"
4646
#include "Poco/Timespan.h"
47-
#include "Poco/DynamicAny.h"
47+
#include "Poco/Dynamic/Var.h"
4848
#include "Poco/SharedPtr.h"
4949

5050

@@ -221,10 +221,10 @@ class Data_API ArchiveByAgeStrategy: public ArchiveStrategy
221221

222222
void initStatements();
223223

224-
Timespan _maxAge;
225-
std::string _ageString;
226-
DateTime _archiveDateTime;
227-
DynamicAny _archiveCount;
224+
Timespan _maxAge;
225+
std::string _ageString;
226+
DateTime _archiveDateTime;
227+
Poco::Dynamic::Var _archiveCount;
228228
};
229229

230230

‎Data/include/Poco/Data/BLOB.h‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
#include "Poco/Data/Data.h"
4444
#include "Poco/SharedPtr.h"
45-
#include "Poco/DynamicAnyHolder.h"
45+
#include "Poco/Dynamic/VarHolder.h"
4646
#include "Poco/Exception.h"
4747
#include <vector>
4848

@@ -232,52 +232,53 @@ namespace std
232232

233233

234234
//
235-
// DynamicAnyHolderImpl<BLOB>
235+
// VarHolderImpl<BLOB>
236236
//
237237

238238

239239
namespace Poco {
240+
namespace Dynamic {
240241

241242

242243
template <>
243-
class DynamicAnyHolderImpl<Data::BLOB>: public DynamicAnyHolder
244+
class VarHolderImpl<Poco::Data::BLOB>: public VarHolder
244245
{
245246
public:
246-
DynamicAnyHolderImpl(const Data::BLOB& val): _val(val)
247+
VarHolderImpl(const Poco::Data::BLOB& val): _val(val)
247248
{
248249
}
249250

250-
~DynamicAnyHolderImpl()
251+
~VarHolderImpl()
251252
{
252253
}
253254

254255
const std::type_info& type() const
255256
{
256-
return typeid(Data::BLOB);
257+
return typeid(Poco::Data::BLOB);
257258
}
258259

259260
void convert(std::string& val) const
260261
{
261262
val.assign(_val.begin(), _val.end());
262263
}
263264

264-
DynamicAnyHolder* clone() const
265+
VarHolder* clone() const
265266
{
266-
return new DynamicAnyHolderImpl(_val);
267+
return new VarHolderImpl(_val);
267268
}
268269

269-
const Data::BLOB& value() const
270+
const Poco::Data::BLOB& value() const
270271
{
271272
return _val;
272273
}
273274

274275
private:
275-
DynamicAnyHolderImpl();
276-
Data::BLOB _val;
276+
VarHolderImpl();
277+
Poco::Data::BLOB _val;
277278
};
278279

279280

280-
} // namespace Poco
281+
} } // namespace Poco::Dynamic
281282

282283

283284
#endif // Data_BLOB_INCLUDED

‎Data/include/Poco/Data/Date.h‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242

4343
#include "Poco/Data/Data.h"
44-
#include "Poco/DynamicAnyHolder.h"
44+
#include "Poco/Dynamic/VarHolder.h"
4545
#include "Poco/Exception.h"
4646

4747

@@ -158,28 +158,29 @@ inline bool Date::operator > (const Date& date)
158158

159159

160160
//
161-
// DynamicAnyHolderImpl<BLOB>
161+
// VarHolderImpl<BLOB>
162162
//
163163

164164

165165
namespace Poco {
166+
namespace Dynamic {
166167

167168

168169
template <>
169-
class DynamicAnyHolderImpl<Data::Date>: public DynamicAnyHolder
170+
class VarHolderImpl<Poco::Data::Date>: public VarHolder
170171
{
171172
public:
172-
DynamicAnyHolderImpl(const Data::Date& val): _val(val)
173+
VarHolderImpl(const Poco::Data::Date& val): _val(val)
173174
{
174175
}
175176

176-
~DynamicAnyHolderImpl()
177+
~VarHolderImpl()
177178
{
178179
}
179180

180181
const std::type_info& type() const
181182
{
182-
return typeid(Data::Date);
183+
return typeid(Poco::Data::Date);
183184
}
184185

185186
void convert(Poco::Timestamp& val) const
@@ -205,23 +206,23 @@ class DynamicAnyHolderImpl<Data::Date>: public DynamicAnyHolder
205206
val = DateTimeFormatter::format(dt, "%Y/%m/%d");
206207
}
207208

208-
DynamicAnyHolder* clone() const
209+
VarHolder* clone() const
209210
{
210-
return new DynamicAnyHolderImpl(_val);
211+
return new VarHolderImpl(_val);
211212
}
212213

213-
const Data::Date& value() const
214+
const Poco::Data::Date& value() const
214215
{
215216
return _val;
216217
}
217218

218219
private:
219-
DynamicAnyHolderImpl();
220-
Data::Date _val;
220+
VarHolderImpl();
221+
Poco::Data::Date _val;
221222
};
222223

223224

224-
} // namespace Poco
225+
} } // namespace Poco::Dynamic
225226

226227

227228
#endif // Data_Date_INCLUDED

0 commit comments

Comments
 (0)