enh(Poco): Mark deprecated functionality with C++ attributes and resolve internal usage of deprecated functions (#4551)

* enh(poco): Replace deprecated comments with C++ deprecated attribute.

* enh(Poco): Replace some deprecated functionality in Poco sources. (#4426)

* enh(Poco): Replace more deprecated functionality in Poco sources. (#4426)

* fix(CMake): Variable BUILD_SHARED_LIBS must be defined properly to create valid binaries.

* enh: Code improvements done while resolving deprecated functionality (#4426)

* Un-deprecate LocalDateTme (#4426)

* enh(Poco): Replace usage of deprecated functionality with other functions/classes (#4426)

* chore(SSL): temporarily un-deprecate SSL-related functionality (#4426)

* chore(SSL): temporarily un-deprecate old MongoDB protocol functionality (#4426)

* enh(Poco): Minor Hash improvements (#4426)

* enh(Foundation): Compile deprecated hash tests only when POCO_TEST_DEPRECATED is enabled (#4426)

* enh(Net): Compile deprecated Socket::select functionality only when POCO_TEST_DEPRECATED is enabled (#4426)

* enh(Bonjour): Replace deprecated Socket::select with PollSet (#4426)

* enh(Poco): Introduce POCO_DEPRECATED macro to have the ability to disable deprecation warnings in applications (#4426)

* test(ODBC): add few asserts to testStoredProcedureDynamicVar

* fix(ODBC): rename DynamicAny -> DynamicVar in tests

* fix(ODBC): make Dignostics static members inline to prevent explicit instantiation warnings on windows

---------

Co-authored-by: Alex Fabijanic <alex@pocoproject.org>
This commit is contained in:
Matej Kenda
2024-07-29 08:16:50 +02:00
parent 5117e27515
commit f24547cdcf
112 changed files with 586 additions and 550 deletions

View File

@@ -20,7 +20,6 @@
#include "Poco/Foundation.h"
#include "Poco/Hash.h"
#include <functional>
#include <algorithm>
#include <vector>
#include <cstddef>
@@ -55,16 +54,16 @@ class LinearHashTable
/// elements in a bucket should not exceed 3.
{
public:
typedef Value ValueType;
typedef Value& Reference;
typedef const Value& ConstReference;
typedef Value* Pointer;
typedef const Value* ConstPointer;
typedef HashFunc Hash;
typedef std::vector<Value> Bucket;
typedef std::vector<Bucket> BucketVec;
typedef typename Bucket::iterator BucketIterator;
typedef typename BucketVec::iterator BucketVecIterator;
using ValueType = Value;
using Reference = Value &;
using ConstReference = const Value &;
using Pointer = Value *;
using ConstPointer = const Value *;
using Hash = HashFunc;
using Bucket = std::vector<Value>;
using BucketVec = std::vector<Bucket>;
using BucketIterator = typename Bucket::iterator;
using BucketVecIterator = typename BucketVec::iterator;
class ConstIterator
{
@@ -176,9 +175,7 @@ public:
class Iterator: public ConstIterator
{
public:
Iterator()
{
}
Iterator() = default;
Iterator(const BucketVecIterator& vecIt, const BucketVecIterator& endIt, const BucketIterator& buckIt):
ConstIterator(vecIt, endIt, buckIt)
@@ -238,10 +235,7 @@ public:
friend class LinearHashTable;
};
LinearHashTable(std::size_t initialReserve = 64):
_split(0),
_front(1),
_size(0)
LinearHashTable(std::size_t initialReserve = 64)
/// Creates the LinearHashTable, using the given initialReserve.
{
_buckets.reserve(calcSize(initialReserve));
@@ -257,10 +251,8 @@ public:
{
}
~LinearHashTable()
~LinearHashTable() = default;
/// Destroys the LinearHashTable.
{
}
LinearHashTable& operator = (const LinearHashTable& table)
/// Assigns another LinearHashTable.
@@ -495,9 +487,9 @@ private:
// Evil hack: _buckets must be mutable because both ConstIterator and Iterator hold
// ordinary iterator's (not const_iterator's).
mutable BucketVec _buckets;
std::size_t _split;
std::size_t _front;
std::size_t _size;
std::size_t _split{0};
std::size_t _front{1};
std::size_t _size{0};
HashFunc _hash;
};