enh(Foundation): modernised header files (override, using, nullptr, ...)

This commit is contained in:
Matej Kenda
2025-02-10 14:52:52 +01:00
parent 9e4e039c04
commit e7687d4bba
184 changed files with 1487 additions and 1797 deletions

View File

@@ -30,14 +30,14 @@ class Foundation_API ASCIIEncoding: public TextEncoding
{ {
public: public:
ASCIIEncoding(); ASCIIEncoding();
~ASCIIEncoding(); ~ASCIIEncoding() override;
const char* canonicalName() const; const char* canonicalName() const override;
bool isA(const std::string& encodingName) const; bool isA(const std::string& encodingName) const override;
const CharacterMap& characterMap() const; const CharacterMap& characterMap() const override;
int convert(const unsigned char* bytes) const; int convert(const unsigned char* bytes) const override;
int convert(int ch, unsigned char* bytes, int length) const; int convert(int ch, unsigned char* bytes, int length) const override;
int queryConvert(const unsigned char* bytes, int length) const; int queryConvert(const unsigned char* bytes, int length) const override;
int sequenceLength(const unsigned char* bytes, int length) const; int sequenceLength(const unsigned char* bytes, int length) const override;
private: private:
static const char* _names[]; static const char* _names[];

View File

@@ -29,17 +29,12 @@ class AbstractDelegate
/// Base class for Delegate and Expire. /// Base class for Delegate and Expire.
{ {
public: public:
AbstractDelegate() AbstractDelegate() = default;
{
}
AbstractDelegate(const AbstractDelegate& /*del*/) AbstractDelegate(const AbstractDelegate & /*del*/) = default;
{ AbstractDelegate& operator=(const AbstractDelegate &) = default;
}
virtual ~AbstractDelegate() virtual ~AbstractDelegate() = default;
{
}
virtual bool notify(const void* sender, TArgs& arguments) = 0; virtual bool notify(const void* sender, TArgs& arguments) = 0;
/// Invokes the delegate's callback function. /// Invokes the delegate's callback function.
@@ -69,17 +64,12 @@ class AbstractDelegate<void>
/// Base class for Delegate and Expire. /// Base class for Delegate and Expire.
{ {
public: public:
AbstractDelegate() AbstractDelegate() = default;
{
}
AbstractDelegate(const AbstractDelegate&) AbstractDelegate(const AbstractDelegate &) = default;
{ AbstractDelegate& operator=(const AbstractDelegate &) = default;
}
virtual ~AbstractDelegate() virtual ~AbstractDelegate() = default;
{
}
virtual bool notify(const void* sender) = 0; virtual bool notify(const void* sender) = 0;
/// Invokes the delegate's callback function. /// Invokes the delegate's callback function.

View File

@@ -149,8 +149,8 @@ class AbstractEvent
/// to create the PriorityDelegate. /// to create the PriorityDelegate.
{ {
public: public:
typedef TDelegate* DelegateHandle; using DelegateHandle = TDelegate *;
typedef TArgs Args; using Args = TArgs;
AbstractEvent(): AbstractEvent():
_executeAsync(this, &AbstractEvent::executeAsyncImpl), _executeAsync(this, &AbstractEvent::executeAsyncImpl),
@@ -165,9 +165,10 @@ public:
{ {
} }
virtual ~AbstractEvent() virtual ~AbstractEvent() = default;
{
} AbstractEvent(const AbstractEvent &other) = delete;
AbstractEvent &operator=(const AbstractEvent &other) = delete;
void operator += (const TDelegate& aDelegate) void operator += (const TDelegate& aDelegate)
/// Adds a delegate to the event. /// Adds a delegate to the event.
@@ -347,10 +348,6 @@ protected:
bool _enabled; /// Stores if an event is enabled. Notifies on disabled events have no effect bool _enabled; /// Stores if an event is enabled. Notifies on disabled events have no effect
/// but it is possible to change the observers. /// but it is possible to change the observers.
mutable TMutex _mutex; mutable TMutex _mutex;
private:
AbstractEvent(const AbstractEvent& other);
AbstractEvent& operator = (const AbstractEvent& other);
}; };
@@ -358,7 +355,7 @@ template <class TStrategy, class TDelegate, class TMutex>
class AbstractEvent<void, TStrategy, TDelegate, TMutex> class AbstractEvent<void, TStrategy, TDelegate, TMutex>
{ {
public: public:
typedef TDelegate* DelegateHandle; using DelegateHandle = TDelegate *;
AbstractEvent(): AbstractEvent():
_executeAsync(this, &AbstractEvent::executeAsyncImpl), _executeAsync(this, &AbstractEvent::executeAsyncImpl),
@@ -373,9 +370,10 @@ public:
{ {
} }
virtual ~AbstractEvent() virtual ~AbstractEvent() = default;
{
} AbstractEvent(const AbstractEvent &other) = delete;
AbstractEvent &operator=(const AbstractEvent &other) = delete;
void operator += (const TDelegate& aDelegate) void operator += (const TDelegate& aDelegate)
/// Adds a delegate to the event. /// Adds a delegate to the event.
@@ -547,10 +545,6 @@ protected:
bool _enabled; /// Stores if an event is enabled. Notifies on disabled events have no effect bool _enabled; /// Stores if an event is enabled. Notifies on disabled events have no effect
/// but it is possible to change the observers. /// but it is possible to change the observers.
mutable TMutex _mutex; mutable TMutex _mutex;
private:
AbstractEvent(const AbstractEvent& other);
AbstractEvent& operator = (const AbstractEvent& other);
}; };

View File

@@ -43,9 +43,7 @@ public:
{ {
} }
virtual ~AbstractPriorityDelegate() virtual ~AbstractPriorityDelegate() = default;
{
}
int priority() const int priority() const
{ {

View File

@@ -32,13 +32,9 @@ class AbstractStrategy
/// An AbstractStrategy is the interface for all strategies. /// An AbstractStrategy is the interface for all strategies.
{ {
public: public:
AbstractStrategy() AbstractStrategy() = default;
{
}
virtual ~AbstractStrategy() virtual ~AbstractStrategy() = default;
{
}
virtual void onUpdate(const void* pSender, const KeyValueArgs <TKey, TValue>& args) virtual void onUpdate(const void* pSender, const KeyValueArgs <TKey, TValue>& args)
/// Updates an existing entry. /// Updates an existing entry.

View File

@@ -51,10 +51,7 @@ public:
{ {
} }
~AccessExpirationDecorator() = default;
~AccessExpirationDecorator()
{
}
const Poco::Timespan& getTimeout() const const Poco::Timespan& getTimeout() const
{ {

View File

@@ -47,13 +47,10 @@ public:
{ {
} }
~AccessExpireCache() ~AccessExpireCache() = default;
{
}
private: AccessExpireCache(const AccessExpireCache& aCache) = delete;
AccessExpireCache(const AccessExpireCache& aCache); AccessExpireCache& operator=(const AccessExpireCache& aCache) = delete;
AccessExpireCache& operator = (const AccessExpireCache& aCache);
}; };

View File

@@ -46,13 +46,10 @@ public:
this->_strategy.pushBack(new AccessExpireStrategy<TKey, TValue>(expire)); this->_strategy.pushBack(new AccessExpireStrategy<TKey, TValue>(expire));
} }
~AccessExpireLRUCache() ~AccessExpireLRUCache() = default;
{
}
private: AccessExpireLRUCache(const AccessExpireLRUCache& aCache) = delete;
AccessExpireLRUCache(const AccessExpireLRUCache& aCache); AccessExpireLRUCache& operator=(const AccessExpireLRUCache& aCache) = delete;
AccessExpireLRUCache& operator = (const AccessExpireLRUCache& aCache);
}; };

View File

@@ -17,16 +17,8 @@
#ifndef Foundation_AccessExpireStrategy_INCLUDED #ifndef Foundation_AccessExpireStrategy_INCLUDED
#define Foundation_AccessExpireStrategy_INCLUDED #define Foundation_AccessExpireStrategy_INCLUDED
#include "Poco/KeyValueArgs.h"
#include "Poco/ValidArgs.h"
#include "Poco/ExpireStrategy.h" #include "Poco/ExpireStrategy.h"
#include "Poco/Bugcheck.h"
#include "Poco/Timestamp.h" #include "Poco/Timestamp.h"
#include "Poco/EventArgs.h"
#include <set>
#include <map>
namespace Poco { namespace Poco {
@@ -45,9 +37,7 @@ public:
{ {
} }
~AccessExpireStrategy() ~AccessExpireStrategy() = default;
{
}
void onGet(const void*, const TKey& key) void onGet(const void*, const TKey& key)
{ {

View File

@@ -79,7 +79,7 @@ public:
/// Creates the ActiveDispatcher and sets /// Creates the ActiveDispatcher and sets
/// the priority of its thread. /// the priority of its thread.
virtual ~ActiveDispatcher(); ~ActiveDispatcher() override;
/// Destroys the ActiveDispatcher. /// Destroys the ActiveDispatcher.
void start(ActiveRunnableBase::Ptr pRunnable); void start(ActiveRunnableBase::Ptr pRunnable);
@@ -89,7 +89,7 @@ public:
/// Cancels all queued methods. /// Cancels all queued methods.
protected: protected:
void run(); void run() override;
void stop(); void stop();
private: private:

View File

@@ -72,9 +72,9 @@ class ActiveMethod
/// class can be used. /// class can be used.
{ {
public: public:
typedef ResultType (OwnerType::*Callback)(const ArgType&); using Callback = ResultType (OwnerType::*)(const ArgType &);
typedef ActiveResult<ResultType> ActiveResultType; using ActiveResultType = ActiveResult<ResultType>;
typedef ActiveRunnable<ResultType, ArgType, OwnerType> ActiveRunnableType; using ActiveRunnableType = ActiveRunnable<ResultType, ArgType, OwnerType>;
ActiveMethod(OwnerType* pOwner, Callback method): ActiveMethod(OwnerType* pOwner, Callback method):
_pOwner(pOwner), _pOwner(pOwner),
@@ -84,6 +84,8 @@ public:
poco_check_ptr (pOwner); poco_check_ptr (pOwner);
} }
ActiveMethod() = delete;
ActiveResultType operator () (const ArgType& arg) ActiveResultType operator () (const ArgType& arg)
/// Invokes the ActiveMethod. /// Invokes the ActiveMethod.
{ {
@@ -113,8 +115,6 @@ public:
} }
private: private:
ActiveMethod();
OwnerType* _pOwner; OwnerType* _pOwner;
Callback _method; Callback _method;
}; };
@@ -164,9 +164,9 @@ class ActiveMethod <ResultType, void, OwnerType, StarterType>
/// For methods that do not require an argument or a return value, simply use void. /// For methods that do not require an argument or a return value, simply use void.
{ {
public: public:
typedef ResultType (OwnerType::*Callback)(void); using Callback = ResultType (OwnerType::*)();
typedef ActiveResult<ResultType> ActiveResultType; using ActiveResultType = ActiveResult<ResultType>;
typedef ActiveRunnable<ResultType, void, OwnerType> ActiveRunnableType; using ActiveRunnableType = ActiveRunnable<ResultType, void, OwnerType>;
ActiveMethod(OwnerType* pOwner, Callback method): ActiveMethod(OwnerType* pOwner, Callback method):
_pOwner(pOwner), _pOwner(pOwner),
@@ -176,6 +176,8 @@ public:
poco_check_ptr (pOwner); poco_check_ptr (pOwner);
} }
ActiveMethod() = delete;
ActiveResultType operator () (void) ActiveResultType operator () (void)
/// Invokes the ActiveMethod. /// Invokes the ActiveMethod.
{ {
@@ -205,8 +207,6 @@ public:
} }
private: private:
ActiveMethod();
OwnerType* _pOwner; OwnerType* _pOwner;
Callback _method; Callback _method;
}; };

View File

@@ -40,7 +40,7 @@ class ActiveResultHolder: public RefCountedObject
public: public:
ActiveResultHolder(): ActiveResultHolder():
_pData(0), _pData(0),
_pExc(0), _pExc(nullptr),
_event(Event::EVENT_MANUALRESET) _event(Event::EVENT_MANUALRESET)
/// Creates an ActiveResultHolder. /// Creates an ActiveResultHolder.
{ {
@@ -91,7 +91,7 @@ public:
/// Returns true if the active method failed (and threw an exception). /// Returns true if the active method failed (and threw an exception).
/// Information about the exception can be obtained by calling error(). /// Information about the exception can be obtained by calling error().
{ {
return _pExc != 0; return _pExc != nullptr;
} }
std::string error() const std::string error() const
@@ -127,7 +127,7 @@ public:
} }
protected: protected:
~ActiveResultHolder() ~ActiveResultHolder() override
{ {
delete _pData; delete _pData;
delete _pExc; delete _pExc;
@@ -146,7 +146,7 @@ class ActiveResultHolder<void>: public RefCountedObject
{ {
public: public:
ActiveResultHolder(): ActiveResultHolder():
_pExc(0), _pExc(nullptr),
_event(Event::EVENT_MANUALRESET) _event(Event::EVENT_MANUALRESET)
/// Creates an ActiveResultHolder. /// Creates an ActiveResultHolder.
{ {
@@ -184,7 +184,7 @@ public:
/// Returns true if the active method failed (and threw an exception). /// Returns true if the active method failed (and threw an exception).
/// Information about the exception can be obtained by calling error(). /// Information about the exception can be obtained by calling error().
{ {
return _pExc != 0; return _pExc != nullptr;
} }
std::string error() const std::string error() const
@@ -220,7 +220,7 @@ public:
} }
protected: protected:
~ActiveResultHolder() ~ActiveResultHolder() override
{ {
delete _pExc; delete _pExc;
} }
@@ -238,8 +238,8 @@ class ActiveResult
/// result from the execution thread back to the invocation thread. /// result from the execution thread back to the invocation thread.
{ {
public: public:
typedef RT ResultType; using ResultType = RT;
typedef ActiveResultHolder<ResultType> ActiveResultHolderType; using ActiveResultHolderType = ActiveResultHolder<ResultType>;
ActiveResult(ActiveResultHolderType* pHolder): ActiveResult(ActiveResultHolderType* pHolder):
_pHolder(pHolder) _pHolder(pHolder)
@@ -261,6 +261,8 @@ public:
_pHolder->release(); _pHolder->release();
} }
ActiveResult() = delete;
ActiveResult& operator = (const ActiveResult& result) ActiveResult& operator = (const ActiveResult& result)
/// Assignment operator. /// Assignment operator.
{ {
@@ -363,8 +365,6 @@ public:
} }
private: private:
ActiveResult();
ActiveResultHolderType* _pHolder; ActiveResultHolderType* _pHolder;
}; };
@@ -377,7 +377,7 @@ class ActiveResult<void>
/// result from the execution thread back to the invocation thread. /// result from the execution thread back to the invocation thread.
{ {
public: public:
typedef ActiveResultHolder<void> ActiveResultHolderType; using ActiveResultHolderType = ActiveResultHolder<void>;
ActiveResult(ActiveResultHolderType* pHolder): ActiveResult(ActiveResultHolderType* pHolder):
_pHolder(pHolder) _pHolder(pHolder)
@@ -399,6 +399,8 @@ public:
_pHolder->release(); _pHolder->release();
} }
ActiveResult() = delete;
ActiveResult& operator = (const ActiveResult& result) ActiveResult& operator = (const ActiveResult& result)
/// Assignment operator. /// Assignment operator.
{ {
@@ -483,8 +485,6 @@ public:
} }
private: private:
ActiveResult();
ActiveResultHolderType* _pHolder; ActiveResultHolderType* _pHolder;
}; };

View File

@@ -43,8 +43,8 @@ class ActiveRunnable: public ActiveRunnableBase
/// See the ActiveMethod class for more information. /// See the ActiveMethod class for more information.
{ {
public: public:
typedef ResultType (OwnerType::*Callback)(const ArgType&); using Callback = ResultType (OwnerType::*)(const ArgType &);
typedef ActiveResult<ResultType> ActiveResultType; using ActiveResultType = ActiveResult<ResultType>;
ActiveRunnable(OwnerType* pOwner, Callback method, const ArgType& arg, const ActiveResultType& result): ActiveRunnable(OwnerType* pOwner, Callback method, const ArgType& arg, const ActiveResultType& result):
_pOwner(pOwner), _pOwner(pOwner),
@@ -55,7 +55,7 @@ public:
poco_check_ptr (pOwner); poco_check_ptr (pOwner);
} }
void run() void run() override
{ {
ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
try try
@@ -91,8 +91,8 @@ class ActiveRunnable<void, ArgType, OwnerType>: public ActiveRunnableBase
/// See the ActiveMethod class for more information. /// See the ActiveMethod class for more information.
{ {
public: public:
typedef void (OwnerType::*Callback)(const ArgType&); using Callback = void (OwnerType::*)(const ArgType &);
typedef ActiveResult<void> ActiveResultType; using ActiveResultType = ActiveResult<void>;
ActiveRunnable(OwnerType* pOwner, Callback method, const ArgType& arg, const ActiveResultType& result): ActiveRunnable(OwnerType* pOwner, Callback method, const ArgType& arg, const ActiveResultType& result):
_pOwner(pOwner), _pOwner(pOwner),
@@ -103,7 +103,7 @@ public:
poco_check_ptr (pOwner); poco_check_ptr (pOwner);
} }
void run() void run() override
{ {
ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
try try
@@ -139,8 +139,8 @@ class ActiveRunnable<ResultType, void, OwnerType>: public ActiveRunnableBase
/// See the ActiveMethod class for more information. /// See the ActiveMethod class for more information.
{ {
public: public:
typedef ResultType (OwnerType::*Callback)(); using Callback = ResultType (OwnerType::*)();
typedef ActiveResult<ResultType> ActiveResultType; using ActiveResultType = ActiveResult<ResultType>;
ActiveRunnable(OwnerType* pOwner, Callback method, const ActiveResultType& result): ActiveRunnable(OwnerType* pOwner, Callback method, const ActiveResultType& result):
_pOwner(pOwner), _pOwner(pOwner),
@@ -150,7 +150,7 @@ public:
poco_check_ptr (pOwner); poco_check_ptr (pOwner);
} }
void run() void run() override
{ {
ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
try try
@@ -185,8 +185,8 @@ class ActiveRunnable<void, void, OwnerType>: public ActiveRunnableBase
/// See the ActiveMethod class for more information. /// See the ActiveMethod class for more information.
{ {
public: public:
typedef void (OwnerType::*Callback)(); using Callback = void (OwnerType::*)();
typedef ActiveResult<void> ActiveResultType; using ActiveResultType = ActiveResult<void>;
ActiveRunnable(OwnerType* pOwner, Callback method, const ActiveResultType& result): ActiveRunnable(OwnerType* pOwner, Callback method, const ActiveResultType& result):
_pOwner(pOwner), _pOwner(pOwner),
@@ -196,7 +196,7 @@ public:
poco_check_ptr (pOwner); poco_check_ptr (pOwner);
} }
void run() void run() override
{ {
ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
try try

View File

@@ -74,8 +74,8 @@ class Activity: public Runnable
/// }; /// };
{ {
public: public:
typedef RunnableAdapter<C> RunnableAdapterType; using RunnableAdapterType = RunnableAdapter<C>;
typedef typename RunnableAdapterType::Callback Callback; using Callback = typename RunnableAdapterType::Callback;
Activity(C* pOwner, Callback method): Activity(C* pOwner, Callback method):
_pOwner(pOwner), _pOwner(pOwner),
@@ -89,7 +89,7 @@ public:
poco_check_ptr (pOwner); poco_check_ptr (pOwner);
} }
~Activity() ~Activity() override
/// Stops and destroys the activity. /// Stops and destroys the activity.
{ {
try try
@@ -103,6 +103,10 @@ public:
} }
} }
Activity() = delete;
Activity(const Activity &) = delete;
Activity &operator=(const Activity &) = delete;
void start() void start()
/// Starts the activity by acquiring a /// Starts the activity by acquiring a
/// thread for it from the default thread pool. /// thread for it from the default thread pool.
@@ -172,7 +176,7 @@ public:
} }
protected: protected:
void run() void run() override
{ {
try try
{ {
@@ -189,10 +193,6 @@ protected:
} }
private: private:
Activity();
Activity(const Activity&);
Activity& operator = (const Activity&);
C* _pOwner; C* _pOwner;
RunnableAdapterType _runnable; RunnableAdapterType _runnable;
std::atomic<bool> _stopped; std::atomic<bool> _stopped;

View File

@@ -89,10 +89,10 @@ class Foundation_API ArchiveByNumberStrategy: public ArchiveStrategy
{ {
public: public:
ArchiveByNumberStrategy(); ArchiveByNumberStrategy();
~ArchiveByNumberStrategy(); ~ArchiveByNumberStrategy() override;
LogFile* open(LogFile* pFile); LogFile *open(LogFile *pFile) override;
LogFile* archive(LogFile* pFile); LogFile *archive(LogFile *pFile) override;
}; };
@@ -102,20 +102,16 @@ class ArchiveByTimestampStrategy: public ArchiveStrategy
/// log files. /// log files.
{ {
public: public:
ArchiveByTimestampStrategy() ArchiveByTimestampStrategy() = default;
{
}
~ArchiveByTimestampStrategy() ~ArchiveByTimestampStrategy() override = default;
{
}
LogFile* open(LogFile* pFile) LogFile* open(LogFile* pFile) override
{ {
return pFile; return pFile;
} }
LogFile* archive(LogFile* pFile) LogFile *archive(LogFile* pFile) override
/// Archives the file by appending the current timestamp to the /// Archives the file by appending the current timestamp to the
/// file name. If the new file name exists, additionally a monotonic /// file name. If the new file name exists, additionally a monotonic
/// increasing number is appended to the log file name. /// increasing number is appended to the log file name.

View File

@@ -41,13 +41,13 @@ class Array
/// His original implementation can be found at http://www.josuttis.com/cppcode/array.html . /// His original implementation can be found at http://www.josuttis.com/cppcode/array.html .
{ {
public: public:
typedef T value_type; using value_type = T;
typedef T* iterator; using iterator = T *;
typedef const T* const_iterator; using const_iterator = const T *;
typedef T& reference; using reference = T &;
typedef const T& const_reference; using const_reference = const T &;
typedef std::size_t size_type; using size_type = std::size_t;
typedef std::ptrdiff_t difference_type; using difference_type = std::ptrdiff_t;
iterator begin() iterator begin()
{ {
@@ -69,8 +69,8 @@ public:
return elems+N; return elems+N;
} }
typedef std::reverse_iterator<iterator> reverse_iterator; using reverse_iterator = std::reverse_iterator<iterator>;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator; using const_reverse_iterator = std::reverse_iterator<const_iterator>;
reverse_iterator rbegin() reverse_iterator rbegin()
{ {

View File

@@ -44,7 +44,7 @@ class Foundation_API AsyncChannel: public Channel, public Runnable
public: public:
using Ptr = AutoPtr<AsyncChannel>; using Ptr = AutoPtr<AsyncChannel>;
AsyncChannel(Channel::Ptr pChannel = 0, Thread::Priority prio = Thread::PRIO_NORMAL); AsyncChannel(Channel::Ptr pChannel = nullptr, Thread::Priority prio = Thread::PRIO_NORMAL);
/// Creates the AsyncChannel and connects it to /// Creates the AsyncChannel and connects it to
/// the given channel. /// the given channel.
@@ -55,19 +55,19 @@ public:
Channel::Ptr getChannel() const; Channel::Ptr getChannel() const;
/// Returns the target channel. /// Returns the target channel.
void open(); void open() override;
/// Opens the channel and creates the /// Opens the channel and creates the
/// background logging thread. /// background logging thread.
void close(); void close() override;
/// Closes the channel and stops the background /// Closes the channel and stops the background
/// logging thread. /// logging thread.
void log(const Message& msg); void log(const Message& msg) override;
/// Queues the message for processing by the /// Queues the message for processing by the
/// background thread. /// background thread.
void setProperty(const std::string& name, const std::string& value); void setProperty(const std::string& name, const std::string& value) override;
/// Sets or changes a configuration property. /// Sets or changes a configuration property.
/// ///
/// The "channel" property allows setting the target /// The "channel" property allows setting the target
@@ -99,8 +99,8 @@ public:
/// The "queueSize" property is set-only. /// The "queueSize" property is set-only.
protected: protected:
~AsyncChannel(); ~AsyncChannel() override;
void run(); void run() override;
void setPriority(const std::string& value); void setPriority(const std::string& value);
private: private:

View File

@@ -42,7 +42,7 @@ public:
AsyncNotificationCenter(); AsyncNotificationCenter();
/// Creates the AsyncNotificationCenter and starts the notifying thread. /// Creates the AsyncNotificationCenter and starts the notifying thread.
~AsyncNotificationCenter(); ~AsyncNotificationCenter() override;
/// Stops the notifying thread and destroys the AsyncNotificationCenter. /// Stops the notifying thread and destroys the AsyncNotificationCenter.
AsyncNotificationCenter& operator = (const AsyncNotificationCenter&) = delete; AsyncNotificationCenter& operator = (const AsyncNotificationCenter&) = delete;
@@ -50,10 +50,10 @@ public:
AsyncNotificationCenter& operator = (AsyncNotificationCenter&&) = delete; AsyncNotificationCenter& operator = (AsyncNotificationCenter&&) = delete;
AsyncNotificationCenter(AsyncNotificationCenter&&) = delete; AsyncNotificationCenter(AsyncNotificationCenter&&) = delete;
virtual void postNotification(Notification::Ptr pNotification); void postNotification(Notification::Ptr pNotification) override;
/// Enqueues notification into the notification queue. /// Enqueues notification into the notification queue.
virtual int backlog() const; int backlog() const override;
/// Returns the numbner of notifications in the notification queue. /// Returns the numbner of notifications in the notification queue.
private: private:

View File

@@ -66,7 +66,7 @@ public:
_started(false), _started(false),
_done(false) _done(false)
{ {
poco_assert(observer._nq.size() == 0); poco_assert(observer._nq.empty());
} }
~AsyncObserver() ~AsyncObserver()
@@ -78,7 +78,7 @@ public:
{ {
if (&observer != this) if (&observer != this)
{ {
poco_assert(observer._nq.size() == 0); poco_assert(observer._nq.empty());
setObject(observer._pObject); setObject(observer._pObject);
setHandler(observer._handler); setHandler(observer._handler);
setMatcher(observer._matcher); setMatcher(observer._matcher);

View File

@@ -34,7 +34,7 @@ class Foundation_API AtomicCounter
/// reference counting and similar functionality. /// reference counting and similar functionality.
{ {
public: public:
typedef int ValueType; /// The underlying integer type. using ValueType = int; /// The underlying integer type.
AtomicCounter(); AtomicCounter();
/// Creates a new AtomicCounter and initializes it to zero. /// Creates a new AtomicCounter and initializes it to zero.

View File

@@ -70,6 +70,11 @@ public:
~AtomicFlag() = default; ~AtomicFlag() = default;
/// Destroys AtomicFlag. /// Destroys AtomicFlag.
AtomicFlag(const AtomicFlag&) = delete;
AtomicFlag& operator = (const AtomicFlag&) = delete;
AtomicFlag(AtomicFlag&&) = delete;
AtomicFlag& operator = (AtomicFlag&&) = delete;
bool set(); bool set();
/// Sets the flag to true and returns previously /// Sets the flag to true and returns previously
/// held value. /// held value.
@@ -82,11 +87,6 @@ public:
/// held value. /// held value.
private: private:
AtomicFlag(const AtomicFlag&) = delete;
AtomicFlag& operator = (const AtomicFlag&) = delete;
AtomicFlag(AtomicFlag&&) = delete;
AtomicFlag& operator = (AtomicFlag&&) = delete;
std::atomic_flag _flag = ATOMIC_FLAG_INIT; std::atomic_flag _flag = ATOMIC_FLAG_INIT;
}; };

View File

@@ -42,10 +42,8 @@ class AutoReleasePool
/// arp.add(ptr.duplicate()); /// arp.add(ptr.duplicate());
{ {
public: public:
AutoReleasePool() AutoReleasePool() = default;
/// Creates the AutoReleasePool. /// Creates the AutoReleasePool.
{
}
~AutoReleasePool() ~AutoReleasePool()
/// Destroys the AutoReleasePool and releases /// Destroys the AutoReleasePool and releases
@@ -74,7 +72,7 @@ public:
} }
private: private:
typedef std::list<C*> ObjectList; using ObjectList = std::list<C *>;
ObjectList _list; ObjectList _list;
}; };

View File

@@ -38,10 +38,10 @@ class Foundation_API Base32DecoderBuf: public UnbufferedStreamBuf
{ {
public: public:
Base32DecoderBuf(std::istream& istr); Base32DecoderBuf(std::istream& istr);
~Base32DecoderBuf(); ~Base32DecoderBuf() override;
private: private:
int readFromDevice(); int readFromDevice() override;
int readOne(); int readOne();
unsigned char _group[8]; unsigned char _group[8];
@@ -66,7 +66,7 @@ class Foundation_API Base32DecoderIOS: public virtual std::ios
{ {
public: public:
Base32DecoderIOS(std::istream& istr); Base32DecoderIOS(std::istream& istr);
~Base32DecoderIOS(); ~Base32DecoderIOS() override;
Base32DecoderBuf* rdbuf(); Base32DecoderBuf* rdbuf();
protected: protected:
@@ -92,7 +92,7 @@ class Foundation_API Base32Decoder: public Base32DecoderIOS, public std::istream
{ {
public: public:
Base32Decoder(std::istream& istr); Base32Decoder(std::istream& istr);
~Base32Decoder(); ~Base32Decoder() override;
private: private:
Base32Decoder(const Base32Decoder&); Base32Decoder(const Base32Decoder&);

View File

@@ -38,13 +38,13 @@ class Foundation_API Base32EncoderBuf: public UnbufferedStreamBuf
{ {
public: public:
Base32EncoderBuf(std::ostream& ostr, bool padding = true); Base32EncoderBuf(std::ostream& ostr, bool padding = true);
~Base32EncoderBuf(); ~Base32EncoderBuf() override;
int close(); int close();
/// Closes the stream buffer. /// Closes the stream buffer.
private: private:
int writeToDevice(char c); int writeToDevice(char c) override;
unsigned char _group[5]; unsigned char _group[5];
int _groupLength; int _groupLength;
@@ -68,7 +68,7 @@ class Foundation_API Base32EncoderIOS: public virtual std::ios
{ {
public: public:
Base32EncoderIOS(std::ostream& ostr, bool padding = true); Base32EncoderIOS(std::ostream& ostr, bool padding = true);
~Base32EncoderIOS(); ~Base32EncoderIOS() override;
int close(); int close();
Base32EncoderBuf* rdbuf(); Base32EncoderBuf* rdbuf();
@@ -98,7 +98,7 @@ class Foundation_API Base32Encoder: public Base32EncoderIOS, public std::ostream
{ {
public: public:
Base32Encoder(std::ostream& ostr, bool padding = true); Base32Encoder(std::ostream& ostr, bool padding = true);
~Base32Encoder(); ~Base32Encoder() override;
private: private:
Base32Encoder(const Base32Encoder&); Base32Encoder(const Base32Encoder&);

View File

@@ -38,10 +38,10 @@ class Foundation_API Base64DecoderBuf: public UnbufferedStreamBuf
{ {
public: public:
Base64DecoderBuf(std::istream& istr, int options = 0); Base64DecoderBuf(std::istream& istr, int options = 0);
~Base64DecoderBuf(); ~Base64DecoderBuf() override;
private: private:
int readFromDevice(); int readFromDevice() override;
int readOne(); int readOne();
int _options; int _options;
@@ -70,7 +70,7 @@ class Foundation_API Base64DecoderIOS: public virtual std::ios
{ {
public: public:
Base64DecoderIOS(std::istream& istr, int options = 0); Base64DecoderIOS(std::istream& istr, int options = 0);
~Base64DecoderIOS(); ~Base64DecoderIOS() override;
Base64DecoderBuf* rdbuf(); Base64DecoderBuf* rdbuf();
protected: protected:
@@ -96,7 +96,7 @@ class Foundation_API Base64Decoder: public Base64DecoderIOS, public std::istream
{ {
public: public:
Base64Decoder(std::istream& istr, int options = 0); Base64Decoder(std::istream& istr, int options = 0);
~Base64Decoder(); ~Base64Decoder() override;
private: private:
Base64Decoder(const Base64Decoder&); Base64Decoder(const Base64Decoder&);

View File

@@ -51,7 +51,7 @@ class Foundation_API Base64EncoderBuf: public UnbufferedStreamBuf
{ {
public: public:
Base64EncoderBuf(std::ostream& ostr, int options = 0); Base64EncoderBuf(std::ostream& ostr, int options = 0);
~Base64EncoderBuf(); ~Base64EncoderBuf() override;
int close(); int close();
/// Closes the stream buffer. /// Closes the stream buffer.
@@ -68,7 +68,7 @@ public:
/// Returns the currently set line length. /// Returns the currently set line length.
private: private:
int writeToDevice(char c); int writeToDevice(char c) override;
int _options; int _options;
unsigned char _group[3]; unsigned char _group[3];
@@ -96,7 +96,7 @@ class Foundation_API Base64EncoderIOS: public virtual std::ios
{ {
public: public:
Base64EncoderIOS(std::ostream& ostr, int options = 0); Base64EncoderIOS(std::ostream& ostr, int options = 0);
~Base64EncoderIOS(); ~Base64EncoderIOS() override;
int close(); int close();
Base64EncoderBuf* rdbuf(); Base64EncoderBuf* rdbuf();
@@ -126,7 +126,7 @@ class Foundation_API Base64Encoder: public Base64EncoderIOS, public std::ostream
{ {
public: public:
Base64Encoder(std::ostream& ostr, int options = 0); Base64Encoder(std::ostream& ostr, int options = 0);
~Base64Encoder(); ~Base64Encoder() override;
private: private:
Base64Encoder(const Base64Encoder&); Base64Encoder(const Base64Encoder&);

View File

@@ -40,17 +40,12 @@ class BasicEvent: public AbstractEvent <
/// for more information. /// for more information.
{ {
public: public:
BasicEvent() BasicEvent() = default;
{
}
~BasicEvent() ~BasicEvent() = default;
{
}
private: BasicEvent(const BasicEvent& e) = delete;
BasicEvent(const BasicEvent& e); BasicEvent& operator=(const BasicEvent& e) = delete;
BasicEvent& operator = (const BasicEvent& e);
}; };

View File

@@ -177,9 +177,7 @@ public:
{ {
} }
~BasicMemoryBinaryReader() ~BasicMemoryBinaryReader() = default;
{
}
const Buffer<T>& data() const const Buffer<T>& data() const
{ {
@@ -201,9 +199,7 @@ private:
MemoryInputStream _istr; MemoryInputStream _istr;
}; };
using MemoryBinaryReader = BasicMemoryBinaryReader<char>;
typedef BasicMemoryBinaryReader<char> MemoryBinaryReader;
// //
// inlines // inlines

View File

@@ -225,9 +225,7 @@ private:
MemoryOutputStream _ostr; MemoryOutputStream _ostr;
}; };
using MemoryBinaryWriter = BasicMemoryBinaryWriter<char>;
typedef BasicMemoryBinaryWriter<char> MemoryBinaryWriter;
// //
// inlines // inlines

View File

@@ -158,6 +158,8 @@ public:
if (_ownMem) delete [] _ptr; if (_ownMem) delete [] _ptr;
} }
Buffer() = delete;
void resize(std::size_t newCapacity, bool preserveContent = true) void resize(std::size_t newCapacity, bool preserveContent = true)
/// Resizes the buffer capacity and size. If preserveContent is true, /// Resizes the buffer capacity and size. If preserveContent is true,
/// the content of the old buffer is copied over to the /// the content of the old buffer is copied over to the
@@ -362,8 +364,6 @@ public:
} }
private: private:
Buffer();
std::size_t _capacity; std::size_t _capacity;
std::size_t _used; std::size_t _used;
T* _ptr; T* _ptr;

View File

@@ -32,7 +32,7 @@ class BufferAllocator
/// BufferAllocator has been specified. /// BufferAllocator has been specified.
{ {
public: public:
typedef ch char_type; using char_type = ch;
static char_type* allocate(std::streamsize size) static char_type* allocate(std::streamsize size)
{ {

View File

@@ -63,7 +63,7 @@ public:
resetBuffers(); resetBuffers();
} }
~BasicBufferedBidirectionalStreamBuf() ~BasicBufferedBidirectionalStreamBuf() override
{ {
Allocator::deallocate(_pReadBuffer, _bufsize); Allocator::deallocate(_pReadBuffer, _bufsize);
Allocator::deallocate(_pWriteBuffer, _bufsize); Allocator::deallocate(_pWriteBuffer, _bufsize);
@@ -72,7 +72,7 @@ public:
BasicBufferedBidirectionalStreamBuf(const BasicBufferedBidirectionalStreamBuf&) = delete; BasicBufferedBidirectionalStreamBuf(const BasicBufferedBidirectionalStreamBuf&) = delete;
BasicBufferedBidirectionalStreamBuf& operator = (const BasicBufferedBidirectionalStreamBuf&) = delete; BasicBufferedBidirectionalStreamBuf& operator = (const BasicBufferedBidirectionalStreamBuf&) = delete;
virtual int_type overflow(int_type c) int_type overflow(int_type c) override
{ {
if (!(_mode & IOS::out)) return char_traits::eof(); if (!(_mode & IOS::out)) return char_traits::eof();
@@ -86,7 +86,7 @@ public:
return c; return c;
} }
virtual int_type underflow() int_type underflow() override
{ {
if (!(_mode & IOS::in)) return char_traits::eof(); if (!(_mode & IOS::in)) return char_traits::eof();
@@ -107,7 +107,7 @@ public:
return char_traits::to_int_type(*this->gptr()); return char_traits::to_int_type(*this->gptr());
} }
virtual int sync() int sync() override
{ {
if (this->pptr() && this->pptr() > this->pbase()) if (this->pptr() && this->pptr() > this->pbase())
{ {

View File

@@ -43,15 +43,15 @@ class BasicBufferedStreamBuf: public std::basic_streambuf<ch, tr>
/// ostream, but not for an iostream. /// ostream, but not for an iostream.
{ {
protected: protected:
typedef std::basic_streambuf<ch, tr> Base; using Base = std::basic_streambuf<ch, tr>;
typedef std::basic_ios<ch, tr> IOS; using IOS = std::basic_ios<ch, tr>;
typedef ch char_type; using char_type = ch;
typedef tr char_traits; using char_traits = tr;
typedef ba Allocator; using Allocator = ba;
typedef typename Base::int_type int_type; using int_type = typename Base::int_type;
typedef typename Base::pos_type pos_type; using pos_type = typename Base::pos_type;
typedef typename Base::off_type off_type; using off_type = typename Base::off_type;
typedef typename IOS::openmode openmode; using openmode = typename IOS::openmode;
public: public:
BasicBufferedStreamBuf(std::streamsize bufferSize, openmode mode): BasicBufferedStreamBuf(std::streamsize bufferSize, openmode mode):
@@ -63,7 +63,7 @@ public:
this->setp(_pBuffer, _pBuffer + _bufsize); this->setp(_pBuffer, _pBuffer + _bufsize);
} }
~BasicBufferedStreamBuf() ~BasicBufferedStreamBuf() override
{ {
try try
{ {
@@ -75,7 +75,10 @@ public:
} }
} }
virtual int_type overflow(int_type c) BasicBufferedStreamBuf(const BasicBufferedStreamBuf&) = delete;
BasicBufferedStreamBuf& operator=(const BasicBufferedStreamBuf&) = delete;
int_type overflow(int_type c) override
{ {
if (!(_mode & IOS::out)) return char_traits::eof(); if (!(_mode & IOS::out)) return char_traits::eof();
@@ -89,7 +92,7 @@ public:
return c; return c;
} }
virtual int_type underflow() int_type underflow() override
{ {
if (!(_mode & IOS::in)) return char_traits::eof(); if (!(_mode & IOS::in)) return char_traits::eof();
@@ -110,7 +113,7 @@ public:
return char_traits::to_int_type(*this->gptr()); return char_traits::to_int_type(*this->gptr());
} }
virtual int sync() int sync() override
{ {
if (this->pptr() && this->pptr() > this->pbase()) if (this->pptr() && this->pptr() > this->pbase())
{ {
@@ -155,9 +158,6 @@ private:
std::streamsize _bufsize; std::streamsize _bufsize;
char_type* _pBuffer; char_type* _pBuffer;
openmode _mode; openmode _mode;
BasicBufferedStreamBuf(const BasicBufferedStreamBuf&);
BasicBufferedStreamBuf& operator = (const BasicBufferedStreamBuf&);
}; };
// //

View File

@@ -39,7 +39,7 @@ class Foundation_API Bugcheck
/// automatically provide useful context information. /// automatically provide useful context information.
{ {
public: public:
[[noreturn]] static void assertion(const char* cond, const char* file, LineNumber line, const char* text = 0); [[noreturn]] static void assertion(const char* cond, const char* file, LineNumber line, const char* text = nullptr);
/// An assertion failed. Break into the debugger, if /// An assertion failed. Break into the debugger, if
/// possible, then throw an AssertionViolationException. /// possible, then throw an AssertionViolationException.
@@ -70,7 +70,7 @@ public:
/// possible. /// possible.
protected: protected:
static std::string what(const char* msg, const char* file, LineNumber line, const char* text = 0); static std::string what(const char* msg, const char* file, LineNumber line, const char* text = nullptr);
}; };

View File

@@ -60,14 +60,14 @@ public:
/// If the channel has not been opened yet, the log() /// If the channel has not been opened yet, the log()
/// method will open it. /// method will open it.
void setProperty(const std::string& name, const std::string& value); void setProperty(const std::string& name, const std::string& value) override;
/// Throws a PropertyNotSupportedException. /// Throws a PropertyNotSupportedException.
std::string getProperty(const std::string& name) const; std::string getProperty(const std::string& name) const override;
/// Throws a PropertyNotSupportedException. /// Throws a PropertyNotSupportedException.
protected: protected:
virtual ~Channel(); ~Channel() override;
private: private:
Channel(const Channel&); Channel(const Channel&);

View File

@@ -51,11 +51,11 @@ class ClassLoader
/// library. /// library.
{ {
public: public:
typedef AbstractMetaObject<Base> Meta; using Meta = AbstractMetaObject<Base>;
typedef Manifest<Base> Manif; using Manif = Manifest<Base>;
typedef void (*InitializeLibraryFunc)(); using InitializeLibraryFunc = void (*)();
typedef void (*UninitializeLibraryFunc)(); using UninitializeLibraryFunc = void (*)();
typedef bool (*BuildManifestFunc)(ManifestBase*); using BuildManifestFunc = bool (*)(ManifestBase *);
struct LibraryInfo struct LibraryInfo
{ {
@@ -63,13 +63,13 @@ public:
const Manif* pManifest; const Manif* pManifest;
int refCount; int refCount;
}; };
typedef std::map<std::string, LibraryInfo> LibraryMap; using LibraryMap = std::map<std::string, LibraryInfo>;
class Iterator class Iterator
/// The ClassLoader's very own iterator class. /// The ClassLoader's very own iterator class.
{ {
public: public:
typedef std::pair<std::string, const Manif*> Pair; using Pair = std::pair<std::string, const Manif *>;
Iterator(const typename LibraryMap::const_iterator& it) Iterator(const typename LibraryMap::const_iterator& it)
{ {
@@ -79,9 +79,7 @@ public:
{ {
_it = it._it; _it = it._it;
} }
~Iterator() ~Iterator() = default;
{
}
Iterator& operator = (const Iterator& it) Iterator& operator = (const Iterator& it)
{ {
_it = it._it; _it = it._it;
@@ -124,10 +122,8 @@ public:
mutable Pair _pair; mutable Pair _pair;
}; };
ClassLoader() ClassLoader() = default;
/// Creates the ClassLoader. /// Creates the ClassLoader.
{
}
virtual ~ClassLoader() virtual ~ClassLoader()
/// Destroys the ClassLoader. /// Destroys the ClassLoader.

View File

@@ -43,10 +43,10 @@ class Foundation_API Clock
/// to the time of day. /// to the time of day.
{ {
public: public:
typedef Int64 ClockVal; using ClockVal = Int64;
/// Monotonic clock value in microsecond resolution. /// Monotonic clock value in microsecond resolution.
typedef Int64 ClockDiff; using ClockDiff = Int64;
/// Difference between two ClockVal values in microseconds. /// Difference between two ClockVal values in microseconds.
static const ClockVal CLOCKVAL_MIN; /// Minimum clock value. static const ClockVal CLOCKVAL_MIN; /// Minimum clock value.

View File

@@ -124,7 +124,7 @@ private:
Condition(const Condition&); Condition(const Condition&);
Condition& operator = (const Condition&); Condition& operator = (const Condition&);
typedef std::deque<Event*> WaitQueue; using WaitQueue = std::deque<Event *>;
FastMutex _mutex; FastMutex _mutex;
WaitQueue _waitQueue; WaitQueue _waitQueue;

View File

@@ -51,11 +51,11 @@ public:
ConsoleChannel(std::ostream& str); ConsoleChannel(std::ostream& str);
/// Creates the channel using the given stream. /// Creates the channel using the given stream.
void log(const Message& msg); void log(const Message& msg) override;
/// Logs the given message to the channel's stream. /// Logs the given message to the channel's stream.
protected: protected:
~ConsoleChannel(); ~ConsoleChannel() override;
private: private:
std::ostream& _str; std::ostream& _str;
@@ -123,10 +123,10 @@ public:
ColorConsoleChannel(std::ostream& str); ColorConsoleChannel(std::ostream& str);
/// Creates the channel using the given stream. /// Creates the channel using the given stream.
void log(const Message& msg); void log(const Message& msg) override;
/// Logs the given message to the channel's stream. /// Logs the given message to the channel's stream.
void setProperty(const std::string& name, const std::string& value); void setProperty(const std::string& name, const std::string& value) override;
/// Sets the property with the given name. /// Sets the property with the given name.
/// ///
/// The following properties are supported: /// The following properties are supported:
@@ -142,7 +142,7 @@ public:
/// ///
/// See the class documentation for a list of supported color values. /// See the class documentation for a list of supported color values.
std::string getProperty(const std::string& name) const; std::string getProperty(const std::string& name) const override;
/// Returns the value of the property with the given name. /// Returns the value of the property with the given name.
/// See setProperty() for a description of the supported /// See setProperty() for a description of the supported
/// properties. /// properties.
@@ -169,7 +169,7 @@ protected:
CC_WHITE = 0x0125 CC_WHITE = 0x0125
}; };
~ColorConsoleChannel(); ~ColorConsoleChannel() override;
Color parseColor(const std::string& color) const; Color parseColor(const std::string& color) const;
std::string formatColor(Color color) const; std::string formatColor(Color color) const;
void initColors(); void initColors();

View File

@@ -43,7 +43,7 @@ public:
/// Creates the CountingStreamBuf and connects it /// Creates the CountingStreamBuf and connects it
/// to the given output stream. /// to the given output stream.
~CountingStreamBuf(); ~CountingStreamBuf() override;
/// Destroys the CountingStream. /// Destroys the CountingStream.
std::streamsize chars() const; std::streamsize chars() const;
@@ -77,8 +77,8 @@ public:
/// Add to the number of characters on the current line. /// Add to the number of characters on the current line.
protected: protected:
int readFromDevice(); int readFromDevice() override;
int writeToDevice(char c); int writeToDevice(char c) override;
private: private:
std::istream* _pIstr; std::istream* _pIstr;
@@ -107,7 +107,7 @@ public:
/// Creates the basic stream and connects it /// Creates the basic stream and connects it
/// to the given output stream. /// to the given output stream.
~CountingIOS(); ~CountingIOS() override;
/// Destroys the stream. /// Destroys the stream.
std::streamsize chars() const; std::streamsize chars() const;
@@ -158,7 +158,7 @@ public:
/// Creates the CountingInputStream and connects it /// Creates the CountingInputStream and connects it
/// to the given input stream. /// to the given input stream.
~CountingInputStream(); ~CountingInputStream() override;
/// Destroys the stream. /// Destroys the stream.
}; };
@@ -175,7 +175,7 @@ public:
/// Creates the CountingOutputStream and connects it /// Creates the CountingOutputStream and connects it
/// to the given output stream. /// to the given output stream.
~CountingOutputStream(); ~CountingOutputStream() override;
/// Destroys the CountingOutputStream. /// Destroys the CountingOutputStream.
}; };

View File

@@ -39,7 +39,7 @@ class Foundation_API DataURIStreamIOS: public virtual std::ios
{ {
public: public:
DataURIStreamIOS(const URI& uri); DataURIStreamIOS(const URI& uri);
~DataURIStreamIOS(); ~DataURIStreamIOS() override;
std::streambuf* rdbuf(); std::streambuf* rdbuf();
protected: protected:
@@ -63,7 +63,7 @@ public:
/// Creates a DataURIStream for the given data URI, /// Creates a DataURIStream for the given data URI,
/// ready for reading data. /// ready for reading data.
/// Throws a DataFormatException exception if the data is incorrect format. /// Throws a DataFormatException exception if the data is incorrect format.
~DataURIStream(); ~DataURIStream() override;
/// Destroys the DataURIStream. /// Destroys the DataURIStream.
private: private:

View File

@@ -34,10 +34,10 @@ public:
DataURIStreamFactory(); DataURIStreamFactory();
/// Creates the DataURIStreamFactory. /// Creates the DataURIStreamFactory.
~DataURIStreamFactory(); ~DataURIStreamFactory() override;
/// Destroys the DataURIStreamFactory. /// Destroys the DataURIStreamFactory.
std::istream* open(const URI& uri); std::istream* open(const URI& uri) override;
/// Creates an input stream returning decoded data from the given data URI. /// Creates an input stream returning decoded data from the given data URI.
/// ///
/// Throws a DataFormatException exception if the data is incorrect format. /// Throws a DataFormatException exception if the data is incorrect format.

View File

@@ -129,7 +129,7 @@ public:
/// Returns true if dateTime validates against at least one supported format. /// Returns true if dateTime validates against at least one supported format.
private: private:
typedef std::unordered_set<std::string> Formatlist; using Formatlist = std::unordered_set<std::string>;
static Formatlist FORMAT_LIST; static Formatlist FORMAT_LIST;
}; };

View File

@@ -41,18 +41,14 @@ public:
using Iterator = typename Delegates::iterator; using Iterator = typename Delegates::iterator;
public: public:
DefaultStrategy() DefaultStrategy() = default;
{
}
DefaultStrategy(const DefaultStrategy& s): DefaultStrategy(const DefaultStrategy& s):
_delegates(s._delegates) _delegates(s._delegates)
{ {
} }
~DefaultStrategy() ~DefaultStrategy() = default;
{
}
void notify(const void* sender, TArgs& arguments) void notify(const void* sender, TArgs& arguments)
{ {
@@ -138,9 +134,7 @@ public:
using Iterator = typename Delegates::iterator; using Iterator = typename Delegates::iterator;
public: public:
DefaultStrategy() DefaultStrategy() = default;
{
}
DefaultStrategy(const DefaultStrategy& s): DefaultStrategy(const DefaultStrategy& s):
_delegates(s._delegates) _delegates(s._delegates)
@@ -152,9 +146,7 @@ public:
{ {
} }
~DefaultStrategy() ~DefaultStrategy() = default;
{
}
void notify(const void* sender) void notify(const void* sender)
{ {

View File

@@ -77,7 +77,7 @@ public:
/// Please refer to the zlib documentation of deflateInit2() for a description /// Please refer to the zlib documentation of deflateInit2() for a description
/// of the windowBits parameter. /// of the windowBits parameter.
~DeflatingStreamBuf(); ~DeflatingStreamBuf() override;
/// Destroys the DeflatingStreamBuf. /// Destroys the DeflatingStreamBuf.
int close(); int close();
@@ -86,9 +86,9 @@ public:
/// Must be called when deflating to an output stream. /// Must be called when deflating to an output stream.
protected: protected:
int readFromDevice(char* buffer, std::streamsize length); int readFromDevice(char* buffer, std::streamsize length) override;
int writeToDevice(const char* buffer, std::streamsize length); int writeToDevice(const char* buffer, std::streamsize length) override;
virtual int sync(); int sync() override;
private: private:
enum enum
@@ -134,7 +134,7 @@ public:
/// Please refer to the zlib documentation of deflateInit2() for a description /// Please refer to the zlib documentation of deflateInit2() for a description
/// of the windowBits parameter. /// of the windowBits parameter.
~DeflatingIOS(); ~DeflatingIOS() override;
/// Destroys the DeflatingIOS. /// Destroys the DeflatingIOS.
DeflatingStreamBuf* rdbuf(); DeflatingStreamBuf* rdbuf();
@@ -169,7 +169,7 @@ public:
/// Please refer to the zlib documentation of deflateInit2() for a description /// Please refer to the zlib documentation of deflateInit2() for a description
/// of the windowBits parameter. /// of the windowBits parameter.
~DeflatingOutputStream(); ~DeflatingOutputStream() override;
/// Destroys the DeflatingOutputStream. /// Destroys the DeflatingOutputStream.
int close(); int close();
@@ -198,7 +198,7 @@ public:
/// Please refer to the zlib documentation of deflateInit2() for a description /// Please refer to the zlib documentation of deflateInit2() for a description
/// of the windowBits parameter. /// of the windowBits parameter.
~DeflatingInputStream(); ~DeflatingInputStream() override;
/// Destroys the DeflatingInputStream. /// Destroys the DeflatingInputStream.
}; };

View File

@@ -32,7 +32,7 @@ template <class TObj, class TArgs, bool withSender = true>
class Delegate: public AbstractDelegate<TArgs> class Delegate: public AbstractDelegate<TArgs>
{ {
public: public:
typedef void (TObj::*NotifyMethod)(const void*, TArgs&); using NotifyMethod = void (TObj::*)(const void *, TArgs &);
Delegate(TObj* obj, NotifyMethod method): Delegate(TObj* obj, NotifyMethod method):
_receiverObject(obj), _receiverObject(obj),
@@ -47,9 +47,9 @@ public:
{ {
} }
~Delegate() ~Delegate() = default;
{
} Delegate() = delete;
Delegate& operator = (const Delegate& delegate) Delegate& operator = (const Delegate& delegate)
{ {
@@ -93,9 +93,6 @@ protected:
TObj* _receiverObject; TObj* _receiverObject;
NotifyMethod _receiverMethod; NotifyMethod _receiverMethod;
Mutex _mutex; Mutex _mutex;
private:
Delegate();
}; };
@@ -103,7 +100,7 @@ template <class TObj, class TArgs>
class Delegate<TObj, TArgs, false>: public AbstractDelegate<TArgs> class Delegate<TObj, TArgs, false>: public AbstractDelegate<TArgs>
{ {
public: public:
typedef void (TObj::*NotifyMethod)(TArgs&); using NotifyMethod = void (TObj::*)(TArgs &);
Delegate(TObj* obj, NotifyMethod method): Delegate(TObj* obj, NotifyMethod method):
_receiverObject(obj), _receiverObject(obj),
@@ -118,9 +115,9 @@ public:
{ {
} }
~Delegate() ~Delegate() = default;
{
} Delegate() = delete;
Delegate& operator = (const Delegate& delegate) Delegate& operator = (const Delegate& delegate)
{ {
@@ -164,9 +161,6 @@ protected:
TObj* _receiverObject; TObj* _receiverObject;
NotifyMethod _receiverMethod; NotifyMethod _receiverMethod;
Mutex _mutex; Mutex _mutex;
private:
Delegate();
}; };
@@ -244,7 +238,7 @@ template <class TObj>
class Delegate<TObj,void,true>: public AbstractDelegate<void> class Delegate<TObj,void,true>: public AbstractDelegate<void>
{ {
public: public:
typedef void (TObj::*NotifyMethod)(const void*); using NotifyMethod = void (TObj::*)(const void *);
Delegate(TObj* obj, NotifyMethod method): Delegate(TObj* obj, NotifyMethod method):
_receiverObject(obj), _receiverObject(obj),
@@ -259,9 +253,9 @@ public:
{ {
} }
~Delegate() ~Delegate() override = default;
{
} Delegate() = delete;
Delegate& operator = (const Delegate& delegate) Delegate& operator = (const Delegate& delegate)
{ {
@@ -273,7 +267,7 @@ public:
return *this; return *this;
} }
bool notify(const void* sender) bool notify(const void *sender) override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
if (_receiverObject) if (_receiverObject)
@@ -284,18 +278,18 @@ public:
else return false; else return false;
} }
bool equals(const AbstractDelegate<void>& other) const bool equals(const AbstractDelegate<void> &other) const override
{ {
const Delegate* pOtherDelegate = dynamic_cast<const Delegate*>(other.unwrap()); const Delegate* pOtherDelegate = dynamic_cast<const Delegate*>(other.unwrap());
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
} }
AbstractDelegate<void>* clone() const AbstractDelegate<void> *clone() const override
{ {
return new Delegate(*this); return new Delegate(*this);
} }
void disable() void disable() override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
_receiverObject = 0; _receiverObject = 0;
@@ -305,9 +299,6 @@ protected:
TObj* _receiverObject; TObj* _receiverObject;
NotifyMethod _receiverMethod; NotifyMethod _receiverMethod;
Mutex _mutex; Mutex _mutex;
private:
Delegate();
}; };
@@ -315,7 +306,7 @@ template <class TObj>
class Delegate<TObj, void, false>: public AbstractDelegate<void> class Delegate<TObj, void, false>: public AbstractDelegate<void>
{ {
public: public:
typedef void (TObj::*NotifyMethod)(); using NotifyMethod = void (TObj::*)();
Delegate(TObj* obj, NotifyMethod method): Delegate(TObj* obj, NotifyMethod method):
_receiverObject(obj), _receiverObject(obj),
@@ -330,9 +321,9 @@ public:
{ {
} }
~Delegate() ~Delegate() override = default;
{
} Delegate() = delete;
Delegate& operator = (const Delegate& delegate) Delegate& operator = (const Delegate& delegate)
{ {
@@ -344,7 +335,7 @@ public:
return *this; return *this;
} }
bool notify(const void*) bool notify(const void *) override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
if (_receiverObject) if (_receiverObject)
@@ -355,18 +346,17 @@ public:
else return false; else return false;
} }
bool equals(const AbstractDelegate<void>& other) const bool equals(const AbstractDelegate<void> &other) const override
{ {
const Delegate* pOtherDelegate = dynamic_cast<const Delegate*>(other.unwrap()); const Delegate* pOtherDelegate = dynamic_cast<const Delegate*>(other.unwrap());
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
} }
AbstractDelegate<void>* clone() const AbstractDelegate<void> *clone() const override {
{
return new Delegate(*this); return new Delegate(*this);
} }
void disable() void disable() override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
_receiverObject = 0; _receiverObject = 0;
@@ -376,9 +366,6 @@ protected:
TObj* _receiverObject; TObj* _receiverObject;
NotifyMethod _receiverMethod; NotifyMethod _receiverMethod;
Mutex _mutex; Mutex _mutex;
private:
Delegate();
}; };

View File

@@ -36,9 +36,9 @@ public:
DigestBuf(DigestEngine& eng); DigestBuf(DigestEngine& eng);
DigestBuf(DigestEngine& eng, std::istream& istr); DigestBuf(DigestEngine& eng, std::istream& istr);
DigestBuf(DigestEngine& eng, std::ostream& ostr); DigestBuf(DigestEngine& eng, std::ostream& ostr);
~DigestBuf(); ~DigestBuf() override;
int readFromDevice(char* buffer, std::streamsize length); int readFromDevice(char *buffer, std::streamsize length) override;
int writeToDevice(const char* buffer, std::streamsize length); int writeToDevice(const char *buffer, std::streamsize length) override;
void close(); void close();
private: private:
@@ -59,7 +59,7 @@ public:
DigestIOS(DigestEngine& eng); DigestIOS(DigestEngine& eng);
DigestIOS(DigestEngine& eng, std::istream& istr); DigestIOS(DigestEngine& eng, std::istream& istr);
DigestIOS(DigestEngine& eng, std::ostream& ostr); DigestIOS(DigestEngine& eng, std::ostream& ostr);
~DigestIOS(); ~DigestIOS() override;
DigestBuf* rdbuf(); DigestBuf* rdbuf();
protected: protected:
@@ -74,7 +74,7 @@ class Foundation_API DigestInputStream: public DigestIOS, public std::istream
{ {
public: public:
DigestInputStream(DigestEngine& eng, std::istream& istr); DigestInputStream(DigestEngine& eng, std::istream& istr);
~DigestInputStream(); ~DigestInputStream() override;
}; };
@@ -89,7 +89,7 @@ class Foundation_API DigestOutputStream: public DigestIOS, public std::ostream
public: public:
DigestOutputStream(DigestEngine& eng); DigestOutputStream(DigestEngine& eng);
DigestOutputStream(DigestEngine& eng, std::ostream& ostr); DigestOutputStream(DigestEngine& eng, std::ostream& ostr);
~DigestOutputStream(); ~DigestOutputStream() override;
void close(); void close();
}; };

View File

@@ -148,7 +148,7 @@ public:
/// scanInterval specifies the interval in seconds between scans /// scanInterval specifies the interval in seconds between scans
/// of the directory. /// of the directory.
~DirectoryWatcher(); ~DirectoryWatcher() override;
/// Destroys the DirectoryWatcher. /// Destroys the DirectoryWatcher.
void suspendEvents(); void suspendEvents();
@@ -177,7 +177,7 @@ public:
protected: protected:
void init(); void init();
void stop(); void stop();
void run(); void run() override;
private: private:
DirectoryWatcher(); DirectoryWatcher();

View File

@@ -34,12 +34,11 @@ class DynamicFactory
/// A factory that creates objects by class name. /// A factory that creates objects by class name.
{ {
public: public:
typedef AbstractInstantiator<Base> AbstractFactory; using AbstractFactory = AbstractInstantiator<Base>;
DynamicFactory() DynamicFactory()
/// Creates the DynamicFactory. /// Creates the DynamicFactory.
{ = default;
}
~DynamicFactory() ~DynamicFactory()
/// Destroys the DynamicFactory and deletes the instantiators for /// Destroys the DynamicFactory and deletes the instantiators for
@@ -51,6 +50,9 @@ public:
} }
} }
DynamicFactory(const DynamicFactory&) = delete;
DynamicFactory& operator=(const DynamicFactory&) = delete;
Base* createInstance(const std::string& className) const Base* createInstance(const std::string& className) const
/// Creates a new instance of the class with the given name. /// Creates a new instance of the class with the given name.
/// The class must have been registered with registerClass. /// The class must have been registered with registerClass.
@@ -121,10 +123,7 @@ public:
} }
private: private:
DynamicFactory(const DynamicFactory&); using FactoryMap = std::map<std::string, AbstractFactory *>;
DynamicFactory& operator = (const DynamicFactory&);
typedef std::map<std::string, AbstractFactory*> FactoryMap;
FactoryMap _map; FactoryMap _map;
mutable FastMutex _mutex; mutable FastMutex _mutex;

View File

@@ -29,7 +29,7 @@ class Foundation_API Environment
/// and some general system information. /// and some general system information.
{ {
public: public:
typedef UInt8 NodeId[6]; /// Ethernet address. using NodeId = UInt8[6]; /// Ethernet address.
static std::string get(const std::string& name); static std::string get(const std::string& name);
/// Returns the value of the environment variable /// Returns the value of the environment variable

View File

@@ -29,7 +29,7 @@ namespace Poco {
class Foundation_API EnvironmentImpl class Foundation_API EnvironmentImpl
{ {
public: public:
typedef UInt8 NodeId[6]; /// Ethernet address. using NodeId = UInt8[6]; /// Ethernet address.
static std::string getImpl(const std::string& name); static std::string getImpl(const std::string& name);
static bool hasImpl(const std::string& name); static bool hasImpl(const std::string& name);
@@ -43,7 +43,7 @@ public:
static unsigned processorCountImpl(); static unsigned processorCountImpl();
private: private:
typedef std::map<std::string, std::string> StringMap; using StringMap = std::map<std::string, std::string>;
static StringMap _map; static StringMap _map;
static FastMutex _mutex; static FastMutex _mutex;

View File

@@ -29,7 +29,7 @@ namespace Poco {
class Foundation_API EnvironmentImpl class Foundation_API EnvironmentImpl
{ {
public: public:
typedef UInt8 NodeId[6]; /// Ethernet address. using NodeId = UInt8[6]; /// Ethernet address.
static std::string getImpl(const std::string& name); static std::string getImpl(const std::string& name);
static bool hasImpl(const std::string& name); static bool hasImpl(const std::string& name);
@@ -43,7 +43,7 @@ public:
static unsigned processorCountImpl(); static unsigned processorCountImpl();
private: private:
typedef std::map<std::string, std::string> StringMap; using StringMap = std::map<std::string, std::string>;
static StringMap _map; static StringMap _map;
static FastMutex _mutex; static FastMutex _mutex;

View File

@@ -27,7 +27,7 @@ namespace Poco {
class Foundation_API EnvironmentImpl class Foundation_API EnvironmentImpl
{ {
public: public:
typedef UInt8 NodeId[6]; /// Ethernet address. using NodeId = UInt8[6]; /// Ethernet address.
static std::string getImpl(const std::string& name); static std::string getImpl(const std::string& name);
static bool hasImpl(const std::string& name); static bool hasImpl(const std::string& name);

View File

@@ -41,11 +41,11 @@ public:
EventChannel(); EventChannel();
/// Creates the EventChannel. /// Creates the EventChannel.
void log(const Message& msg); void log(const Message& msg) override;
/// Fires the messageLogged event. /// Fires the messageLogged event.
protected: protected:
~EventChannel(); ~EventChannel() override;
/// Destroys the EventChannel. /// Destroys the EventChannel.
}; };

View File

@@ -43,7 +43,7 @@ public:
Exception(const Exception& exc); Exception(const Exception& exc);
/// Copy constructor. /// Copy constructor.
~Exception() noexcept; ~Exception() noexcept override;
/// Destroys the exception and deletes the nested exception. /// Destroys the exception and deletes the nested exception.
Exception& operator = (const Exception& exc); Exception& operator = (const Exception& exc);
@@ -55,7 +55,7 @@ public:
virtual const char* className() const noexcept; virtual const char* className() const noexcept;
/// Returns the name of the exception class. /// Returns the name of the exception class.
virtual const char* what() const noexcept; const char* what() const noexcept override;
/// Returns a static string describing the exception. /// Returns a static string describing the exception.
/// ///
/// Same as name(), but for compatibility with std::exception. /// Same as name(), but for compatibility with std::exception.

View File

@@ -60,10 +60,7 @@ public:
{ {
} }
~ExpirationDecorator() = default;
~ExpirationDecorator()
{
}
const Poco::Timestamp& getExpiration() const const Poco::Timestamp& getExpiration() const
{ {

View File

@@ -51,6 +51,8 @@ public:
delete _pDelegate; delete _pDelegate;
} }
Expire() = delete;
Expire& operator = (const Expire& expire) Expire& operator = (const Expire& expire)
{ {
if (&expire != this) if (&expire != this)
@@ -101,9 +103,6 @@ protected:
AbstractDelegate<TArgs>* _pDelegate; AbstractDelegate<TArgs>* _pDelegate;
Timestamp::TimeDiff _expire; Timestamp::TimeDiff _expire;
Timestamp _creationTime; Timestamp _creationTime;
private:
Expire();
}; };
@@ -127,11 +126,13 @@ public:
{ {
} }
~Expire() ~Expire() override
{ {
delete _pDelegate; delete _pDelegate;
} }
Expire() = delete;
Expire& operator = (const Expire& expire) Expire& operator = (const Expire& expire)
{ {
if (&expire != this) if (&expire != this)
@@ -145,7 +146,7 @@ public:
return *this; return *this;
} }
bool notify(const void* sender) bool notify(const void* sender) override
{ {
if (!expired()) if (!expired())
return this->_pDelegate->notify(sender); return this->_pDelegate->notify(sender);
@@ -153,22 +154,22 @@ public:
return false; return false;
} }
bool equals(const AbstractDelegate<void>& other) const bool equals(const AbstractDelegate<void>& other) const override
{ {
return other.equals(*_pDelegate); return other.equals(*_pDelegate);
} }
AbstractDelegate<void>* clone() const AbstractDelegate<void>* clone() const override
{ {
return new Expire(*this); return new Expire(*this);
} }
void disable() void disable() override
{ {
_pDelegate->disable(); _pDelegate->disable();
} }
const AbstractDelegate<void>* unwrap() const const AbstractDelegate<void>* unwrap() const override
{ {
return this->_pDelegate; return this->_pDelegate;
} }
@@ -182,9 +183,6 @@ protected:
AbstractDelegate<void>* _pDelegate; AbstractDelegate<void>* _pDelegate;
Timestamp::TimeDiff _expire; Timestamp::TimeDiff _expire;
Timestamp _creationTime; Timestamp _creationTime;
private:
Expire();
}; };

View File

@@ -49,13 +49,10 @@ public:
{ {
} }
~ExpireCache() ~ExpireCache() = default;
{
}
private: ExpireCache(const ExpireCache& aCache) = delete;
ExpireCache(const ExpireCache& aCache); ExpireCache& operator=(const ExpireCache& aCache) = delete;
ExpireCache& operator = (const ExpireCache& aCache);
}; };

View File

@@ -46,13 +46,10 @@ public:
this->_strategy.pushBack(new ExpireStrategy<TKey, TValue>(expire)); this->_strategy.pushBack(new ExpireStrategy<TKey, TValue>(expire));
} }
~ExpireLRUCache() ~ExpireLRUCache() = default;
{
}
private: ExpireLRUCache(const ExpireLRUCache& aCache) = delete;
ExpireLRUCache(const ExpireLRUCache& aCache); ExpireLRUCache& operator=(const ExpireLRUCache& aCache) = delete;
ExpireLRUCache& operator = (const ExpireLRUCache& aCache);
}; };

View File

@@ -18,10 +18,10 @@
#define Foundation_ExpireStrategy_INCLUDED #define Foundation_ExpireStrategy_INCLUDED
#include "Poco/Exception.h"
#include "Poco/KeyValueArgs.h" #include "Poco/KeyValueArgs.h"
#include "Poco/ValidArgs.h" #include "Poco/ValidArgs.h"
#include "Poco/AbstractStrategy.h" #include "Poco/AbstractStrategy.h"
#include "Poco/Bugcheck.h"
#include "Poco/Timestamp.h" #include "Poco/Timestamp.h"
#include "Poco/EventArgs.h" #include "Poco/EventArgs.h"
#include <set> #include <set>
@@ -39,11 +39,11 @@ class ExpireStrategy: public AbstractStrategy<TKey, TValue>
/// An ExpireStrategy implements time based expiration of cache entries /// An ExpireStrategy implements time based expiration of cache entries
{ {
public: public:
typedef std::multimap<Timestamp, TKey> TimeIndex; using TimeIndex = std::multimap<Timestamp, TKey>;
typedef typename TimeIndex::iterator IndexIterator; using IndexIterator = typename TimeIndex::iterator;
typedef typename TimeIndex::const_iterator ConstIndexIterator; using ConstIndexIterator = typename TimeIndex::const_iterator;
typedef std::map<TKey, IndexIterator> Keys; using Keys = std::map<TKey, IndexIterator>;
typedef typename Keys::iterator Iterator; using Iterator = typename Keys::iterator;
public: public:
ExpireStrategy(Timestamp::TimeDiff expireTimeInMilliSec): _expireTime(expireTimeInMilliSec * 1000) ExpireStrategy(Timestamp::TimeDiff expireTimeInMilliSec): _expireTime(expireTimeInMilliSec * 1000)
@@ -53,9 +53,7 @@ public:
if (_expireTime < 25000) throw InvalidArgumentException("expireTime must be at least 25 ms"); if (_expireTime < 25000) throw InvalidArgumentException("expireTime must be at least 25 ms");
} }
~ExpireStrategy() ~ExpireStrategy() = default;
{
}
void onAdd(const void*, const KeyValueArgs <TKey, TValue>& args) void onAdd(const void*, const KeyValueArgs <TKey, TValue>& args)
{ {

View File

@@ -49,7 +49,7 @@ class BasicFIFOBuffer
/// is needed. /// is needed.
{ {
public: public:
typedef T Type; using Type = T;
mutable Poco::BasicEvent<bool> writable; mutable Poco::BasicEvent<bool> writable;
/// Event indicating "writability" of the buffer, /// Event indicating "writability" of the buffer,
@@ -108,10 +108,12 @@ public:
{ {
} }
~BasicFIFOBuffer() ~BasicFIFOBuffer() = default;
/// Destroys the FIFOBuffer. /// Destroys the FIFOBuffer.
{
} BasicFIFOBuffer() = delete;
BasicFIFOBuffer(const BasicFIFOBuffer&) = delete;
BasicFIFOBuffer& operator=(const BasicFIFOBuffer&) = delete;
void resize(std::size_t newSize, bool preserveContent = true) void resize(std::size_t newSize, bool preserveContent = true)
/// Resizes the buffer. If preserveContent is true, /// Resizes the buffer. If preserveContent is true,
@@ -531,10 +533,6 @@ private:
writable.notify(this, f); writable.notify(this, f);
} }
BasicFIFOBuffer();
BasicFIFOBuffer(const BasicFIFOBuffer&);
BasicFIFOBuffer& operator = (const BasicFIFOBuffer&);
Buffer<T> _buffer; Buffer<T> _buffer;
std::size_t _begin; std::size_t _begin;
std::size_t _used; std::size_t _used;
@@ -548,8 +546,7 @@ private:
// //
// We provide an instantiation for char // We provide an instantiation for char
// //
typedef BasicFIFOBuffer<char> FIFOBuffer; using FIFOBuffer = BasicFIFOBuffer<char>;
} // namespace Poco } // namespace Poco

View File

@@ -49,15 +49,15 @@ public:
explicit FIFOBufferStreamBuf(std::size_t length); explicit FIFOBufferStreamBuf(std::size_t length);
/// Creates a FIFOBufferStreamBuf of the given length. /// Creates a FIFOBufferStreamBuf of the given length.
~FIFOBufferStreamBuf(); ~FIFOBufferStreamBuf() override;
/// Destroys the FIFOBufferStreamBuf. /// Destroys the FIFOBufferStreamBuf.
FIFOBuffer& fifoBuffer(); FIFOBuffer& fifoBuffer();
/// Returns the underlying FIFO buffer reference. /// Returns the underlying FIFO buffer reference.
protected: protected:
int readFromDevice(char* buffer, std::streamsize length); int readFromDevice(char* buffer, std::streamsize length) override;
int writeToDevice(const char* buffer, std::streamsize length); int writeToDevice(const char* buffer, std::streamsize length) override;
private: private:
enum enum
@@ -90,7 +90,7 @@ public:
explicit FIFOIOS(std::size_t length); explicit FIFOIOS(std::size_t length);
/// Creates a FIFOIOS of the given length. /// Creates a FIFOIOS of the given length.
~FIFOIOS(); ~FIFOIOS() override;
/// Destroys the FIFOIOS. /// Destroys the FIFOIOS.
/// ///
/// Flushes the buffer. /// Flushes the buffer.
@@ -125,7 +125,7 @@ public:
explicit FIFOBufferStream(std::size_t length); explicit FIFOBufferStream(std::size_t length);
/// Creates a FIFOBufferStream of the given length. /// Creates a FIFOBufferStream of the given length.
~FIFOBufferStream(); ~FIFOBufferStream() override;
/// Destroys the FIFOBufferStream. /// Destroys the FIFOBufferStream.
/// ///
/// Flushes the buffer. /// Flushes the buffer.

View File

@@ -42,17 +42,12 @@ class POCO_DEPRECATED("use BasicEvent") FIFOEvent: public AbstractEvent <
/// for backwards compatibility only. /// for backwards compatibility only.
{ {
public: public:
FIFOEvent() FIFOEvent() = default;
{
}
~FIFOEvent() ~FIFOEvent() = default;
{
}
private: FIFOEvent(const FIFOEvent& e) = delete;
FIFOEvent(const FIFOEvent& e); FIFOEvent& operator=(const FIFOEvent& e) = delete;
FIFOEvent& operator = (const FIFOEvent& e);
}; };

View File

@@ -31,9 +31,7 @@ class POCO_DEPRECATED("") FIFOStrategy: public DefaultStrategy<TArgs, TDelegate>
/// for backwards compatibility only. /// for backwards compatibility only.
{ {
public: public:
FIFOStrategy() FIFOStrategy() = default;
{
}
FIFOStrategy(const FIFOStrategy& s): FIFOStrategy(const FIFOStrategy& s):
DefaultStrategy<TArgs, TDelegate>(s) DefaultStrategy<TArgs, TDelegate>(s)
@@ -45,9 +43,7 @@ public:
{ {
} }
~FIFOStrategy() ~FIFOStrategy() = default;
{
}
FIFOStrategy& operator = (const FIFOStrategy& s) FIFOStrategy& operator = (const FIFOStrategy& s)
{ {

View File

@@ -123,8 +123,7 @@ public:
// For convenience, we provide a shorter name for // For convenience, we provide a shorter name for
// the FPEnvironment class. // the FPEnvironment class.
// //
typedef FPEnvironment FPE; using FPE = FPEnvironment;
// //
// inline's // inline's

View File

@@ -171,16 +171,16 @@ public:
FileChannel(const std::string& path); FileChannel(const std::string& path);
/// Creates the FileChannel for a file with the given path. /// Creates the FileChannel for a file with the given path.
void open(); void open() override;
/// Opens the FileChannel and creates the log file if necessary. /// Opens the FileChannel and creates the log file if necessary.
void close(); void close() override;
/// Closes the FileChannel. /// Closes the FileChannel.
void log(const Message& msg); void log(const Message& msg) override;
/// Logs the given message to the file. /// Logs the given message to the file.
void setProperty(const std::string& name, const std::string& value); void setProperty(const std::string& name, const std::string& value) override;
/// Sets the property with the given name. /// Sets the property with the given name.
/// ///
/// The following properties are supported: /// The following properties are supported:
@@ -206,7 +206,7 @@ public:
/// * rotateOnOpen: Specifies whether an existing log file should be /// * rotateOnOpen: Specifies whether an existing log file should be
/// rotated and archived when the channel is opened. /// rotated and archived when the channel is opened.
std::string getProperty(const std::string& name) const; std::string getProperty(const std::string& name) const override;
/// Returns the value of the property with the given name. /// Returns the value of the property with the given name.
/// See setProperty() for a description of the supported /// See setProperty() for a description of the supported
/// properties. /// properties.
@@ -243,7 +243,7 @@ public:
static const std::string PROP_ROTATEONOPEN; static const std::string PROP_ROTATEONOPEN;
protected: protected:
~FileChannel(); ~FileChannel() override;
void setRotation(const std::string& rotation); void setRotation(const std::string& rotation);
void setArchive(const std::string& archive); void setArchive(const std::string& archive);
@@ -256,7 +256,7 @@ protected:
private: private:
bool setNoPurge(const std::string& value); bool setNoPurge(const std::string& value);
int extractDigit(const std::string& value, std::string::const_iterator* nextToDigit = NULL) const; int extractDigit(const std::string& value, std::string::const_iterator* nextToDigit = nullptr) const;
Timespan::TimeDiff extractFactor(const std::string& value, std::string::const_iterator start) const; Timespan::TimeDiff extractFactor(const std::string& value, std::string::const_iterator start) const;
RotateStrategy* createRotationStrategy(const std::string& rotation, const std::string& times) const; RotateStrategy* createRotationStrategy(const std::string& rotation, const std::string& times) const;

View File

@@ -36,10 +36,10 @@ public:
FileStreamFactory(); FileStreamFactory();
/// Creates the FileStreamFactory. /// Creates the FileStreamFactory.
~FileStreamFactory(); ~FileStreamFactory() override;
/// Destroys the FileStreamFactory. /// Destroys the FileStreamFactory.
std::istream* open(const URI& uri); std::istream *open(const URI &uri) override;
/// Creates and opens a file stream in binary mode for the given URI. /// Creates and opens a file stream in binary mode for the given URI.
/// The URI must be either a file URI or a relative URI reference /// The URI must be either a file URI or a relative URI reference
/// containing a path to a local file. /// containing a path to a local file.

View File

@@ -89,12 +89,13 @@ public:
ScopedFStreamRWLock(FileStreamRWLock& rwl, bool write = false); ScopedFStreamRWLock(FileStreamRWLock& rwl, bool write = false);
~ScopedFStreamRWLock(); ~ScopedFStreamRWLock();
ScopedFStreamRWLock() = delete;
ScopedFStreamRWLock(const ScopedFStreamRWLock&) = delete;
ScopedFStreamRWLock& operator=(const ScopedFStreamRWLock&) = delete;
private: private:
FileStreamRWLock& _rwl; FileStreamRWLock& _rwl;
ScopedFStreamRWLock();
ScopedFStreamRWLock(const ScopedFStreamRWLock&);
ScopedFStreamRWLock& operator = (const ScopedFStreamRWLock&);
}; };
@@ -182,21 +183,13 @@ inline ScopedFStreamReadRWLock::ScopedFStreamReadRWLock(FileStreamRWLock& rwl):
{ {
} }
inline ScopedFStreamReadRWLock::~ScopedFStreamReadRWLock() = default;
inline ScopedFStreamReadRWLock::~ScopedFStreamReadRWLock()
{
}
inline ScopedFStreamWriteRWLock::ScopedFStreamWriteRWLock(FileStreamRWLock& rwl): ScopedFStreamRWLock(rwl, true) inline ScopedFStreamWriteRWLock::ScopedFStreamWriteRWLock(FileStreamRWLock& rwl): ScopedFStreamRWLock(rwl, true)
{ {
} }
inline ScopedFStreamWriteRWLock::~ScopedFStreamWriteRWLock() = default;
inline ScopedFStreamWriteRWLock::~ScopedFStreamWriteRWLock()
{
}
} // namespace Poco } // namespace Poco

View File

@@ -56,17 +56,17 @@ public:
Formatter(); Formatter();
/// Creates the formatter. /// Creates the formatter.
virtual ~Formatter(); ~Formatter() override;
/// Destroys the formatter. /// Destroys the formatter.
virtual void format(const Message& msg, std::string& text) = 0; virtual void format(const Message& msg, std::string& text) = 0;
/// Formats the message and places the result in text. /// Formats the message and places the result in text.
/// Subclasses must override this method. /// Subclasses must override this method.
void setProperty(const std::string& name, const std::string& value); void setProperty(const std::string& name, const std::string& value) override;
/// Throws a PropertyNotSupportedException. /// Throws a PropertyNotSupportedException.
std::string getProperty(const std::string& name) const; std::string getProperty(const std::string& name) const override;
/// Throws a PropertyNotSupportedException. /// Throws a PropertyNotSupportedException.
}; };

View File

@@ -65,12 +65,12 @@ public:
/// Returns the channel to which the formatted /// Returns the channel to which the formatted
/// messages are passed on. /// messages are passed on.
void log(const Message& msg); void log(const Message &msg) override;
/// Formats the given Message using the Formatter and /// Formats the given Message using the Formatter and
/// passes the formatted message on to the destination /// passes the formatted message on to the destination
/// Channel. /// Channel.
void setProperty(const std::string& name, const std::string& value); void setProperty(const std::string& name, const std::string& value) override;
/// Sets or changes a configuration property. /// Sets or changes a configuration property.
/// ///
/// Only the "channel" and "formatter" properties are supported, which allow /// Only the "channel" and "formatter" properties are supported, which allow
@@ -79,14 +79,14 @@ public:
/// ///
/// Unsupported properties are passed to the attached Channel. /// Unsupported properties are passed to the attached Channel.
void open(); void open() override;
/// Opens the attached channel. /// Opens the attached channel.
void close(); void close() override;
/// Closes the attached channel. /// Closes the attached channel.
protected: protected:
~FormattingChannel(); ~FormattingChannel() override;
private: private:
Formatter::Ptr _pFormatter; Formatter::Ptr _pFormatter;

View File

@@ -32,7 +32,7 @@ class FunctionDelegate: public AbstractDelegate<TArgs>
/// for use as a Delegate. /// for use as a Delegate.
{ {
public: public:
typedef void (*NotifyFunction)(const void*, TArgs&); using NotifyFunction = void (*)(const void *, TArgs &);
FunctionDelegate(NotifyFunction function): FunctionDelegate(NotifyFunction function):
_function(function) _function(function)
@@ -45,9 +45,9 @@ public:
{ {
} }
~FunctionDelegate() ~FunctionDelegate() = default;
{
} FunctionDelegate() = delete;
FunctionDelegate& operator = (const FunctionDelegate& delegate) FunctionDelegate& operator = (const FunctionDelegate& delegate)
{ {
@@ -89,9 +89,6 @@ public:
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionDelegate();
}; };
@@ -99,7 +96,7 @@ template <class TArgs>
class FunctionDelegate<TArgs, true, false>: public AbstractDelegate<TArgs> class FunctionDelegate<TArgs, true, false>: public AbstractDelegate<TArgs>
{ {
public: public:
typedef void (*NotifyFunction)(void*, TArgs&); using NotifyFunction = void (*)(void *, TArgs &);
FunctionDelegate(NotifyFunction function): FunctionDelegate(NotifyFunction function):
_function(function) _function(function)
@@ -112,9 +109,9 @@ public:
{ {
} }
~FunctionDelegate() ~FunctionDelegate() = default;
{
} FunctionDelegate() = delete;
FunctionDelegate& operator = (const FunctionDelegate& delegate) FunctionDelegate& operator = (const FunctionDelegate& delegate)
{ {
@@ -156,9 +153,6 @@ public:
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionDelegate();
}; };
@@ -166,7 +160,7 @@ template <class TArgs, bool senderIsConst>
class FunctionDelegate<TArgs, false, senderIsConst>: public AbstractDelegate<TArgs> class FunctionDelegate<TArgs, false, senderIsConst>: public AbstractDelegate<TArgs>
{ {
public: public:
typedef void (*NotifyFunction)(TArgs&); using NotifyFunction = void (*)(TArgs &);
FunctionDelegate(NotifyFunction function): FunctionDelegate(NotifyFunction function):
_function(function) _function(function)
@@ -179,9 +173,9 @@ public:
{ {
} }
~FunctionDelegate() ~FunctionDelegate() = default;
{
} FunctionDelegate() = delete;
FunctionDelegate& operator = (const FunctionDelegate& delegate) FunctionDelegate& operator = (const FunctionDelegate& delegate)
{ {
@@ -223,9 +217,6 @@ public:
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionDelegate();
}; };
@@ -235,7 +226,7 @@ class FunctionDelegate<void, true, true>: public AbstractDelegate<void>
/// for use as a Delegate. /// for use as a Delegate.
{ {
public: public:
typedef void (*NotifyFunction)(const void*); using NotifyFunction = void (*)(const void *);
FunctionDelegate(NotifyFunction function): FunctionDelegate(NotifyFunction function):
_function(function) _function(function)
@@ -248,9 +239,9 @@ public:
{ {
} }
~FunctionDelegate() ~FunctionDelegate() override = default;
{
} FunctionDelegate() = delete;
FunctionDelegate& operator = (const FunctionDelegate& delegate) FunctionDelegate& operator = (const FunctionDelegate& delegate)
{ {
@@ -261,7 +252,7 @@ public:
return *this; return *this;
} }
bool notify(const void* sender) bool notify(const void *sender) override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
if (_function) if (_function)
@@ -272,29 +263,26 @@ public:
else return false; else return false;
} }
bool equals(const AbstractDelegate<void>& other) const bool equals(const AbstractDelegate<void> &other) const override
{ {
const FunctionDelegate* pOtherDelegate = dynamic_cast<const FunctionDelegate*>(other.unwrap()); const FunctionDelegate* pOtherDelegate = dynamic_cast<const FunctionDelegate*>(other.unwrap());
return pOtherDelegate && _function == pOtherDelegate->_function; return pOtherDelegate && _function == pOtherDelegate->_function;
} }
AbstractDelegate<void>* clone() const AbstractDelegate<void> *clone() const override
{ {
return new FunctionDelegate(*this); return new FunctionDelegate(*this);
} }
void disable() void disable() override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
_function = 0; _function = nullptr;
} }
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionDelegate();
}; };
@@ -302,7 +290,7 @@ template <>
class FunctionDelegate<void, true, false>: public AbstractDelegate<void> class FunctionDelegate<void, true, false>: public AbstractDelegate<void>
{ {
public: public:
typedef void (*NotifyFunction)(void*); using NotifyFunction = void (*)(void *);
FunctionDelegate(NotifyFunction function): FunctionDelegate(NotifyFunction function):
_function(function) _function(function)
@@ -315,9 +303,9 @@ public:
{ {
} }
~FunctionDelegate() ~FunctionDelegate() override = default;
{
} FunctionDelegate() = delete;
FunctionDelegate& operator = (const FunctionDelegate& delegate) FunctionDelegate& operator = (const FunctionDelegate& delegate)
{ {
@@ -328,7 +316,7 @@ public:
return *this; return *this;
} }
bool notify(const void* sender) bool notify(const void *sender) override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
if (_function) if (_function)
@@ -339,29 +327,26 @@ public:
else return false; else return false;
} }
bool equals(const AbstractDelegate<void>& other) const bool equals(const AbstractDelegate<void> &other) const override
{ {
const FunctionDelegate* pOtherDelegate = dynamic_cast<const FunctionDelegate*>(other.unwrap()); const FunctionDelegate* pOtherDelegate = dynamic_cast<const FunctionDelegate*>(other.unwrap());
return pOtherDelegate && _function == pOtherDelegate->_function; return pOtherDelegate && _function == pOtherDelegate->_function;
} }
AbstractDelegate<void>* clone() const AbstractDelegate<void> *clone() const override
{ {
return new FunctionDelegate(*this); return new FunctionDelegate(*this);
} }
void disable() void disable() override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
_function = 0; _function = nullptr;
} }
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionDelegate();
}; };
@@ -369,7 +354,7 @@ template <bool senderIsConst>
class FunctionDelegate<void, false, senderIsConst>: public AbstractDelegate<void> class FunctionDelegate<void, false, senderIsConst>: public AbstractDelegate<void>
{ {
public: public:
typedef void (*NotifyFunction)(); using NotifyFunction = void (*)();
FunctionDelegate(NotifyFunction function): FunctionDelegate(NotifyFunction function):
_function(function) _function(function)
@@ -382,9 +367,9 @@ public:
{ {
} }
~FunctionDelegate() ~FunctionDelegate() override = default;
{
} FunctionDelegate() = delete;
FunctionDelegate& operator = (const FunctionDelegate& delegate) FunctionDelegate& operator = (const FunctionDelegate& delegate)
{ {
@@ -395,7 +380,7 @@ public:
return *this; return *this;
} }
bool notify(const void* /*sender*/) bool notify(const void * /*sender*/) override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
if (_function) if (_function)
@@ -406,29 +391,26 @@ public:
else return false; else return false;
} }
bool equals(const AbstractDelegate<void>& other) const bool equals(const AbstractDelegate<void> &other) const override
{ {
const FunctionDelegate* pOtherDelegate = dynamic_cast<const FunctionDelegate*>(other.unwrap()); const FunctionDelegate* pOtherDelegate = dynamic_cast<const FunctionDelegate*>(other.unwrap());
return pOtherDelegate && _function == pOtherDelegate->_function; return pOtherDelegate && _function == pOtherDelegate->_function;
} }
AbstractDelegate<void>* clone() const AbstractDelegate<void> *clone() const override
{ {
return new FunctionDelegate(*this); return new FunctionDelegate(*this);
} }
void disable() void disable() override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
_function = 0; _function = nullptr;
} }
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionDelegate();
}; };

View File

@@ -32,7 +32,7 @@ class FunctionPriorityDelegate: public AbstractPriorityDelegate<TArgs>
/// for use as a PriorityDelegate. /// for use as a PriorityDelegate.
{ {
public: public:
typedef void (*NotifyFunction)(const void*, TArgs&); using NotifyFunction = void (*)(const void *, TArgs &);
FunctionPriorityDelegate(NotifyFunction function, int prio): FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<TArgs>(prio), AbstractPriorityDelegate<TArgs>(prio),
@@ -56,9 +56,9 @@ public:
return *this; return *this;
} }
~FunctionPriorityDelegate() ~FunctionPriorityDelegate() = default;
{
} FunctionPriorityDelegate() = delete;
bool notify(const void* sender, TArgs& arguments) bool notify(const void* sender, TArgs& arguments)
{ {
@@ -91,9 +91,6 @@ public:
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionPriorityDelegate();
}; };
@@ -101,7 +98,7 @@ template <class TArgs>
class FunctionPriorityDelegate<TArgs, true, false>: public AbstractPriorityDelegate<TArgs> class FunctionPriorityDelegate<TArgs, true, false>: public AbstractPriorityDelegate<TArgs>
{ {
public: public:
typedef void (*NotifyFunction)(void*, TArgs&); using NotifyFunction = void (*)(void *, TArgs &);
FunctionPriorityDelegate(NotifyFunction function, int prio): FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<TArgs>(prio), AbstractPriorityDelegate<TArgs>(prio),
@@ -125,9 +122,9 @@ public:
return *this; return *this;
} }
~FunctionPriorityDelegate() ~FunctionPriorityDelegate() = default;
{
} FunctionPriorityDelegate() = delete;
bool notify(const void* sender, TArgs& arguments) bool notify(const void* sender, TArgs& arguments)
{ {
@@ -160,9 +157,6 @@ public:
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionPriorityDelegate();
}; };
@@ -170,7 +164,7 @@ template <class TArgs>
class FunctionPriorityDelegate<TArgs, false>: public AbstractPriorityDelegate<TArgs> class FunctionPriorityDelegate<TArgs, false>: public AbstractPriorityDelegate<TArgs>
{ {
public: public:
typedef void (*NotifyFunction)(TArgs&); using NotifyFunction = void (*)(TArgs &);
FunctionPriorityDelegate(NotifyFunction function, int prio): FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<TArgs>(prio), AbstractPriorityDelegate<TArgs>(prio),
@@ -194,9 +188,9 @@ public:
return *this; return *this;
} }
~FunctionPriorityDelegate() ~FunctionPriorityDelegate() = default;
{
} FunctionPriorityDelegate() = delete;
bool notify(const void* sender, TArgs& arguments) bool notify(const void* sender, TArgs& arguments)
{ {
@@ -229,9 +223,6 @@ public:
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionPriorityDelegate();
}; };
@@ -241,7 +232,7 @@ class FunctionPriorityDelegate<void, true, true>: public AbstractPriorityDelegat
/// for use as a PriorityDelegate. /// for use as a PriorityDelegate.
{ {
public: public:
typedef void (*NotifyFunction)(const void*); using NotifyFunction = void (*)(const void *);
FunctionPriorityDelegate(NotifyFunction function, int prio): FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<void>(prio), AbstractPriorityDelegate<void>(prio),
@@ -255,6 +246,8 @@ public:
{ {
} }
FunctionPriorityDelegate() = delete;
FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate) FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate)
{ {
if (&delegate != this) if (&delegate != this)
@@ -265,11 +258,9 @@ public:
return *this; return *this;
} }
~FunctionPriorityDelegate() ~FunctionPriorityDelegate() override = default;
{
}
bool notify(const void* sender) bool notify(const void* sender) override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
if (_function) if (_function)
@@ -280,29 +271,26 @@ public:
else return false; else return false;
} }
bool equals(const AbstractDelegate<void>& other) const bool equals(const AbstractDelegate<void>& other) const override
{ {
const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast<const FunctionPriorityDelegate*>(other.unwrap()); const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast<const FunctionPriorityDelegate*>(other.unwrap());
return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function; return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function;
} }
AbstractDelegate<void>* clone() const AbstractDelegate<void>* clone() const override
{ {
return new FunctionPriorityDelegate(*this); return new FunctionPriorityDelegate(*this);
} }
void disable() void disable() override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
_function = 0; _function = nullptr;
} }
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionPriorityDelegate();
}; };
@@ -310,7 +298,7 @@ template <>
class FunctionPriorityDelegate<void, true, false>: public AbstractPriorityDelegate<void> class FunctionPriorityDelegate<void, true, false>: public AbstractPriorityDelegate<void>
{ {
public: public:
typedef void (*NotifyFunction)(void*); using NotifyFunction = void (*)(void *);
FunctionPriorityDelegate(NotifyFunction function, int prio): FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<void>(prio), AbstractPriorityDelegate<void>(prio),
@@ -334,11 +322,11 @@ public:
return *this; return *this;
} }
~FunctionPriorityDelegate() ~FunctionPriorityDelegate() override = default;
{
}
bool notify(const void* sender) FunctionPriorityDelegate() = delete;
bool notify(const void* sender) override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
if (_function) if (_function)
@@ -349,29 +337,26 @@ public:
else return false; else return false;
} }
bool equals(const AbstractDelegate<void>& other) const bool equals(const AbstractDelegate<void>& other) const override
{ {
const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast<const FunctionPriorityDelegate*>(other.unwrap()); const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast<const FunctionPriorityDelegate*>(other.unwrap());
return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function; return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function;
} }
AbstractDelegate<void>* clone() const AbstractDelegate<void>* clone() const override
{ {
return new FunctionPriorityDelegate(*this); return new FunctionPriorityDelegate(*this);
} }
void disable() void disable() override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
_function = 0; _function = nullptr;
} }
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionPriorityDelegate();
}; };
@@ -379,7 +364,7 @@ template <>
class FunctionPriorityDelegate<void, false>: public AbstractPriorityDelegate<void> class FunctionPriorityDelegate<void, false>: public AbstractPriorityDelegate<void>
{ {
public: public:
typedef void (*NotifyFunction)(); using NotifyFunction = void (*)();
FunctionPriorityDelegate(NotifyFunction function, int prio): FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<void>(prio), AbstractPriorityDelegate<void>(prio),
@@ -403,11 +388,11 @@ public:
return *this; return *this;
} }
~FunctionPriorityDelegate() ~FunctionPriorityDelegate() override = default;
{
}
bool notify(const void* sender) FunctionPriorityDelegate() = delete;
bool notify(const void* sender) override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
if (_function) if (_function)
@@ -418,29 +403,26 @@ public:
else return false; else return false;
} }
bool equals(const AbstractDelegate<void>& other) const bool equals(const AbstractDelegate<void>& other) const override
{ {
const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast<const FunctionPriorityDelegate*>(other.unwrap()); const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast<const FunctionPriorityDelegate*>(other.unwrap());
return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function; return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function;
} }
AbstractDelegate<void>* clone() const AbstractDelegate<void>* clone() const override
{ {
return new FunctionPriorityDelegate(*this); return new FunctionPriorityDelegate(*this);
} }
void disable() void disable() override
{ {
Mutex::ScopedLock lock(_mutex); Mutex::ScopedLock lock(_mutex);
_function = 0; _function = nullptr;
} }
protected: protected:
NotifyFunction _function; NotifyFunction _function;
Mutex _mutex; Mutex _mutex;
private:
FunctionPriorityDelegate();
}; };

View File

@@ -56,7 +56,7 @@ public:
init(passphrase, length); init(passphrase, length);
} }
~HMACEngine() ~HMACEngine() override
{ {
std::memset(_ipad, 0, BLOCK_SIZE); std::memset(_ipad, 0, BLOCK_SIZE);
std::memset(_opad, 0, BLOCK_SIZE); std::memset(_opad, 0, BLOCK_SIZE);
@@ -64,18 +64,19 @@ public:
delete [] _opad; delete [] _opad;
} }
std::size_t digestLength() const HMACEngine() = delete;
{ HMACEngine(const HMACEngine&) = delete;
return DIGEST_SIZE; HMACEngine& operator=(const HMACEngine&) = delete;
}
void reset() std::size_t digestLength() const override { return DIGEST_SIZE; }
void reset() override
{ {
_engine.reset(); _engine.reset();
_engine.update(_ipad, BLOCK_SIZE); _engine.update(_ipad, BLOCK_SIZE);
} }
const DigestEngine::Digest& digest() const DigestEngine::Digest& digest() override
{ {
const DigestEngine::Digest& d = _engine.digest(); const DigestEngine::Digest& d = _engine.digest();
poco_assert (d.size() == DIGEST_SIZE); poco_assert (d.size() == DIGEST_SIZE);
@@ -124,16 +125,12 @@ protected:
reset(); reset();
} }
void updateImpl(const void* data, std::size_t length) void updateImpl(const void* data, std::size_t length) override
{ {
_engine.update(data, length); _engine.update(data, length);
} }
private: private:
HMACEngine();
HMACEngine(const HMACEngine&);
HMACEngine& operator = (const HMACEngine&);
Engine _engine; Engine _engine;
char* _ipad; char* _ipad;
char* _opad; char* _opad;

View File

@@ -32,22 +32,20 @@ class HashSet
/// A HashSet can be used just like a std::set. /// A HashSet can be used just like a std::set.
{ {
public: public:
typedef Value ValueType; using ValueType = Value;
typedef Value& Reference; using Reference = Value &;
typedef const Value& ConstReference; using ConstReference = const Value &;
typedef Value* Pointer; using Pointer = Value *;
typedef const Value* ConstPointer; using ConstPointer = const Value *;
typedef HashFunc Hash; using Hash = HashFunc;
typedef LinearHashTable<ValueType, Hash> HashTable; using HashTable = LinearHashTable<ValueType, Hash>;
typedef typename HashTable::Iterator Iterator; using Iterator = typename HashTable::Iterator;
typedef typename HashTable::ConstIterator ConstIterator; using ConstIterator = typename HashTable::ConstIterator;
HashSet() HashSet() = default;
/// Creates an empty HashSet. /// Creates an empty HashSet.
{
}
HashSet(std::size_t initialReserve): HashSet(std::size_t initialReserve):
_table(initialReserve) _table(initialReserve)
@@ -61,10 +59,8 @@ public:
{ {
} }
~HashSet() ~HashSet() = default;
/// Destroys the HashSet. /// Destroys the HashSet.
{
}
HashSet& operator = (const HashSet& table) HashSet& operator = (const HashSet& table)
/// Assigns another HashSet. /// Assigns another HashSet.

View File

@@ -44,11 +44,11 @@ class POCO_DEPRECATED("use LinearHashTable") HashTable
/// This class is NOT thread safe. /// This class is NOT thread safe.
{ {
public: public:
typedef std::map<Key, Value> HashEntryMap; using HashEntryMap = std::map<Key, Value>;
typedef HashEntryMap** HashTableVector; using HashTableVector = HashEntryMap **;
typedef typename HashEntryMap::const_iterator ConstIterator; using ConstIterator = typename HashEntryMap::const_iterator;
typedef typename HashEntryMap::iterator Iterator; using Iterator = typename HashEntryMap::iterator;
HashTable(UInt32 initialSize = 251): HashTable(UInt32 initialSize = 251):
_entries(0), _entries(0),

View File

@@ -42,10 +42,10 @@ class Foundation_API HexBinaryDecoderBuf: public UnbufferedStreamBuf
{ {
public: public:
HexBinaryDecoderBuf(std::istream& istr); HexBinaryDecoderBuf(std::istream& istr);
~HexBinaryDecoderBuf(); ~HexBinaryDecoderBuf() override;
private: private:
int readFromDevice(); int readFromDevice() override;
int readOne(); int readOne();
std::streambuf& _buf; std::streambuf& _buf;
@@ -60,7 +60,7 @@ class Foundation_API HexBinaryDecoderIOS: public virtual std::ios
{ {
public: public:
HexBinaryDecoderIOS(std::istream& istr); HexBinaryDecoderIOS(std::istream& istr);
~HexBinaryDecoderIOS(); ~HexBinaryDecoderIOS() override;
HexBinaryDecoderBuf* rdbuf(); HexBinaryDecoderBuf* rdbuf();
protected: protected:
@@ -84,7 +84,7 @@ class Foundation_API HexBinaryDecoder: public HexBinaryDecoderIOS, public std::i
{ {
public: public:
HexBinaryDecoder(std::istream& istr); HexBinaryDecoder(std::istream& istr);
~HexBinaryDecoder(); ~HexBinaryDecoder() override;
}; };

View File

@@ -42,7 +42,7 @@ class Foundation_API HexBinaryEncoderBuf: public UnbufferedStreamBuf
{ {
public: public:
HexBinaryEncoderBuf(std::ostream& ostr); HexBinaryEncoderBuf(std::ostream& ostr);
~HexBinaryEncoderBuf(); ~HexBinaryEncoderBuf() override;
int close(); int close();
/// Closes the stream buffer. /// Closes the stream buffer.
@@ -62,7 +62,7 @@ public:
/// Specify whether hex digits a-f are written in upper or lower case. /// Specify whether hex digits a-f are written in upper or lower case.
private: private:
int writeToDevice(char c); int writeToDevice(char c) override;
int _pos; int _pos;
int _lineLength; int _lineLength;
@@ -79,7 +79,7 @@ class Foundation_API HexBinaryEncoderIOS: public virtual std::ios
{ {
public: public:
HexBinaryEncoderIOS(std::ostream& ostr); HexBinaryEncoderIOS(std::ostream& ostr);
~HexBinaryEncoderIOS(); ~HexBinaryEncoderIOS() override;
int close(); int close();
HexBinaryEncoderBuf* rdbuf(); HexBinaryEncoderBuf* rdbuf();
@@ -107,7 +107,7 @@ class Foundation_API HexBinaryEncoder: public HexBinaryEncoderIOS, public std::o
{ {
public: public:
HexBinaryEncoder(std::ostream& ostr); HexBinaryEncoder(std::ostream& ostr);
~HexBinaryEncoder(); ~HexBinaryEncoder() override;
}; };

View File

@@ -66,7 +66,7 @@ public:
/// Please refer to the zlib documentation of inflateInit2() for a description /// Please refer to the zlib documentation of inflateInit2() for a description
/// of the windowBits parameter. /// of the windowBits parameter.
~InflatingStreamBuf(); ~InflatingStreamBuf() override;
/// Destroys the InflatingStreamBuf. /// Destroys the InflatingStreamBuf.
int close(); int close();
@@ -78,9 +78,9 @@ public:
/// Resets the stream buffer. /// Resets the stream buffer.
protected: protected:
int readFromDevice(char* buffer, std::streamsize length); int readFromDevice(char* buffer, std::streamsize length) override;
int writeToDevice(const char* buffer, std::streamsize length); int writeToDevice(const char* buffer, std::streamsize length) override;
int sync(); int sync() override;
private: private:
enum enum
@@ -127,7 +127,7 @@ public:
/// Please refer to the zlib documentation of inflateInit2() for a description /// Please refer to the zlib documentation of inflateInit2() for a description
/// of the windowBits parameter. /// of the windowBits parameter.
~InflatingIOS(); ~InflatingIOS() override;
/// Destroys the InflatingIOS. /// Destroys the InflatingIOS.
InflatingStreamBuf* rdbuf(); InflatingStreamBuf* rdbuf();
@@ -157,7 +157,7 @@ public:
/// Please refer to the zlib documentation of inflateInit2() for a description /// Please refer to the zlib documentation of inflateInit2() for a description
/// of the windowBits parameter. /// of the windowBits parameter.
~InflatingOutputStream(); ~InflatingOutputStream() override;
/// Destroys the InflatingOutputStream. /// Destroys the InflatingOutputStream.
int close(); int close();
@@ -193,7 +193,7 @@ public:
/// Please refer to the zlib documentation of inflateInit2() for a description /// Please refer to the zlib documentation of inflateInit2() for a description
/// of the windowBits parameter. /// of the windowBits parameter.
~InflatingInputStream(); ~InflatingInputStream() override;
/// Destroys the InflatingInputStream. /// Destroys the InflatingInputStream.
void reset(); void reset();

View File

@@ -32,20 +32,17 @@ class AbstractInstantiator
public: public:
AbstractInstantiator() AbstractInstantiator()
/// Creates the AbstractInstantiator. /// Creates the AbstractInstantiator.
{ = default;
}
virtual ~AbstractInstantiator() virtual ~AbstractInstantiator()
/// Destroys the AbstractInstantiator. /// Destroys the AbstractInstantiator.
{ = default;
}
virtual Base* createInstance() const = 0; virtual Base* createInstance() const = 0;
/// Creates an instance of a concrete subclass of Base. /// Creates an instance of a concrete subclass of Base.
private: AbstractInstantiator(const AbstractInstantiator&) = delete;
AbstractInstantiator(const AbstractInstantiator&); AbstractInstantiator& operator=(const AbstractInstantiator&) = delete;
AbstractInstantiator& operator = (const AbstractInstantiator&);
}; };
@@ -59,15 +56,11 @@ class Instantiator: public AbstractInstantiator<Base>
/// constructor. /// constructor.
{ {
public: public:
Instantiator() Instantiator() = default;
/// Creates the Instantiator. /// Creates the Instantiator.
{
}
virtual ~Instantiator() virtual ~Instantiator() = default;
/// Destroys the Instantiator. /// Destroys the Instantiator.
{
}
Base* createInstance() const Base* createInstance() const
{ {

View File

@@ -57,13 +57,13 @@ public:
JSONFormatter() = default; JSONFormatter() = default;
/// Creates a JSONFormatter. /// Creates a JSONFormatter.
~JSONFormatter() = default; ~JSONFormatter() override = default;
/// Destroys the JSONFormatter. /// Destroys the JSONFormatter.
void format(const Message& msg, std::string& text); void format(const Message& msg, std::string& text) override;
/// Formats the message as a JSON string. /// Formats the message as a JSON string.
void setProperty(const std::string& name, const std::string& value); void setProperty(const std::string& name, const std::string& value) override;
/// Sets the property with the given name to the given value. /// Sets the property with the given name to the given value.
/// ///
/// The following properties are supported: /// The following properties are supported:
@@ -77,7 +77,7 @@ public:
/// If any other property name is given, a PropertyNotSupported /// If any other property name is given, a PropertyNotSupported
/// exception is thrown. /// exception is thrown.
std::string getProperty(const std::string& name) const; std::string getProperty(const std::string& name) const override;
/// Returns the value of the property with the given name or /// Returns the value of the property with the given name or
/// throws a PropertyNotSupported exception if the given /// throws a PropertyNotSupported exception if the given
/// name is not recognized. /// name is not recognized.

View File

@@ -42,9 +42,9 @@ public:
{ {
} }
~KeyValueArgs() ~KeyValueArgs() = default;
{
} KeyValueArgs& operator=(const KeyValueArgs& args) = delete;
const TKey& key() const const TKey& key() const
/// Returns a reference to the key, /// Returns a reference to the key,
@@ -61,9 +61,6 @@ public:
protected: protected:
const TKey& _key; const TKey& _key;
const TValue& _value; const TValue& _value;
private:
KeyValueArgs& operator = (const KeyValueArgs& args);
}; };

View File

@@ -40,13 +40,10 @@ public:
{ {
} }
~LRUCache() ~LRUCache() = default;
{
}
private: LRUCache(const LRUCache& aCache) = delete;
LRUCache(const LRUCache& aCache); LRUCache& operator=(const LRUCache& aCache) = delete;
LRUCache& operator = (const LRUCache& aCache);
}; };

View File

@@ -36,12 +36,12 @@ class LRUStrategy: public AbstractStrategy<TKey, TValue>
/// An LRUStrategy implements least recently used cache replacement. /// An LRUStrategy implements least recently used cache replacement.
{ {
public: public:
typedef std::list<TKey> Keys; using Keys = std::list<TKey>;
typedef typename Keys::iterator Iterator; using Iterator = typename Keys::iterator;
typedef typename Keys::const_iterator ConstIterator; using ConstIterator = typename Keys::const_iterator;
typedef std::map<TKey, Iterator> KeyIndex; using KeyIndex = std::map<TKey, Iterator>;
typedef typename KeyIndex::iterator IndexIterator; using IndexIterator = typename KeyIndex::iterator;
typedef typename KeyIndex::const_iterator ConstIndexIterator; using ConstIndexIterator = typename KeyIndex::const_iterator;
public: public:
LRUStrategy(std::size_t size): LRUStrategy(std::size_t size):
@@ -50,9 +50,7 @@ public:
if (_size < 1) throw InvalidArgumentException("size must be > 0"); if (_size < 1) throw InvalidArgumentException("size must be > 0");
} }
~LRUStrategy() ~LRUStrategy() = default;
{
}
void onAdd(const void*, const KeyValueArgs <TKey, TValue>& args) void onAdd(const void*, const KeyValueArgs <TKey, TValue>& args)
{ {

View File

@@ -30,14 +30,14 @@ class Foundation_API Latin1Encoding: public TextEncoding
{ {
public: public:
Latin1Encoding(); Latin1Encoding();
~Latin1Encoding(); ~Latin1Encoding() override;
const char* canonicalName() const; const char* canonicalName() const override;
bool isA(const std::string& encodingName) const; bool isA(const std::string& encodingName) const override;
const CharacterMap& characterMap() const; const CharacterMap& characterMap() const override;
int convert(const unsigned char* bytes) const; int convert(const unsigned char* bytes) const override;
int convert(int ch, unsigned char* bytes, int length) const; int convert(int ch, unsigned char* bytes, int length) const override;
int queryConvert(const unsigned char* bytes, int length) const; int queryConvert(const unsigned char* bytes, int length) const override;
int sequenceLength(const unsigned char* bytes, int length) const; int sequenceLength(const unsigned char* bytes, int length) const override;
private: private:
static const char* _names[]; static const char* _names[];

View File

@@ -33,14 +33,14 @@ class Foundation_API Latin2Encoding: public TextEncoding
{ {
public: public:
Latin2Encoding(); Latin2Encoding();
virtual ~Latin2Encoding(); ~Latin2Encoding() override;
const char* canonicalName() const; const char* canonicalName() const override;
bool isA(const std::string& encodingName) const; bool isA(const std::string& encodingName) const override;
const CharacterMap& characterMap() const; const CharacterMap& characterMap() const override;
int convert(const unsigned char* bytes) const; int convert(const unsigned char* bytes) const override;
int convert(int ch, unsigned char* bytes, int length) const; int convert(int ch, unsigned char* bytes, int length) const override;
int queryConvert(const unsigned char* bytes, int length) const; int queryConvert(const unsigned char* bytes, int length) const override;
int sequenceLength(const unsigned char* bytes, int length) const; int sequenceLength(const unsigned char* bytes, int length) const override;
private: private:
static const char* _names[]; static const char* _names[];

View File

@@ -33,14 +33,14 @@ class Foundation_API Latin9Encoding: public TextEncoding
{ {
public: public:
Latin9Encoding(); Latin9Encoding();
~Latin9Encoding(); ~Latin9Encoding() override;
const char* canonicalName() const; const char* canonicalName() const override;
bool isA(const std::string& encodingName) const; bool isA(const std::string& encodingName) const override;
const CharacterMap& characterMap() const; const CharacterMap& characterMap() const override;
int convert(const unsigned char* bytes) const; int convert(const unsigned char* bytes) const override;
int convert(int ch, unsigned char* bytes, int length) const; int convert(int ch, unsigned char* bytes, int length) const override;
int queryConvert(const unsigned char* bytes, int length) const; int queryConvert(const unsigned char* bytes, int length) const override;
int sequenceLength(const unsigned char* bytes, int length) const; int sequenceLength(const unsigned char* bytes, int length) const override;
private: private:
static const char* _names[]; static const char* _names[];

View File

@@ -56,7 +56,7 @@ public:
/// Creates the LineEndingConverterStreamBuf and connects it /// Creates the LineEndingConverterStreamBuf and connects it
/// to the given output stream. /// to the given output stream.
~LineEndingConverterStreamBuf(); ~LineEndingConverterStreamBuf() override;
/// Destroys the LineEndingConverterStream. /// Destroys the LineEndingConverterStream.
void setNewLine(const std::string& newLineCharacters); void setNewLine(const std::string& newLineCharacters);
@@ -75,8 +75,8 @@ public:
/// Returns the line ending currently in use. /// Returns the line ending currently in use.
protected: protected:
int readFromDevice(); int readFromDevice() override;
int writeToDevice(char c); int writeToDevice(char c) override;
private: private:
std::istream* _pIstr; std::istream* _pIstr;
@@ -102,7 +102,7 @@ public:
/// Creates the LineEndingConverterIOS and connects it /// Creates the LineEndingConverterIOS and connects it
/// to the given output stream. /// to the given output stream.
~LineEndingConverterIOS(); ~LineEndingConverterIOS() override;
/// Destroys the stream. /// Destroys the stream.
void setNewLine(const std::string& newLineCharacters); void setNewLine(const std::string& newLineCharacters);
@@ -148,7 +148,7 @@ public:
/// Creates the LineEndingConverterInputStream and connects it /// Creates the LineEndingConverterInputStream and connects it
/// to the given input stream. /// to the given input stream.
~InputLineEndingConverter(); ~InputLineEndingConverter() override;
/// Destroys the stream. /// Destroys the stream.
}; };
@@ -170,7 +170,7 @@ public:
/// Creates the LineEndingConverterOutputStream and connects it /// Creates the LineEndingConverterOutputStream and connects it
/// to the given input stream. /// to the given input stream.
~OutputLineEndingConverter(); ~OutputLineEndingConverter() override;
/// Destroys the LineEndingConverterOutputStream. /// Destroys the LineEndingConverterOutputStream.
}; };

View File

@@ -51,10 +51,8 @@ public:
using Iterator = typename Container::iterator; using Iterator = typename Container::iterator;
using ConstIterator = typename Container::const_iterator; using ConstIterator = typename Container::const_iterator;
ListMap() ListMap() = default;
/// Creates an empty ListMap. /// Creates an empty ListMap.
{
}
explicit ListMap(std::size_t initialReserve): explicit ListMap(std::size_t initialReserve):
_container(initialReserve) _container(initialReserve)

View File

@@ -40,7 +40,7 @@ public:
LogStreamBuf(Logger& logger, Message::Priority priority, std::size_t bufferCapacity = 0); LogStreamBuf(Logger& logger, Message::Priority priority, std::size_t bufferCapacity = 0);
/// Creates the LogStream. /// Creates the LogStream.
~LogStreamBuf(); ~LogStreamBuf() override;
/// Destroys the LogStream. /// Destroys the LogStream.
void setPriority(Message::Priority priority); void setPriority(Message::Priority priority);
@@ -59,7 +59,7 @@ public:
/// Sets the capacity of the internal message buffer to the given size. /// Sets the capacity of the internal message buffer to the given size.
private: private:
int writeToDevice(char c); int writeToDevice(char c) override;
private: private:
Logger& _logger; Logger& _logger;
@@ -76,7 +76,7 @@ class Foundation_API LogIOS: public virtual std::ios
{ {
public: public:
LogIOS(Logger& logger, Message::Priority priority, std::size_t bufferCapacity = 0); LogIOS(Logger& logger, Message::Priority priority, std::size_t bufferCapacity = 0);
~LogIOS(); ~LogIOS() override;
LogStreamBuf* rdbuf(); LogStreamBuf* rdbuf();
protected: protected:
@@ -108,7 +108,7 @@ public:
/// Creates the LogStream, using the logger identified /// Creates the LogStream, using the logger identified
/// by loggerName, and sets the priority. /// by loggerName, and sets the priority.
~LogStream(); ~LogStream() override;
/// Destroys the LogStream. /// Destroys the LogStream.
LogStream& fatal(); LogStream& fatal();

View File

@@ -116,14 +116,14 @@ public:
/// - debug /// - debug
/// - trace /// - trace
void setProperty(const std::string& name, const std::string& value); void setProperty(const std::string &name, const std::string &value) override;
/// Sets or changes a configuration property. /// Sets or changes a configuration property.
/// ///
/// Only the "channel" and "level" properties are supported, which allow /// Only the "channel" and "level" properties are supported, which allow
/// setting the target channel and log level, respectively, via the LoggingRegistry. /// setting the target channel and log level, respectively, via the LoggingRegistry.
/// The "channel" and "level" properties are set-only. /// The "channel" and "level" properties are set-only.
void log(const Message& msg); void log(const Message& msg) override;
/// Logs the given message if its priority is /// Logs the given message if its priority is
/// greater than or equal to the Logger's log level. /// greater than or equal to the Logger's log level.
@@ -456,10 +456,10 @@ public:
static const std::string ROOT; /// The name of the root logger (""). static const std::string ROOT; /// The name of the root logger ("").
protected: protected:
typedef std::map<std::string, Ptr> LoggerMap; using LoggerMap = std::map<std::string, Ptr>;
Logger(const std::string& name, Channel::Ptr pChannel, int level); Logger(const std::string& name, Channel::Ptr pChannel, int level);
~Logger(); ~Logger() override;
void log(const std::string& text, Message::Priority prio); void log(const std::string& text, Message::Priority prio);
void logNPC(const std::string& text, Message::Priority prio); void logNPC(const std::string& text, Message::Priority prio);
@@ -471,7 +471,7 @@ protected:
static Ptr find(const std::string& name); static Ptr find(const std::string& name);
private: private:
typedef std::unique_ptr<LoggerMap> LoggerMapPtr; using LoggerMapPtr = std::unique_ptr<LoggerMap>;
Logger(); Logger();
Logger(const Logger&); Logger(const Logger&);

View File

@@ -44,8 +44,8 @@ class Foundation_API LoggingFactory
/// - PatternFormatter /// - PatternFormatter
{ {
public: public:
typedef AbstractInstantiator<Channel> ChannelInstantiator; using ChannelInstantiator = AbstractInstantiator<Channel>;
typedef AbstractInstantiator<Formatter> FormatterFactory; using FormatterFactory = AbstractInstantiator<Formatter>;
LoggingFactory(); LoggingFactory();
/// Creates the LoggingFactory. /// Creates the LoggingFactory.

View File

@@ -82,10 +82,10 @@ public:
/// LoggingRegistry. /// LoggingRegistry.
private: private:
typedef Channel::Ptr ChannelPtr; using ChannelPtr = Channel::Ptr;
typedef AutoPtr<Formatter> FormatterPtr; using FormatterPtr = AutoPtr<Formatter>;
typedef std::map<std::string, ChannelPtr> ChannelMap; using ChannelMap = std::map<std::string, ChannelPtr>;
typedef std::map<std::string, FormatterPtr> FormatterMap; using FormatterMap = std::map<std::string, FormatterPtr>;
ChannelMap _channelMap; ChannelMap _channelMap;
FormatterMap _formatterMap; FormatterMap _formatterMap;

View File

@@ -60,14 +60,14 @@ public:
}; };
MD4Engine(); MD4Engine();
~MD4Engine(); ~MD4Engine() override;
std::size_t digestLength() const; std::size_t digestLength() const override;
void reset(); void reset() override;
const DigestEngine::Digest& digest(); const DigestEngine::Digest& digest() override;
protected: protected:
void updateImpl(const void* data, std::size_t length); void updateImpl(const void* data, std::size_t length) override;
private: private:
static void transform(UInt32 state[4], const unsigned char block[64]); static void transform(UInt32 state[4], const unsigned char block[64]);

View File

@@ -60,14 +60,14 @@ public:
}; };
MD5Engine(); MD5Engine();
~MD5Engine(); ~MD5Engine() override;
std::size_t digestLength() const; std::size_t digestLength() const override;
void reset(); void reset() override;
const DigestEngine::Digest& digest(); const DigestEngine::Digest& digest() override;
protected: protected:
void updateImpl(const void* data, std::size_t length); void updateImpl(const void* data, std::size_t length) override;
private: private:
static void transform(UInt32 state[4], const unsigned char block[64]); static void transform(UInt32 state[4], const unsigned char block[64]);

View File

@@ -50,8 +50,8 @@ class Manifest: public ManifestBase
/// iterate over all the classes in a Manifest. /// iterate over all the classes in a Manifest.
{ {
public: public:
typedef AbstractMetaObject<B> Meta; using Meta = AbstractMetaObject<B>;
typedef std::map<std::string, const Meta*> MetaMap; using MetaMap = std::map<std::string, const Meta *>;
class Iterator class Iterator
/// The Manifest's very own iterator class. /// The Manifest's very own iterator class.
@@ -65,15 +65,10 @@ public:
{ {
_it = it._it; _it = it._it;
} }
~Iterator() ~Iterator() = default;
{ Iterator& operator=(const Iterator &it) = default;
}
Iterator& operator = (const Iterator& it) inline bool operator==(const Iterator &it) const
{
_it = it._it;
return *this;
}
inline bool operator == (const Iterator& it) const
{ {
return _it == it._it; return _it == it._it;
} }
@@ -105,12 +100,10 @@ public:
typename MetaMap::const_iterator _it; typename MetaMap::const_iterator _it;
}; };
Manifest() Manifest() = default;
/// Creates an empty Manifest. /// Creates an empty Manifest.
{
}
virtual ~Manifest() ~Manifest() override
/// Destroys the Manifest. /// Destroys the Manifest.
{ {
clear(); clear();
@@ -164,7 +157,7 @@ public:
return _metaMap.empty(); return _metaMap.empty();
} }
const char* className() const const char* className() const override
{ {
return typeid(*this).name(); return typeid(*this).name();
} }

View File

@@ -79,7 +79,7 @@ private:
BLOCK_RESERVE = 128 BLOCK_RESERVE = 128
}; };
typedef std::vector<char*> BlockVec; using BlockVec = std::vector<char *>;
std::size_t _blockSize; std::size_t _blockSize;
int _maxAlloc; int _maxAlloc;
@@ -229,6 +229,9 @@ private:
_memory.next = next; _memory.next = next;
} }
Block(const Block&) = delete;
Block& operator=(const Block&) = delete;
#ifndef POCO_DOC #ifndef POCO_DOC
union union
/// Memory block storage. /// Memory block storage.
@@ -244,18 +247,14 @@ private:
Block* next; Block* next;
} _memory; } _memory;
#endif #endif
private:
Block(const Block&);
Block& operator = (const Block&);
}; };
public: public:
typedef M MutexType; using MutexType = M;
typedef typename M::ScopedLock ScopedLock; using ScopedLock = typename M::ScopedLock;
typedef Block* Bucket; using Bucket = Block *;
typedef std::vector<Bucket> BucketVec; using BucketVec = std::vector<Bucket>;
FastMemoryPool(std::size_t blocksPerBucket = POCO_FAST_MEMORY_POOL_PREALLOC, std::size_t bucketPreAlloc = 10, std::size_t maxAlloc = 0): FastMemoryPool(std::size_t blocksPerBucket = POCO_FAST_MEMORY_POOL_PREALLOC, std::size_t bucketPreAlloc = 10, std::size_t maxAlloc = 0):
_blocksPerBucket(blocksPerBucket), _blocksPerBucket(blocksPerBucket),
@@ -291,6 +290,9 @@ public:
clear(); clear();
} }
FastMemoryPool(const FastMemoryPool&) = delete;
FastMemoryPool& operator=(const FastMemoryPool&) = delete;
void* get() void* get()
/// Returns pointer to the next available /// Returns pointer to the next available
/// memory block. If the pool is exhausted, /// memory block. If the pool is exhausted,
@@ -342,9 +344,6 @@ public:
} }
private: private:
FastMemoryPool(const FastMemoryPool&);
FastMemoryPool& operator = (const FastMemoryPool&);
void resize() void resize()
/// Creates new bucket and initializes it for internal use. /// Creates new bucket and initializes it for internal use.
/// Sets the previously next block to point to the new bucket's /// Sets the previously next block to point to the new bucket's
@@ -371,7 +370,7 @@ private:
for (; it != end; ++it) delete[] *it; for (; it != end; ++it) delete[] *it;
} }
typedef Poco::AtomicCounter Counter; using Counter = Poco::AtomicCounter;
const const
std::size_t _blocksPerBucket; std::size_t _blocksPerBucket;

View File

@@ -42,13 +42,13 @@ class BasicMemoryStreamBuf: public std::basic_streambuf<ch, tr>
/// ostream, but not for an iostream. /// ostream, but not for an iostream.
{ {
protected: protected:
typedef std::basic_streambuf<ch, tr> Base; using Base = std::basic_streambuf<ch, tr>;
typedef std::basic_ios<ch, tr> IOS; using IOS = std::basic_ios<ch, tr>;
typedef ch char_type; using char_type = ch;
typedef tr char_traits; using char_traits = tr;
typedef typename Base::int_type int_type; using int_type = typename Base::int_type;
typedef typename Base::pos_type pos_type; using pos_type = typename Base::pos_type;
typedef typename Base::off_type off_type; using off_type = typename Base::off_type;
public: public:
BasicMemoryStreamBuf(char_type* pBuffer, std::streamsize bufferSize): BasicMemoryStreamBuf(char_type* pBuffer, std::streamsize bufferSize):
@@ -59,21 +59,23 @@ public:
this->setp(_pBuffer, _pBuffer + _bufferSize); this->setp(_pBuffer, _pBuffer + _bufferSize);
} }
~BasicMemoryStreamBuf() ~BasicMemoryStreamBuf() override = default;
{
}
virtual int_type overflow(int_type /*c*/) BasicMemoryStreamBuf() = delete;
BasicMemoryStreamBuf(const BasicMemoryStreamBuf&) = delete;
BasicMemoryStreamBuf& operator=(const BasicMemoryStreamBuf&) = delete;
int_type overflow(int_type /*c*/) override
{ {
return char_traits::eof(); return char_traits::eof();
} }
virtual int_type underflow() int_type underflow() override
{ {
return char_traits::eof(); return char_traits::eof();
} }
virtual pos_type seekoff(off_type off, std::ios_base::seekdir way, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) pos_type seekoff(off_type off, std::ios_base::seekdir way, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override
{ {
const pos_type fail = off_type(-1); const pos_type fail = off_type(-1);
off_type newoff = off_type(-1); off_type newoff = off_type(-1);
@@ -141,13 +143,13 @@ public:
return newoff; return newoff;
} }
virtual pos_type seekpos(pos_type pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) pos_type seekpos(pos_type pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override
{ {
const off_type off = pos; const off_type off = pos;
return seekoff(off, std::ios::beg, which); return seekoff(off, std::ios::beg, which);
} }
virtual int sync() int sync() override
{ {
return 0; return 0;
} }
@@ -168,18 +170,13 @@ public:
private: private:
char_type* _pBuffer; char_type* _pBuffer;
std::streamsize _bufferSize; std::streamsize _bufferSize;
BasicMemoryStreamBuf();
BasicMemoryStreamBuf(const BasicMemoryStreamBuf&);
BasicMemoryStreamBuf& operator = (const BasicMemoryStreamBuf&);
}; };
// //
// We provide an instantiation for char // We provide an instantiation for char
// //
typedef BasicMemoryStreamBuf<char, std::char_traits<char>> MemoryStreamBuf; using MemoryStreamBuf = BasicMemoryStreamBuf<char, std::char_traits<char>>;
class Foundation_API MemoryIOS: public virtual std::ios class Foundation_API MemoryIOS: public virtual std::ios
/// The base class for MemoryInputStream and MemoryOutputStream. /// The base class for MemoryInputStream and MemoryOutputStream.
@@ -191,7 +188,7 @@ public:
MemoryIOS(char* pBuffer, std::streamsize bufferSize); MemoryIOS(char* pBuffer, std::streamsize bufferSize);
/// Creates the basic stream. /// Creates the basic stream.
~MemoryIOS(); ~MemoryIOS() override;
/// Destroys the stream. /// Destroys the stream.
MemoryStreamBuf* rdbuf(); MemoryStreamBuf* rdbuf();
@@ -210,7 +207,7 @@ public:
/// Creates a MemoryInputStream for the given memory area, /// Creates a MemoryInputStream for the given memory area,
/// ready for reading. /// ready for reading.
~MemoryInputStream(); ~MemoryInputStream() override;
/// Destroys the MemoryInputStream. /// Destroys the MemoryInputStream.
}; };
@@ -223,7 +220,7 @@ public:
/// Creates a MemoryOutputStream for the given memory area, /// Creates a MemoryOutputStream for the given memory area,
/// ready for writing. /// ready for writing.
~MemoryOutputStream(); ~MemoryOutputStream() override;
/// Destroys the MemoryInputStream. /// Destroys the MemoryInputStream.
std::streamsize charsWritten() const; std::streamsize charsWritten() const;

View File

@@ -50,6 +50,10 @@ public:
} }
} }
AbstractMetaObject() = delete;
AbstractMetaObject(const AbstractMetaObject&) = delete;
AbstractMetaObject& operator=(const AbstractMetaObject&) = delete;
const char* name() const const char* name() const
{ {
return _name; return _name;
@@ -110,11 +114,7 @@ public:
} }
private: private:
AbstractMetaObject(); using ObjectSet = std::set<B *>;
AbstractMetaObject(const AbstractMetaObject&);
AbstractMetaObject& operator = (const AbstractMetaObject&);
typedef std::set<B*> ObjectSet;
const char* _name; const char* _name;
mutable ObjectSet _deleteSet; mutable ObjectSet _deleteSet;
@@ -134,9 +134,7 @@ public:
{ {
} }
~MetaObject() ~MetaObject() = default;
{
}
B* create() const B* create() const
{ {
@@ -166,9 +164,7 @@ public:
{ {
} }
~MetaSingleton() ~MetaSingleton() = default;
{
}
B* create() const B* create() const
{ {

View File

@@ -101,40 +101,40 @@ template <typename T>
struct TypeWrapper struct TypeWrapper
/// Use the type wrapper if you want to decouple constness and references from template types. /// Use the type wrapper if you want to decouple constness and references from template types.
{ {
typedef T TYPE; using TYPE = T;
typedef const T CONSTTYPE; using CONSTTYPE = const T;
typedef T& REFTYPE; using REFTYPE = T &;
typedef const T& CONSTREFTYPE; using CONSTREFTYPE = const T &;
}; };
template <typename T> template <typename T>
struct TypeWrapper<const T> struct TypeWrapper<const T>
{ {
typedef T TYPE; using TYPE = T;
typedef const T CONSTTYPE; using CONSTTYPE = const T;
typedef T& REFTYPE; using REFTYPE = T &;
typedef const T& CONSTREFTYPE; using CONSTREFTYPE = const T &;
}; };
template <typename T> template <typename T>
struct TypeWrapper<const T&> struct TypeWrapper<const T&>
{ {
typedef T TYPE; using TYPE = T;
typedef const T CONSTTYPE; using CONSTTYPE = const T;
typedef T& REFTYPE; using REFTYPE = T &;
typedef const T& CONSTREFTYPE; using CONSTREFTYPE = const T &;
}; };
template <typename T> template <typename T>
struct TypeWrapper<T&> struct TypeWrapper<T&>
{ {
typedef T TYPE; using TYPE = T;
typedef const T CONSTTYPE; using CONSTTYPE = const T;
typedef T& REFTYPE; using REFTYPE = T &;
typedef const T& CONSTREFTYPE; using CONSTREFTYPE = const T &;
}; };

View File

@@ -214,15 +214,11 @@ public:
using ScopedLock = Poco::ScopedLock<NullMutex>; using ScopedLock = Poco::ScopedLock<NullMutex>;
using ScopedLockWithUnlock = Poco::ScopedLockWithUnlock<NullMutex>; using ScopedLockWithUnlock = Poco::ScopedLockWithUnlock<NullMutex>;
NullMutex() NullMutex() = default;
/// Creates the NullMutex. /// Creates the NullMutex.
{
}
~NullMutex() ~NullMutex() = default;
/// Destroys the NullMutex. /// Destroys the NullMutex.
{
}
void lock() void lock()
/// Does nothing. /// Does nothing.

Some files were not shown because too many files have changed in this diff Show More