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

@@ -21,8 +21,7 @@
#include "Poco/KeyValueArgs.h"
#include "Poco/ValidArgs.h"
#include "Poco/Mutex.h"
#include "Poco/Exception.h"
#include "Poco/FIFOEvent.h"
#include "Poco/BasicEvent.h"
#include "Poco/EventArgs.h"
#include "Poco/Delegate.h"
#include "Poco/SharedPtr.h"
@@ -39,16 +38,16 @@ class AbstractCache
/// An AbstractCache is the interface of all caches.
{
public:
FIFOEvent<const KeyValueArgs<TKey, TValue>, TEventMutex> Add;
FIFOEvent<const KeyValueArgs<TKey, TValue>, TEventMutex> Update;
FIFOEvent<const TKey, TEventMutex> Remove;
FIFOEvent<const TKey, TEventMutex> Get;
FIFOEvent<const EventArgs, TEventMutex> Clear;
BasicEvent<const KeyValueArgs<TKey, TValue>, TEventMutex> Add;
BasicEvent<const KeyValueArgs<TKey, TValue>, TEventMutex> Update;
BasicEvent<const TKey, TEventMutex> Remove;
BasicEvent<const TKey, TEventMutex> Get;
BasicEvent<const EventArgs, TEventMutex> Clear;
typedef std::map<TKey, SharedPtr<TValue>> DataHolder;
typedef typename DataHolder::iterator Iterator;
typedef typename DataHolder::const_iterator ConstIterator;
typedef std::set<TKey> KeySet;
using DataHolder = std::map<TKey, SharedPtr<TValue>>;
using Iterator = typename DataHolder::iterator;
using ConstIterator = typename DataHolder::const_iterator;
using KeySet = std::set<TKey>;
AbstractCache()
{
@@ -72,6 +71,9 @@ public:
}
}
AbstractCache(const AbstractCache& aCache) = delete;
AbstractCache& operator = (const AbstractCache& aCache) = delete;
void add(const TKey& key, const TValue& val)
/// Adds the key value pair to the cache.
/// If for the key already an entry exists, it will be overwritten.
@@ -194,8 +196,8 @@ public:
}
protected:
mutable FIFOEvent<ValidArgs<TKey>> IsValid;
mutable FIFOEvent<KeySet> Replace;
mutable BasicEvent<ValidArgs<TKey>> IsValid;
mutable BasicEvent<KeySet> Replace;
void initialize()
/// Sets up event registration.
@@ -371,9 +373,6 @@ protected:
mutable DataHolder _data;
mutable TMutex _mutex;
private:
AbstractCache(const AbstractCache& aCache);
AbstractCache& operator = (const AbstractCache& aCache);
};