diff --git a/Foundation/include/Poco/ASCIIEncoding.h b/Foundation/include/Poco/ASCIIEncoding.h index d839508db..9096d17e9 100644 --- a/Foundation/include/Poco/ASCIIEncoding.h +++ b/Foundation/include/Poco/ASCIIEncoding.h @@ -30,14 +30,14 @@ class Foundation_API ASCIIEncoding: public TextEncoding { public: ASCIIEncoding(); - ~ASCIIEncoding(); - const char* canonicalName() const; - bool isA(const std::string& encodingName) const; - const CharacterMap& characterMap() const; - int convert(const unsigned char* bytes) const; - int convert(int ch, unsigned char* bytes, int length) const; - int queryConvert(const unsigned char* bytes, int length) const; - int sequenceLength(const unsigned char* bytes, int length) const; + ~ASCIIEncoding() override; + const char* canonicalName() const override; + bool isA(const std::string& encodingName) const override; + const CharacterMap& characterMap() const override; + int convert(const unsigned char* bytes) const override; + int convert(int ch, unsigned char* bytes, int length) const override; + int queryConvert(const unsigned char* bytes, int length) const override; + int sequenceLength(const unsigned char* bytes, int length) const override; private: static const char* _names[]; diff --git a/Foundation/include/Poco/AbstractDelegate.h b/Foundation/include/Poco/AbstractDelegate.h index 0a2b830f0..4f4582004 100644 --- a/Foundation/include/Poco/AbstractDelegate.h +++ b/Foundation/include/Poco/AbstractDelegate.h @@ -29,17 +29,12 @@ class AbstractDelegate /// Base class for Delegate and Expire. { 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; /// Invokes the delegate's callback function. @@ -69,17 +64,12 @@ class AbstractDelegate /// Base class for Delegate and Expire. { 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; /// Invokes the delegate's callback function. diff --git a/Foundation/include/Poco/AbstractEvent.h b/Foundation/include/Poco/AbstractEvent.h index 032f1477d..0a755a0f6 100644 --- a/Foundation/include/Poco/AbstractEvent.h +++ b/Foundation/include/Poco/AbstractEvent.h @@ -149,8 +149,8 @@ class AbstractEvent /// to create the PriorityDelegate. { public: - typedef TDelegate* DelegateHandle; - typedef TArgs Args; + using DelegateHandle = TDelegate *; + using Args = TArgs; AbstractEvent(): _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) /// 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 /// but it is possible to change the observers. mutable TMutex _mutex; - -private: - AbstractEvent(const AbstractEvent& other); - AbstractEvent& operator = (const AbstractEvent& other); }; @@ -358,7 +355,7 @@ template class AbstractEvent { public: - typedef TDelegate* DelegateHandle; + using DelegateHandle = TDelegate *; AbstractEvent(): _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) /// 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 /// but it is possible to change the observers. mutable TMutex _mutex; - -private: - AbstractEvent(const AbstractEvent& other); - AbstractEvent& operator = (const AbstractEvent& other); }; diff --git a/Foundation/include/Poco/AbstractPriorityDelegate.h b/Foundation/include/Poco/AbstractPriorityDelegate.h index dbe367a4e..fbed21bd9 100644 --- a/Foundation/include/Poco/AbstractPriorityDelegate.h +++ b/Foundation/include/Poco/AbstractPriorityDelegate.h @@ -43,9 +43,7 @@ public: { } - virtual ~AbstractPriorityDelegate() - { - } + virtual ~AbstractPriorityDelegate() = default; int priority() const { diff --git a/Foundation/include/Poco/AbstractStrategy.h b/Foundation/include/Poco/AbstractStrategy.h index 265804ac4..4988c2e78 100644 --- a/Foundation/include/Poco/AbstractStrategy.h +++ b/Foundation/include/Poco/AbstractStrategy.h @@ -32,13 +32,9 @@ class AbstractStrategy /// An AbstractStrategy is the interface for all strategies. { public: - AbstractStrategy() - { - } + AbstractStrategy() = default; - virtual ~AbstractStrategy() - { - } + virtual ~AbstractStrategy() = default; virtual void onUpdate(const void* pSender, const KeyValueArgs & args) /// Updates an existing entry. diff --git a/Foundation/include/Poco/AccessExpirationDecorator.h b/Foundation/include/Poco/AccessExpirationDecorator.h index ea0210675..bd459ebad 100644 --- a/Foundation/include/Poco/AccessExpirationDecorator.h +++ b/Foundation/include/Poco/AccessExpirationDecorator.h @@ -51,10 +51,7 @@ public: { } - - ~AccessExpirationDecorator() - { - } + ~AccessExpirationDecorator() = default; const Poco::Timespan& getTimeout() const { diff --git a/Foundation/include/Poco/AccessExpireCache.h b/Foundation/include/Poco/AccessExpireCache.h index b8b87339d..021ffc786 100644 --- a/Foundation/include/Poco/AccessExpireCache.h +++ b/Foundation/include/Poco/AccessExpireCache.h @@ -47,13 +47,10 @@ public: { } - ~AccessExpireCache() - { - } + ~AccessExpireCache() = default; -private: - AccessExpireCache(const AccessExpireCache& aCache); - AccessExpireCache& operator = (const AccessExpireCache& aCache); + AccessExpireCache(const AccessExpireCache& aCache) = delete; + AccessExpireCache& operator=(const AccessExpireCache& aCache) = delete; }; diff --git a/Foundation/include/Poco/AccessExpireLRUCache.h b/Foundation/include/Poco/AccessExpireLRUCache.h index 4618a353f..0e7aa21f2 100644 --- a/Foundation/include/Poco/AccessExpireLRUCache.h +++ b/Foundation/include/Poco/AccessExpireLRUCache.h @@ -46,13 +46,10 @@ public: this->_strategy.pushBack(new AccessExpireStrategy(expire)); } - ~AccessExpireLRUCache() - { - } + ~AccessExpireLRUCache() = default; -private: - AccessExpireLRUCache(const AccessExpireLRUCache& aCache); - AccessExpireLRUCache& operator = (const AccessExpireLRUCache& aCache); + AccessExpireLRUCache(const AccessExpireLRUCache& aCache) = delete; + AccessExpireLRUCache& operator=(const AccessExpireLRUCache& aCache) = delete; }; diff --git a/Foundation/include/Poco/AccessExpireStrategy.h b/Foundation/include/Poco/AccessExpireStrategy.h index 3bfa45c21..3a4e20469 100644 --- a/Foundation/include/Poco/AccessExpireStrategy.h +++ b/Foundation/include/Poco/AccessExpireStrategy.h @@ -17,16 +17,8 @@ #ifndef Foundation_AccessExpireStrategy_INCLUDED #define Foundation_AccessExpireStrategy_INCLUDED - -#include "Poco/KeyValueArgs.h" -#include "Poco/ValidArgs.h" #include "Poco/ExpireStrategy.h" -#include "Poco/Bugcheck.h" #include "Poco/Timestamp.h" -#include "Poco/EventArgs.h" -#include -#include - namespace Poco { @@ -45,9 +37,7 @@ public: { } - ~AccessExpireStrategy() - { - } + ~AccessExpireStrategy() = default; void onGet(const void*, const TKey& key) { diff --git a/Foundation/include/Poco/ActiveDispatcher.h b/Foundation/include/Poco/ActiveDispatcher.h index 81c5fbef1..aa47fd2f2 100644 --- a/Foundation/include/Poco/ActiveDispatcher.h +++ b/Foundation/include/Poco/ActiveDispatcher.h @@ -79,8 +79,8 @@ public: /// Creates the ActiveDispatcher and sets /// the priority of its thread. - virtual ~ActiveDispatcher(); - /// Destroys the ActiveDispatcher. + ~ActiveDispatcher() override; + /// Destroys the ActiveDispatcher. void start(ActiveRunnableBase::Ptr pRunnable); /// Adds the Runnable to the dispatch queue. @@ -89,7 +89,7 @@ public: /// Cancels all queued methods. protected: - void run(); + void run() override; void stop(); private: diff --git a/Foundation/include/Poco/ActiveMethod.h b/Foundation/include/Poco/ActiveMethod.h index fba154938..0fde9f695 100644 --- a/Foundation/include/Poco/ActiveMethod.h +++ b/Foundation/include/Poco/ActiveMethod.h @@ -72,9 +72,9 @@ class ActiveMethod /// class can be used. { public: - typedef ResultType (OwnerType::*Callback)(const ArgType&); - typedef ActiveResult ActiveResultType; - typedef ActiveRunnable ActiveRunnableType; + using Callback = ResultType (OwnerType::*)(const ArgType &); + using ActiveResultType = ActiveResult; + using ActiveRunnableType = ActiveRunnable; ActiveMethod(OwnerType* pOwner, Callback method): _pOwner(pOwner), @@ -84,6 +84,8 @@ public: poco_check_ptr (pOwner); } + ActiveMethod() = delete; + ActiveResultType operator () (const ArgType& arg) /// Invokes the ActiveMethod. { @@ -113,8 +115,6 @@ public: } private: - ActiveMethod(); - OwnerType* _pOwner; Callback _method; }; @@ -164,9 +164,9 @@ class ActiveMethod /// For methods that do not require an argument or a return value, simply use void. { public: - typedef ResultType (OwnerType::*Callback)(void); - typedef ActiveResult ActiveResultType; - typedef ActiveRunnable ActiveRunnableType; + using Callback = ResultType (OwnerType::*)(); + using ActiveResultType = ActiveResult; + using ActiveRunnableType = ActiveRunnable; ActiveMethod(OwnerType* pOwner, Callback method): _pOwner(pOwner), @@ -176,6 +176,8 @@ public: poco_check_ptr (pOwner); } + ActiveMethod() = delete; + ActiveResultType operator () (void) /// Invokes the ActiveMethod. { @@ -205,8 +207,6 @@ public: } private: - ActiveMethod(); - OwnerType* _pOwner; Callback _method; }; diff --git a/Foundation/include/Poco/ActiveResult.h b/Foundation/include/Poco/ActiveResult.h index 640c55b96..15ee6612d 100644 --- a/Foundation/include/Poco/ActiveResult.h +++ b/Foundation/include/Poco/ActiveResult.h @@ -40,7 +40,7 @@ class ActiveResultHolder: public RefCountedObject public: ActiveResultHolder(): _pData(0), - _pExc(0), + _pExc(nullptr), _event(Event::EVENT_MANUALRESET) /// Creates an ActiveResultHolder. { @@ -91,7 +91,7 @@ public: /// Returns true if the active method failed (and threw an exception). /// Information about the exception can be obtained by calling error(). { - return _pExc != 0; + return _pExc != nullptr; } std::string error() const @@ -127,7 +127,7 @@ public: } protected: - ~ActiveResultHolder() + ~ActiveResultHolder() override { delete _pData; delete _pExc; @@ -146,7 +146,7 @@ class ActiveResultHolder: public RefCountedObject { public: ActiveResultHolder(): - _pExc(0), + _pExc(nullptr), _event(Event::EVENT_MANUALRESET) /// Creates an ActiveResultHolder. { @@ -184,7 +184,7 @@ public: /// Returns true if the active method failed (and threw an exception). /// Information about the exception can be obtained by calling error(). { - return _pExc != 0; + return _pExc != nullptr; } std::string error() const @@ -220,7 +220,7 @@ public: } protected: - ~ActiveResultHolder() + ~ActiveResultHolder() override { delete _pExc; } @@ -238,8 +238,8 @@ class ActiveResult /// result from the execution thread back to the invocation thread. { public: - typedef RT ResultType; - typedef ActiveResultHolder ActiveResultHolderType; + using ResultType = RT; + using ActiveResultHolderType = ActiveResultHolder; ActiveResult(ActiveResultHolderType* pHolder): _pHolder(pHolder) @@ -261,6 +261,8 @@ public: _pHolder->release(); } + ActiveResult() = delete; + ActiveResult& operator = (const ActiveResult& result) /// Assignment operator. { @@ -363,8 +365,6 @@ public: } private: - ActiveResult(); - ActiveResultHolderType* _pHolder; }; @@ -377,7 +377,7 @@ class ActiveResult /// result from the execution thread back to the invocation thread. { public: - typedef ActiveResultHolder ActiveResultHolderType; + using ActiveResultHolderType = ActiveResultHolder; ActiveResult(ActiveResultHolderType* pHolder): _pHolder(pHolder) @@ -399,6 +399,8 @@ public: _pHolder->release(); } + ActiveResult() = delete; + ActiveResult& operator = (const ActiveResult& result) /// Assignment operator. { @@ -483,8 +485,6 @@ public: } private: - ActiveResult(); - ActiveResultHolderType* _pHolder; }; diff --git a/Foundation/include/Poco/ActiveRunnable.h b/Foundation/include/Poco/ActiveRunnable.h index 051f3478d..30e01830b 100644 --- a/Foundation/include/Poco/ActiveRunnable.h +++ b/Foundation/include/Poco/ActiveRunnable.h @@ -43,8 +43,8 @@ class ActiveRunnable: public ActiveRunnableBase /// See the ActiveMethod class for more information. { public: - typedef ResultType (OwnerType::*Callback)(const ArgType&); - typedef ActiveResult ActiveResultType; + using Callback = ResultType (OwnerType::*)(const ArgType &); + using ActiveResultType = ActiveResult; ActiveRunnable(OwnerType* pOwner, Callback method, const ArgType& arg, const ActiveResultType& result): _pOwner(pOwner), @@ -55,7 +55,7 @@ public: poco_check_ptr (pOwner); } - void run() + void run() override { ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done try @@ -91,8 +91,8 @@ class ActiveRunnable: public ActiveRunnableBase /// See the ActiveMethod class for more information. { public: - typedef void (OwnerType::*Callback)(const ArgType&); - typedef ActiveResult ActiveResultType; + using Callback = void (OwnerType::*)(const ArgType &); + using ActiveResultType = ActiveResult; ActiveRunnable(OwnerType* pOwner, Callback method, const ArgType& arg, const ActiveResultType& result): _pOwner(pOwner), @@ -103,7 +103,7 @@ public: poco_check_ptr (pOwner); } - void run() + void run() override { ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done try @@ -139,8 +139,8 @@ class ActiveRunnable: public ActiveRunnableBase /// See the ActiveMethod class for more information. { public: - typedef ResultType (OwnerType::*Callback)(); - typedef ActiveResult ActiveResultType; + using Callback = ResultType (OwnerType::*)(); + using ActiveResultType = ActiveResult; ActiveRunnable(OwnerType* pOwner, Callback method, const ActiveResultType& result): _pOwner(pOwner), @@ -150,7 +150,7 @@ public: poco_check_ptr (pOwner); } - void run() + void run() override { ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done try @@ -185,8 +185,8 @@ class ActiveRunnable: public ActiveRunnableBase /// See the ActiveMethod class for more information. { public: - typedef void (OwnerType::*Callback)(); - typedef ActiveResult ActiveResultType; + using Callback = void (OwnerType::*)(); + using ActiveResultType = ActiveResult; ActiveRunnable(OwnerType* pOwner, Callback method, const ActiveResultType& result): _pOwner(pOwner), @@ -196,7 +196,7 @@ public: poco_check_ptr (pOwner); } - void run() + void run() override { ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done try diff --git a/Foundation/include/Poco/Activity.h b/Foundation/include/Poco/Activity.h index 9da1d8a8d..ac5acc1d3 100644 --- a/Foundation/include/Poco/Activity.h +++ b/Foundation/include/Poco/Activity.h @@ -74,8 +74,8 @@ class Activity: public Runnable /// }; { public: - typedef RunnableAdapter RunnableAdapterType; - typedef typename RunnableAdapterType::Callback Callback; + using RunnableAdapterType = RunnableAdapter; + using Callback = typename RunnableAdapterType::Callback; Activity(C* pOwner, Callback method): _pOwner(pOwner), @@ -89,8 +89,8 @@ public: poco_check_ptr (pOwner); } - ~Activity() - /// Stops and destroys the activity. + ~Activity() override + /// Stops and destroys the activity. { try { @@ -103,6 +103,10 @@ public: } } + Activity() = delete; + Activity(const Activity &) = delete; + Activity &operator=(const Activity &) = delete; + void start() /// Starts the activity by acquiring a /// thread for it from the default thread pool. @@ -172,7 +176,7 @@ public: } protected: - void run() + void run() override { try { @@ -189,10 +193,6 @@ protected: } private: - Activity(); - Activity(const Activity&); - Activity& operator = (const Activity&); - C* _pOwner; RunnableAdapterType _runnable; std::atomic _stopped; diff --git a/Foundation/include/Poco/ArchiveStrategy.h b/Foundation/include/Poco/ArchiveStrategy.h index d4c498568..3294006b9 100644 --- a/Foundation/include/Poco/ArchiveStrategy.h +++ b/Foundation/include/Poco/ArchiveStrategy.h @@ -89,10 +89,10 @@ class Foundation_API ArchiveByNumberStrategy: public ArchiveStrategy { public: ArchiveByNumberStrategy(); - ~ArchiveByNumberStrategy(); + ~ArchiveByNumberStrategy() override; - LogFile* open(LogFile* pFile); - LogFile* archive(LogFile* pFile); + LogFile *open(LogFile *pFile) override; + LogFile *archive(LogFile *pFile) override; }; @@ -102,23 +102,19 @@ class ArchiveByTimestampStrategy: public ArchiveStrategy /// log files. { public: - ArchiveByTimestampStrategy() - { - } + ArchiveByTimestampStrategy() = default; - ~ArchiveByTimestampStrategy() - { - } + ~ArchiveByTimestampStrategy() override = default; - LogFile* open(LogFile* pFile) + LogFile* open(LogFile* pFile) override { return pFile; } - LogFile* archive(LogFile* pFile) - /// Archives the file by appending the current timestamp to the - /// file name. If the new file name exists, additionally a monotonic - /// increasing number is appended to the log file name. + LogFile *archive(LogFile* pFile) override + /// Archives the file by appending the current timestamp to the + /// file name. If the new file name exists, additionally a monotonic + /// increasing number is appended to the log file name. { std::string path = pFile->path(); delete pFile; diff --git a/Foundation/include/Poco/Array.h b/Foundation/include/Poco/Array.h index ff598b85f..6bfec92b6 100644 --- a/Foundation/include/Poco/Array.h +++ b/Foundation/include/Poco/Array.h @@ -41,13 +41,13 @@ class Array /// His original implementation can be found at http://www.josuttis.com/cppcode/array.html . { public: - typedef T value_type; - typedef T* iterator; - typedef const T* const_iterator; - typedef T& reference; - typedef const T& const_reference; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; + using value_type = T; + using iterator = T *; + using const_iterator = const T *; + using reference = T &; + using const_reference = const T &; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; iterator begin() { @@ -69,8 +69,8 @@ public: return elems+N; } - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; reverse_iterator rbegin() { diff --git a/Foundation/include/Poco/AsyncChannel.h b/Foundation/include/Poco/AsyncChannel.h index 190bae7dd..aeb464e67 100644 --- a/Foundation/include/Poco/AsyncChannel.h +++ b/Foundation/include/Poco/AsyncChannel.h @@ -44,9 +44,9 @@ class Foundation_API AsyncChannel: public Channel, public Runnable public: using Ptr = AutoPtr; - AsyncChannel(Channel::Ptr pChannel = 0, Thread::Priority prio = Thread::PRIO_NORMAL); - /// Creates the AsyncChannel and connects it to - /// the given channel. + AsyncChannel(Channel::Ptr pChannel = nullptr, Thread::Priority prio = Thread::PRIO_NORMAL); + /// Creates the AsyncChannel and connects it to + /// the given channel. void setChannel(Channel::Ptr pChannel); /// Connects the AsyncChannel to the given target channel. @@ -55,52 +55,52 @@ public: Channel::Ptr getChannel() const; /// Returns the target channel. - void open(); - /// Opens the channel and creates the - /// background logging thread. + void open() override; + /// Opens the channel and creates the + /// background logging thread. - void close(); - /// Closes the channel and stops the background - /// logging thread. + void close() override; + /// Closes the channel and stops the background + /// logging thread. - void log(const Message& msg); - /// Queues the message for processing by the - /// background thread. + void log(const Message& msg) override; + /// Queues the message for processing by the + /// background thread. - void setProperty(const std::string& name, const std::string& value); - /// Sets or changes a configuration property. - /// - /// The "channel" property allows setting the target - /// channel via the LoggingRegistry. - /// The "channel" property is set-only. - /// - /// The "priority" property allows setting the thread - /// priority. The following values are supported: - /// * lowest - /// * low - /// * normal (default) - /// * high - /// * highest - /// - /// The "priority" property is set-only. - /// - /// The "queueSize" property allows to limit the number - /// of messages in the queue. If the queue is full and - /// new messages are logged, these are dropped until the - /// queue has free capacity again. The number of dropped - /// messages is recorded, and a log message indicating the - /// number of dropped messages will be generated when the - /// queue has free capacity again. - /// In addition to an unsigned integer specifying the size, - /// this property can have the values "none" or "unlimited", - /// which disable the queue size limit. A size of 0 also - /// removes the limit. - /// - /// The "queueSize" property is set-only. + void setProperty(const std::string& name, const std::string& value) override; + /// Sets or changes a configuration property. + /// + /// The "channel" property allows setting the target + /// channel via the LoggingRegistry. + /// The "channel" property is set-only. + /// + /// The "priority" property allows setting the thread + /// priority. The following values are supported: + /// * lowest + /// * low + /// * normal (default) + /// * high + /// * highest + /// + /// The "priority" property is set-only. + /// + /// The "queueSize" property allows to limit the number + /// of messages in the queue. If the queue is full and + /// new messages are logged, these are dropped until the + /// queue has free capacity again. The number of dropped + /// messages is recorded, and a log message indicating the + /// number of dropped messages will be generated when the + /// queue has free capacity again. + /// In addition to an unsigned integer specifying the size, + /// this property can have the values "none" or "unlimited", + /// which disable the queue size limit. A size of 0 also + /// removes the limit. + /// + /// The "queueSize" property is set-only. protected: - ~AsyncChannel(); - void run(); + ~AsyncChannel() override; + void run() override; void setPriority(const std::string& value); private: diff --git a/Foundation/include/Poco/AsyncNotificationCenter.h b/Foundation/include/Poco/AsyncNotificationCenter.h index 7bf8ded1b..97d371104 100644 --- a/Foundation/include/Poco/AsyncNotificationCenter.h +++ b/Foundation/include/Poco/AsyncNotificationCenter.h @@ -42,19 +42,19 @@ public: AsyncNotificationCenter(); /// Creates the AsyncNotificationCenter and starts the notifying thread. - ~AsyncNotificationCenter(); - /// Stops the notifying thread and destroys the AsyncNotificationCenter. + ~AsyncNotificationCenter() override; + /// Stops the notifying thread and destroys the AsyncNotificationCenter. AsyncNotificationCenter& operator = (const AsyncNotificationCenter&) = delete; AsyncNotificationCenter(const AsyncNotificationCenter&) = delete; AsyncNotificationCenter& operator = (AsyncNotificationCenter&&) = delete; AsyncNotificationCenter(AsyncNotificationCenter&&) = delete; - virtual void postNotification(Notification::Ptr pNotification); - /// Enqueues notification into the notification queue. + void postNotification(Notification::Ptr pNotification) override; + /// Enqueues notification into the notification queue. - virtual int backlog() const; - /// Returns the numbner of notifications in the notification queue. + int backlog() const override; + /// Returns the numbner of notifications in the notification queue. private: void start(); diff --git a/Foundation/include/Poco/AsyncObserver.h b/Foundation/include/Poco/AsyncObserver.h index 221ee54b2..718e9be35 100644 --- a/Foundation/include/Poco/AsyncObserver.h +++ b/Foundation/include/Poco/AsyncObserver.h @@ -66,7 +66,7 @@ public: _started(false), _done(false) { - poco_assert(observer._nq.size() == 0); + poco_assert(observer._nq.empty()); } ~AsyncObserver() @@ -78,7 +78,7 @@ public: { if (&observer != this) { - poco_assert(observer._nq.size() == 0); + poco_assert(observer._nq.empty()); setObject(observer._pObject); setHandler(observer._handler); setMatcher(observer._matcher); diff --git a/Foundation/include/Poco/AtomicCounter.h b/Foundation/include/Poco/AtomicCounter.h index 1377fd4c9..0f7e49a83 100644 --- a/Foundation/include/Poco/AtomicCounter.h +++ b/Foundation/include/Poco/AtomicCounter.h @@ -34,7 +34,7 @@ class Foundation_API AtomicCounter /// reference counting and similar functionality. { public: - typedef int ValueType; /// The underlying integer type. + using ValueType = int; /// The underlying integer type. AtomicCounter(); /// Creates a new AtomicCounter and initializes it to zero. diff --git a/Foundation/include/Poco/AtomicFlag.h b/Foundation/include/Poco/AtomicFlag.h index d9191ea72..2c55b5ec7 100644 --- a/Foundation/include/Poco/AtomicFlag.h +++ b/Foundation/include/Poco/AtomicFlag.h @@ -70,6 +70,11 @@ public: ~AtomicFlag() = default; /// Destroys AtomicFlag. + AtomicFlag(const AtomicFlag&) = delete; + AtomicFlag& operator = (const AtomicFlag&) = delete; + AtomicFlag(AtomicFlag&&) = delete; + AtomicFlag& operator = (AtomicFlag&&) = delete; + bool set(); /// Sets the flag to true and returns previously /// held value. @@ -82,11 +87,6 @@ public: /// held value. private: - AtomicFlag(const AtomicFlag&) = delete; - AtomicFlag& operator = (const AtomicFlag&) = delete; - AtomicFlag(AtomicFlag&&) = delete; - AtomicFlag& operator = (AtomicFlag&&) = delete; - std::atomic_flag _flag = ATOMIC_FLAG_INIT; }; diff --git a/Foundation/include/Poco/AutoReleasePool.h b/Foundation/include/Poco/AutoReleasePool.h index 80e11e558..f5c4ceef5 100644 --- a/Foundation/include/Poco/AutoReleasePool.h +++ b/Foundation/include/Poco/AutoReleasePool.h @@ -42,10 +42,8 @@ class AutoReleasePool /// arp.add(ptr.duplicate()); { public: - AutoReleasePool() + AutoReleasePool() = default; /// Creates the AutoReleasePool. - { - } ~AutoReleasePool() /// Destroys the AutoReleasePool and releases @@ -74,7 +72,7 @@ public: } private: - typedef std::list ObjectList; + using ObjectList = std::list; ObjectList _list; }; diff --git a/Foundation/include/Poco/Base32Decoder.h b/Foundation/include/Poco/Base32Decoder.h index bc87205d3..5c7eabaac 100644 --- a/Foundation/include/Poco/Base32Decoder.h +++ b/Foundation/include/Poco/Base32Decoder.h @@ -38,10 +38,10 @@ class Foundation_API Base32DecoderBuf: public UnbufferedStreamBuf { public: Base32DecoderBuf(std::istream& istr); - ~Base32DecoderBuf(); + ~Base32DecoderBuf() override; private: - int readFromDevice(); + int readFromDevice() override; int readOne(); unsigned char _group[8]; @@ -66,7 +66,7 @@ class Foundation_API Base32DecoderIOS: public virtual std::ios { public: Base32DecoderIOS(std::istream& istr); - ~Base32DecoderIOS(); + ~Base32DecoderIOS() override; Base32DecoderBuf* rdbuf(); protected: @@ -92,7 +92,7 @@ class Foundation_API Base32Decoder: public Base32DecoderIOS, public std::istream { public: Base32Decoder(std::istream& istr); - ~Base32Decoder(); + ~Base32Decoder() override; private: Base32Decoder(const Base32Decoder&); diff --git a/Foundation/include/Poco/Base32Encoder.h b/Foundation/include/Poco/Base32Encoder.h index f36eac89d..44196d625 100644 --- a/Foundation/include/Poco/Base32Encoder.h +++ b/Foundation/include/Poco/Base32Encoder.h @@ -38,13 +38,13 @@ class Foundation_API Base32EncoderBuf: public UnbufferedStreamBuf { public: Base32EncoderBuf(std::ostream& ostr, bool padding = true); - ~Base32EncoderBuf(); + ~Base32EncoderBuf() override; int close(); /// Closes the stream buffer. private: - int writeToDevice(char c); + int writeToDevice(char c) override; unsigned char _group[5]; int _groupLength; @@ -68,7 +68,7 @@ class Foundation_API Base32EncoderIOS: public virtual std::ios { public: Base32EncoderIOS(std::ostream& ostr, bool padding = true); - ~Base32EncoderIOS(); + ~Base32EncoderIOS() override; int close(); Base32EncoderBuf* rdbuf(); @@ -98,7 +98,7 @@ class Foundation_API Base32Encoder: public Base32EncoderIOS, public std::ostream { public: Base32Encoder(std::ostream& ostr, bool padding = true); - ~Base32Encoder(); + ~Base32Encoder() override; private: Base32Encoder(const Base32Encoder&); diff --git a/Foundation/include/Poco/Base64Decoder.h b/Foundation/include/Poco/Base64Decoder.h index 678da50ec..2ec94ffd2 100644 --- a/Foundation/include/Poco/Base64Decoder.h +++ b/Foundation/include/Poco/Base64Decoder.h @@ -38,10 +38,10 @@ class Foundation_API Base64DecoderBuf: public UnbufferedStreamBuf { public: Base64DecoderBuf(std::istream& istr, int options = 0); - ~Base64DecoderBuf(); + ~Base64DecoderBuf() override; private: - int readFromDevice(); + int readFromDevice() override; int readOne(); int _options; @@ -70,7 +70,7 @@ class Foundation_API Base64DecoderIOS: public virtual std::ios { public: Base64DecoderIOS(std::istream& istr, int options = 0); - ~Base64DecoderIOS(); + ~Base64DecoderIOS() override; Base64DecoderBuf* rdbuf(); protected: @@ -96,7 +96,7 @@ class Foundation_API Base64Decoder: public Base64DecoderIOS, public std::istream { public: Base64Decoder(std::istream& istr, int options = 0); - ~Base64Decoder(); + ~Base64Decoder() override; private: Base64Decoder(const Base64Decoder&); diff --git a/Foundation/include/Poco/Base64Encoder.h b/Foundation/include/Poco/Base64Encoder.h index bc39d826b..3afd3142e 100644 --- a/Foundation/include/Poco/Base64Encoder.h +++ b/Foundation/include/Poco/Base64Encoder.h @@ -51,7 +51,7 @@ class Foundation_API Base64EncoderBuf: public UnbufferedStreamBuf { public: Base64EncoderBuf(std::ostream& ostr, int options = 0); - ~Base64EncoderBuf(); + ~Base64EncoderBuf() override; int close(); /// Closes the stream buffer. @@ -68,7 +68,7 @@ public: /// Returns the currently set line length. private: - int writeToDevice(char c); + int writeToDevice(char c) override; int _options; unsigned char _group[3]; @@ -96,7 +96,7 @@ class Foundation_API Base64EncoderIOS: public virtual std::ios { public: Base64EncoderIOS(std::ostream& ostr, int options = 0); - ~Base64EncoderIOS(); + ~Base64EncoderIOS() override; int close(); Base64EncoderBuf* rdbuf(); @@ -126,7 +126,7 @@ class Foundation_API Base64Encoder: public Base64EncoderIOS, public std::ostream { public: Base64Encoder(std::ostream& ostr, int options = 0); - ~Base64Encoder(); + ~Base64Encoder() override; private: Base64Encoder(const Base64Encoder&); diff --git a/Foundation/include/Poco/BasicEvent.h b/Foundation/include/Poco/BasicEvent.h index a4b53101e..38852da58 100644 --- a/Foundation/include/Poco/BasicEvent.h +++ b/Foundation/include/Poco/BasicEvent.h @@ -40,17 +40,12 @@ class BasicEvent: public AbstractEvent < /// for more information. { public: - BasicEvent() - { - } + BasicEvent() = default; - ~BasicEvent() - { - } + ~BasicEvent() = default; -private: - BasicEvent(const BasicEvent& e); - BasicEvent& operator = (const BasicEvent& e); + BasicEvent(const BasicEvent& e) = delete; + BasicEvent& operator=(const BasicEvent& e) = delete; }; diff --git a/Foundation/include/Poco/BinaryReader.h b/Foundation/include/Poco/BinaryReader.h index de5ab8054..bb30fc0d2 100644 --- a/Foundation/include/Poco/BinaryReader.h +++ b/Foundation/include/Poco/BinaryReader.h @@ -177,9 +177,7 @@ public: { } - ~BasicMemoryBinaryReader() - { - } + ~BasicMemoryBinaryReader() = default; const Buffer& data() const { @@ -201,9 +199,7 @@ private: MemoryInputStream _istr; }; - -typedef BasicMemoryBinaryReader MemoryBinaryReader; - +using MemoryBinaryReader = BasicMemoryBinaryReader; // // inlines diff --git a/Foundation/include/Poco/BinaryWriter.h b/Foundation/include/Poco/BinaryWriter.h index 730a61dbb..6aa8fb70a 100644 --- a/Foundation/include/Poco/BinaryWriter.h +++ b/Foundation/include/Poco/BinaryWriter.h @@ -225,9 +225,7 @@ private: MemoryOutputStream _ostr; }; - -typedef BasicMemoryBinaryWriter MemoryBinaryWriter; - +using MemoryBinaryWriter = BasicMemoryBinaryWriter; // // inlines diff --git a/Foundation/include/Poco/Buffer.h b/Foundation/include/Poco/Buffer.h index 34981e556..409d6754c 100644 --- a/Foundation/include/Poco/Buffer.h +++ b/Foundation/include/Poco/Buffer.h @@ -158,6 +158,8 @@ public: if (_ownMem) delete [] _ptr; } + Buffer() = delete; + void resize(std::size_t newCapacity, bool preserveContent = true) /// Resizes the buffer capacity and size. If preserveContent is true, /// the content of the old buffer is copied over to the @@ -362,8 +364,6 @@ public: } private: - Buffer(); - std::size_t _capacity; std::size_t _used; T* _ptr; diff --git a/Foundation/include/Poco/BufferAllocator.h b/Foundation/include/Poco/BufferAllocator.h index 9a3083eee..c8443561a 100644 --- a/Foundation/include/Poco/BufferAllocator.h +++ b/Foundation/include/Poco/BufferAllocator.h @@ -32,7 +32,7 @@ class BufferAllocator /// BufferAllocator has been specified. { public: - typedef ch char_type; + using char_type = ch; static char_type* allocate(std::streamsize size) { diff --git a/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h b/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h index 033467d48..5c4e63572 100644 --- a/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h +++ b/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h @@ -63,7 +63,7 @@ public: resetBuffers(); } - ~BasicBufferedBidirectionalStreamBuf() + ~BasicBufferedBidirectionalStreamBuf() override { Allocator::deallocate(_pReadBuffer, _bufsize); Allocator::deallocate(_pWriteBuffer, _bufsize); @@ -72,7 +72,7 @@ public: BasicBufferedBidirectionalStreamBuf(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(); @@ -86,7 +86,7 @@ public: return c; } - virtual int_type underflow() + int_type underflow() override { if (!(_mode & IOS::in)) return char_traits::eof(); @@ -107,7 +107,7 @@ public: return char_traits::to_int_type(*this->gptr()); } - virtual int sync() + int sync() override { if (this->pptr() && this->pptr() > this->pbase()) { diff --git a/Foundation/include/Poco/BufferedStreamBuf.h b/Foundation/include/Poco/BufferedStreamBuf.h index de915675b..1e5acbcf2 100644 --- a/Foundation/include/Poco/BufferedStreamBuf.h +++ b/Foundation/include/Poco/BufferedStreamBuf.h @@ -43,15 +43,15 @@ class BasicBufferedStreamBuf: public std::basic_streambuf /// ostream, but not for an iostream. { protected: - typedef std::basic_streambuf Base; - typedef std::basic_ios IOS; - typedef ch char_type; - typedef tr char_traits; - typedef ba Allocator; - typedef typename Base::int_type int_type; - typedef typename Base::pos_type pos_type; - typedef typename Base::off_type off_type; - typedef typename IOS::openmode openmode; + using Base = std::basic_streambuf; + using IOS = std::basic_ios; + using char_type = ch; + using char_traits = tr; + using Allocator = ba; + using int_type = typename Base::int_type; + using pos_type = typename Base::pos_type; + using off_type = typename Base::off_type; + using openmode = typename IOS::openmode; public: BasicBufferedStreamBuf(std::streamsize bufferSize, openmode mode): @@ -63,7 +63,7 @@ public: this->setp(_pBuffer, _pBuffer + _bufsize); } - ~BasicBufferedStreamBuf() + ~BasicBufferedStreamBuf() override { 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(); @@ -89,7 +92,7 @@ public: return c; } - virtual int_type underflow() + int_type underflow() override { if (!(_mode & IOS::in)) return char_traits::eof(); @@ -110,7 +113,7 @@ public: return char_traits::to_int_type(*this->gptr()); } - virtual int sync() + int sync() override { if (this->pptr() && this->pptr() > this->pbase()) { @@ -155,9 +158,6 @@ private: std::streamsize _bufsize; char_type* _pBuffer; openmode _mode; - - BasicBufferedStreamBuf(const BasicBufferedStreamBuf&); - BasicBufferedStreamBuf& operator = (const BasicBufferedStreamBuf&); }; // diff --git a/Foundation/include/Poco/Bugcheck.h b/Foundation/include/Poco/Bugcheck.h index 6b24ae903..97c129dba 100644 --- a/Foundation/include/Poco/Bugcheck.h +++ b/Foundation/include/Poco/Bugcheck.h @@ -39,7 +39,7 @@ class Foundation_API Bugcheck /// automatically provide useful context information. { 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 /// possible, then throw an AssertionViolationException. @@ -70,7 +70,7 @@ public: /// possible. 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); }; diff --git a/Foundation/include/Poco/Channel.h b/Foundation/include/Poco/Channel.h index 8b97fc616..773b474b8 100644 --- a/Foundation/include/Poco/Channel.h +++ b/Foundation/include/Poco/Channel.h @@ -60,14 +60,14 @@ public: /// If the channel has not been opened yet, the log() /// 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. - std::string getProperty(const std::string& name) const; + std::string getProperty(const std::string& name) const override; /// Throws a PropertyNotSupportedException. protected: - virtual ~Channel(); + ~Channel() override; private: Channel(const Channel&); diff --git a/Foundation/include/Poco/ClassLoader.h b/Foundation/include/Poco/ClassLoader.h index 4a49c2514..9188b8a9d 100644 --- a/Foundation/include/Poco/ClassLoader.h +++ b/Foundation/include/Poco/ClassLoader.h @@ -51,11 +51,11 @@ class ClassLoader /// library. { public: - typedef AbstractMetaObject Meta; - typedef Manifest Manif; - typedef void (*InitializeLibraryFunc)(); - typedef void (*UninitializeLibraryFunc)(); - typedef bool (*BuildManifestFunc)(ManifestBase*); + using Meta = AbstractMetaObject; + using Manif = Manifest; + using InitializeLibraryFunc = void (*)(); + using UninitializeLibraryFunc = void (*)(); + using BuildManifestFunc = bool (*)(ManifestBase *); struct LibraryInfo { @@ -63,13 +63,13 @@ public: const Manif* pManifest; int refCount; }; - typedef std::map LibraryMap; + using LibraryMap = std::map; class Iterator /// The ClassLoader's very own iterator class. { public: - typedef std::pair Pair; + using Pair = std::pair; Iterator(const typename LibraryMap::const_iterator& it) { @@ -79,9 +79,7 @@ public: { _it = it._it; } - ~Iterator() - { - } + ~Iterator() = default; Iterator& operator = (const Iterator& it) { _it = it._it; @@ -124,10 +122,8 @@ public: mutable Pair _pair; }; - ClassLoader() + ClassLoader() = default; /// Creates the ClassLoader. - { - } virtual ~ClassLoader() /// Destroys the ClassLoader. diff --git a/Foundation/include/Poco/Clock.h b/Foundation/include/Poco/Clock.h index 570866c45..74ec06296 100644 --- a/Foundation/include/Poco/Clock.h +++ b/Foundation/include/Poco/Clock.h @@ -43,11 +43,11 @@ class Foundation_API Clock /// to the time of day. { public: - typedef Int64 ClockVal; - /// Monotonic clock value in microsecond resolution. + using ClockVal = Int64; + /// Monotonic clock value in microsecond resolution. - typedef Int64 ClockDiff; - /// Difference between two ClockVal values in microseconds. + using ClockDiff = Int64; + /// Difference between two ClockVal values in microseconds. static const ClockVal CLOCKVAL_MIN; /// Minimum clock value. static const ClockVal CLOCKVAL_MAX; /// Maximum clock value. diff --git a/Foundation/include/Poco/Condition.h b/Foundation/include/Poco/Condition.h index 35e73d779..c0b4912c5 100644 --- a/Foundation/include/Poco/Condition.h +++ b/Foundation/include/Poco/Condition.h @@ -124,7 +124,7 @@ private: Condition(const Condition&); Condition& operator = (const Condition&); - typedef std::deque WaitQueue; + using WaitQueue = std::deque; FastMutex _mutex; WaitQueue _waitQueue; diff --git a/Foundation/include/Poco/ConsoleChannel.h b/Foundation/include/Poco/ConsoleChannel.h index d02eb78a9..9710bcd1c 100644 --- a/Foundation/include/Poco/ConsoleChannel.h +++ b/Foundation/include/Poco/ConsoleChannel.h @@ -51,11 +51,11 @@ public: ConsoleChannel(std::ostream& str); /// 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. protected: - ~ConsoleChannel(); + ~ConsoleChannel() override; private: std::ostream& _str; @@ -123,10 +123,10 @@ public: ColorConsoleChannel(std::ostream& str); /// Creates the channel using the given stream. - void log(const Message& msg); - /// Logs the given message to the channel's stream. + void log(const Message& msg) override; + /// 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. /// /// The following properties are supported: @@ -142,7 +142,7 @@ public: /// /// 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. /// See setProperty() for a description of the supported /// properties. @@ -169,7 +169,7 @@ protected: CC_WHITE = 0x0125 }; - ~ColorConsoleChannel(); + ~ColorConsoleChannel() override; Color parseColor(const std::string& color) const; std::string formatColor(Color color) const; void initColors(); diff --git a/Foundation/include/Poco/CountingStream.h b/Foundation/include/Poco/CountingStream.h index 459d4f338..fc4c7d9eb 100644 --- a/Foundation/include/Poco/CountingStream.h +++ b/Foundation/include/Poco/CountingStream.h @@ -43,7 +43,7 @@ public: /// Creates the CountingStreamBuf and connects it /// to the given output stream. - ~CountingStreamBuf(); + ~CountingStreamBuf() override; /// Destroys the CountingStream. std::streamsize chars() const; @@ -77,8 +77,8 @@ public: /// Add to the number of characters on the current line. protected: - int readFromDevice(); - int writeToDevice(char c); + int readFromDevice() override; + int writeToDevice(char c) override; private: std::istream* _pIstr; @@ -107,7 +107,7 @@ public: /// Creates the basic stream and connects it /// to the given output stream. - ~CountingIOS(); + ~CountingIOS() override; /// Destroys the stream. std::streamsize chars() const; @@ -158,7 +158,7 @@ public: /// Creates the CountingInputStream and connects it /// to the given input stream. - ~CountingInputStream(); + ~CountingInputStream() override; /// Destroys the stream. }; @@ -175,7 +175,7 @@ public: /// Creates the CountingOutputStream and connects it /// to the given output stream. - ~CountingOutputStream(); + ~CountingOutputStream() override; /// Destroys the CountingOutputStream. }; diff --git a/Foundation/include/Poco/DataURIStream.h b/Foundation/include/Poco/DataURIStream.h index 154f3fb35..ff1f06b43 100644 --- a/Foundation/include/Poco/DataURIStream.h +++ b/Foundation/include/Poco/DataURIStream.h @@ -39,7 +39,7 @@ class Foundation_API DataURIStreamIOS: public virtual std::ios { public: DataURIStreamIOS(const URI& uri); - ~DataURIStreamIOS(); + ~DataURIStreamIOS() override; std::streambuf* rdbuf(); protected: @@ -63,7 +63,7 @@ public: /// Creates a DataURIStream for the given data URI, /// ready for reading data. /// Throws a DataFormatException exception if the data is incorrect format. - ~DataURIStream(); + ~DataURIStream() override; /// Destroys the DataURIStream. private: diff --git a/Foundation/include/Poco/DataURIStreamFactory.h b/Foundation/include/Poco/DataURIStreamFactory.h index 6297c59a0..c3d996555 100644 --- a/Foundation/include/Poco/DataURIStreamFactory.h +++ b/Foundation/include/Poco/DataURIStreamFactory.h @@ -34,10 +34,10 @@ public: DataURIStreamFactory(); /// Creates the DataURIStreamFactory. - ~DataURIStreamFactory(); - /// Destroys the DataURIStreamFactory. + ~DataURIStreamFactory() override; + /// 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. /// /// Throws a DataFormatException exception if the data is incorrect format. diff --git a/Foundation/include/Poco/DateTimeFormat.h b/Foundation/include/Poco/DateTimeFormat.h index 069eebf11..6a8d5dd5d 100644 --- a/Foundation/include/Poco/DateTimeFormat.h +++ b/Foundation/include/Poco/DateTimeFormat.h @@ -129,7 +129,7 @@ public: /// Returns true if dateTime validates against at least one supported format. private: - typedef std::unordered_set Formatlist; + using Formatlist = std::unordered_set; static Formatlist FORMAT_LIST; }; diff --git a/Foundation/include/Poco/DefaultStrategy.h b/Foundation/include/Poco/DefaultStrategy.h index ede9d051e..a778a91e5 100644 --- a/Foundation/include/Poco/DefaultStrategy.h +++ b/Foundation/include/Poco/DefaultStrategy.h @@ -41,18 +41,14 @@ public: using Iterator = typename Delegates::iterator; public: - DefaultStrategy() - { - } + DefaultStrategy() = default; DefaultStrategy(const DefaultStrategy& s): _delegates(s._delegates) { } - ~DefaultStrategy() - { - } + ~DefaultStrategy() = default; void notify(const void* sender, TArgs& arguments) { @@ -138,9 +134,7 @@ public: using Iterator = typename Delegates::iterator; public: - DefaultStrategy() - { - } + DefaultStrategy() = default; DefaultStrategy(const DefaultStrategy& s): _delegates(s._delegates) @@ -152,9 +146,7 @@ public: { } - ~DefaultStrategy() - { - } + ~DefaultStrategy() = default; void notify(const void* sender) { diff --git a/Foundation/include/Poco/DeflatingStream.h b/Foundation/include/Poco/DeflatingStream.h index e48eef046..5cc1bd246 100644 --- a/Foundation/include/Poco/DeflatingStream.h +++ b/Foundation/include/Poco/DeflatingStream.h @@ -77,8 +77,8 @@ public: /// Please refer to the zlib documentation of deflateInit2() for a description /// of the windowBits parameter. - ~DeflatingStreamBuf(); - /// Destroys the DeflatingStreamBuf. + ~DeflatingStreamBuf() override; + /// Destroys the DeflatingStreamBuf. int close(); /// Finishes up the stream. @@ -86,9 +86,9 @@ public: /// Must be called when deflating to an output stream. protected: - int readFromDevice(char* buffer, std::streamsize length); - int writeToDevice(const char* buffer, std::streamsize length); - virtual int sync(); + int readFromDevice(char* buffer, std::streamsize length) override; + int writeToDevice(const char* buffer, std::streamsize length) override; + int sync() override; private: enum @@ -134,8 +134,8 @@ public: /// Please refer to the zlib documentation of deflateInit2() for a description /// of the windowBits parameter. - ~DeflatingIOS(); - /// Destroys the DeflatingIOS. + ~DeflatingIOS() override; + /// Destroys the DeflatingIOS. DeflatingStreamBuf* rdbuf(); /// Returns a pointer to the underlying stream buffer. @@ -169,8 +169,8 @@ public: /// Please refer to the zlib documentation of deflateInit2() for a description /// of the windowBits parameter. - ~DeflatingOutputStream(); - /// Destroys the DeflatingOutputStream. + ~DeflatingOutputStream() override; + /// Destroys the DeflatingOutputStream. int close(); /// Finishes up the stream. @@ -198,8 +198,8 @@ public: /// Please refer to the zlib documentation of deflateInit2() for a description /// of the windowBits parameter. - ~DeflatingInputStream(); - /// Destroys the DeflatingInputStream. + ~DeflatingInputStream() override; + /// Destroys the DeflatingInputStream. }; diff --git a/Foundation/include/Poco/Delegate.h b/Foundation/include/Poco/Delegate.h index b0b2c7615..d489bd61c 100644 --- a/Foundation/include/Poco/Delegate.h +++ b/Foundation/include/Poco/Delegate.h @@ -32,7 +32,7 @@ template class Delegate: public AbstractDelegate { public: - typedef void (TObj::*NotifyMethod)(const void*, TArgs&); + using NotifyMethod = void (TObj::*)(const void *, TArgs &); Delegate(TObj* obj, NotifyMethod method): _receiverObject(obj), @@ -47,9 +47,9 @@ public: { } - ~Delegate() - { - } + ~Delegate() = default; + + Delegate() = delete; Delegate& operator = (const Delegate& delegate) { @@ -93,9 +93,6 @@ protected: TObj* _receiverObject; NotifyMethod _receiverMethod; Mutex _mutex; - -private: - Delegate(); }; @@ -103,7 +100,7 @@ template class Delegate: public AbstractDelegate { public: - typedef void (TObj::*NotifyMethod)(TArgs&); + using NotifyMethod = void (TObj::*)(TArgs &); Delegate(TObj* obj, NotifyMethod method): _receiverObject(obj), @@ -118,9 +115,9 @@ public: { } - ~Delegate() - { - } + ~Delegate() = default; + + Delegate() = delete; Delegate& operator = (const Delegate& delegate) { @@ -164,9 +161,6 @@ protected: TObj* _receiverObject; NotifyMethod _receiverMethod; Mutex _mutex; - -private: - Delegate(); }; @@ -244,7 +238,7 @@ template class Delegate: public AbstractDelegate { public: - typedef void (TObj::*NotifyMethod)(const void*); + using NotifyMethod = void (TObj::*)(const void *); Delegate(TObj* obj, NotifyMethod method): _receiverObject(obj), @@ -259,9 +253,9 @@ public: { } - ~Delegate() - { - } + ~Delegate() override = default; + + Delegate() = delete; Delegate& operator = (const Delegate& delegate) { @@ -273,7 +267,7 @@ public: return *this; } - bool notify(const void* sender) + bool notify(const void *sender) override { Mutex::ScopedLock lock(_mutex); if (_receiverObject) @@ -284,18 +278,18 @@ public: else return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate &other) const override { const Delegate* pOtherDelegate = dynamic_cast(other.unwrap()); return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; } - AbstractDelegate* clone() const + AbstractDelegate *clone() const override { return new Delegate(*this); } - void disable() + void disable() override { Mutex::ScopedLock lock(_mutex); _receiverObject = 0; @@ -305,9 +299,6 @@ protected: TObj* _receiverObject; NotifyMethod _receiverMethod; Mutex _mutex; - -private: - Delegate(); }; @@ -315,7 +306,7 @@ template class Delegate: public AbstractDelegate { public: - typedef void (TObj::*NotifyMethod)(); + using NotifyMethod = void (TObj::*)(); Delegate(TObj* obj, NotifyMethod method): _receiverObject(obj), @@ -330,9 +321,9 @@ public: { } - ~Delegate() - { - } + ~Delegate() override = default; + + Delegate() = delete; Delegate& operator = (const Delegate& delegate) { @@ -344,7 +335,7 @@ public: return *this; } - bool notify(const void*) + bool notify(const void *) override { Mutex::ScopedLock lock(_mutex); if (_receiverObject) @@ -355,18 +346,17 @@ public: else return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate &other) const override { const Delegate* pOtherDelegate = dynamic_cast(other.unwrap()); return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; } - AbstractDelegate* clone() const - { + AbstractDelegate *clone() const override { return new Delegate(*this); } - void disable() + void disable() override { Mutex::ScopedLock lock(_mutex); _receiverObject = 0; @@ -376,9 +366,6 @@ protected: TObj* _receiverObject; NotifyMethod _receiverMethod; Mutex _mutex; - -private: - Delegate(); }; diff --git a/Foundation/include/Poco/DigestStream.h b/Foundation/include/Poco/DigestStream.h index 5d1de54c3..1881bdc4e 100644 --- a/Foundation/include/Poco/DigestStream.h +++ b/Foundation/include/Poco/DigestStream.h @@ -36,9 +36,9 @@ public: DigestBuf(DigestEngine& eng); DigestBuf(DigestEngine& eng, std::istream& istr); DigestBuf(DigestEngine& eng, std::ostream& ostr); - ~DigestBuf(); - int readFromDevice(char* buffer, std::streamsize length); - int writeToDevice(const char* buffer, std::streamsize length); + ~DigestBuf() override; + int readFromDevice(char *buffer, std::streamsize length) override; + int writeToDevice(const char *buffer, std::streamsize length) override; void close(); private: @@ -59,7 +59,7 @@ public: DigestIOS(DigestEngine& eng); DigestIOS(DigestEngine& eng, std::istream& istr); DigestIOS(DigestEngine& eng, std::ostream& ostr); - ~DigestIOS(); + ~DigestIOS() override; DigestBuf* rdbuf(); protected: @@ -74,7 +74,7 @@ class Foundation_API DigestInputStream: public DigestIOS, public std::istream { public: DigestInputStream(DigestEngine& eng, std::istream& istr); - ~DigestInputStream(); + ~DigestInputStream() override; }; @@ -89,7 +89,7 @@ class Foundation_API DigestOutputStream: public DigestIOS, public std::ostream public: DigestOutputStream(DigestEngine& eng); DigestOutputStream(DigestEngine& eng, std::ostream& ostr); - ~DigestOutputStream(); + ~DigestOutputStream() override; void close(); }; diff --git a/Foundation/include/Poco/DirectoryWatcher.h b/Foundation/include/Poco/DirectoryWatcher.h index 2de0c9f2a..dbe72165a 100644 --- a/Foundation/include/Poco/DirectoryWatcher.h +++ b/Foundation/include/Poco/DirectoryWatcher.h @@ -148,8 +148,8 @@ public: /// scanInterval specifies the interval in seconds between scans /// of the directory. - ~DirectoryWatcher(); - /// Destroys the DirectoryWatcher. + ~DirectoryWatcher() override; + /// Destroys the DirectoryWatcher. void suspendEvents(); /// Suspends sending of events. Can be called multiple times, but every @@ -177,7 +177,7 @@ public: protected: void init(); void stop(); - void run(); + void run() override; private: DirectoryWatcher(); diff --git a/Foundation/include/Poco/DynamicFactory.h b/Foundation/include/Poco/DynamicFactory.h index f8d10ef3d..c8f1eef46 100644 --- a/Foundation/include/Poco/DynamicFactory.h +++ b/Foundation/include/Poco/DynamicFactory.h @@ -34,12 +34,11 @@ class DynamicFactory /// A factory that creates objects by class name. { public: - typedef AbstractInstantiator AbstractFactory; + using AbstractFactory = AbstractInstantiator; DynamicFactory() /// Creates the DynamicFactory. - { - } + = default; ~DynamicFactory() /// 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 /// Creates a new instance of the class with the given name. /// The class must have been registered with registerClass. @@ -121,10 +123,7 @@ public: } private: - DynamicFactory(const DynamicFactory&); - DynamicFactory& operator = (const DynamicFactory&); - - typedef std::map FactoryMap; + using FactoryMap = std::map; FactoryMap _map; mutable FastMutex _mutex; diff --git a/Foundation/include/Poco/Environment.h b/Foundation/include/Poco/Environment.h index a42210912..31557fcbb 100644 --- a/Foundation/include/Poco/Environment.h +++ b/Foundation/include/Poco/Environment.h @@ -29,7 +29,7 @@ class Foundation_API Environment /// and some general system information. { public: - typedef UInt8 NodeId[6]; /// Ethernet address. + using NodeId = UInt8[6]; /// Ethernet address. static std::string get(const std::string& name); /// Returns the value of the environment variable diff --git a/Foundation/include/Poco/Environment_UNIX.h b/Foundation/include/Poco/Environment_UNIX.h index 1efb4ea15..e5e527a24 100644 --- a/Foundation/include/Poco/Environment_UNIX.h +++ b/Foundation/include/Poco/Environment_UNIX.h @@ -29,7 +29,7 @@ namespace Poco { class Foundation_API EnvironmentImpl { public: - typedef UInt8 NodeId[6]; /// Ethernet address. + using NodeId = UInt8[6]; /// Ethernet address. static std::string getImpl(const std::string& name); static bool hasImpl(const std::string& name); @@ -43,7 +43,7 @@ public: static unsigned processorCountImpl(); private: - typedef std::map StringMap; + using StringMap = std::map; static StringMap _map; static FastMutex _mutex; diff --git a/Foundation/include/Poco/Environment_VX.h b/Foundation/include/Poco/Environment_VX.h index 8feb6b9f0..e0b8ee4c7 100644 --- a/Foundation/include/Poco/Environment_VX.h +++ b/Foundation/include/Poco/Environment_VX.h @@ -29,7 +29,7 @@ namespace Poco { class Foundation_API EnvironmentImpl { public: - typedef UInt8 NodeId[6]; /// Ethernet address. + using NodeId = UInt8[6]; /// Ethernet address. static std::string getImpl(const std::string& name); static bool hasImpl(const std::string& name); @@ -43,7 +43,7 @@ public: static unsigned processorCountImpl(); private: - typedef std::map StringMap; + using StringMap = std::map; static StringMap _map; static FastMutex _mutex; diff --git a/Foundation/include/Poco/Environment_WIN32U.h b/Foundation/include/Poco/Environment_WIN32U.h index f7f5e793b..16eaabb42 100644 --- a/Foundation/include/Poco/Environment_WIN32U.h +++ b/Foundation/include/Poco/Environment_WIN32U.h @@ -27,7 +27,7 @@ namespace Poco { class Foundation_API EnvironmentImpl { public: - typedef UInt8 NodeId[6]; /// Ethernet address. + using NodeId = UInt8[6]; /// Ethernet address. static std::string getImpl(const std::string& name); static bool hasImpl(const std::string& name); diff --git a/Foundation/include/Poco/EventChannel.h b/Foundation/include/Poco/EventChannel.h index 94a94cfb0..c3d9dbd18 100644 --- a/Foundation/include/Poco/EventChannel.h +++ b/Foundation/include/Poco/EventChannel.h @@ -41,11 +41,11 @@ public: EventChannel(); /// Creates the EventChannel. - void log(const Message& msg); + void log(const Message& msg) override; /// Fires the messageLogged event. protected: - ~EventChannel(); + ~EventChannel() override; /// Destroys the EventChannel. }; diff --git a/Foundation/include/Poco/Exception.h b/Foundation/include/Poco/Exception.h index 0ed444299..41a3644c2 100644 --- a/Foundation/include/Poco/Exception.h +++ b/Foundation/include/Poco/Exception.h @@ -43,7 +43,7 @@ public: Exception(const Exception& exc); /// Copy constructor. - ~Exception() noexcept; + ~Exception() noexcept override; /// Destroys the exception and deletes the nested exception. Exception& operator = (const Exception& exc); @@ -55,7 +55,7 @@ public: virtual const char* className() const noexcept; /// 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. /// /// Same as name(), but for compatibility with std::exception. diff --git a/Foundation/include/Poco/ExpirationDecorator.h b/Foundation/include/Poco/ExpirationDecorator.h index 15c8e6a8f..d2b65a3cb 100644 --- a/Foundation/include/Poco/ExpirationDecorator.h +++ b/Foundation/include/Poco/ExpirationDecorator.h @@ -60,10 +60,7 @@ public: { } - - ~ExpirationDecorator() - { - } + ~ExpirationDecorator() = default; const Poco::Timestamp& getExpiration() const { diff --git a/Foundation/include/Poco/Expire.h b/Foundation/include/Poco/Expire.h index 672ddfc02..0e6daf28e 100644 --- a/Foundation/include/Poco/Expire.h +++ b/Foundation/include/Poco/Expire.h @@ -51,6 +51,8 @@ public: delete _pDelegate; } + Expire() = delete; + Expire& operator = (const Expire& expire) { if (&expire != this) @@ -101,9 +103,6 @@ protected: AbstractDelegate* _pDelegate; Timestamp::TimeDiff _expire; Timestamp _creationTime; - -private: - Expire(); }; @@ -127,11 +126,13 @@ public: { } - ~Expire() + ~Expire() override { delete _pDelegate; } + Expire() = delete; + Expire& operator = (const Expire& expire) { if (&expire != this) @@ -145,7 +146,7 @@ public: return *this; } - bool notify(const void* sender) + bool notify(const void* sender) override { if (!expired()) return this->_pDelegate->notify(sender); @@ -153,22 +154,22 @@ public: return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate& other) const override { return other.equals(*_pDelegate); } - AbstractDelegate* clone() const + AbstractDelegate* clone() const override { return new Expire(*this); } - void disable() + void disable() override { _pDelegate->disable(); } - const AbstractDelegate* unwrap() const + const AbstractDelegate* unwrap() const override { return this->_pDelegate; } @@ -182,9 +183,6 @@ protected: AbstractDelegate* _pDelegate; Timestamp::TimeDiff _expire; Timestamp _creationTime; - -private: - Expire(); }; diff --git a/Foundation/include/Poco/ExpireCache.h b/Foundation/include/Poco/ExpireCache.h index 5dd8ff720..4211a060d 100644 --- a/Foundation/include/Poco/ExpireCache.h +++ b/Foundation/include/Poco/ExpireCache.h @@ -49,13 +49,10 @@ public: { } - ~ExpireCache() - { - } + ~ExpireCache() = default; -private: - ExpireCache(const ExpireCache& aCache); - ExpireCache& operator = (const ExpireCache& aCache); + ExpireCache(const ExpireCache& aCache) = delete; + ExpireCache& operator=(const ExpireCache& aCache) = delete; }; diff --git a/Foundation/include/Poco/ExpireLRUCache.h b/Foundation/include/Poco/ExpireLRUCache.h index 492121262..97013fe68 100644 --- a/Foundation/include/Poco/ExpireLRUCache.h +++ b/Foundation/include/Poco/ExpireLRUCache.h @@ -46,13 +46,10 @@ public: this->_strategy.pushBack(new ExpireStrategy(expire)); } - ~ExpireLRUCache() - { - } + ~ExpireLRUCache() = default; -private: - ExpireLRUCache(const ExpireLRUCache& aCache); - ExpireLRUCache& operator = (const ExpireLRUCache& aCache); + ExpireLRUCache(const ExpireLRUCache& aCache) = delete; + ExpireLRUCache& operator=(const ExpireLRUCache& aCache) = delete; }; diff --git a/Foundation/include/Poco/ExpireStrategy.h b/Foundation/include/Poco/ExpireStrategy.h index 157286ada..ace6d755d 100644 --- a/Foundation/include/Poco/ExpireStrategy.h +++ b/Foundation/include/Poco/ExpireStrategy.h @@ -18,10 +18,10 @@ #define Foundation_ExpireStrategy_INCLUDED +#include "Poco/Exception.h" #include "Poco/KeyValueArgs.h" #include "Poco/ValidArgs.h" #include "Poco/AbstractStrategy.h" -#include "Poco/Bugcheck.h" #include "Poco/Timestamp.h" #include "Poco/EventArgs.h" #include @@ -39,11 +39,11 @@ class ExpireStrategy: public AbstractStrategy /// An ExpireStrategy implements time based expiration of cache entries { public: - typedef std::multimap TimeIndex; - typedef typename TimeIndex::iterator IndexIterator; - typedef typename TimeIndex::const_iterator ConstIndexIterator; - typedef std::map Keys; - typedef typename Keys::iterator Iterator; + using TimeIndex = std::multimap; + using IndexIterator = typename TimeIndex::iterator; + using ConstIndexIterator = typename TimeIndex::const_iterator; + using Keys = std::map; + using Iterator = typename Keys::iterator; public: ExpireStrategy(Timestamp::TimeDiff expireTimeInMilliSec): _expireTime(expireTimeInMilliSec * 1000) @@ -53,9 +53,7 @@ public: if (_expireTime < 25000) throw InvalidArgumentException("expireTime must be at least 25 ms"); } - ~ExpireStrategy() - { - } + ~ExpireStrategy() = default; void onAdd(const void*, const KeyValueArgs & args) { diff --git a/Foundation/include/Poco/FIFOBuffer.h b/Foundation/include/Poco/FIFOBuffer.h index c1a6d9966..3cfc184ce 100644 --- a/Foundation/include/Poco/FIFOBuffer.h +++ b/Foundation/include/Poco/FIFOBuffer.h @@ -49,7 +49,7 @@ class BasicFIFOBuffer /// is needed. { public: - typedef T Type; + using Type = T; mutable Poco::BasicEvent writable; /// Event indicating "writability" of the buffer, @@ -108,10 +108,12 @@ public: { } - ~BasicFIFOBuffer() + ~BasicFIFOBuffer() = default; /// Destroys the FIFOBuffer. - { - } + + BasicFIFOBuffer() = delete; + BasicFIFOBuffer(const BasicFIFOBuffer&) = delete; + BasicFIFOBuffer& operator=(const BasicFIFOBuffer&) = delete; void resize(std::size_t newSize, bool preserveContent = true) /// Resizes the buffer. If preserveContent is true, @@ -531,10 +533,6 @@ private: writable.notify(this, f); } - BasicFIFOBuffer(); - BasicFIFOBuffer(const BasicFIFOBuffer&); - BasicFIFOBuffer& operator = (const BasicFIFOBuffer&); - Buffer _buffer; std::size_t _begin; std::size_t _used; @@ -548,8 +546,7 @@ private: // // We provide an instantiation for char // -typedef BasicFIFOBuffer FIFOBuffer; - +using FIFOBuffer = BasicFIFOBuffer; } // namespace Poco diff --git a/Foundation/include/Poco/FIFOBufferStream.h b/Foundation/include/Poco/FIFOBufferStream.h index 08673a7ad..93d3ec7da 100644 --- a/Foundation/include/Poco/FIFOBufferStream.h +++ b/Foundation/include/Poco/FIFOBufferStream.h @@ -49,15 +49,15 @@ public: explicit FIFOBufferStreamBuf(std::size_t length); /// Creates a FIFOBufferStreamBuf of the given length. - ~FIFOBufferStreamBuf(); - /// Destroys the FIFOBufferStreamBuf. + ~FIFOBufferStreamBuf() override; + /// Destroys the FIFOBufferStreamBuf. FIFOBuffer& fifoBuffer(); /// Returns the underlying FIFO buffer reference. protected: - int readFromDevice(char* buffer, std::streamsize length); - int writeToDevice(const char* buffer, std::streamsize length); + int readFromDevice(char* buffer, std::streamsize length) override; + int writeToDevice(const char* buffer, std::streamsize length) override; private: enum @@ -90,10 +90,10 @@ public: explicit FIFOIOS(std::size_t length); /// Creates a FIFOIOS of the given length. - ~FIFOIOS(); - /// Destroys the FIFOIOS. - /// - /// Flushes the buffer. + ~FIFOIOS() override; + /// Destroys the FIFOIOS. + /// + /// Flushes the buffer. FIFOBufferStreamBuf* rdbuf(); /// Returns a pointer to the internal FIFOBufferStreamBuf. @@ -125,10 +125,10 @@ public: explicit FIFOBufferStream(std::size_t length); /// Creates a FIFOBufferStream of the given length. - ~FIFOBufferStream(); - /// Destroys the FIFOBufferStream. - /// - /// Flushes the buffer. + ~FIFOBufferStream() override; + /// Destroys the FIFOBufferStream. + /// + /// Flushes the buffer. private: FIFOBufferStream(); diff --git a/Foundation/include/Poco/FIFOEvent.h b/Foundation/include/Poco/FIFOEvent.h index 6d8701ba7..fce4d5a8a 100644 --- a/Foundation/include/Poco/FIFOEvent.h +++ b/Foundation/include/Poco/FIFOEvent.h @@ -42,17 +42,12 @@ class POCO_DEPRECATED("use BasicEvent") FIFOEvent: public AbstractEvent < /// for backwards compatibility only. { public: - FIFOEvent() - { - } + FIFOEvent() = default; - ~FIFOEvent() - { - } + ~FIFOEvent() = default; -private: - FIFOEvent(const FIFOEvent& e); - FIFOEvent& operator = (const FIFOEvent& e); + FIFOEvent(const FIFOEvent& e) = delete; + FIFOEvent& operator=(const FIFOEvent& e) = delete; }; diff --git a/Foundation/include/Poco/FIFOStrategy.h b/Foundation/include/Poco/FIFOStrategy.h index db837f0d7..8c8c3f2aa 100644 --- a/Foundation/include/Poco/FIFOStrategy.h +++ b/Foundation/include/Poco/FIFOStrategy.h @@ -31,9 +31,7 @@ class POCO_DEPRECATED("") FIFOStrategy: public DefaultStrategy /// for backwards compatibility only. { public: - FIFOStrategy() - { - } + FIFOStrategy() = default; FIFOStrategy(const FIFOStrategy& s): DefaultStrategy(s) @@ -45,9 +43,7 @@ public: { } - ~FIFOStrategy() - { - } + ~FIFOStrategy() = default; FIFOStrategy& operator = (const FIFOStrategy& s) { diff --git a/Foundation/include/Poco/FPEnvironment.h b/Foundation/include/Poco/FPEnvironment.h index 4602f57f9..1f3cb9e9f 100644 --- a/Foundation/include/Poco/FPEnvironment.h +++ b/Foundation/include/Poco/FPEnvironment.h @@ -123,8 +123,7 @@ public: // For convenience, we provide a shorter name for // the FPEnvironment class. // -typedef FPEnvironment FPE; - +using FPE = FPEnvironment; // // inline's diff --git a/Foundation/include/Poco/FileChannel.h b/Foundation/include/Poco/FileChannel.h index 10aea1066..ed84c6f47 100644 --- a/Foundation/include/Poco/FileChannel.h +++ b/Foundation/include/Poco/FileChannel.h @@ -171,16 +171,16 @@ public: FileChannel(const std::string& 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. - void close(); + void close() override; /// Closes the FileChannel. - void log(const Message& msg); + void log(const Message& msg) override; /// 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. /// /// The following properties are supported: @@ -206,7 +206,7 @@ public: /// * rotateOnOpen: Specifies whether an existing log file should be /// 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. /// See setProperty() for a description of the supported /// properties. @@ -243,7 +243,7 @@ public: static const std::string PROP_ROTATEONOPEN; protected: - ~FileChannel(); + ~FileChannel() override; void setRotation(const std::string& rotation); void setArchive(const std::string& archive); @@ -256,7 +256,7 @@ protected: private: 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; RotateStrategy* createRotationStrategy(const std::string& rotation, const std::string& times) const; diff --git a/Foundation/include/Poco/FileStreamFactory.h b/Foundation/include/Poco/FileStreamFactory.h index e82d2f3ac..d9fa91c33 100644 --- a/Foundation/include/Poco/FileStreamFactory.h +++ b/Foundation/include/Poco/FileStreamFactory.h @@ -36,16 +36,16 @@ public: FileStreamFactory(); /// Creates the FileStreamFactory. - ~FileStreamFactory(); + ~FileStreamFactory() override; /// Destroys the FileStreamFactory. - std::istream* open(const URI& 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 - /// containing a path to a local file. - /// - /// Throws an FileNotFound exception if the file cannot - /// be opened. + std::istream *open(const URI &uri) override; + /// 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 + /// containing a path to a local file. + /// + /// Throws an FileNotFound exception if the file cannot + /// be opened. std::istream* open(const Path& path); /// Creates and opens a file stream in binary mode for the given path. diff --git a/Foundation/include/Poco/FileStreamRWLock.h b/Foundation/include/Poco/FileStreamRWLock.h index 7227ed03d..cb1b41b5e 100644 --- a/Foundation/include/Poco/FileStreamRWLock.h +++ b/Foundation/include/Poco/FileStreamRWLock.h @@ -89,12 +89,13 @@ public: ScopedFStreamRWLock(FileStreamRWLock& rwl, bool write = false); ~ScopedFStreamRWLock(); + ScopedFStreamRWLock() = delete; + ScopedFStreamRWLock(const ScopedFStreamRWLock&) = delete; + ScopedFStreamRWLock& operator=(const ScopedFStreamRWLock&) = delete; + private: FileStreamRWLock& _rwl; - ScopedFStreamRWLock(); - ScopedFStreamRWLock(const ScopedFStreamRWLock&); - ScopedFStreamRWLock& operator = (const ScopedFStreamRWLock&); }; @@ -182,21 +183,13 @@ inline ScopedFStreamReadRWLock::ScopedFStreamReadRWLock(FileStreamRWLock& rwl): { } - -inline ScopedFStreamReadRWLock::~ScopedFStreamReadRWLock() -{ -} - +inline ScopedFStreamReadRWLock::~ScopedFStreamReadRWLock() = default; inline ScopedFStreamWriteRWLock::ScopedFStreamWriteRWLock(FileStreamRWLock& rwl): ScopedFStreamRWLock(rwl, true) { } - -inline ScopedFStreamWriteRWLock::~ScopedFStreamWriteRWLock() -{ -} - +inline ScopedFStreamWriteRWLock::~ScopedFStreamWriteRWLock() = default; } // namespace Poco diff --git a/Foundation/include/Poco/Formatter.h b/Foundation/include/Poco/Formatter.h index e05199289..376eab5ab 100644 --- a/Foundation/include/Poco/Formatter.h +++ b/Foundation/include/Poco/Formatter.h @@ -56,18 +56,18 @@ public: Formatter(); /// Creates the formatter. - virtual ~Formatter(); - /// Destroys the formatter. + ~Formatter() override; + /// Destroys the formatter. virtual void format(const Message& msg, std::string& text) = 0; /// Formats the message and places the result in text. /// Subclasses must override this method. - void setProperty(const std::string& name, const std::string& value); - /// Throws a PropertyNotSupportedException. + void setProperty(const std::string& name, const std::string& value) override; + /// Throws a PropertyNotSupportedException. - std::string getProperty(const std::string& name) const; - /// Throws a PropertyNotSupportedException. + std::string getProperty(const std::string& name) const override; + /// Throws a PropertyNotSupportedException. }; diff --git a/Foundation/include/Poco/FormattingChannel.h b/Foundation/include/Poco/FormattingChannel.h index af9d0d6c2..b652242fb 100644 --- a/Foundation/include/Poco/FormattingChannel.h +++ b/Foundation/include/Poco/FormattingChannel.h @@ -65,12 +65,12 @@ public: /// Returns the channel to which the formatted /// messages are passed on. - void log(const Message& msg); + void log(const Message &msg) override; /// Formats the given Message using the Formatter and /// passes the formatted message on to the destination /// 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. /// /// Only the "channel" and "formatter" properties are supported, which allow @@ -79,14 +79,14 @@ public: /// /// Unsupported properties are passed to the attached Channel. - void open(); + void open() override; /// Opens the attached channel. - void close(); + void close() override; /// Closes the attached channel. protected: - ~FormattingChannel(); + ~FormattingChannel() override; private: Formatter::Ptr _pFormatter; diff --git a/Foundation/include/Poco/FunctionDelegate.h b/Foundation/include/Poco/FunctionDelegate.h index b5676a3b5..b54ad27dc 100644 --- a/Foundation/include/Poco/FunctionDelegate.h +++ b/Foundation/include/Poco/FunctionDelegate.h @@ -32,7 +32,7 @@ class FunctionDelegate: public AbstractDelegate /// for use as a Delegate. { public: - typedef void (*NotifyFunction)(const void*, TArgs&); + using NotifyFunction = void (*)(const void *, TArgs &); FunctionDelegate(NotifyFunction function): _function(function) @@ -45,9 +45,9 @@ public: { } - ~FunctionDelegate() - { - } + ~FunctionDelegate() = default; + + FunctionDelegate() = delete; FunctionDelegate& operator = (const FunctionDelegate& delegate) { @@ -89,9 +89,6 @@ public: protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionDelegate(); }; @@ -99,7 +96,7 @@ template class FunctionDelegate: public AbstractDelegate { public: - typedef void (*NotifyFunction)(void*, TArgs&); + using NotifyFunction = void (*)(void *, TArgs &); FunctionDelegate(NotifyFunction function): _function(function) @@ -112,9 +109,9 @@ public: { } - ~FunctionDelegate() - { - } + ~FunctionDelegate() = default; + + FunctionDelegate() = delete; FunctionDelegate& operator = (const FunctionDelegate& delegate) { @@ -156,9 +153,6 @@ public: protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionDelegate(); }; @@ -166,7 +160,7 @@ template class FunctionDelegate: public AbstractDelegate { public: - typedef void (*NotifyFunction)(TArgs&); + using NotifyFunction = void (*)(TArgs &); FunctionDelegate(NotifyFunction function): _function(function) @@ -179,9 +173,9 @@ public: { } - ~FunctionDelegate() - { - } + ~FunctionDelegate() = default; + + FunctionDelegate() = delete; FunctionDelegate& operator = (const FunctionDelegate& delegate) { @@ -223,9 +217,6 @@ public: protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionDelegate(); }; @@ -235,7 +226,7 @@ class FunctionDelegate: public AbstractDelegate /// for use as a Delegate. { public: - typedef void (*NotifyFunction)(const void*); + using NotifyFunction = void (*)(const void *); FunctionDelegate(NotifyFunction function): _function(function) @@ -248,9 +239,9 @@ public: { } - ~FunctionDelegate() - { - } + ~FunctionDelegate() override = default; + + FunctionDelegate() = delete; FunctionDelegate& operator = (const FunctionDelegate& delegate) { @@ -261,7 +252,7 @@ public: return *this; } - bool notify(const void* sender) + bool notify(const void *sender) override { Mutex::ScopedLock lock(_mutex); if (_function) @@ -272,29 +263,26 @@ public: else return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate &other) const override { const FunctionDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); return pOtherDelegate && _function == pOtherDelegate->_function; } - AbstractDelegate* clone() const + AbstractDelegate *clone() const override { return new FunctionDelegate(*this); } - void disable() + void disable() override { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionDelegate(); }; @@ -302,7 +290,7 @@ template <> class FunctionDelegate: public AbstractDelegate { public: - typedef void (*NotifyFunction)(void*); + using NotifyFunction = void (*)(void *); FunctionDelegate(NotifyFunction function): _function(function) @@ -315,9 +303,9 @@ public: { } - ~FunctionDelegate() - { - } + ~FunctionDelegate() override = default; + + FunctionDelegate() = delete; FunctionDelegate& operator = (const FunctionDelegate& delegate) { @@ -328,7 +316,7 @@ public: return *this; } - bool notify(const void* sender) + bool notify(const void *sender) override { Mutex::ScopedLock lock(_mutex); if (_function) @@ -339,29 +327,26 @@ public: else return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate &other) const override { const FunctionDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); return pOtherDelegate && _function == pOtherDelegate->_function; } - AbstractDelegate* clone() const + AbstractDelegate *clone() const override { return new FunctionDelegate(*this); } - void disable() + void disable() override { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionDelegate(); }; @@ -369,7 +354,7 @@ template class FunctionDelegate: public AbstractDelegate { public: - typedef void (*NotifyFunction)(); + using NotifyFunction = void (*)(); FunctionDelegate(NotifyFunction function): _function(function) @@ -382,9 +367,9 @@ public: { } - ~FunctionDelegate() - { - } + ~FunctionDelegate() override = default; + + FunctionDelegate() = delete; FunctionDelegate& operator = (const FunctionDelegate& delegate) { @@ -395,7 +380,7 @@ public: return *this; } - bool notify(const void* /*sender*/) + bool notify(const void * /*sender*/) override { Mutex::ScopedLock lock(_mutex); if (_function) @@ -406,29 +391,26 @@ public: else return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate &other) const override { const FunctionDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); return pOtherDelegate && _function == pOtherDelegate->_function; } - AbstractDelegate* clone() const + AbstractDelegate *clone() const override { return new FunctionDelegate(*this); } - void disable() + void disable() override { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionDelegate(); }; diff --git a/Foundation/include/Poco/FunctionPriorityDelegate.h b/Foundation/include/Poco/FunctionPriorityDelegate.h index a1b94b6b2..e801deb06 100644 --- a/Foundation/include/Poco/FunctionPriorityDelegate.h +++ b/Foundation/include/Poco/FunctionPriorityDelegate.h @@ -32,7 +32,7 @@ class FunctionPriorityDelegate: public AbstractPriorityDelegate /// for use as a PriorityDelegate. { public: - typedef void (*NotifyFunction)(const void*, TArgs&); + using NotifyFunction = void (*)(const void *, TArgs &); FunctionPriorityDelegate(NotifyFunction function, int prio): AbstractPriorityDelegate(prio), @@ -56,9 +56,9 @@ public: return *this; } - ~FunctionPriorityDelegate() - { - } + ~FunctionPriorityDelegate() = default; + + FunctionPriorityDelegate() = delete; bool notify(const void* sender, TArgs& arguments) { @@ -91,9 +91,6 @@ public: protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionPriorityDelegate(); }; @@ -101,7 +98,7 @@ template class FunctionPriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (*NotifyFunction)(void*, TArgs&); + using NotifyFunction = void (*)(void *, TArgs &); FunctionPriorityDelegate(NotifyFunction function, int prio): AbstractPriorityDelegate(prio), @@ -125,9 +122,9 @@ public: return *this; } - ~FunctionPriorityDelegate() - { - } + ~FunctionPriorityDelegate() = default; + + FunctionPriorityDelegate() = delete; bool notify(const void* sender, TArgs& arguments) { @@ -160,9 +157,6 @@ public: protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionPriorityDelegate(); }; @@ -170,7 +164,7 @@ template class FunctionPriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (*NotifyFunction)(TArgs&); + using NotifyFunction = void (*)(TArgs &); FunctionPriorityDelegate(NotifyFunction function, int prio): AbstractPriorityDelegate(prio), @@ -194,9 +188,9 @@ public: return *this; } - ~FunctionPriorityDelegate() - { - } + ~FunctionPriorityDelegate() = default; + + FunctionPriorityDelegate() = delete; bool notify(const void* sender, TArgs& arguments) { @@ -229,9 +223,6 @@ public: protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionPriorityDelegate(); }; @@ -241,7 +232,7 @@ class FunctionPriorityDelegate: public AbstractPriorityDelegat /// for use as a PriorityDelegate. { public: - typedef void (*NotifyFunction)(const void*); + using NotifyFunction = void (*)(const void *); FunctionPriorityDelegate(NotifyFunction function, int prio): AbstractPriorityDelegate(prio), @@ -255,6 +246,8 @@ public: { } + FunctionPriorityDelegate() = delete; + FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate) { if (&delegate != this) @@ -265,11 +258,9 @@ public: return *this; } - ~FunctionPriorityDelegate() - { - } + ~FunctionPriorityDelegate() override = default; - bool notify(const void* sender) + bool notify(const void* sender) override { Mutex::ScopedLock lock(_mutex); if (_function) @@ -280,29 +271,26 @@ public: else return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate& other) const override { const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function; } - AbstractDelegate* clone() const + AbstractDelegate* clone() const override { return new FunctionPriorityDelegate(*this); } - void disable() + void disable() override { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionPriorityDelegate(); }; @@ -310,7 +298,7 @@ template <> class FunctionPriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (*NotifyFunction)(void*); + using NotifyFunction = void (*)(void *); FunctionPriorityDelegate(NotifyFunction function, int prio): AbstractPriorityDelegate(prio), @@ -334,11 +322,11 @@ public: return *this; } - ~FunctionPriorityDelegate() - { - } + ~FunctionPriorityDelegate() override = default; - bool notify(const void* sender) + FunctionPriorityDelegate() = delete; + + bool notify(const void* sender) override { Mutex::ScopedLock lock(_mutex); if (_function) @@ -349,29 +337,26 @@ public: else return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate& other) const override { const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function; } - AbstractDelegate* clone() const + AbstractDelegate* clone() const override { return new FunctionPriorityDelegate(*this); } - void disable() + void disable() override { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionPriorityDelegate(); }; @@ -379,7 +364,7 @@ template <> class FunctionPriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (*NotifyFunction)(); + using NotifyFunction = void (*)(); FunctionPriorityDelegate(NotifyFunction function, int prio): AbstractPriorityDelegate(prio), @@ -403,11 +388,11 @@ public: return *this; } - ~FunctionPriorityDelegate() - { - } + ~FunctionPriorityDelegate() override = default; - bool notify(const void* sender) + FunctionPriorityDelegate() = delete; + + bool notify(const void* sender) override { Mutex::ScopedLock lock(_mutex); if (_function) @@ -418,29 +403,26 @@ public: else return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate& other) const override { const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function; } - AbstractDelegate* clone() const + AbstractDelegate* clone() const override { return new FunctionPriorityDelegate(*this); } - void disable() + void disable() override { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: NotifyFunction _function; Mutex _mutex; - -private: - FunctionPriorityDelegate(); }; diff --git a/Foundation/include/Poco/HMACEngine.h b/Foundation/include/Poco/HMACEngine.h index f37a11725..7701f2486 100644 --- a/Foundation/include/Poco/HMACEngine.h +++ b/Foundation/include/Poco/HMACEngine.h @@ -56,7 +56,7 @@ public: init(passphrase, length); } - ~HMACEngine() + ~HMACEngine() override { std::memset(_ipad, 0, BLOCK_SIZE); std::memset(_opad, 0, BLOCK_SIZE); @@ -64,18 +64,19 @@ public: delete [] _opad; } - std::size_t digestLength() const - { - return DIGEST_SIZE; - } + HMACEngine() = delete; + HMACEngine(const HMACEngine&) = delete; + HMACEngine& operator=(const HMACEngine&) = delete; - void reset() + std::size_t digestLength() const override { return DIGEST_SIZE; } + + void reset() override { _engine.reset(); _engine.update(_ipad, BLOCK_SIZE); } - const DigestEngine::Digest& digest() + const DigestEngine::Digest& digest() override { const DigestEngine::Digest& d = _engine.digest(); poco_assert (d.size() == DIGEST_SIZE); @@ -124,16 +125,12 @@ protected: reset(); } - void updateImpl(const void* data, std::size_t length) + void updateImpl(const void* data, std::size_t length) override { _engine.update(data, length); } private: - HMACEngine(); - HMACEngine(const HMACEngine&); - HMACEngine& operator = (const HMACEngine&); - Engine _engine; char* _ipad; char* _opad; diff --git a/Foundation/include/Poco/HashSet.h b/Foundation/include/Poco/HashSet.h index ee0dcb7ce..7c628be6f 100644 --- a/Foundation/include/Poco/HashSet.h +++ b/Foundation/include/Poco/HashSet.h @@ -32,22 +32,20 @@ class HashSet /// A HashSet can be used just like a std::set. { public: - typedef Value ValueType; - typedef Value& Reference; - typedef const Value& ConstReference; - typedef Value* Pointer; - typedef const Value* ConstPointer; - typedef HashFunc Hash; + using ValueType = Value; + using Reference = Value &; + using ConstReference = const Value &; + using Pointer = Value *; + using ConstPointer = const Value *; + using Hash = HashFunc; - typedef LinearHashTable HashTable; + using HashTable = LinearHashTable; - typedef typename HashTable::Iterator Iterator; - typedef typename HashTable::ConstIterator ConstIterator; + using Iterator = typename HashTable::Iterator; + using ConstIterator = typename HashTable::ConstIterator; - HashSet() + HashSet() = default; /// Creates an empty HashSet. - { - } HashSet(std::size_t initialReserve): _table(initialReserve) @@ -61,10 +59,8 @@ public: { } - ~HashSet() + ~HashSet() = default; /// Destroys the HashSet. - { - } HashSet& operator = (const HashSet& table) /// Assigns another HashSet. diff --git a/Foundation/include/Poco/HashTable.h b/Foundation/include/Poco/HashTable.h index b4b4eed5e..bd4208624 100644 --- a/Foundation/include/Poco/HashTable.h +++ b/Foundation/include/Poco/HashTable.h @@ -44,11 +44,11 @@ class POCO_DEPRECATED("use LinearHashTable") HashTable /// This class is NOT thread safe. { public: - typedef std::map HashEntryMap; - typedef HashEntryMap** HashTableVector; + using HashEntryMap = std::map; + using HashTableVector = HashEntryMap **; - typedef typename HashEntryMap::const_iterator ConstIterator; - typedef typename HashEntryMap::iterator Iterator; + using ConstIterator = typename HashEntryMap::const_iterator; + using Iterator = typename HashEntryMap::iterator; HashTable(UInt32 initialSize = 251): _entries(0), diff --git a/Foundation/include/Poco/HexBinaryDecoder.h b/Foundation/include/Poco/HexBinaryDecoder.h index 408e38d42..aba79aecb 100644 --- a/Foundation/include/Poco/HexBinaryDecoder.h +++ b/Foundation/include/Poco/HexBinaryDecoder.h @@ -42,10 +42,10 @@ class Foundation_API HexBinaryDecoderBuf: public UnbufferedStreamBuf { public: HexBinaryDecoderBuf(std::istream& istr); - ~HexBinaryDecoderBuf(); + ~HexBinaryDecoderBuf() override; private: - int readFromDevice(); + int readFromDevice() override; int readOne(); std::streambuf& _buf; @@ -60,7 +60,7 @@ class Foundation_API HexBinaryDecoderIOS: public virtual std::ios { public: HexBinaryDecoderIOS(std::istream& istr); - ~HexBinaryDecoderIOS(); + ~HexBinaryDecoderIOS() override; HexBinaryDecoderBuf* rdbuf(); protected: @@ -84,7 +84,7 @@ class Foundation_API HexBinaryDecoder: public HexBinaryDecoderIOS, public std::i { public: HexBinaryDecoder(std::istream& istr); - ~HexBinaryDecoder(); + ~HexBinaryDecoder() override; }; diff --git a/Foundation/include/Poco/HexBinaryEncoder.h b/Foundation/include/Poco/HexBinaryEncoder.h index bd7653982..fe71fc94e 100644 --- a/Foundation/include/Poco/HexBinaryEncoder.h +++ b/Foundation/include/Poco/HexBinaryEncoder.h @@ -42,7 +42,7 @@ class Foundation_API HexBinaryEncoderBuf: public UnbufferedStreamBuf { public: HexBinaryEncoderBuf(std::ostream& ostr); - ~HexBinaryEncoderBuf(); + ~HexBinaryEncoderBuf() override; int close(); /// Closes the stream buffer. @@ -62,7 +62,7 @@ public: /// Specify whether hex digits a-f are written in upper or lower case. private: - int writeToDevice(char c); + int writeToDevice(char c) override; int _pos; int _lineLength; @@ -79,7 +79,7 @@ class Foundation_API HexBinaryEncoderIOS: public virtual std::ios { public: HexBinaryEncoderIOS(std::ostream& ostr); - ~HexBinaryEncoderIOS(); + ~HexBinaryEncoderIOS() override; int close(); HexBinaryEncoderBuf* rdbuf(); @@ -107,7 +107,7 @@ class Foundation_API HexBinaryEncoder: public HexBinaryEncoderIOS, public std::o { public: HexBinaryEncoder(std::ostream& ostr); - ~HexBinaryEncoder(); + ~HexBinaryEncoder() override; }; diff --git a/Foundation/include/Poco/InflatingStream.h b/Foundation/include/Poco/InflatingStream.h index 0a01d121d..0205a93f9 100644 --- a/Foundation/include/Poco/InflatingStream.h +++ b/Foundation/include/Poco/InflatingStream.h @@ -66,8 +66,8 @@ public: /// Please refer to the zlib documentation of inflateInit2() for a description /// of the windowBits parameter. - ~InflatingStreamBuf(); - /// Destroys the InflatingStreamBuf. + ~InflatingStreamBuf() override; + /// Destroys the InflatingStreamBuf. int close(); /// Finishes up the stream. @@ -78,9 +78,9 @@ public: /// Resets the stream buffer. protected: - int readFromDevice(char* buffer, std::streamsize length); - int writeToDevice(const char* buffer, std::streamsize length); - int sync(); + int readFromDevice(char* buffer, std::streamsize length) override; + int writeToDevice(const char* buffer, std::streamsize length) override; + int sync() override; private: enum @@ -127,8 +127,8 @@ public: /// Please refer to the zlib documentation of inflateInit2() for a description /// of the windowBits parameter. - ~InflatingIOS(); - /// Destroys the InflatingIOS. + ~InflatingIOS() override; + /// Destroys the InflatingIOS. InflatingStreamBuf* rdbuf(); /// Returns a pointer to the underlying stream buffer. @@ -157,8 +157,8 @@ public: /// Please refer to the zlib documentation of inflateInit2() for a description /// of the windowBits parameter. - ~InflatingOutputStream(); - /// Destroys the InflatingOutputStream. + ~InflatingOutputStream() override; + /// Destroys the InflatingOutputStream. int close(); /// Finishes up the stream. @@ -193,8 +193,8 @@ public: /// Please refer to the zlib documentation of inflateInit2() for a description /// of the windowBits parameter. - ~InflatingInputStream(); - /// Destroys the InflatingInputStream. + ~InflatingInputStream() override; + /// Destroys the InflatingInputStream. void reset(); /// Resets the zlib machinery so that another zlib stream can be read from diff --git a/Foundation/include/Poco/Instantiator.h b/Foundation/include/Poco/Instantiator.h index 323a523e0..7f68aaa8a 100644 --- a/Foundation/include/Poco/Instantiator.h +++ b/Foundation/include/Poco/Instantiator.h @@ -32,20 +32,17 @@ class AbstractInstantiator public: AbstractInstantiator() /// Creates the AbstractInstantiator. - { - } + = default; virtual ~AbstractInstantiator() /// Destroys the AbstractInstantiator. - { - } + = default; virtual Base* createInstance() const = 0; /// Creates an instance of a concrete subclass of Base. -private: - AbstractInstantiator(const AbstractInstantiator&); - AbstractInstantiator& operator = (const AbstractInstantiator&); + AbstractInstantiator(const AbstractInstantiator&) = delete; + AbstractInstantiator& operator=(const AbstractInstantiator&) = delete; }; @@ -59,15 +56,11 @@ class Instantiator: public AbstractInstantiator /// constructor. { public: - Instantiator() + Instantiator() = default; /// Creates the Instantiator. - { - } - virtual ~Instantiator() + virtual ~Instantiator() = default; /// Destroys the Instantiator. - { - } Base* createInstance() const { diff --git a/Foundation/include/Poco/JSONFormatter.h b/Foundation/include/Poco/JSONFormatter.h index 5edc6e16d..05aa5784d 100644 --- a/Foundation/include/Poco/JSONFormatter.h +++ b/Foundation/include/Poco/JSONFormatter.h @@ -57,13 +57,13 @@ public: JSONFormatter() = default; /// Creates a JSONFormatter. - ~JSONFormatter() = default; + ~JSONFormatter() override = default; /// 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. - 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. /// /// The following properties are supported: @@ -77,7 +77,7 @@ public: /// If any other property name is given, a PropertyNotSupported /// 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 /// throws a PropertyNotSupported exception if the given /// name is not recognized. diff --git a/Foundation/include/Poco/KeyValueArgs.h b/Foundation/include/Poco/KeyValueArgs.h index 6c3009da1..5c8dbc59f 100644 --- a/Foundation/include/Poco/KeyValueArgs.h +++ b/Foundation/include/Poco/KeyValueArgs.h @@ -42,9 +42,9 @@ public: { } - ~KeyValueArgs() - { - } + ~KeyValueArgs() = default; + + KeyValueArgs& operator=(const KeyValueArgs& args) = delete; const TKey& key() const /// Returns a reference to the key, @@ -61,9 +61,6 @@ public: protected: const TKey& _key; const TValue& _value; - -private: - KeyValueArgs& operator = (const KeyValueArgs& args); }; diff --git a/Foundation/include/Poco/LRUCache.h b/Foundation/include/Poco/LRUCache.h index d73bbf046..621bfdaef 100644 --- a/Foundation/include/Poco/LRUCache.h +++ b/Foundation/include/Poco/LRUCache.h @@ -40,13 +40,10 @@ public: { } - ~LRUCache() - { - } + ~LRUCache() = default; -private: - LRUCache(const LRUCache& aCache); - LRUCache& operator = (const LRUCache& aCache); + LRUCache(const LRUCache& aCache) = delete; + LRUCache& operator=(const LRUCache& aCache) = delete; }; diff --git a/Foundation/include/Poco/LRUStrategy.h b/Foundation/include/Poco/LRUStrategy.h index 6bb274443..7e968b0e0 100644 --- a/Foundation/include/Poco/LRUStrategy.h +++ b/Foundation/include/Poco/LRUStrategy.h @@ -36,12 +36,12 @@ class LRUStrategy: public AbstractStrategy /// An LRUStrategy implements least recently used cache replacement. { public: - typedef std::list Keys; - typedef typename Keys::iterator Iterator; - typedef typename Keys::const_iterator ConstIterator; - typedef std::map KeyIndex; - typedef typename KeyIndex::iterator IndexIterator; - typedef typename KeyIndex::const_iterator ConstIndexIterator; + using Keys = std::list; + using Iterator = typename Keys::iterator; + using ConstIterator = typename Keys::const_iterator; + using KeyIndex = std::map; + using IndexIterator = typename KeyIndex::iterator; + using ConstIndexIterator = typename KeyIndex::const_iterator; public: LRUStrategy(std::size_t size): @@ -50,9 +50,7 @@ public: if (_size < 1) throw InvalidArgumentException("size must be > 0"); } - ~LRUStrategy() - { - } + ~LRUStrategy() = default; void onAdd(const void*, const KeyValueArgs & args) { diff --git a/Foundation/include/Poco/Latin1Encoding.h b/Foundation/include/Poco/Latin1Encoding.h index 532da2b9d..03c02f459 100644 --- a/Foundation/include/Poco/Latin1Encoding.h +++ b/Foundation/include/Poco/Latin1Encoding.h @@ -30,14 +30,14 @@ class Foundation_API Latin1Encoding: public TextEncoding { public: Latin1Encoding(); - ~Latin1Encoding(); - const char* canonicalName() const; - bool isA(const std::string& encodingName) const; - const CharacterMap& characterMap() const; - int convert(const unsigned char* bytes) const; - int convert(int ch, unsigned char* bytes, int length) const; - int queryConvert(const unsigned char* bytes, int length) const; - int sequenceLength(const unsigned char* bytes, int length) const; + ~Latin1Encoding() override; + const char* canonicalName() const override; + bool isA(const std::string& encodingName) const override; + const CharacterMap& characterMap() const override; + int convert(const unsigned char* bytes) const override; + int convert(int ch, unsigned char* bytes, int length) const override; + int queryConvert(const unsigned char* bytes, int length) const override; + int sequenceLength(const unsigned char* bytes, int length) const override; private: static const char* _names[]; diff --git a/Foundation/include/Poco/Latin2Encoding.h b/Foundation/include/Poco/Latin2Encoding.h index b82475596..5684fe35c 100644 --- a/Foundation/include/Poco/Latin2Encoding.h +++ b/Foundation/include/Poco/Latin2Encoding.h @@ -33,14 +33,14 @@ class Foundation_API Latin2Encoding: public TextEncoding { public: Latin2Encoding(); - virtual ~Latin2Encoding(); - const char* canonicalName() const; - bool isA(const std::string& encodingName) const; - const CharacterMap& characterMap() const; - int convert(const unsigned char* bytes) const; - int convert(int ch, unsigned char* bytes, int length) const; - int queryConvert(const unsigned char* bytes, int length) const; - int sequenceLength(const unsigned char* bytes, int length) const; + ~Latin2Encoding() override; + const char* canonicalName() const override; + bool isA(const std::string& encodingName) const override; + const CharacterMap& characterMap() const override; + int convert(const unsigned char* bytes) const override; + int convert(int ch, unsigned char* bytes, int length) const override; + int queryConvert(const unsigned char* bytes, int length) const override; + int sequenceLength(const unsigned char* bytes, int length) const override; private: static const char* _names[]; diff --git a/Foundation/include/Poco/Latin9Encoding.h b/Foundation/include/Poco/Latin9Encoding.h index 0eac73349..160d2d882 100644 --- a/Foundation/include/Poco/Latin9Encoding.h +++ b/Foundation/include/Poco/Latin9Encoding.h @@ -33,14 +33,14 @@ class Foundation_API Latin9Encoding: public TextEncoding { public: Latin9Encoding(); - ~Latin9Encoding(); - const char* canonicalName() const; - bool isA(const std::string& encodingName) const; - const CharacterMap& characterMap() const; - int convert(const unsigned char* bytes) const; - int convert(int ch, unsigned char* bytes, int length) const; - int queryConvert(const unsigned char* bytes, int length) const; - int sequenceLength(const unsigned char* bytes, int length) const; + ~Latin9Encoding() override; + const char* canonicalName() const override; + bool isA(const std::string& encodingName) const override; + const CharacterMap& characterMap() const override; + int convert(const unsigned char* bytes) const override; + int convert(int ch, unsigned char* bytes, int length) const override; + int queryConvert(const unsigned char* bytes, int length) const override; + int sequenceLength(const unsigned char* bytes, int length) const override; private: static const char* _names[]; diff --git a/Foundation/include/Poco/LineEndingConverter.h b/Foundation/include/Poco/LineEndingConverter.h index b519b51ec..a27934aae 100644 --- a/Foundation/include/Poco/LineEndingConverter.h +++ b/Foundation/include/Poco/LineEndingConverter.h @@ -56,8 +56,8 @@ public: /// Creates the LineEndingConverterStreamBuf and connects it /// to the given output stream. - ~LineEndingConverterStreamBuf(); - /// Destroys the LineEndingConverterStream. + ~LineEndingConverterStreamBuf() override; + /// Destroys the LineEndingConverterStream. void setNewLine(const std::string& newLineCharacters); /// Sets the target line ending for the converter. @@ -75,8 +75,8 @@ public: /// Returns the line ending currently in use. protected: - int readFromDevice(); - int writeToDevice(char c); + int readFromDevice() override; + int writeToDevice(char c) override; private: std::istream* _pIstr; @@ -102,8 +102,8 @@ public: /// Creates the LineEndingConverterIOS and connects it /// to the given output stream. - ~LineEndingConverterIOS(); - /// Destroys the stream. + ~LineEndingConverterIOS() override; + /// Destroys the stream. void setNewLine(const std::string& newLineCharacters); /// Sets the target line ending for the converter. @@ -148,8 +148,8 @@ public: /// Creates the LineEndingConverterInputStream and connects it /// to the given input stream. - ~InputLineEndingConverter(); - /// Destroys the stream. + ~InputLineEndingConverter() override; + /// Destroys the stream. }; @@ -170,8 +170,8 @@ public: /// Creates the LineEndingConverterOutputStream and connects it /// to the given input stream. - ~OutputLineEndingConverter(); - /// Destroys the LineEndingConverterOutputStream. + ~OutputLineEndingConverter() override; + /// Destroys the LineEndingConverterOutputStream. }; diff --git a/Foundation/include/Poco/ListMap.h b/Foundation/include/Poco/ListMap.h index 2e41af0a3..03d2f5851 100644 --- a/Foundation/include/Poco/ListMap.h +++ b/Foundation/include/Poco/ListMap.h @@ -51,10 +51,8 @@ public: using Iterator = typename Container::iterator; using ConstIterator = typename Container::const_iterator; - ListMap() + ListMap() = default; /// Creates an empty ListMap. - { - } explicit ListMap(std::size_t initialReserve): _container(initialReserve) diff --git a/Foundation/include/Poco/LogStream.h b/Foundation/include/Poco/LogStream.h index 83d61a976..8e6d729b8 100644 --- a/Foundation/include/Poco/LogStream.h +++ b/Foundation/include/Poco/LogStream.h @@ -40,8 +40,8 @@ public: LogStreamBuf(Logger& logger, Message::Priority priority, std::size_t bufferCapacity = 0); /// Creates the LogStream. - ~LogStreamBuf(); - /// Destroys the LogStream. + ~LogStreamBuf() override; + /// Destroys the LogStream. void setPriority(Message::Priority priority); /// Sets the priority for log messages. @@ -59,7 +59,7 @@ public: /// Sets the capacity of the internal message buffer to the given size. private: - int writeToDevice(char c); + int writeToDevice(char c) override; private: Logger& _logger; @@ -76,7 +76,7 @@ class Foundation_API LogIOS: public virtual std::ios { public: LogIOS(Logger& logger, Message::Priority priority, std::size_t bufferCapacity = 0); - ~LogIOS(); + ~LogIOS() override; LogStreamBuf* rdbuf(); protected: @@ -108,8 +108,8 @@ public: /// Creates the LogStream, using the logger identified /// by loggerName, and sets the priority. - ~LogStream(); - /// Destroys the LogStream. + ~LogStream() override; + /// Destroys the LogStream. LogStream& fatal(); /// Sets the priority for log messages to Message::PRIO_FATAL. diff --git a/Foundation/include/Poco/Logger.h b/Foundation/include/Poco/Logger.h index 027ccc70b..e5b38e209 100644 --- a/Foundation/include/Poco/Logger.h +++ b/Foundation/include/Poco/Logger.h @@ -116,14 +116,14 @@ public: /// - debug /// - 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. /// /// Only the "channel" and "level" properties are supported, which allow /// setting the target channel and log level, respectively, via the LoggingRegistry. /// 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 /// 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 (""). protected: - typedef std::map LoggerMap; + using LoggerMap = std::map; Logger(const std::string& name, Channel::Ptr pChannel, int level); - ~Logger(); + ~Logger() override; void log(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); private: - typedef std::unique_ptr LoggerMapPtr; + using LoggerMapPtr = std::unique_ptr; Logger(); Logger(const Logger&); diff --git a/Foundation/include/Poco/LoggingFactory.h b/Foundation/include/Poco/LoggingFactory.h index 390b1b677..24ec1361c 100644 --- a/Foundation/include/Poco/LoggingFactory.h +++ b/Foundation/include/Poco/LoggingFactory.h @@ -44,8 +44,8 @@ class Foundation_API LoggingFactory /// - PatternFormatter { public: - typedef AbstractInstantiator ChannelInstantiator; - typedef AbstractInstantiator FormatterFactory; + using ChannelInstantiator = AbstractInstantiator; + using FormatterFactory = AbstractInstantiator; LoggingFactory(); /// Creates the LoggingFactory. diff --git a/Foundation/include/Poco/LoggingRegistry.h b/Foundation/include/Poco/LoggingRegistry.h index 397b81993..5e99f05aa 100644 --- a/Foundation/include/Poco/LoggingRegistry.h +++ b/Foundation/include/Poco/LoggingRegistry.h @@ -82,10 +82,10 @@ public: /// LoggingRegistry. private: - typedef Channel::Ptr ChannelPtr; - typedef AutoPtr FormatterPtr; - typedef std::map ChannelMap; - typedef std::map FormatterMap; + using ChannelPtr = Channel::Ptr; + using FormatterPtr = AutoPtr; + using ChannelMap = std::map; + using FormatterMap = std::map; ChannelMap _channelMap; FormatterMap _formatterMap; diff --git a/Foundation/include/Poco/MD4Engine.h b/Foundation/include/Poco/MD4Engine.h index 291c561f6..fc35b5f2e 100644 --- a/Foundation/include/Poco/MD4Engine.h +++ b/Foundation/include/Poco/MD4Engine.h @@ -60,14 +60,14 @@ public: }; MD4Engine(); - ~MD4Engine(); + ~MD4Engine() override; - std::size_t digestLength() const; - void reset(); - const DigestEngine::Digest& digest(); + std::size_t digestLength() const override; + void reset() override; + const DigestEngine::Digest& digest() override; protected: - void updateImpl(const void* data, std::size_t length); + void updateImpl(const void* data, std::size_t length) override; private: static void transform(UInt32 state[4], const unsigned char block[64]); diff --git a/Foundation/include/Poco/MD5Engine.h b/Foundation/include/Poco/MD5Engine.h index e67b10a99..617b27541 100644 --- a/Foundation/include/Poco/MD5Engine.h +++ b/Foundation/include/Poco/MD5Engine.h @@ -60,14 +60,14 @@ public: }; MD5Engine(); - ~MD5Engine(); + ~MD5Engine() override; - std::size_t digestLength() const; - void reset(); - const DigestEngine::Digest& digest(); + std::size_t digestLength() const override; + void reset() override; + const DigestEngine::Digest& digest() override; protected: - void updateImpl(const void* data, std::size_t length); + void updateImpl(const void* data, std::size_t length) override; private: static void transform(UInt32 state[4], const unsigned char block[64]); diff --git a/Foundation/include/Poco/Manifest.h b/Foundation/include/Poco/Manifest.h index 11e3470ea..2f6e37989 100644 --- a/Foundation/include/Poco/Manifest.h +++ b/Foundation/include/Poco/Manifest.h @@ -50,8 +50,8 @@ class Manifest: public ManifestBase /// iterate over all the classes in a Manifest. { public: - typedef AbstractMetaObject Meta; - typedef std::map MetaMap; + using Meta = AbstractMetaObject; + using MetaMap = std::map; class Iterator /// The Manifest's very own iterator class. @@ -65,15 +65,10 @@ public: { _it = it._it; } - ~Iterator() - { - } - Iterator& operator = (const Iterator& it) - { - _it = it._it; - return *this; - } - inline bool operator == (const Iterator& it) const + ~Iterator() = default; + Iterator& operator=(const Iterator &it) = default; + + inline bool operator==(const Iterator &it) const { return _it == it._it; } @@ -105,13 +100,11 @@ public: typename MetaMap::const_iterator _it; }; - Manifest() + Manifest() = default; /// Creates an empty Manifest. - { - } - virtual ~Manifest() - /// Destroys the Manifest. + ~Manifest() override + /// Destroys the Manifest. { clear(); } @@ -164,7 +157,7 @@ public: return _metaMap.empty(); } - const char* className() const + const char* className() const override { return typeid(*this).name(); } diff --git a/Foundation/include/Poco/MemoryPool.h b/Foundation/include/Poco/MemoryPool.h index a68f2dc2f..79cb4ff89 100644 --- a/Foundation/include/Poco/MemoryPool.h +++ b/Foundation/include/Poco/MemoryPool.h @@ -79,7 +79,7 @@ private: BLOCK_RESERVE = 128 }; - typedef std::vector BlockVec; + using BlockVec = std::vector; std::size_t _blockSize; int _maxAlloc; @@ -229,6 +229,9 @@ private: _memory.next = next; } + Block(const Block&) = delete; + Block& operator=(const Block&) = delete; + #ifndef POCO_DOC union /// Memory block storage. @@ -244,18 +247,14 @@ private: Block* next; } _memory; #endif - - private: - Block(const Block&); - Block& operator = (const Block&); }; public: - typedef M MutexType; - typedef typename M::ScopedLock ScopedLock; + using MutexType = M; + using ScopedLock = typename M::ScopedLock; - typedef Block* Bucket; - typedef std::vector BucketVec; + using Bucket = Block *; + using BucketVec = std::vector; FastMemoryPool(std::size_t blocksPerBucket = POCO_FAST_MEMORY_POOL_PREALLOC, std::size_t bucketPreAlloc = 10, std::size_t maxAlloc = 0): _blocksPerBucket(blocksPerBucket), @@ -291,6 +290,9 @@ public: clear(); } + FastMemoryPool(const FastMemoryPool&) = delete; + FastMemoryPool& operator=(const FastMemoryPool&) = delete; + void* get() /// Returns pointer to the next available /// memory block. If the pool is exhausted, @@ -342,9 +344,6 @@ public: } private: - FastMemoryPool(const FastMemoryPool&); - FastMemoryPool& operator = (const FastMemoryPool&); - void resize() /// Creates new bucket and initializes it for internal use. /// Sets the previously next block to point to the new bucket's @@ -371,7 +370,7 @@ private: for (; it != end; ++it) delete[] *it; } - typedef Poco::AtomicCounter Counter; + using Counter = Poco::AtomicCounter; const std::size_t _blocksPerBucket; diff --git a/Foundation/include/Poco/MemoryStream.h b/Foundation/include/Poco/MemoryStream.h index a53730767..26eb11647 100644 --- a/Foundation/include/Poco/MemoryStream.h +++ b/Foundation/include/Poco/MemoryStream.h @@ -42,13 +42,13 @@ class BasicMemoryStreamBuf: public std::basic_streambuf /// ostream, but not for an iostream. { protected: - typedef std::basic_streambuf Base; - typedef std::basic_ios IOS; - typedef ch char_type; - typedef tr char_traits; - typedef typename Base::int_type int_type; - typedef typename Base::pos_type pos_type; - typedef typename Base::off_type off_type; + using Base = std::basic_streambuf; + using IOS = std::basic_ios; + using char_type = ch; + using char_traits = tr; + using int_type = typename Base::int_type; + using pos_type = typename Base::pos_type; + using off_type = typename Base::off_type; public: BasicMemoryStreamBuf(char_type* pBuffer, std::streamsize bufferSize): @@ -59,21 +59,23 @@ public: 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(); } - virtual int_type underflow() + int_type underflow() override { 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); off_type newoff = off_type(-1); @@ -140,14 +142,14 @@ public: 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; return seekoff(off, std::ios::beg, which); } - virtual int sync() + int sync() override { return 0; } @@ -168,18 +170,13 @@ public: private: char_type* _pBuffer; std::streamsize _bufferSize; - - BasicMemoryStreamBuf(); - BasicMemoryStreamBuf(const BasicMemoryStreamBuf&); - BasicMemoryStreamBuf& operator = (const BasicMemoryStreamBuf&); }; // // We provide an instantiation for char // -typedef BasicMemoryStreamBuf> MemoryStreamBuf; - +using MemoryStreamBuf = BasicMemoryStreamBuf>; class Foundation_API MemoryIOS: public virtual std::ios /// The base class for MemoryInputStream and MemoryOutputStream. @@ -191,8 +188,8 @@ public: MemoryIOS(char* pBuffer, std::streamsize bufferSize); /// Creates the basic stream. - ~MemoryIOS(); - /// Destroys the stream. + ~MemoryIOS() override; + /// Destroys the stream. MemoryStreamBuf* rdbuf(); /// Returns a pointer to the underlying streambuf. @@ -210,8 +207,8 @@ public: /// Creates a MemoryInputStream for the given memory area, /// ready for reading. - ~MemoryInputStream(); - /// Destroys the MemoryInputStream. + ~MemoryInputStream() override; + /// Destroys the MemoryInputStream. }; @@ -223,8 +220,8 @@ public: /// Creates a MemoryOutputStream for the given memory area, /// ready for writing. - ~MemoryOutputStream(); - /// Destroys the MemoryInputStream. + ~MemoryOutputStream() override; + /// Destroys the MemoryInputStream. std::streamsize charsWritten() const; /// Returns the number of chars written to the buffer. diff --git a/Foundation/include/Poco/MetaObject.h b/Foundation/include/Poco/MetaObject.h index 907c9d73d..3e31156de 100644 --- a/Foundation/include/Poco/MetaObject.h +++ b/Foundation/include/Poco/MetaObject.h @@ -50,6 +50,10 @@ public: } } + AbstractMetaObject() = delete; + AbstractMetaObject(const AbstractMetaObject&) = delete; + AbstractMetaObject& operator=(const AbstractMetaObject&) = delete; + const char* name() const { return _name; @@ -110,11 +114,7 @@ public: } private: - AbstractMetaObject(); - AbstractMetaObject(const AbstractMetaObject&); - AbstractMetaObject& operator = (const AbstractMetaObject&); - - typedef std::set ObjectSet; + using ObjectSet = std::set; const char* _name; mutable ObjectSet _deleteSet; @@ -134,9 +134,7 @@ public: { } - ~MetaObject() - { - } + ~MetaObject() = default; B* create() const { @@ -166,9 +164,7 @@ public: { } - ~MetaSingleton() - { - } + ~MetaSingleton() = default; B* create() const { diff --git a/Foundation/include/Poco/MetaProgramming.h b/Foundation/include/Poco/MetaProgramming.h index 620d77dea..af8b5d276 100644 --- a/Foundation/include/Poco/MetaProgramming.h +++ b/Foundation/include/Poco/MetaProgramming.h @@ -101,40 +101,40 @@ template struct TypeWrapper /// Use the type wrapper if you want to decouple constness and references from template types. { - typedef T TYPE; - typedef const T CONSTTYPE; - typedef T& REFTYPE; - typedef const T& CONSTREFTYPE; + using TYPE = T; + using CONSTTYPE = const T; + using REFTYPE = T &; + using CONSTREFTYPE = const T &; }; template struct TypeWrapper { - typedef T TYPE; - typedef const T CONSTTYPE; - typedef T& REFTYPE; - typedef const T& CONSTREFTYPE; + using TYPE = T; + using CONSTTYPE = const T; + using REFTYPE = T &; + using CONSTREFTYPE = const T &; }; template struct TypeWrapper { - typedef T TYPE; - typedef const T CONSTTYPE; - typedef T& REFTYPE; - typedef const T& CONSTREFTYPE; + using TYPE = T; + using CONSTTYPE = const T; + using REFTYPE = T &; + using CONSTREFTYPE = const T &; }; template struct TypeWrapper { - typedef T TYPE; - typedef const T CONSTTYPE; - typedef T& REFTYPE; - typedef const T& CONSTREFTYPE; + using TYPE = T; + using CONSTTYPE = const T; + using REFTYPE = T &; + using CONSTREFTYPE = const T &; }; diff --git a/Foundation/include/Poco/Mutex.h b/Foundation/include/Poco/Mutex.h index 512cdbd6a..6a09ac73a 100644 --- a/Foundation/include/Poco/Mutex.h +++ b/Foundation/include/Poco/Mutex.h @@ -214,15 +214,11 @@ public: using ScopedLock = Poco::ScopedLock; using ScopedLockWithUnlock = Poco::ScopedLockWithUnlock; - NullMutex() + NullMutex() = default; /// Creates the NullMutex. - { - } - ~NullMutex() + ~NullMutex() = default; /// Destroys the NullMutex. - { - } void lock() /// Does nothing. diff --git a/Foundation/include/Poco/NObserver.h b/Foundation/include/Poco/NObserver.h index 72c354434..3e5a25c7c 100755 --- a/Foundation/include/Poco/NObserver.h +++ b/Foundation/include/Poco/NObserver.h @@ -73,9 +73,7 @@ public: { } - ~NObserver() - { - } + ~NObserver() override = default; NObserver& operator = (const NObserver& observer) { @@ -88,34 +86,34 @@ public: return *this; } - virtual void notify(Notification* pNf) const + void notify(Notification* pNf) const override { handle(NotificationPtr(static_cast(pNf), true)); } - virtual bool equals(const AbstractObserver& abstractObserver) const + bool equals(const AbstractObserver& abstractObserver) const override { const NObserver* pObs = dynamic_cast(&abstractObserver); return pObs && pObs->_pObject == _pObject && pObs->_handler == _handler && pObs->_matcher == _matcher; } POCO_DEPRECATED("use `bool accepts(const Notification::Ptr&)` instead") - virtual bool accepts(Notification* pNf, const char* pName) const + bool accepts(Notification* pNf, const char* pName) const override { return (!pName || pNf->name() == pName) && dynamic_cast(pNf) != nullptr; } - virtual bool accepts(const Notification::Ptr& pNf) const + bool accepts(const Notification::Ptr& pNf) const override { return (match(pNf) && (pNf.template cast() != nullptr)); } - virtual AbstractObserver* clone() const + AbstractObserver* clone() const override { return new NObserver(*this); } - virtual void disable() + void disable() override { Poco::Mutex::ScopedLock lock(_mutex); diff --git a/Foundation/include/Poco/NamedTuple.h b/Foundation/include/Poco/NamedTuple.h index 7b6e1c882..390fab71a 100644 --- a/Foundation/include/Poco/NamedTuple.h +++ b/Foundation/include/Poco/NamedTuple.h @@ -71,12 +71,12 @@ template struct NamedTuple: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -130,7 +130,7 @@ struct NamedTuple: public Tuple::CONSTTYPE& t38 = POCO_TYPEWRAPPER_DEFAULTVALUE(T38), typename TypeWrapper::CONSTTYPE& t39 = POCO_TYPEWRAPPER_DEFAULTVALUE(T39)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39), - _pNames(0) + _pNames(nullptr) { init(); } @@ -527,12 +527,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -585,7 +585,7 @@ struct NamedTuple::CONSTTYPE& t37 = POCO_TYPEWRAPPER_DEFAULTVALUE(T37), typename TypeWrapper::CONSTTYPE& t38 = POCO_TYPEWRAPPER_DEFAULTVALUE(T38)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38), - _pNames(0) + _pNames(nullptr) { init(); } @@ -717,7 +717,7 @@ struct NamedTuple::CONSTTYPE& t38 = POCO_TYPEWRAPPER_DEFAULTVALUE(T38)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n33,n34,n35,n36,n37,n38); } @@ -975,12 +975,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -1032,7 +1032,7 @@ struct NamedTuple::CONSTTYPE& t36 = POCO_TYPEWRAPPER_DEFAULTVALUE(T36), typename TypeWrapper::CONSTTYPE& t37 = POCO_TYPEWRAPPER_DEFAULTVALUE(T37)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37), - _pNames(0) + _pNames(nullptr) { init(); } @@ -1161,7 +1161,7 @@ struct NamedTuple::CONSTTYPE& t37 = POCO_TYPEWRAPPER_DEFAULTVALUE(T37)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n33,n34,n35,n36,n37); } @@ -1415,12 +1415,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -1471,7 +1471,7 @@ struct NamedTuple::CONSTTYPE& t35 = POCO_TYPEWRAPPER_DEFAULTVALUE(T35), typename TypeWrapper::CONSTTYPE& t36 = POCO_TYPEWRAPPER_DEFAULTVALUE(T36)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36), - _pNames(0) + _pNames(nullptr) { init(); } @@ -1597,7 +1597,7 @@ struct NamedTuple::CONSTTYPE& t36 = POCO_TYPEWRAPPER_DEFAULTVALUE(T36)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n33,n34,n35,n36); } @@ -1847,12 +1847,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -1902,7 +1902,7 @@ struct NamedTuple::CONSTTYPE& t34 = POCO_TYPEWRAPPER_DEFAULTVALUE(T34), typename TypeWrapper::CONSTTYPE& t35 = POCO_TYPEWRAPPER_DEFAULTVALUE(T35)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35), - _pNames(0) + _pNames(nullptr) { init(); } @@ -2025,7 +2025,7 @@ struct NamedTuple::CONSTTYPE& t35 = POCO_TYPEWRAPPER_DEFAULTVALUE(T35)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n33,n34,n35); } @@ -2271,12 +2271,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -2325,7 +2325,7 @@ struct NamedTuple::CONSTTYPE& t33 = POCO_TYPEWRAPPER_DEFAULTVALUE(T33), typename TypeWrapper::CONSTTYPE& t34 = POCO_TYPEWRAPPER_DEFAULTVALUE(T34)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34), - _pNames(0) + _pNames(nullptr) { init(); } @@ -2445,7 +2445,7 @@ struct NamedTuple::CONSTTYPE& t34 = POCO_TYPEWRAPPER_DEFAULTVALUE(T34)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n33,n34); } @@ -2687,12 +2687,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -2740,7 +2740,7 @@ struct NamedTuple::CONSTTYPE& t32 = POCO_TYPEWRAPPER_DEFAULTVALUE(T32), typename TypeWrapper::CONSTTYPE& t33 = POCO_TYPEWRAPPER_DEFAULTVALUE(T33)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33), - _pNames(0) + _pNames(nullptr) { init(); } @@ -2857,7 +2857,7 @@ struct NamedTuple::CONSTTYPE& t33 = POCO_TYPEWRAPPER_DEFAULTVALUE(T33)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n33); } @@ -3095,12 +3095,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -3147,7 +3147,7 @@ struct NamedTuple::CONSTTYPE& t31 = POCO_TYPEWRAPPER_DEFAULTVALUE(T31), typename TypeWrapper::CONSTTYPE& t32 = POCO_TYPEWRAPPER_DEFAULTVALUE(T32)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32), - _pNames(0) + _pNames(nullptr) { init(); } @@ -3261,7 +3261,7 @@ struct NamedTuple::CONSTTYPE& t32 = POCO_TYPEWRAPPER_DEFAULTVALUE(T32)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32); } @@ -3495,12 +3495,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -3546,7 +3546,7 @@ struct NamedTuple::CONSTTYPE& t30 = POCO_TYPEWRAPPER_DEFAULTVALUE(T30), typename TypeWrapper::CONSTTYPE& t31 = POCO_TYPEWRAPPER_DEFAULTVALUE(T31)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31), - _pNames(0) + _pNames(nullptr) { init(); } @@ -3657,7 +3657,7 @@ struct NamedTuple::CONSTTYPE& t31 = POCO_TYPEWRAPPER_DEFAULTVALUE(T31)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31); } @@ -3887,12 +3887,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -3937,7 +3937,7 @@ struct NamedTuple::CONSTTYPE& t29 = POCO_TYPEWRAPPER_DEFAULTVALUE(T29), typename TypeWrapper::CONSTTYPE& t30 = POCO_TYPEWRAPPER_DEFAULTVALUE(T30)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30), - _pNames(0) + _pNames(nullptr) { init(); } @@ -4045,7 +4045,7 @@ struct NamedTuple::CONSTTYPE& t30 = POCO_TYPEWRAPPER_DEFAULTVALUE(T30)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30); } @@ -4271,12 +4271,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -4320,7 +4320,7 @@ struct NamedTuple::CONSTTYPE& t28 = POCO_TYPEWRAPPER_DEFAULTVALUE(T28), typename TypeWrapper::CONSTTYPE& t29 = POCO_TYPEWRAPPER_DEFAULTVALUE(T29)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29), - _pNames(0) + _pNames(nullptr) { init(); } @@ -4425,7 +4425,7 @@ struct NamedTuple::CONSTTYPE& t29 = POCO_TYPEWRAPPER_DEFAULTVALUE(T29)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29); } @@ -4647,12 +4647,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -4695,7 +4695,7 @@ struct NamedTuple::CONSTTYPE& t27 = POCO_TYPEWRAPPER_DEFAULTVALUE(T27), typename TypeWrapper::CONSTTYPE& t28 = POCO_TYPEWRAPPER_DEFAULTVALUE(T28)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28), - _pNames(0) + _pNames(nullptr) { init(); } @@ -4797,7 +4797,7 @@ struct NamedTuple::CONSTTYPE& t28 = POCO_TYPEWRAPPER_DEFAULTVALUE(T28)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28); } @@ -5015,12 +5015,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -5062,7 +5062,7 @@ struct NamedTuple::CONSTTYPE& t26 = POCO_TYPEWRAPPER_DEFAULTVALUE(T26), typename TypeWrapper::CONSTTYPE& t27 = POCO_TYPEWRAPPER_DEFAULTVALUE(T27)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27), - _pNames(0) + _pNames(nullptr) { init(); } @@ -5161,7 +5161,7 @@ struct NamedTuple::CONSTTYPE& t27 = POCO_TYPEWRAPPER_DEFAULTVALUE(T27)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27); } @@ -5375,12 +5375,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -5421,7 +5421,7 @@ struct NamedTuple::CONSTTYPE& t25 = POCO_TYPEWRAPPER_DEFAULTVALUE(T25), typename TypeWrapper::CONSTTYPE& t26 = POCO_TYPEWRAPPER_DEFAULTVALUE(T26)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26), - _pNames(0) + _pNames(nullptr) { init(); } @@ -5517,7 +5517,7 @@ struct NamedTuple::CONSTTYPE& t26 = POCO_TYPEWRAPPER_DEFAULTVALUE(T26)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26); } @@ -5727,12 +5727,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -5772,7 +5772,7 @@ struct NamedTuple::CONSTTYPE& t24 = POCO_TYPEWRAPPER_DEFAULTVALUE(T24), typename TypeWrapper::CONSTTYPE& t25 = POCO_TYPEWRAPPER_DEFAULTVALUE(T25)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25), - _pNames(0) + _pNames(nullptr) { init(); } @@ -5865,7 +5865,7 @@ struct NamedTuple::CONSTTYPE& t25 = POCO_TYPEWRAPPER_DEFAULTVALUE(T25)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25); } @@ -6071,12 +6071,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -6115,7 +6115,7 @@ struct NamedTuple::CONSTTYPE& t23 = POCO_TYPEWRAPPER_DEFAULTVALUE(T23), typename TypeWrapper::CONSTTYPE& t24 = POCO_TYPEWRAPPER_DEFAULTVALUE(T24)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24), - _pNames(0) + _pNames(nullptr) { init(); } @@ -6205,7 +6205,7 @@ struct NamedTuple::CONSTTYPE& t24 = POCO_TYPEWRAPPER_DEFAULTVALUE(T24)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24); } @@ -6407,12 +6407,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -6450,7 +6450,7 @@ struct NamedTuple::CONSTTYPE& t22 = POCO_TYPEWRAPPER_DEFAULTVALUE(T22), typename TypeWrapper::CONSTTYPE& t23 = POCO_TYPEWRAPPER_DEFAULTVALUE(T23)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23), - _pNames(0) + _pNames(nullptr) { init(); } @@ -6537,7 +6537,7 @@ struct NamedTuple::CONSTTYPE& t23 = POCO_TYPEWRAPPER_DEFAULTVALUE(T23)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23); } @@ -6735,12 +6735,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -6777,7 +6777,7 @@ struct NamedTuple::CONSTTYPE& t21 = POCO_TYPEWRAPPER_DEFAULTVALUE(T21), typename TypeWrapper::CONSTTYPE& t22 = POCO_TYPEWRAPPER_DEFAULTVALUE(T22)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22), - _pNames(0) + _pNames(nullptr) { init(); } @@ -6861,7 +6861,7 @@ struct NamedTuple::CONSTTYPE& t22 = POCO_TYPEWRAPPER_DEFAULTVALUE(T22)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22); } @@ -7055,12 +7055,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -7096,7 +7096,7 @@ struct NamedTuple::CONSTTYPE& t20 = POCO_TYPEWRAPPER_DEFAULTVALUE(T20), typename TypeWrapper::CONSTTYPE& t21 = POCO_TYPEWRAPPER_DEFAULTVALUE(T21)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21), - _pNames(0) + _pNames(nullptr) { init(); } @@ -7177,7 +7177,7 @@ struct NamedTuple::CONSTTYPE& t21 = POCO_TYPEWRAPPER_DEFAULTVALUE(T21)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21); } @@ -7367,12 +7367,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -7407,7 +7407,7 @@ struct NamedTuple::CONSTTYPE& t19 = POCO_TYPEWRAPPER_DEFAULTVALUE(T19), typename TypeWrapper::CONSTTYPE& t20 = POCO_TYPEWRAPPER_DEFAULTVALUE(T20)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20), - _pNames(0) + _pNames(nullptr) { init(); } @@ -7485,7 +7485,7 @@ struct NamedTuple::CONSTTYPE& t20 = POCO_TYPEWRAPPER_DEFAULTVALUE(T20)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20); } @@ -7671,12 +7671,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -7710,7 +7710,7 @@ struct NamedTuple::CONSTTYPE& t18 = POCO_TYPEWRAPPER_DEFAULTVALUE(T18), typename TypeWrapper::CONSTTYPE& t19 = POCO_TYPEWRAPPER_DEFAULTVALUE(T19)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19), - _pNames(0) + _pNames(nullptr) { init(); } @@ -7785,7 +7785,7 @@ struct NamedTuple::CONSTTYPE& t19 = POCO_TYPEWRAPPER_DEFAULTVALUE(T19)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19); } @@ -7967,12 +7967,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -8005,7 +8005,7 @@ struct NamedTuple::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17), typename TypeWrapper::CONSTTYPE& t18 = POCO_TYPEWRAPPER_DEFAULTVALUE(T18)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18), - _pNames(0) + _pNames(nullptr) { init(); } @@ -8077,7 +8077,7 @@ struct NamedTuple::CONSTTYPE& t18 = POCO_TYPEWRAPPER_DEFAULTVALUE(T18)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18); } @@ -8255,12 +8255,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -8292,7 +8292,7 @@ struct NamedTuple::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16), typename TypeWrapper::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17), - _pNames(0) + _pNames(nullptr) { init(); } @@ -8361,7 +8361,7 @@ struct NamedTuple::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17); } @@ -8535,12 +8535,12 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using TupleType = Tuple; + using Type = typename Tuple::Type; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -8571,7 +8571,7 @@ struct NamedTuple::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15), typename TypeWrapper::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16), - _pNames(0) + _pNames(nullptr) { init(); } @@ -8637,7 +8637,7 @@ struct NamedTuple::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16); } @@ -8807,13 +8807,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -8843,7 +8843,7 @@ struct NamedTuple::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14), typename TypeWrapper::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15), - _pNames(0) + _pNames(nullptr) { init(); } @@ -8906,7 +8906,7 @@ struct NamedTuple::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15); } @@ -9072,13 +9072,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -9107,7 +9107,7 @@ struct NamedTuple::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13), typename TypeWrapper::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14), - _pNames(0) + _pNames(nullptr) { init(); } @@ -9167,7 +9167,7 @@ struct NamedTuple::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14); } @@ -9329,13 +9329,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -9363,7 +9363,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12), typename TypeWrapper::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13), - _pNames(0) + _pNames(nullptr) { init(); } @@ -9420,7 +9420,7 @@ struct NamedTuple: const std::string& n13 = "N", typename TypeWrapper::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13); } @@ -9578,13 +9578,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -9611,7 +9611,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11), typename TypeWrapper::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12), - _pNames(0) + _pNames(nullptr) { init(); } @@ -9664,7 +9664,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11), const std::string& n12 = "M", typename TypeWrapper::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12)): - TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12), _pNames(0) + TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12), _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12); } @@ -9818,13 +9818,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -9850,7 +9850,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10), typename TypeWrapper::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11), - _pNames(0) + _pNames(nullptr) { init(); } @@ -9901,7 +9901,7 @@ struct NamedTuple: const std::string& n11 = "L", typename TypeWrapper::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11); } @@ -10051,13 +10051,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -10082,7 +10082,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9), typename TypeWrapper::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10), - _pNames(0) + _pNames(nullptr) { init(); } @@ -10129,7 +10129,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9), const std::string& n10 = "K", typename TypeWrapper::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10)): - TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10), _pNames(0) + TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10), _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10); } @@ -10275,13 +10275,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -10305,7 +10305,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8), typename TypeWrapper::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9), - _pNames(0) + _pNames(nullptr) { init(); } @@ -10350,7 +10350,7 @@ struct NamedTuple: const std::string& n9 = "J", typename TypeWrapper::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9); } @@ -10492,13 +10492,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -10521,7 +10521,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7), typename TypeWrapper::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8), - _pNames(0) + _pNames(nullptr) { init(); } @@ -10563,7 +10563,7 @@ struct NamedTuple: const std::string& n8 = "I", typename TypeWrapper::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7,n8); } @@ -10701,13 +10701,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -10729,7 +10729,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6), typename TypeWrapper::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7), - _pNames(0) + _pNames(nullptr) { init(); } @@ -10768,7 +10768,7 @@ struct NamedTuple: const std::string& n7 = "H", typename TypeWrapper::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7)): TupleType(t0,t1,t2,t3,t4,t5,t6,t7), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6,n7); } @@ -10902,13 +10902,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -10928,7 +10928,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4), typename TypeWrapper::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5), typename TypeWrapper::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6)): - TupleType(t0,t1,t2,t3,t4,t5,t6), _pNames(0) + TupleType(t0,t1,t2,t3,t4,t5,t6), _pNames(nullptr) { init(); } @@ -10963,7 +10963,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5), const std::string& n6 = "G", typename TypeWrapper::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6)): - TupleType(t0,t1,t2,t3,t4,t5,t6), _pNames(0) + TupleType(t0,t1,t2,t3,t4,t5,t6), _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5,n6); } @@ -11093,13 +11093,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -11118,7 +11118,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3), typename TypeWrapper::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4), typename TypeWrapper::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5)): - TupleType(t0,t1,t2,t3,t4,t5), _pNames(0) + TupleType(t0,t1,t2,t3,t4,t5), _pNames(nullptr) { init(); } @@ -11150,7 +11150,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4), const std::string& n5 = "F", typename TypeWrapper::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5)): - TupleType(t0,t1,t2,t3,t4,t5), _pNames(0) + TupleType(t0,t1,t2,t3,t4,t5), _pNames(nullptr) { init(n0,n1,n2,n3,n4,n5); } @@ -11276,13 +11276,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -11301,7 +11301,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3), typename TypeWrapper::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4)): TupleType(t0,t1,t2,t3,t4), - _pNames(0) + _pNames(nullptr) { init(); } @@ -11331,7 +11331,7 @@ struct NamedTuple: const std::string& n4 = "E", typename TypeWrapper::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4)): TupleType(t0,t1,t2,t3,t4), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2,n3,n4); } @@ -11453,13 +11453,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -11477,7 +11477,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2), typename TypeWrapper::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3)): TupleType(t0,t1,t2,t3), - _pNames(0) + _pNames(nullptr) { init(); } @@ -11503,7 +11503,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2), const std::string& n3 = "D", typename TypeWrapper::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3)): - TupleType(t0,t1,t2,t3), _pNames(0) + TupleType(t0,t1,t2,t3), _pNames(nullptr) { init(n0,n1,n2,n3); } @@ -11621,13 +11621,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -11644,7 +11644,7 @@ struct NamedTuple: typename TypeWrapper::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1), typename TypeWrapper::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2)): TupleType(t0,t1,t2), - _pNames(0) + _pNames(nullptr) { init(); } @@ -11668,7 +11668,7 @@ struct NamedTuple: const std::string& n2 = "C", typename TypeWrapper::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2)): TupleType(t0,t1,t2), - _pNames(0) + _pNames(nullptr) { init(n0,n1,n2); } @@ -11782,13 +11782,13 @@ template: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -11804,7 +11804,7 @@ struct NamedTuple: NamedTuple(typename TypeWrapper::CONSTTYPE& t0, typename TypeWrapper::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1)): TupleType(t0,t1), - _pNames(0) + _pNames(nullptr) { init(); } @@ -11825,7 +11825,7 @@ struct NamedTuple: const std::string& n1 = "B", typename TypeWrapper::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1)): TupleType(t0,t1), - _pNames(0) + _pNames(nullptr) { init(n0,n1); } @@ -11935,13 +11935,13 @@ template struct NamedTuple: public Tuple { - typedef Tuple TupleType; - typedef typename Tuple::Type Type; + using TupleType = Tuple; + using Type = typename Tuple::Type; - typedef std::vector NameVec; - typedef SharedPtr NameVecPtr; + using NameVec = std::vector; + using NameVecPtr = SharedPtr; - NamedTuple(): _pNames(0) + NamedTuple(): _pNames(nullptr) { init(); } @@ -11956,7 +11956,7 @@ struct NamedTuple: NamedTuple(typename TypeWrapper::CONSTTYPE& t0): TupleType(t0), - _pNames(0) + _pNames(nullptr) { init(); } @@ -11973,7 +11973,7 @@ struct NamedTuple: NamedTuple(const std::string& n0, typename TypeWrapper::CONSTTYPE& t0): TupleType(t0), - _pNames(0) + _pNames(nullptr) { init(n0); } diff --git a/Foundation/include/Poco/NestedDiagnosticContext.h b/Foundation/include/Poco/NestedDiagnosticContext.h index 94d3ee075..76acd5836 100644 --- a/Foundation/include/Poco/NestedDiagnosticContext.h +++ b/Foundation/include/Poco/NestedDiagnosticContext.h @@ -51,7 +51,7 @@ class Foundation_API NestedDiagnosticContext /// source code line number and file name. { public: - typedef NDCScope Scope; + using Scope = NDCScope; NestedDiagnosticContext(); /// Creates the NestedDiagnosticContext. @@ -108,14 +108,12 @@ private: const char* file; LineNumber line; }; - typedef std::vector Stack; + using Stack = std::vector; Stack _stack; }; - -typedef NestedDiagnosticContext NDC; - +using NDC = NestedDiagnosticContext; class Foundation_API NDCScope /// This class can be used to automatically push a context onto diff --git a/Foundation/include/Poco/Notification.h b/Foundation/include/Poco/Notification.h index 9d84287c2..e599b290a 100644 --- a/Foundation/include/Poco/Notification.h +++ b/Foundation/include/Poco/Notification.h @@ -46,7 +46,7 @@ public: /// The default implementation returns the class name. protected: - virtual ~Notification(); + ~Notification() override; std::unique_ptr _pName; }; diff --git a/Foundation/include/Poco/NotificationQueue.h b/Foundation/include/Poco/NotificationQueue.h index e34219c72..1fa662ee6 100644 --- a/Foundation/include/Poco/NotificationQueue.h +++ b/Foundation/include/Poco/NotificationQueue.h @@ -139,13 +139,13 @@ protected: Notification::Ptr dequeueOne(); private: - typedef std::deque NfQueue; + using NfQueue = std::deque; struct WaitInfo { Notification::Ptr pNf; Event nfAvailable; }; - typedef std::deque WaitQueue; + using WaitQueue = std::deque; NfQueue _nfQueue; WaitQueue _waitQueue; diff --git a/Foundation/include/Poco/NotificationStrategy.h b/Foundation/include/Poco/NotificationStrategy.h index 63e820916..24f2c2b8a 100644 --- a/Foundation/include/Poco/NotificationStrategy.h +++ b/Foundation/include/Poco/NotificationStrategy.h @@ -35,13 +35,9 @@ class NotificationStrategy public: using DelegateHandle = TDelegate*; - NotificationStrategy() - { - } + NotificationStrategy() = default; - virtual ~NotificationStrategy() - { - } + virtual ~NotificationStrategy() = default; virtual void notify(const void* sender, TArgs& arguments) = 0; /// Sends a notification to all registered delegates. @@ -76,13 +72,9 @@ class NotificationStrategy public: using DelegateHandle = TDelegate*; - NotificationStrategy() - { - } + NotificationStrategy() = default; - virtual ~NotificationStrategy() - { - } + virtual ~NotificationStrategy() = default; virtual void notify(const void* sender) = 0; /// Sends a notification to all registered delegates. diff --git a/Foundation/include/Poco/NullChannel.h b/Foundation/include/Poco/NullChannel.h index bd3ab3f57..a6a93ef8b 100644 --- a/Foundation/include/Poco/NullChannel.h +++ b/Foundation/include/Poco/NullChannel.h @@ -40,13 +40,13 @@ public: NullChannel(); /// Creates the NullChannel. - ~NullChannel(); + ~NullChannel() override; /// Destroys the NullChannel. - void log(const Message& msg); + void log(const Message& msg) override; /// Does nothing. - void setProperty(const std::string& name, const std::string& value); + void setProperty(const std::string& name, const std::string& value) override; /// Ignores both name and value. }; diff --git a/Foundation/include/Poco/NullStream.h b/Foundation/include/Poco/NullStream.h index 07c689590..04225895e 100644 --- a/Foundation/include/Poco/NullStream.h +++ b/Foundation/include/Poco/NullStream.h @@ -35,12 +35,12 @@ public: NullStreamBuf(); /// Creates a NullStreamBuf. - ~NullStreamBuf(); - /// Destroys the NullStreamBuf. + ~NullStreamBuf() override; + /// Destroys the NullStreamBuf. protected: - int readFromDevice(); - int writeToDevice(char c); + int readFromDevice() override; + int writeToDevice(char c) override; }; @@ -52,7 +52,7 @@ class Foundation_API NullIOS: public virtual std::ios { public: NullIOS(); - ~NullIOS(); + ~NullIOS() override; protected: NullStreamBuf _buf; @@ -67,8 +67,8 @@ public: NullInputStream(); /// Creates the NullInputStream. - ~NullInputStream(); - /// Destroys the NullInputStream. + ~NullInputStream() override; + /// Destroys the NullInputStream. }; @@ -79,8 +79,8 @@ public: NullOutputStream(); /// Creates the NullOutputStream. - ~NullOutputStream(); - /// Destroys the NullOutputStream. + ~NullOutputStream() override; + /// Destroys the NullOutputStream. }; diff --git a/Foundation/include/Poco/Nullable.h b/Foundation/include/Poco/Nullable.h index 3d8d4d17b..40f06e905 100644 --- a/Foundation/include/Poco/Nullable.h +++ b/Foundation/include/Poco/Nullable.h @@ -55,10 +55,8 @@ class Nullable public: using Type = C; - Nullable() + Nullable() = default; /// Creates an empty Nullable. - { - } Nullable(const NullType&) /// Creates an empty Nullable. diff --git a/Foundation/include/Poco/ObjectPool.h b/Foundation/include/Poco/ObjectPool.h index 76497a36f..06f9db081 100644 --- a/Foundation/include/Poco/ObjectPool.h +++ b/Foundation/include/Poco/ObjectPool.h @@ -206,6 +206,10 @@ public: } } + ObjectPool() = delete; + ObjectPool(const ObjectPool&) = delete; + ObjectPool& operator=(const ObjectPool&) = delete; + P borrowObject(long timeoutMilliseconds = 0) /// Obtains an object from the pool, or creates a new object if /// possible. @@ -322,10 +326,6 @@ protected: } private: - ObjectPool(); - ObjectPool(const ObjectPool&); - ObjectPool& operator = (const ObjectPool&); - F _factory; std::size_t _capacity; std::size_t _peakCapacity; diff --git a/Foundation/include/Poco/Observer.h b/Foundation/include/Poco/Observer.h index 8e69329ea..910aa4636 100755 --- a/Foundation/include/Poco/Observer.h +++ b/Foundation/include/Poco/Observer.h @@ -42,7 +42,7 @@ class Observer: public AbstractObserver /// you from memory management issues. { public: - typedef void (C::*Callback)(N*); + using Callback = void (C::*)(N *); Observer(C& object, Callback method): _pObject(&object), @@ -57,9 +57,9 @@ public: { } - ~Observer() - { - } + ~Observer() override = default; + + Observer() = delete; Observer& operator = (const Observer& observer) { @@ -71,7 +71,7 @@ public: return *this; } - void notify(Notification* pNf) const + void notify(Notification *pNf) const override { Poco::Mutex::ScopedLock lock(_mutex); if (_pObject) @@ -81,38 +81,35 @@ public: } } - bool equals(const AbstractObserver& abstractObserver) const + bool equals(const AbstractObserver& abstractObserver) const override { const Observer* pObs = dynamic_cast(&abstractObserver); return pObs && pObs->_pObject == _pObject && pObs->_method == _method; } POCO_DEPRECATED("use `bool accepts(const Notification::Ptr&)` instead") - bool accepts(Notification* pNf, const char* pName) const + bool accepts(Notification* pNf, const char* pName) const override { return (!pName || pNf->name() == pName) && (dynamic_cast(pNf) != nullptr); } - bool accepts(const Notification::Ptr& pNf) const + bool accepts(const Notification::Ptr& pNf) const override { return (pNf.cast() != nullptr); } - AbstractObserver* clone() const + AbstractObserver *clone() const override { return new Observer(*this); } - void disable() + void disable() override { Poco::Mutex::ScopedLock lock(_mutex); - - _pObject = 0; + _pObject = nullptr; } private: - Observer(); - C* _pObject; Callback _method; mutable Poco::Mutex _mutex; diff --git a/Foundation/include/Poco/Optional.h b/Foundation/include/Poco/Optional.h index b7344642b..78b83768b 100644 --- a/Foundation/include/Poco/Optional.h +++ b/Foundation/include/Poco/Optional.h @@ -53,10 +53,8 @@ class Optional /// nillable == true. { public: - Optional() + Optional() = default; /// Creates an empty Optional. - { - } Optional(const C& value): /// Creates a Optional with the given value. @@ -82,10 +80,8 @@ public: { } - ~Optional() + ~Optional() = default; /// Destroys the Optional. - { - } Optional& assign(const C& value) /// Assigns a value to the Optional. diff --git a/Foundation/include/Poco/PBKDF2Engine.h b/Foundation/include/Poco/PBKDF2Engine.h index 4c6a34eb2..fbbec4a09 100644 --- a/Foundation/include/Poco/PBKDF2Engine.h +++ b/Foundation/include/Poco/PBKDF2Engine.h @@ -74,22 +74,24 @@ public: _result.reserve(_dkLen + PRF_DIGEST_SIZE); } - ~PBKDF2Engine() - { - } + ~PBKDF2Engine() override = default; - std::size_t digestLength() const + PBKDF2Engine() = delete; + PBKDF2Engine(const PBKDF2Engine&) = delete; + PBKDF2Engine& operator=(const PBKDF2Engine&) = delete; + + std::size_t digestLength() const override { return _dkLen; } - void reset() + void reset() override { _p.clear(); _result.clear(); } - const DigestEngine::Digest& digest() + const DigestEngine::Digest& digest() override { Poco::UInt32 i = 1; while (_result.size() < _dkLen) @@ -101,7 +103,7 @@ public: } protected: - void updateImpl(const void* data, std::size_t length) + void updateImpl(const void* data, std::size_t length) override { _p.append(reinterpret_cast(data), length); } @@ -131,10 +133,6 @@ protected: } private: - PBKDF2Engine(); - PBKDF2Engine(const PBKDF2Engine&); - PBKDF2Engine& operator = (const PBKDF2Engine&); - std::string _p; std::string _s; unsigned _c; diff --git a/Foundation/include/Poco/PatternFormatter.h b/Foundation/include/Poco/PatternFormatter.h index 9f259bd61..d206e4d89 100644 --- a/Foundation/include/Poco/PatternFormatter.h +++ b/Foundation/include/Poco/PatternFormatter.h @@ -90,14 +90,14 @@ public: /// Creates a PatternFormatter that uses the /// given format pattern. - ~PatternFormatter(); + ~PatternFormatter() override; /// Destroys the PatternFormatter. - void format(const Message& msg, std::string& text); + void format(const Message& msg, std::string& text) override; /// Formats the message according to the specified /// format pattern and places the result in text. - 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. /// /// The following properties are supported: @@ -112,7 +112,7 @@ public: /// If any other property name is given, a PropertyNotSupported /// 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 /// throws a PropertyNotSupported exception if the given /// name is not recognized. diff --git a/Foundation/include/Poco/Pipe.h b/Foundation/include/Poco/Pipe.h index e27a0d25d..4bf9efca1 100644 --- a/Foundation/include/Poco/Pipe.h +++ b/Foundation/include/Poco/Pipe.h @@ -48,7 +48,7 @@ class Foundation_API Pipe /// to a reference-counted PipeImpl object. { public: - typedef PipeImpl::Handle Handle; /// The read/write handle or file descriptor. + using Handle = PipeImpl::Handle; /// The read/write handle or file descriptor. enum CloseMode /// used by close() { diff --git a/Foundation/include/Poco/PipeImpl_DUMMY.h b/Foundation/include/Poco/PipeImpl_DUMMY.h index e7616ff6c..33ab61ea8 100644 --- a/Foundation/include/Poco/PipeImpl_DUMMY.h +++ b/Foundation/include/Poco/PipeImpl_DUMMY.h @@ -30,10 +30,10 @@ class Foundation_API PipeImpl: public RefCountedObject /// that do not support pipes. { public: - typedef int Handle; + using Handle = int; PipeImpl(); - ~PipeImpl(); + ~PipeImpl() override; int writeBytes(const void* buffer, int length); int readBytes(void* buffer, int length); Handle readHandle() const; diff --git a/Foundation/include/Poco/PipeImpl_POSIX.h b/Foundation/include/Poco/PipeImpl_POSIX.h index 5b62fefc6..648dd4e60 100644 --- a/Foundation/include/Poco/PipeImpl_POSIX.h +++ b/Foundation/include/Poco/PipeImpl_POSIX.h @@ -30,10 +30,10 @@ class Foundation_API PipeImpl: public RefCountedObject /// that do not support pipes. { public: - typedef int Handle; + using Handle = int; PipeImpl(); - ~PipeImpl(); + ~PipeImpl() override; int writeBytes(const void* buffer, int length); int readBytes(void* buffer, int length); Handle readHandle() const; diff --git a/Foundation/include/Poco/PipeStream.h b/Foundation/include/Poco/PipeStream.h index 5f107986c..ac3f65c30 100644 --- a/Foundation/include/Poco/PipeStream.h +++ b/Foundation/include/Poco/PipeStream.h @@ -32,20 +32,20 @@ class Foundation_API PipeStreamBuf: public BufferedStreamBuf /// This is the streambuf class used for reading from and writing to a Pipe. { public: - typedef BufferedStreamBuf::openmode openmode; + using openmode = BufferedStreamBuf::openmode; PipeStreamBuf(const Pipe& pipe, openmode mode); /// Creates a PipeStreamBuf with the given Pipe. - ~PipeStreamBuf(); + ~PipeStreamBuf() override; /// Destroys the PipeStreamBuf. void close(); /// Closes the pipe. protected: - int readFromDevice(char* buffer, std::streamsize length); - int writeToDevice(const char* buffer, std::streamsize length); + int readFromDevice(char* buffer, std::streamsize length) override; + int writeToDevice(const char* buffer, std::streamsize length) override; private: enum @@ -68,7 +68,7 @@ public: PipeIOS(const Pipe& pipe, openmode mode); /// Creates the PipeIOS with the given Pipe. - ~PipeIOS(); + ~PipeIOS() override; /// Destroys the PipeIOS. /// /// Flushes the buffer, but does not close the pipe. @@ -91,7 +91,7 @@ public: PipeOutputStream(const Pipe& pipe); /// Creates the PipeOutputStream with the given Pipe. - ~PipeOutputStream(); + ~PipeOutputStream() override; /// Destroys the PipeOutputStream. /// /// Flushes the buffer, but does not close the pipe. @@ -109,7 +109,7 @@ public: PipeInputStream(const Pipe& pipe); /// Creates the PipeInputStream with the given Pipe. - ~PipeInputStream(); + ~PipeInputStream() override; /// Destroys the PipeInputStream. }; diff --git a/Foundation/include/Poco/PriorityDelegate.h b/Foundation/include/Poco/PriorityDelegate.h index cac9cf25e..8b6ba9abb 100644 --- a/Foundation/include/Poco/PriorityDelegate.h +++ b/Foundation/include/Poco/PriorityDelegate.h @@ -32,7 +32,7 @@ template class PriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (TObj::*NotifyMethod)(const void*, TArgs&); + using NotifyMethod = void (TObj::*)(const void *, TArgs &); PriorityDelegate(TObj* obj, NotifyMethod method, int prio): AbstractPriorityDelegate(prio), @@ -59,9 +59,9 @@ public: return *this; } - ~PriorityDelegate() - { - } + ~PriorityDelegate() = default; + + PriorityDelegate() = delete; bool notify(const void* sender, TArgs& arguments) { @@ -95,9 +95,6 @@ protected: TObj* _receiverObject; NotifyMethod _receiverMethod; Mutex _mutex; - -private: - PriorityDelegate(); }; @@ -105,7 +102,7 @@ template class PriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (TObj::*NotifyMethod)(TArgs&); + using NotifyMethod = void (TObj::*)(TArgs &); PriorityDelegate(TObj* obj, NotifyMethod method, int prio): AbstractPriorityDelegate(prio), @@ -132,9 +129,9 @@ public: return *this; } - ~PriorityDelegate() - { - } + ~PriorityDelegate() = default; + + PriorityDelegate() = delete; bool notify(const void* sender, TArgs& arguments) { @@ -168,9 +165,6 @@ protected: TObj* _receiverObject; NotifyMethod _receiverMethod; Mutex _mutex; - -private: - PriorityDelegate(); }; @@ -178,7 +172,7 @@ template class PriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (TObj::*NotifyMethod)(const void*); + using NotifyMethod = void (TObj::*)(const void *); PriorityDelegate(TObj* obj, NotifyMethod method, int prio): AbstractPriorityDelegate(prio), @@ -205,11 +199,11 @@ public: return *this; } - ~PriorityDelegate() - { - } + ~PriorityDelegate() override = default; - bool notify(const void* sender) + PriorityDelegate() = delete; + + bool notify(const void* sender) override { Mutex::ScopedLock lock(_mutex); if (_receiverObject) @@ -220,18 +214,18 @@ public: else return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate& other) const override { const PriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; } - AbstractDelegate* clone() const + AbstractDelegate* clone() const override { return new PriorityDelegate(*this); } - void disable() + void disable() override { Mutex::ScopedLock lock(_mutex); _receiverObject = 0; @@ -241,9 +235,6 @@ protected: TObj* _receiverObject; NotifyMethod _receiverMethod; Mutex _mutex; - -private: - PriorityDelegate(); }; @@ -251,7 +242,7 @@ template class PriorityDelegate: public AbstractPriorityDelegate { public: - typedef void (TObj::*NotifyMethod)(); + using NotifyMethod = void (TObj::*)(); PriorityDelegate(TObj* obj, NotifyMethod method, int prio): AbstractPriorityDelegate(prio), @@ -278,11 +269,11 @@ public: return *this; } - ~PriorityDelegate() - { - } + ~PriorityDelegate() override = default; - bool notify(const void* sender) + PriorityDelegate() = delete; + + bool notify(const void* sender) override { Mutex::ScopedLock lock(_mutex); if (_receiverObject) @@ -293,18 +284,18 @@ public: return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate& other) const override { const PriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; } - AbstractDelegate* clone() const + AbstractDelegate* clone() const override { return new PriorityDelegate(*this); } - void disable() + void disable() override { Mutex::ScopedLock lock(_mutex); _receiverObject = 0; @@ -314,9 +305,6 @@ protected: TObj* _receiverObject; NotifyMethod _receiverMethod; Mutex _mutex; - -private: - PriorityDelegate(); }; diff --git a/Foundation/include/Poco/PriorityEvent.h b/Foundation/include/Poco/PriorityEvent.h index 1ccfb89c5..b6b18e229 100644 --- a/Foundation/include/Poco/PriorityEvent.h +++ b/Foundation/include/Poco/PriorityEvent.h @@ -41,17 +41,12 @@ class PriorityEvent: public AbstractEvent < /// an arbitrary manner. { public: - PriorityEvent() - { - } + PriorityEvent() = default; - ~PriorityEvent() - { - } + ~PriorityEvent() = default; -private: - PriorityEvent(const PriorityEvent&); - PriorityEvent& operator = (const PriorityEvent&); + PriorityEvent(const PriorityEvent&) = delete; + PriorityEvent& operator=(const PriorityEvent&) = delete; }; diff --git a/Foundation/include/Poco/PriorityExpire.h b/Foundation/include/Poco/PriorityExpire.h index d9fc5a4fa..9f04e32d6 100644 --- a/Foundation/include/Poco/PriorityExpire.h +++ b/Foundation/include/Poco/PriorityExpire.h @@ -52,6 +52,8 @@ public: delete _pDelegate; } + PriorityExpire() = delete; + PriorityExpire& operator = (const PriorityExpire& expire) { if (&expire != this) @@ -102,9 +104,6 @@ protected: AbstractPriorityDelegate* _pDelegate; Timestamp::TimeDiff _expire; Timestamp _creationTime; - -private: - PriorityExpire(); }; @@ -129,11 +128,13 @@ public: { } - ~PriorityExpire() + ~PriorityExpire() override { delete _pDelegate; } + PriorityExpire() = delete; + PriorityExpire& operator = (const PriorityExpire& expire) { if (&expire != this) @@ -146,7 +147,7 @@ public: return *this; } - bool notify(const void* sender) + bool notify(const void* sender) override { if (!expired()) return this->_pDelegate->notify(sender); @@ -154,22 +155,22 @@ public: return false; } - bool equals(const AbstractDelegate& other) const + bool equals(const AbstractDelegate& other) const override { return other.equals(*_pDelegate); } - AbstractPriorityDelegate* clone() const + AbstractPriorityDelegate* clone() const override { return new PriorityExpire(*this); } - void disable() + void disable() override { _pDelegate->disable(); } - const AbstractPriorityDelegate* unwrap() const + const AbstractPriorityDelegate* unwrap() const override { return this->_pDelegate; } @@ -183,9 +184,6 @@ protected: AbstractPriorityDelegate* _pDelegate; Timestamp::TimeDiff _expire; Timestamp _creationTime; - -private: - PriorityExpire(); }; diff --git a/Foundation/include/Poco/PriorityNotificationQueue.h b/Foundation/include/Poco/PriorityNotificationQueue.h index d11317465..83d01087d 100644 --- a/Foundation/include/Poco/PriorityNotificationQueue.h +++ b/Foundation/include/Poco/PriorityNotificationQueue.h @@ -138,13 +138,13 @@ protected: Notification::Ptr dequeueOne(); private: - typedef std::multimap NfQueue; + using NfQueue = std::multimap; struct WaitInfo { Notification::Ptr pNf; Event nfAvailable; }; - typedef std::deque WaitQueue; + using WaitQueue = std::deque; NfQueue _nfQueue; WaitQueue _waitQueue; diff --git a/Foundation/include/Poco/PriorityStrategy.h b/Foundation/include/Poco/PriorityStrategy.h index db031e4e3..72f8acbee 100644 --- a/Foundation/include/Poco/PriorityStrategy.h +++ b/Foundation/include/Poco/PriorityStrategy.h @@ -40,18 +40,14 @@ public: using Iterator = typename Delegates::iterator; public: - PriorityStrategy() - { - } + PriorityStrategy() = default; PriorityStrategy(const PriorityStrategy& s): _delegates(s._delegates) { } - ~PriorityStrategy() - { - } + ~PriorityStrategy() = default; void notify(const void* sender, TArgs& arguments) { diff --git a/Foundation/include/Poco/Process.h b/Foundation/include/Poco/Process.h index bb650c644..5118b2744 100644 --- a/Foundation/include/Poco/Process.h +++ b/Foundation/include/Poco/Process.h @@ -44,7 +44,7 @@ class Foundation_API ProcessHandle /// the completion of a process. { public: - typedef ProcessImpl::PIDImpl PID; + using PID = ProcessImpl::PIDImpl; ProcessHandle(const ProcessHandle& handle); /// Creates a ProcessHandle by copying another one. @@ -83,9 +83,9 @@ class Foundation_API Process: public ProcessImpl /// This class provides methods for working with processes. { public: - typedef PIDImpl PID; - typedef ArgsImpl Args; - typedef EnvImpl Env; + using PID = PIDImpl; + using Args = ArgsImpl; + using Env = EnvImpl; static PID id(); /// Returns the process ID of the current process. diff --git a/Foundation/include/Poco/ProcessRunner.h b/Foundation/include/Poco/ProcessRunner.h index 3826bd5e3..410444ed8 100644 --- a/Foundation/include/Poco/ProcessRunner.h +++ b/Foundation/include/Poco/ProcessRunner.h @@ -81,7 +81,7 @@ public: /// /// If `startProcess` is true, the process is started on object creation. - ~ProcessRunner(); + ~ProcessRunner() override; /// Destroys the ProcessRunner. PID pid() const; @@ -137,8 +137,7 @@ private: #endif } - - void run(); + void run() override; /// Starts the process and waits for it to be fully initialized. /// Process initialization completion is indicated by new pid in /// the pid file. If pid file is not specified, there is no waiting. diff --git a/Foundation/include/Poco/Process_UNIX.h b/Foundation/include/Poco/Process_UNIX.h index 26666cb4b..adfded4a2 100644 --- a/Foundation/include/Poco/Process_UNIX.h +++ b/Foundation/include/Poco/Process_UNIX.h @@ -36,7 +36,7 @@ class Foundation_API ProcessHandleImpl: public RefCountedObject { public: ProcessHandleImpl(pid_t pid); - ~ProcessHandleImpl(); + ~ProcessHandleImpl() override; pid_t id() const; int wait() const; @@ -50,9 +50,9 @@ private: class Foundation_API ProcessImpl { public: - typedef pid_t PIDImpl; - typedef std::vector ArgsImpl; - typedef std::map EnvImpl; + using PIDImpl = pid_t; + using ArgsImpl = std::vector; + using EnvImpl = std::map; static PIDImpl idImpl(); static void timesImpl(long& userTime, long& kernelTime); diff --git a/Foundation/include/Poco/Process_VX.h b/Foundation/include/Poco/Process_VX.h index 0fbda8c55..01ce3a356 100644 --- a/Foundation/include/Poco/Process_VX.h +++ b/Foundation/include/Poco/Process_VX.h @@ -37,7 +37,7 @@ class Foundation_API ProcessHandleImpl: public RefCountedObject { public: ProcessHandleImpl(int pid); - ~ProcessHandleImpl(); + ~ProcessHandleImpl() override; int id() const; int wait() const; @@ -51,9 +51,9 @@ private: class Foundation_API ProcessImpl { public: - typedef int PIDImpl; - typedef std::vector ArgsImpl; - typedef std::map EnvImpl; + using PIDImpl = int; + using ArgsImpl = std::vector; + using EnvImpl = std::map; static PIDImpl idImpl(); static void timesImpl(long& userTime, long& kernelTime); diff --git a/Foundation/include/Poco/PurgeStrategy.h b/Foundation/include/Poco/PurgeStrategy.h index bfe34e17a..81403a061 100644 --- a/Foundation/include/Poco/PurgeStrategy.h +++ b/Foundation/include/Poco/PurgeStrategy.h @@ -64,9 +64,9 @@ class Foundation_API NullPurgeStrategy : public PurgeStrategy { public: NullPurgeStrategy(); - ~NullPurgeStrategy(); + ~NullPurgeStrategy() override; - void purge(const std::string& path); + void purge(const std::string& path) override; }; @@ -76,9 +76,9 @@ class Foundation_API PurgeByAgeStrategy: public PurgeStrategy { public: PurgeByAgeStrategy(const Timespan& age); - ~PurgeByAgeStrategy(); + ~PurgeByAgeStrategy() override; - void purge(const std::string& path); + void purge(const std::string& path) override; private: Timespan _age; @@ -92,9 +92,9 @@ class Foundation_API PurgeByCountStrategy: public PurgeStrategy { public: PurgeByCountStrategy(int count); - ~PurgeByCountStrategy(); + ~PurgeByCountStrategy() override; - void purge(const std::string& path); + void purge(const std::string& path) override; private: int _count; diff --git a/Foundation/include/Poco/RWLock.h b/Foundation/include/Poco/RWLock.h index b0ea3e456..41e2bb75d 100644 --- a/Foundation/include/Poco/RWLock.h +++ b/Foundation/include/Poco/RWLock.h @@ -91,12 +91,12 @@ public: ScopedRWLock(RWLock& rwl, bool write = false); ~ScopedRWLock(); + ScopedRWLock() = delete; + ScopedRWLock(const ScopedRWLock&) = delete; + ScopedRWLock& operator=(const ScopedRWLock&) = delete; + private: RWLock& _rwl; - - ScopedRWLock(); - ScopedRWLock(const ScopedRWLock&); - ScopedRWLock& operator = (const ScopedRWLock&); }; @@ -177,21 +177,13 @@ inline ScopedReadRWLock::ScopedReadRWLock(RWLock& rwl): ScopedRWLock(rwl, false) { } - -inline ScopedReadRWLock::~ScopedReadRWLock() -{ -} - +inline ScopedReadRWLock::~ScopedReadRWLock() = default; inline ScopedWriteRWLock::ScopedWriteRWLock(RWLock& rwl): ScopedRWLock(rwl, true) { } - -inline ScopedWriteRWLock::~ScopedWriteRWLock() -{ -} - +inline ScopedWriteRWLock::~ScopedWriteRWLock() = default; } // namespace Poco diff --git a/Foundation/include/Poco/RandomStream.h b/Foundation/include/Poco/RandomStream.h index 152b95c83..720ed9327 100644 --- a/Foundation/include/Poco/RandomStream.h +++ b/Foundation/include/Poco/RandomStream.h @@ -36,8 +36,8 @@ class Foundation_API RandomBuf: public BufferedStreamBuf { public: RandomBuf(); - ~RandomBuf(); - int readFromDevice(char* buffer, std::streamsize length); + ~RandomBuf() override; + int readFromDevice(char* buffer, std::streamsize length) override; }; @@ -49,7 +49,7 @@ class Foundation_API RandomIOS: public virtual std::ios { public: RandomIOS(); - ~RandomIOS(); + ~RandomIOS() override; RandomBuf* rdbuf(); protected: @@ -63,7 +63,7 @@ class Foundation_API RandomInputStream: public RandomIOS, public std::istream { public: RandomInputStream(); - ~RandomInputStream(); + ~RandomInputStream() override; }; diff --git a/Foundation/include/Poco/RecursiveDirectoryIterator.h b/Foundation/include/Poco/RecursiveDirectoryIterator.h index 869feb8f6..5adb62700 100644 --- a/Foundation/include/Poco/RecursiveDirectoryIterator.h +++ b/Foundation/include/Poco/RecursiveDirectoryIterator.h @@ -60,7 +60,7 @@ class RecursiveDirectoryIterator /// parameter maxDepth (which sets the infinite depth by default). { public: - typedef RecursiveDirectoryIterator MyType; + using MyType = RecursiveDirectoryIterator; enum { @@ -217,7 +217,7 @@ public: friend inline bool operator !=(const RecursiveDirectoryIterator& a, const RecursiveDirectoryIterator& b); private: - typedef RecursiveDirectoryIteratorImpl ImplType; + using ImplType = RecursiveDirectoryIteratorImpl; ImplType* _pImpl; Path _path; @@ -244,9 +244,8 @@ inline bool operator !=(const RecursiveDirectoryIterator& a, const Recursive // // typedefs // -typedef RecursiveDirectoryIterator SimpleRecursiveDirectoryIterator; -typedef RecursiveDirectoryIterator SiblingsFirstRecursiveDirectoryIterator; - +using SimpleRecursiveDirectoryIterator = RecursiveDirectoryIterator; +using SiblingsFirstRecursiveDirectoryIterator = RecursiveDirectoryIterator; } // namespace Poco diff --git a/Foundation/include/Poco/RecursiveDirectoryIteratorImpl.h b/Foundation/include/Poco/RecursiveDirectoryIteratorImpl.h index 0b96ad0a1..e39a0845b 100644 --- a/Foundation/include/Poco/RecursiveDirectoryIteratorImpl.h +++ b/Foundation/include/Poco/RecursiveDirectoryIteratorImpl.h @@ -47,9 +47,7 @@ public: _current = _itStack.top()->path(); } - ~RecursiveDirectoryIteratorImpl() - { - } + ~RecursiveDirectoryIteratorImpl() = default; inline void duplicate() { @@ -87,7 +85,7 @@ public: } private: - typedef std::stack Stack; + using Stack = std::stack; static UInt16 depthFun(const Stack& stack) /// Function which implements the logic of determining diff --git a/Foundation/include/Poco/RotateStrategy.h b/Foundation/include/Poco/RotateStrategy.h index 1f1fb8b1d..3ee882420 100644 --- a/Foundation/include/Poco/RotateStrategy.h +++ b/Foundation/include/Poco/RotateStrategy.h @@ -52,7 +52,7 @@ private: class Foundation_API NullRotateStrategy : public RotateStrategy { public: - bool mustRotate(LogFile* pFile); + bool mustRotate(LogFile *pFile) override; }; @@ -97,11 +97,9 @@ public: getNextRollover(); } - ~RotateAtTimeStrategy() - { - } + ~RotateAtTimeStrategy() override = default; - bool mustRotate(LogFile* /*pFile*/) + bool mustRotate(LogFile* /*pFile*/) override { if (DT() >= _threshold) { @@ -144,8 +142,8 @@ class Foundation_API RotateByIntervalStrategy: public RotateStrategy { public: RotateByIntervalStrategy(const Timespan& span); - ~RotateByIntervalStrategy(); - bool mustRotate(LogFile* pFile); + ~RotateByIntervalStrategy() override; + bool mustRotate(LogFile* pFile) override; private: Timespan _span; @@ -160,8 +158,8 @@ class Foundation_API RotateBySizeStrategy: public RotateStrategy { public: RotateBySizeStrategy(UInt64 size); - ~RotateBySizeStrategy(); - bool mustRotate(LogFile* pFile); + ~RotateBySizeStrategy() override; + bool mustRotate(LogFile* pFile) override; private: UInt64 _size; diff --git a/Foundation/include/Poco/RunnableAdapter.h b/Foundation/include/Poco/RunnableAdapter.h index e3480486d..72d966c2f 100644 --- a/Foundation/include/Poco/RunnableAdapter.h +++ b/Foundation/include/Poco/RunnableAdapter.h @@ -38,7 +38,7 @@ class RunnableAdapter: public Runnable /// target, please see the ThreadTarget class. { public: - typedef void (C::*Callback)(); + using Callback = void (C::*)(); RunnableAdapter(C& object, Callback method): _pObject(&object), _method(method) { @@ -48,9 +48,9 @@ public: { } - ~RunnableAdapter() - { - } + ~RunnableAdapter() override = default; + + RunnableAdapter() = delete; RunnableAdapter& operator = (const RunnableAdapter& ra) { @@ -59,14 +59,9 @@ public: return *this; } - void run() - { - (_pObject->*_method)(); - } + void run() override { (_pObject->*_method)(); } private: - RunnableAdapter(); - C* _pObject; Callback _method; }; diff --git a/Foundation/include/Poco/SHA1Engine.h b/Foundation/include/Poco/SHA1Engine.h index 6d9c07644..beef44137 100644 --- a/Foundation/include/Poco/SHA1Engine.h +++ b/Foundation/include/Poco/SHA1Engine.h @@ -43,20 +43,20 @@ public: }; SHA1Engine(); - ~SHA1Engine(); + ~SHA1Engine() override; - std::size_t digestLength() const; - void reset(); - const DigestEngine::Digest& digest(); + std::size_t digestLength() const override; + void reset() override; + const DigestEngine::Digest& digest() override; protected: - void updateImpl(const void* data, std::size_t length); + void updateImpl(const void *data, std::size_t length) override; private: void transform(); static void byteReverse(UInt32* buffer, int byteCount); - typedef UInt8 BYTE; + using BYTE = UInt8; struct Context { diff --git a/Foundation/include/Poco/SHA2Engine.h b/Foundation/include/Poco/SHA2Engine.h index c1de5cd50..73309a529 100644 --- a/Foundation/include/Poco/SHA2Engine.h +++ b/Foundation/include/Poco/SHA2Engine.h @@ -47,14 +47,14 @@ public: }; SHA2Engine(ALGORITHM algorithm = SHA_256); - virtual ~SHA2Engine(); + ~SHA2Engine() override; - std::size_t digestLength() const; - void reset(); - const DigestEngine::Digest& digest(); + std::size_t digestLength() const override; + void reset() override; + const DigestEngine::Digest& digest() override; protected: - void updateImpl(const void* data, std::size_t length); + void updateImpl(const void *data, std::size_t length) override; private: void transform(); @@ -81,9 +81,7 @@ public: { } - virtual ~SHA2Engine224() - { - } + ~SHA2Engine224() override = default; }; @@ -100,9 +98,7 @@ public: { } - virtual ~SHA2Engine256() - { - } + ~SHA2Engine256() override = default; }; @@ -119,9 +115,7 @@ public: { } - virtual ~SHA2Engine384() - { - } + ~SHA2Engine384() override = default; }; @@ -138,9 +132,7 @@ public: { } - virtual ~SHA2Engine512() - { - } + ~SHA2Engine512() override = default; }; diff --git a/Foundation/include/Poco/ScopedLock.h b/Foundation/include/Poco/ScopedLock.h index eef753635..a98007987 100644 --- a/Foundation/include/Poco/ScopedLock.h +++ b/Foundation/include/Poco/ScopedLock.h @@ -55,12 +55,12 @@ public: } } + ScopedLock() = delete; + ScopedLock(const ScopedLock&) = delete; + ScopedLock& operator=(const ScopedLock&) = delete; + private: M& _mutex; - - ScopedLock(); - ScopedLock(const ScopedLock&); - ScopedLock& operator = (const ScopedLock&); }; @@ -103,6 +103,10 @@ public: } } + ScopedLockWithUnlock() = delete; + ScopedLockWithUnlock(const ScopedLockWithUnlock&) = delete; + ScopedLockWithUnlock& operator=(const ScopedLockWithUnlock&) = delete; + void lock() { poco_assert(_pMutex != nullptr); @@ -126,10 +130,6 @@ public: private: M* _pMutex; bool _locked = false; - - ScopedLockWithUnlock(); - ScopedLockWithUnlock(const ScopedLockWithUnlock&); - ScopedLockWithUnlock& operator = (const ScopedLockWithUnlock&); }; diff --git a/Foundation/include/Poco/ScopedUnlock.h b/Foundation/include/Poco/ScopedUnlock.h index a62fbb33b..cd10d4891 100644 --- a/Foundation/include/Poco/ScopedUnlock.h +++ b/Foundation/include/Poco/ScopedUnlock.h @@ -49,12 +49,12 @@ public: } } + ScopedUnlock() = delete; + ScopedUnlock(const ScopedUnlock&) = delete; + ScopedUnlock& operator=(const ScopedUnlock&) = delete; + private: M& _mutex; - - ScopedUnlock(); - ScopedUnlock(const ScopedUnlock&); - ScopedUnlock& operator = (const ScopedUnlock&); }; diff --git a/Foundation/include/Poco/SharedMemory.h b/Foundation/include/Poco/SharedMemory.h index e0bc1614b..051fe89aa 100644 --- a/Foundation/include/Poco/SharedMemory.h +++ b/Foundation/include/Poco/SharedMemory.h @@ -49,7 +49,7 @@ public: /// Default constructor creates an unmapped SharedMemory object. /// No clients can connect to an unmapped SharedMemory object. - SharedMemory(const std::string& name, std::size_t size, AccessMode mode, const void* addrHint = 0, bool server = true); + SharedMemory(const std::string& name, std::size_t size, AccessMode mode, const void* addrHint = nullptr, bool server = true); /// Creates or connects to a shared memory object with the given name. /// /// For maximum portability, name should be a valid Unix filename and not @@ -64,7 +64,7 @@ public: /// by calling shm_unlink() (on POSIX platforms) when the SharedMemory object is destroyed. /// The server parameter is ignored on Windows platforms. - SharedMemory(const File& file, AccessMode mode, const void* addrHint = 0); + SharedMemory(const File& file, AccessMode mode, const void* addrHint = nullptr); /// Maps the entire contents of file into a shared memory segment. /// /// An address hint can be passed to the system, specifying the desired diff --git a/Foundation/include/Poco/SharedMemory_DUMMY.h b/Foundation/include/Poco/SharedMemory_DUMMY.h index 6b740f709..04a43d838 100644 --- a/Foundation/include/Poco/SharedMemory_DUMMY.h +++ b/Foundation/include/Poco/SharedMemory_DUMMY.h @@ -57,8 +57,8 @@ public: /// Returns the one-past-end end address of the shared memory segment. protected: - ~SharedMemoryImpl(); - /// Destroys the SharedMemoryImpl. + ~SharedMemoryImpl() override; + /// Destroys the SharedMemoryImpl. private: SharedMemoryImpl(); @@ -72,13 +72,13 @@ private: // inline char* SharedMemoryImpl::begin() const { - return 0; + return nullptr; } inline char* SharedMemoryImpl::end() const { - return 0; + return nullptr; } diff --git a/Foundation/include/Poco/SharedMemory_POSIX.h b/Foundation/include/Poco/SharedMemory_POSIX.h index 8b7f34e65..e90b6fa35 100644 --- a/Foundation/include/Poco/SharedMemory_POSIX.h +++ b/Foundation/include/Poco/SharedMemory_POSIX.h @@ -68,7 +68,7 @@ protected: void close(); /// Releases the handle for the shared memory segment. - ~SharedMemoryImpl(); + ~SharedMemoryImpl() override; /// Destroys the SharedMemoryImpl. private: diff --git a/Foundation/include/Poco/SharedPtr.h b/Foundation/include/Poco/SharedPtr.h index 9a4fd69e6..a2240656f 100644 --- a/Foundation/include/Poco/SharedPtr.h +++ b/Foundation/include/Poco/SharedPtr.h @@ -114,7 +114,7 @@ class SharedPtr /// is required. { public: - typedef C Type; + using Type = C; SharedPtr(): _pCounter(nullptr), @@ -473,7 +473,7 @@ inline void swap(SharedPtr& p1, SharedPtr& p2) template SharedPtr makeShared(Args&&... args) { - return SharedPtr(new T(std::forward(args)...)); + return SharedPtr(new T(std::forward(args)...)); } diff --git a/Foundation/include/Poco/SignalHandler.h b/Foundation/include/Poco/SignalHandler.h index 471d7a7f0..a02e205a8 100644 --- a/Foundation/include/Poco/SignalHandler.h +++ b/Foundation/include/Poco/SignalHandler.h @@ -98,7 +98,7 @@ protected: { sigjmp_buf buf; }; - typedef std::vector JumpBufferVec; + using JumpBufferVec = std::vector; static JumpBufferVec& jumpBufferVec(); /// Returns the JumpBufferVec for the current thread. diff --git a/Foundation/include/Poco/SimpleHashTable.h b/Foundation/include/Poco/SimpleHashTable.h index 9c6e9868c..4af3fb916 100644 --- a/Foundation/include/Poco/SimpleHashTable.h +++ b/Foundation/include/Poco/SimpleHashTable.h @@ -53,7 +53,7 @@ public: } }; - typedef std::vector HashTableVector; + using HashTableVector = std::vector; SimpleHashTable(UInt32 capacity = 251): _entries(capacity, 0), _size(0), _capacity(capacity) /// Creates the SimpleHashTable. diff --git a/Foundation/include/Poco/SortedDirectoryIterator.h b/Foundation/include/Poco/SortedDirectoryIterator.h index 94c822be4..1ade54e90 100644 --- a/Foundation/include/Poco/SortedDirectoryIterator.h +++ b/Foundation/include/Poco/SortedDirectoryIterator.h @@ -48,10 +48,10 @@ public: SortedDirectoryIterator(const Path& path); /// Creates a directory iterator for the given path. - virtual ~SortedDirectoryIterator(); - /// Destroys the DirsFirstDirectoryIterator. + ~SortedDirectoryIterator() override; + /// Destroys the DirsFirstDirectoryIterator. - virtual SortedDirectoryIterator& operator ++(); // prefix + SortedDirectoryIterator& operator++() override; // prefix private: bool _is_finished; diff --git a/Foundation/include/Poco/SplitterChannel.h b/Foundation/include/Poco/SplitterChannel.h index cdac8f578..d19af6439 100644 --- a/Foundation/include/Poco/SplitterChannel.h +++ b/Foundation/include/Poco/SplitterChannel.h @@ -44,11 +44,11 @@ public: void removeChannel(Channel::Ptr pChannel); /// Removes a channel. - void log(const Message& msg); + void log(const Message& msg) override; /// Sends the given Message to all /// attaches channels. - 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. /// /// Only the "channel" property is supported, which allows @@ -57,17 +57,17 @@ public: /// To simplify file-based configuration, all property /// names starting with "channel" are treated as "channel". - void close(); + void close() override; /// Removes all channels. int count() const; /// Returns the number of channels in the SplitterChannel. protected: - ~SplitterChannel(); + ~SplitterChannel() override; private: - typedef std::vector ChannelVec; + using ChannelVec = std::vector; ChannelVec _channels; mutable FastMutex _mutex; diff --git a/Foundation/include/Poco/StrategyCollection.h b/Foundation/include/Poco/StrategyCollection.h index b67370ddc..c01f7de6d 100644 --- a/Foundation/include/Poco/StrategyCollection.h +++ b/Foundation/include/Poco/StrategyCollection.h @@ -38,13 +38,9 @@ public: using ConstIterator = typename Strategies::const_iterator; public: - StrategyCollection() - { - } + StrategyCollection() = default; - ~StrategyCollection() - { - } + ~StrategyCollection() = default; void pushBack(AbstractStrategy* pStrat) /// Adds an AbstractStrategy to the collection. Class takes ownership of pointer diff --git a/Foundation/include/Poco/StreamChannel.h b/Foundation/include/Poco/StreamChannel.h index ab8ae57f0..d6470b724 100644 --- a/Foundation/include/Poco/StreamChannel.h +++ b/Foundation/include/Poco/StreamChannel.h @@ -43,11 +43,11 @@ public: StreamChannel(std::ostream& str); /// Creates the channel. - void log(const Message& msg); - /// Logs the given message to the channel's stream. + void log(const Message& msg) override; + /// Logs the given message to the channel's stream. protected: - virtual ~StreamChannel(); + ~StreamChannel() override; private: std::ostream& _str; diff --git a/Foundation/include/Poco/StreamConverter.h b/Foundation/include/Poco/StreamConverter.h index 99701aadb..e93eb066c 100644 --- a/Foundation/include/Poco/StreamConverter.h +++ b/Foundation/include/Poco/StreamConverter.h @@ -45,15 +45,15 @@ public: /// Creates the StreamConverterBuf and connects it /// to the given output stream. - ~StreamConverterBuf(); - /// Destroys the StreamConverterBuf. + ~StreamConverterBuf() override; + /// Destroys the StreamConverterBuf. int errors() const; /// Returns the number of encoding errors encountered. protected: - int readFromDevice(); - int writeToDevice(char c); + int readFromDevice() override; + int writeToDevice(char c) override; private: std::istream* _pIstr; @@ -77,7 +77,7 @@ class Foundation_API StreamConverterIOS: public virtual std::ios public: StreamConverterIOS(std::istream& istr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar = '?'); StreamConverterIOS(std::ostream& ostr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar = '?'); - ~StreamConverterIOS(); + ~StreamConverterIOS() override; StreamConverterBuf* rdbuf(); int errors() const; @@ -99,8 +99,8 @@ public: /// Creates the InputStreamConverter and connects it /// to the given input stream. - ~InputStreamConverter(); - /// Destroys the stream. + ~InputStreamConverter() override; + /// Destroys the stream. }; @@ -117,8 +117,8 @@ public: /// Creates the OutputStreamConverter and connects it /// to the given input stream. - ~OutputStreamConverter(); - /// Destroys the CountingOutputStream. + ~OutputStreamConverter() override; + /// Destroys the CountingOutputStream. }; diff --git a/Foundation/include/Poco/StreamTokenizer.h b/Foundation/include/Poco/StreamTokenizer.h index 2b5ad5c13..36afb1625 100644 --- a/Foundation/include/Poco/StreamTokenizer.h +++ b/Foundation/include/Poco/StreamTokenizer.h @@ -82,7 +82,7 @@ private: bool ignore; }; - typedef std::vector TokenVec; + using TokenVec = std::vector; TokenVec _tokens; std::istream* _pIstr; diff --git a/Foundation/include/Poco/String.h b/Foundation/include/Poco/String.h index 995dbec7f..48e32c788 100644 --- a/Foundation/include/Poco/String.h +++ b/Foundation/include/Poco/String.h @@ -44,8 +44,8 @@ std::size_t cstrlen(const C* str) /// provided that call strlen() and wcslen(). { const C* end = str; - while (*end) ++end; - return end - str; + while (*end) ++end; + return end - str; } @@ -288,13 +288,13 @@ int icompare(const S& str1, const S& str2) // A special optimization for an often used case. { typename S::const_iterator it1(str1.begin()); - typename S::const_iterator end1(str1.end()); + const typename S::const_iterator end1(str1.end()); typename S::const_iterator it2(str2.begin()); - typename S::const_iterator end2(str2.end()); + const typename S::const_iterator end2(str2.end()); while (it1 != end1 && it2 != end2) { - typename S::value_type c1(static_cast(Ascii::toLower(*it1))); - typename S::value_type c2(static_cast(Ascii::toLower(*it2))); + const typename S::value_type c1(static_cast(Ascii::toLower(*it1))); + const typename S::value_type c2(static_cast(Ascii::toLower(*it2))); if (c1 < c2) return -1; else if (c1 > c2) @@ -773,7 +773,7 @@ struct i_char_traits : public std::char_traits }; -typedef std::basic_string> istring; +using istring = std::basic_string>; /// Case-insensitive std::string counterpart. diff --git a/Foundation/include/Poco/StringTokenizer.h b/Foundation/include/Poco/StringTokenizer.h index a3c625889..2d4a09fa6 100644 --- a/Foundation/include/Poco/StringTokenizer.h +++ b/Foundation/include/Poco/StringTokenizer.h @@ -39,8 +39,8 @@ public: TOK_TRIM = 2 /// remove leading and trailing whitespace from tokens }; - typedef std::vector TokenVec; - typedef TokenVec::const_iterator Iterator; + using TokenVec = std::vector; + using Iterator = TokenVec::const_iterator; StringTokenizer(const std::string& str, const std::string& separators, int options = 0); /// Splits the given string into tokens. The tokens are expected to be diff --git a/Foundation/include/Poco/SyslogChannel.h b/Foundation/include/Poco/SyslogChannel.h index 2b3e398b7..97eed7a48 100644 --- a/Foundation/include/Poco/SyslogChannel.h +++ b/Foundation/include/Poco/SyslogChannel.h @@ -69,16 +69,16 @@ public: SyslogChannel(const std::string& name, int options = SYSLOG_CONS, int facility = SYSLOG_USER); /// Creates a SyslogChannel with the given name, options and facility. - void open(); + void open() override; /// Opens the SyslogChannel. - void close(); + void close() override; /// Closes the SyslogChannel. - void log(const Message& msg); - /// Sens the message's text to the syslog service. + void log(const Message& msg) override; + /// Sends the message's text to the syslog service. - 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 value. /// /// The following properties are supported: @@ -86,7 +86,7 @@ public: /// * facility: The facility added to each log message. See the Facility enumeration for a list of supported values. /// * options: The logging options. See the Option enumeration for a list of supported 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. static const std::string PROP_NAME; @@ -94,7 +94,7 @@ public: static const std::string PROP_OPTIONS; protected: - ~SyslogChannel(); + ~SyslogChannel() override; static int getPrio(const Message& msg); private: diff --git a/Foundation/include/Poco/Task.h b/Foundation/include/Poco/Task.h index b2c4441a3..600736e95 100644 --- a/Foundation/include/Poco/Task.h +++ b/Foundation/include/Poco/Task.h @@ -91,7 +91,7 @@ public: /// Do whatever the task needs to do. Must /// be overridden by subclasses. - void run(); + void run() override; /// If task has not been cancelled prior to this call, it /// calls the task's runTask() method and notifies the owner of /// the task's start and completion. @@ -144,7 +144,7 @@ protected: TaskState setState(TaskState state); /// Sets the task's state. - virtual ~Task(); + ~Task() override; /// Destroys the Task. private: diff --git a/Foundation/include/Poco/TaskNotification.h b/Foundation/include/Poco/TaskNotification.h index 120643fff..e38278bdc 100644 --- a/Foundation/include/Poco/TaskNotification.h +++ b/Foundation/include/Poco/TaskNotification.h @@ -37,7 +37,7 @@ public: /// Returns the subject of the notification. protected: - virtual ~TaskNotification(); + ~TaskNotification() override; /// Destroys the TaskNotification. private: @@ -53,7 +53,7 @@ public: TaskStartedNotification(Task* pTask); protected: - ~TaskStartedNotification(); + ~TaskStartedNotification() override; }; @@ -65,7 +65,7 @@ public: TaskCancelledNotification(Task* pTask); protected: - ~TaskCancelledNotification(); + ~TaskCancelledNotification() override; }; @@ -77,7 +77,7 @@ public: TaskFinishedNotification(Task* pTask); protected: - ~TaskFinishedNotification(); + ~TaskFinishedNotification() override; }; @@ -91,7 +91,7 @@ public: const Exception& reason() const; protected: - ~TaskFailedNotification(); + ~TaskFailedNotification() override; private: Exception* _pException; @@ -108,7 +108,7 @@ public: float progress() const; protected: - ~TaskProgressNotification(); + ~TaskProgressNotification() override; private: float _progress; @@ -136,7 +136,7 @@ public: } protected: - ~TaskCustomNotification(){}; + ~TaskCustomNotification() override = default; private: C _custom; diff --git a/Foundation/include/Poco/TeeStream.h b/Foundation/include/Poco/TeeStream.h index ad6f2940c..774754cea 100644 --- a/Foundation/include/Poco/TeeStream.h +++ b/Foundation/include/Poco/TeeStream.h @@ -45,18 +45,18 @@ public: /// Creates the CountingStreamBuf and connects it /// to the given output stream. - ~TeeStreamBuf(); - /// Destroys the CountingStream. + ~TeeStreamBuf() override; + /// Destroys the CountingStream. void addStream(std::ostream& ostr); /// Adds the given output stream. protected: - int readFromDevice(); - int writeToDevice(char c); + int readFromDevice() override; + int writeToDevice(char c) override; private: - typedef std::vector StreamVec; + using StreamVec = std::vector; std::istream* _pIstr; StreamVec _streams; @@ -81,8 +81,8 @@ public: /// Creates the basic stream and connects it /// to the given output stream. - ~TeeIOS(); - /// Destroys the stream. + ~TeeIOS() override; + /// Destroys the stream. void addStream(std::ostream& ostr); /// Adds the given output stream. @@ -104,8 +104,8 @@ public: /// Creates the TeeInputStream and connects it /// to the given input stream. - ~TeeInputStream(); - /// Destroys the TeeInputStream. + ~TeeInputStream() override; + /// Destroys the TeeInputStream. }; @@ -121,8 +121,8 @@ public: /// Creates the TeeOutputStream and connects it /// to the given input stream. - ~TeeOutputStream(); - /// Destroys the TeeOutputStream. + ~TeeOutputStream() override; + /// Destroys the TeeOutputStream. }; diff --git a/Foundation/include/Poco/TemporaryFile.h b/Foundation/include/Poco/TemporaryFile.h index 9314613b3..f84b2d6b1 100644 --- a/Foundation/include/Poco/TemporaryFile.h +++ b/Foundation/include/Poco/TemporaryFile.h @@ -52,7 +52,7 @@ public: TemporaryFile(const std::string& tempDir); /// Creates the TemporaryFile using the given directory. - ~TemporaryFile(); + ~TemporaryFile() override; /// Destroys the TemporaryFile and /// deletes the corresponding file on /// disk unless keep() or keepUntilExit() diff --git a/Foundation/include/Poco/TextConverter.h b/Foundation/include/Poco/TextConverter.h index 88e2d3191..d6d5bdf05 100644 --- a/Foundation/include/Poco/TextConverter.h +++ b/Foundation/include/Poco/TextConverter.h @@ -32,8 +32,8 @@ class Foundation_API TextConverter /// into another. { public: - typedef int (*Transform)(int); - /// Transform function for convert. + using Transform = int (*)(int); + /// Transform function for convert. TextConverter(const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar = '?'); /// Creates the TextConverter. The encoding objects must not be deleted while the diff --git a/Foundation/include/Poco/TextEncoding.h b/Foundation/include/Poco/TextEncoding.h index 2a5db0f4d..203187afd 100644 --- a/Foundation/include/Poco/TextEncoding.h +++ b/Foundation/include/Poco/TextEncoding.h @@ -48,7 +48,7 @@ public: MAX_SEQUENCE_LENGTH = 4 /// The maximum character byte sequence length supported. }; - typedef int CharacterMap[256]; + using CharacterMap = int[256]; /// The map[b] member gives information about byte sequences /// whose first byte is b. /// If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c. diff --git a/Foundation/include/Poco/Thread.h b/Foundation/include/Poco/Thread.h index 5b7e68b4e..dd0379fa6 100644 --- a/Foundation/include/Poco/Thread.h +++ b/Foundation/include/Poco/Thread.h @@ -51,7 +51,7 @@ class Foundation_API Thread: private ThreadImpl /// The name of a thread can be changed at any time. { public: - typedef ThreadImpl::TIDImpl TID; + using TID = ThreadImpl::TIDImpl; using ThreadImpl::Callable; @@ -283,11 +283,9 @@ protected: { } - ~FunctorRunnable() - { - } + ~FunctorRunnable() override = default; - void run() + void run() override { _functor(); } diff --git a/Foundation/include/Poco/ThreadLocal.h b/Foundation/include/Poco/ThreadLocal.h index 9cdd01521..1c921587d 100644 --- a/Foundation/include/Poco/ThreadLocal.h +++ b/Foundation/include/Poco/ThreadLocal.h @@ -48,9 +48,10 @@ public: { } - ~TLSSlot() - { - } + ~TLSSlot() override = default; + + TLSSlot(const TLSSlot&) = delete; + TLSSlot& operator=(const TLSSlot&) = delete; C& value() { @@ -58,9 +59,6 @@ public: } private: - TLSSlot(const TLSSlot&); - TLSSlot& operator = (const TLSSlot&); - C _value; }; @@ -89,7 +87,7 @@ public: /// Does nothing in the main thread. private: - typedef std::map TLSMap; + using TLSMap = std::map; TLSMap _map; @@ -112,16 +110,15 @@ class ThreadLocal /// thread local data. There is no way for a thread /// to access another thread's local data. { - typedef TLSSlot Slot; + using Slot = TLSSlot; public: - ThreadLocal() - { - } + ThreadLocal() = default; - ~ThreadLocal() - { - } + ~ThreadLocal() = default; + + ThreadLocal(const ThreadLocal&) = delete; + ThreadLocal& operator=(const ThreadLocal&) = delete; C* operator -> () { @@ -144,10 +141,6 @@ public: if (!p) p = new Slot; return static_cast(p)->value(); } - -private: - ThreadLocal(const ThreadLocal&); - ThreadLocal& operator = (const ThreadLocal&); }; diff --git a/Foundation/include/Poco/ThreadPool.h b/Foundation/include/Poco/ThreadPool.h index 04fcc2141..c47d5c71b 100644 --- a/Foundation/include/Poco/ThreadPool.h +++ b/Foundation/include/Poco/ThreadPool.h @@ -167,7 +167,7 @@ private: ThreadPool(const ThreadPool& pool); ThreadPool& operator = (const ThreadPool& pool); - typedef std::vector ThreadVec; + using ThreadVec = std::vector; std::string _name; int _minCapacity; diff --git a/Foundation/include/Poco/ThreadTarget.h b/Foundation/include/Poco/ThreadTarget.h index 5cf9c4e60..85dcd2f9f 100644 --- a/Foundation/include/Poco/ThreadTarget.h +++ b/Foundation/include/Poco/ThreadTarget.h @@ -53,17 +53,17 @@ class Foundation_API ThreadTarget: public Runnable /// thr.start(ra); { public: - typedef void (*Callback)(); + using Callback = void (*)(); ThreadTarget(Callback method); ThreadTarget(const ThreadTarget& te); - ~ThreadTarget(); + ~ThreadTarget() override; ThreadTarget& operator = (const ThreadTarget& te); - void run(); + void run() override; private: ThreadTarget(); diff --git a/Foundation/include/Poco/TimedNotificationQueue.h b/Foundation/include/Poco/TimedNotificationQueue.h index 8a48b8561..b83c29da6 100644 --- a/Foundation/include/Poco/TimedNotificationQueue.h +++ b/Foundation/include/Poco/TimedNotificationQueue.h @@ -136,7 +136,7 @@ public: /// behavior. protected: - typedef std::multimap NfQueue; + using NfQueue = std::multimap; Notification::Ptr dequeueOne(NfQueue::iterator& it); bool wait(Clock::ClockDiff interval); diff --git a/Foundation/include/Poco/Timespan.h b/Foundation/include/Poco/Timespan.h index d00f9c23f..2b25fc1ac 100644 --- a/Foundation/include/Poco/Timespan.h +++ b/Foundation/include/Poco/Timespan.h @@ -305,11 +305,7 @@ inline void swap(Timespan& s1, Timespan& s2) noexcept s1.swap(s2); } - -inline Timespan::~Timespan() -{ -} - +inline Timespan::~Timespan() = default; } // namespace Poco diff --git a/Foundation/include/Poco/Token.h b/Foundation/include/Poco/Token.h index be1eea239..b3488c9e5 100644 --- a/Foundation/include/Poco/Token.h +++ b/Foundation/include/Poco/Token.h @@ -122,8 +122,8 @@ class Foundation_API InvalidToken: public Token { public: InvalidToken(); - ~InvalidToken(); - Class tokenClass() const; + ~InvalidToken() override; + Class tokenClass() const override; }; @@ -133,8 +133,8 @@ class Foundation_API EOFToken: public Token { public: EOFToken(); - ~EOFToken(); - Class tokenClass() const; + ~EOFToken() override; + Class tokenClass() const override; }; @@ -144,10 +144,10 @@ class Foundation_API WhitespaceToken: public Token { public: WhitespaceToken(); - ~WhitespaceToken(); - Class tokenClass() const; - bool start(char c, std::istream& istr); - void finish(std::istream& istr); + ~WhitespaceToken() override; + Class tokenClass() const override; + bool start(char c, std::istream& istr) override; + void finish(std::istream& istr) override; }; diff --git a/Foundation/include/Poco/Tuple.h b/Foundation/include/Poco/Tuple.h index ee1e7aee7..fc36f82f0 100644 --- a/Foundation/include/Poco/Tuple.h +++ b/Foundation/include/Poco/Tuple.h @@ -7,7 +7,7 @@ // // Definition of the Tuple class. // -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// Copyright (c) 2004-2006,Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 @@ -74,7 +74,7 @@ template struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -245,9 +245,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -415,9 +415,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -582,9 +582,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -746,9 +746,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -907,9 +907,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -1065,9 +1065,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -1220,9 +1220,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -1372,9 +1372,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -1521,9 +1521,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -1667,9 +1667,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -1810,9 +1810,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -1950,9 +1950,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -2087,9 +2087,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -2221,9 +2221,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -2352,9 +2352,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -2480,9 +2480,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -2605,9 +2605,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -2727,9 +2727,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -2846,9 +2846,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -2962,9 +2962,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -3075,9 +3075,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -3185,9 +3185,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -3292,9 +3292,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -3396,9 +3396,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -3497,9 +3497,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -3595,9 +3595,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -3692,7 +3692,7 @@ template struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -3782,9 +3782,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -3871,9 +3871,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -3957,9 +3957,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -4040,9 +4040,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -4120,9 +4120,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -4197,9 +4197,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -4271,9 +4271,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -4342,9 +4342,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -4410,9 +4410,9 @@ template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -4475,9 +4475,9 @@ private: template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -4537,9 +4537,9 @@ private: template -struct Tuple +struct Tuple { - typedef typename TypeListType::HeadType Type; + using Type = typename TypeListType::HeadType; enum TupleLengthType { @@ -4597,7 +4597,7 @@ private: template struct Tuple { - typedef TypeList Type; + using Type = TypeList; enum TupleLengthType { diff --git a/Foundation/include/Poco/TypeList.h b/Foundation/include/Poco/TypeList.h index a4022c5a7..8dc6685df 100644 --- a/Foundation/include/Poco/TypeList.h +++ b/Foundation/include/Poco/TypeList.h @@ -61,10 +61,10 @@ template struct TypeList /// Compile Time List of Types { - typedef Head HeadType; - typedef Tail TailType; - typedef typename TypeWrapper::CONSTTYPE ConstHeadType; - typedef typename TypeWrapper::CONSTTYPE ConstTailType; + using HeadType = Head; + using TailType = Tail; + using ConstHeadType = typename TypeWrapper::CONSTTYPE; + using ConstTailType = typename TypeWrapper::CONSTTYPE; enum { length = TailType::length+1 @@ -165,21 +165,21 @@ struct TypeListType /// typeList is a TypeList of T0, T1, ... , Tn { private: - typedef typename + using TailType = typename TypeListType::HeadType TailType; + T31,T32,T33,T34,T35,T36,T37,T38,T39>::HeadType ; public: - typedef TypeList HeadType; + using HeadType = TypeList; }; template <> struct TypeListType<> { - typedef NullTypeList HeadType; + using HeadType = NullTypeList; }; @@ -224,16 +224,16 @@ struct TypeGetter; template struct TypeGetter> { - typedef typename TypeGetter::HeadType HeadType; - typedef typename TypeWrapper::CONSTTYPE ConstHeadType; + using HeadType = typename TypeGetter::HeadType; + using ConstHeadType = typename TypeWrapper::CONSTTYPE; }; template struct TypeGetter<0, TypeList> { - typedef typename TypeList::HeadType HeadType; - typedef typename TypeWrapper::CONSTTYPE ConstHeadType; + using HeadType = typename TypeList::HeadType; + using ConstHeadType = typename TypeWrapper::CONSTTYPE; }; @@ -293,28 +293,28 @@ struct TypeAppender; template <> struct TypeAppender { - typedef NullTypeList HeadType; + using HeadType = NullTypeList; }; template struct TypeAppender { - typedef TypeList HeadType; + using HeadType = TypeList; }; template struct TypeAppender> { - typedef TypeList HeadType; + using HeadType = TypeList; }; template struct TypeAppender, T> { - typedef TypeList::HeadType> HeadType; + using HeadType = TypeList::HeadType>; }; @@ -332,21 +332,21 @@ struct TypeOneEraser; template struct TypeOneEraser { - typedef NullTypeList HeadType; + using HeadType = NullTypeList; }; template struct TypeOneEraser, T> { - typedef Tail HeadType; + using HeadType = Tail; }; template struct TypeOneEraser, T> { - typedef TypeList ::HeadType> HeadType; + using HeadType = TypeList::HeadType>; }; @@ -364,21 +364,21 @@ struct TypeAllEraser; template struct TypeAllEraser { - typedef NullTypeList HeadType; + using HeadType = NullTypeList; }; template struct TypeAllEraser, T> { - typedef typename TypeAllEraser::HeadType HeadType; + using HeadType = typename TypeAllEraser::HeadType; }; template struct TypeAllEraser, T> { - typedef TypeList ::HeadType> HeadType; + using HeadType = TypeList::HeadType>; }; @@ -396,7 +396,7 @@ struct TypeDuplicateEraser; template <> struct TypeDuplicateEraser { - typedef NullTypeList HeadType; + using HeadType = NullTypeList; }; @@ -404,10 +404,11 @@ template struct TypeDuplicateEraser> { private: - typedef typename TypeDuplicateEraser::HeadType L1; - typedef typename TypeOneEraser::HeadType L2; + using L1 = typename TypeDuplicateEraser::HeadType; + using L2 = typename TypeOneEraser::HeadType; + public: - typedef TypeList HeadType; + using HeadType = TypeList; }; @@ -426,21 +427,21 @@ struct TypeOneReplacer; template struct TypeOneReplacer { - typedef NullTypeList HeadType; + using HeadType = NullTypeList; }; template struct TypeOneReplacer, T, R> { - typedef TypeList HeadType; + using HeadType = TypeList; }; template struct TypeOneReplacer, T, R> { - typedef TypeList::HeadType> HeadType; + using HeadType = TypeList::HeadType>; }; @@ -459,21 +460,21 @@ struct TypeAllReplacer; template struct TypeAllReplacer { - typedef NullTypeList HeadType; + using HeadType = NullTypeList; }; template struct TypeAllReplacer, T, R> { - typedef TypeList::HeadType> HeadType; + using HeadType = TypeList::HeadType>; }; template struct TypeAllReplacer, T, R> { - typedef TypeList::HeadType> HeadType; + using HeadType = TypeList::HeadType>; }; diff --git a/Foundation/include/Poco/URIStreamOpener.h b/Foundation/include/Poco/URIStreamOpener.h index 009923882..270a5c374 100644 --- a/Foundation/include/Poco/URIStreamOpener.h +++ b/Foundation/include/Poco/URIStreamOpener.h @@ -122,7 +122,7 @@ private: URIStreamOpener(const URIStreamOpener&); URIStreamOpener& operator = (const URIStreamOpener&); - typedef std::map FactoryMap; + using FactoryMap = std::map; FactoryMap _map; mutable FastMutex _mutex; diff --git a/Foundation/include/Poco/UTF16Encoding.h b/Foundation/include/Poco/UTF16Encoding.h index 5e95d0aa2..899bb4ba8 100644 --- a/Foundation/include/Poco/UTF16Encoding.h +++ b/Foundation/include/Poco/UTF16Encoding.h @@ -51,7 +51,7 @@ public: /// indicated by the given byte-order mark, which is the Unicode /// character 0xFEFF. - ~UTF16Encoding(); + ~UTF16Encoding() override; ByteOrderType getByteOrder() const; /// Returns the byte-order currently in use. @@ -64,13 +64,13 @@ public: /// byte order mark, which is the Unicode /// character 0xFEFF. - const char* canonicalName() const; - bool isA(const std::string& encodingName) const; - const CharacterMap& characterMap() const; - int convert(const unsigned char* bytes) const; - int convert(int ch, unsigned char* bytes, int length) const; - int queryConvert(const unsigned char* bytes, int length) const; - int sequenceLength(const unsigned char* bytes, int length) const; + const char* canonicalName() const override; + bool isA(const std::string& encodingName) const override; + const CharacterMap& characterMap() const override; + int convert(const unsigned char* bytes) const override; + int convert(int ch, unsigned char* bytes, int length) const override; + int queryConvert(const unsigned char* bytes, int length) const override; + int sequenceLength(const unsigned char* bytes, int length) const override; private: bool _flipBytes; diff --git a/Foundation/include/Poco/UTF32Encoding.h b/Foundation/include/Poco/UTF32Encoding.h index 2c216e6e0..141e42590 100644 --- a/Foundation/include/Poco/UTF32Encoding.h +++ b/Foundation/include/Poco/UTF32Encoding.h @@ -48,7 +48,7 @@ public: /// indicated by the given byte-order mark, which is the Unicode /// character 0xFEFF. - ~UTF32Encoding(); + ~UTF32Encoding() override; ByteOrderType getByteOrder() const; /// Returns the byte-order currently in use. @@ -61,13 +61,13 @@ public: /// byte order mark, which is the Unicode /// character 0xFEFF. - const char* canonicalName() const; - bool isA(const std::string& encodingName) const; - const CharacterMap& characterMap() const; - int convert(const unsigned char* bytes) const; - int convert(int ch, unsigned char* bytes, int length) const; - int queryConvert(const unsigned char* bytes, int length) const; - int sequenceLength(const unsigned char* bytes, int length) const; + const char* canonicalName() const override; + bool isA(const std::string& encodingName) const override; + const CharacterMap& characterMap() const override; + int convert(const unsigned char* bytes) const override; + int convert(int ch, unsigned char* bytes, int length) const override; + int queryConvert(const unsigned char* bytes, int length) const override; + int sequenceLength(const unsigned char* bytes, int length) const override; protected: static int safeToInt(Poco::UInt32 value) diff --git a/Foundation/include/Poco/UTF8Encoding.h b/Foundation/include/Poco/UTF8Encoding.h index 984c163f4..ea56f6aee 100644 --- a/Foundation/include/Poco/UTF8Encoding.h +++ b/Foundation/include/Poco/UTF8Encoding.h @@ -30,14 +30,14 @@ class Foundation_API UTF8Encoding: public TextEncoding { public: UTF8Encoding(); - ~UTF8Encoding(); - const char* canonicalName() const; - bool isA(const std::string& encodingName) const; - const CharacterMap& characterMap() const; - int convert(const unsigned char* bytes) const; - int convert(int ch, unsigned char* bytes, int length) const; - int queryConvert(const unsigned char* bytes, int length) const; - int sequenceLength(const unsigned char* bytes, int length) const; + ~UTF8Encoding() override; + const char* canonicalName() const override; + bool isA(const std::string& encodingName) const override; + const CharacterMap& characterMap() const override; + int convert(const unsigned char* bytes) const override; + int convert(int ch, unsigned char* bytes, int length) const override; + int queryConvert(const unsigned char* bytes, int length) const override; + int sequenceLength(const unsigned char* bytes, int length) const override; static bool isLegal(const unsigned char *bytes, int length); /// Utility routine to tell whether a sequence of bytes is legal UTF-8. diff --git a/Foundation/include/Poco/UTFString.h b/Foundation/include/Poco/UTFString.h index e631ac349..db9dc1010 100644 --- a/Foundation/include/Poco/UTFString.h +++ b/Foundation/include/Poco/UTFString.h @@ -28,12 +28,12 @@ namespace Poco { struct UTF16CharTraits { - typedef std::fpos u16streampos; - typedef UInt16 char_type; - typedef int int_type; - typedef std::streamoff off_type; - typedef u16streampos pos_type; - typedef std::mbstate_t state_type; + using u16streampos = std::fpos; + using char_type = UInt16; + using int_type = int; + using off_type = std::streamoff; + using pos_type = u16streampos; + using state_type = std::mbstate_t; static void assign(char_type& c1, const char_type& c2) { @@ -78,7 +78,7 @@ struct UTF16CharTraits return s; ++s; } - return 0; + return nullptr; } static char_type* move(char_type* s1, const char_type* s2, std::size_t n) @@ -145,12 +145,12 @@ struct UTF16CharTraits struct UTF32CharTraits { - typedef std::fpos u32streampos; - typedef UInt32 char_type; - typedef int int_type; - typedef std::streamoff off_type; - typedef u32streampos pos_type; - typedef std::mbstate_t state_type; + using u32streampos = std::fpos; + using char_type = UInt32; + using int_type = int; + using off_type = std::streamoff; + using pos_type = u32streampos; + using state_type = std::mbstate_t; static void assign(char_type& c1, const char_type& c2) { @@ -195,7 +195,7 @@ struct UTF32CharTraits return s; ++s; } - return 0; + return nullptr; } static char_type* move(char_type* s1, const char_type* s2, std::size_t n) @@ -261,43 +261,43 @@ struct UTF32CharTraits //#if defined(POCO_ENABLE_CPP11) //TODO - // typedef char16_t UTF16Char; - // typedef std::u16string UTF16String; - // typedef char32_t UTF32Char; - // typedef std::u32string UTF32String; + // using char16_t UTF16Char; + // using std::u16string UTF16String; + // using char32_t UTF32Char; + // using std::u32string UTF32String; //#else #ifdef POCO_NO_WSTRING - typedef Poco::UInt16 UTF16Char; - typedef std::basic_string UTF16String; - typedef UInt32 UTF32Char; - typedef std::basic_string UTF32String; + using UTF16Char = Poco::UInt16; + using UTF16String = std::basic_string; + using UTF32Char = UInt32; + using UTF32String = std::basic_string; #define POCO_USE_STRING16 #define POCO_USE_STRING32 #else // POCO_NO_WSTRING #if defined(POCO_OS_FAMILY_WINDOWS) - typedef wchar_t UTF16Char; - typedef std::wstring UTF16String; - typedef UInt32 UTF32Char; - typedef std::basic_string UTF32String; + using UTF16Char = wchar_t; + using UTF16String = std::wstring; + using UTF32Char = UInt32; + using UTF32String = std::basic_string; #elif defined(__SIZEOF_WCHAR_T__) //gcc #if (__SIZEOF_WCHAR_T__ == 2) - typedef wchar_t UTF16Char; - typedef std::wstring UTF16String; - typedef UInt32 UTF32Char; - typedef std::basic_string UTF32String; + using UTF16Char = wchar_t; + using UTF16String = std::wstring; + using UTF32Char = UInt32; + using UTF32String = std::basic_string; #define POCO_USE_STRING32 #elif (__SIZEOF_WCHAR_T__ == 4) - typedef Poco::UInt16 UTF16Char; - typedef std::basic_string UTF16String; - typedef wchar_t UTF32Char; - typedef std::wstring UTF32String; + using UTF16Char = Poco::UInt16; + using UTF16String = std::basic_string; + using UTF32Char = wchar_t; + using UTF32String = std::wstring; #define POCO_USE_STRING16 #endif #else // default to 32-bit wchar_t - typedef Poco::UInt16 UTF16Char; - typedef std::basic_string UTF16String; - typedef wchar_t UTF32Char; - typedef std::wstring UTF32String; + using UTF16Char = Poco::UInt16; + using UTF16String = std::basic_string; + using UTF32Char = wchar_t; + using UTF32String = std::wstring; #define POCO_USE_STRING16 #endif //POCO_OS_FAMILY_WINDOWS #endif //POCO_NO_WSTRING diff --git a/Foundation/include/Poco/UnbufferedStreamBuf.h b/Foundation/include/Poco/UnbufferedStreamBuf.h index 2c1437976..e94eb5b70 100644 --- a/Foundation/include/Poco/UnbufferedStreamBuf.h +++ b/Foundation/include/Poco/UnbufferedStreamBuf.h @@ -37,14 +37,14 @@ class BasicUnbufferedStreamBuf: public std::basic_streambuf /// readFromDevice() or writeToDevice(). { protected: - typedef std::basic_streambuf Base; - typedef std::basic_ios IOS; - typedef ch char_type; - typedef tr char_traits; - typedef typename Base::int_type int_type; - typedef typename Base::pos_type pos_type; - typedef typename Base::off_type off_type; - typedef typename IOS::openmode openmode; + using Base = std::basic_streambuf; + using IOS = std::basic_ios; + using char_type = ch; + using char_traits = tr; + using int_type = typename Base::int_type; + using pos_type = typename Base::pos_type; + using off_type = typename Base::off_type; + using openmode = typename IOS::openmode; public: BasicUnbufferedStreamBuf(): @@ -55,11 +55,12 @@ public: this->setp(0, 0); } - ~BasicUnbufferedStreamBuf() - { - } + ~BasicUnbufferedStreamBuf() override = default; - virtual int_type overflow(int_type c) + BasicUnbufferedStreamBuf(const BasicUnbufferedStreamBuf&) = delete; + BasicUnbufferedStreamBuf& operator=(const BasicUnbufferedStreamBuf&) = delete; + + int_type overflow(int_type c) override { if (c != char_traits::eof()) return writeToDevice(char_traits::to_char_type(c)); @@ -67,7 +68,7 @@ public: return c; } - virtual int_type underflow() + int_type underflow() override { if (_ispb) { @@ -85,7 +86,7 @@ public: } } - virtual int_type uflow() + int_type uflow() override { if (_ispb) { @@ -103,7 +104,7 @@ public: } } - virtual int_type pbackfail(int_type c) + int_type pbackfail(int_type c) override { if (_ispb) { @@ -117,7 +118,7 @@ public: } } - virtual std::streamsize xsgetn(char_type* p, std::streamsize count) + std::streamsize xsgetn(char_type* p, std::streamsize count) override /// Some platforms (for example, Compaq C++) have buggy implementations of /// xsgetn that handle null buffers incorrectly. /// Anyway, it does not hurt to provide an optimized implementation @@ -154,9 +155,6 @@ private: int_type _pb; bool _ispb; - - BasicUnbufferedStreamBuf(const BasicUnbufferedStreamBuf&); - BasicUnbufferedStreamBuf& operator = (const BasicUnbufferedStreamBuf&); }; diff --git a/Foundation/include/Poco/UniqueAccessExpireCache.h b/Foundation/include/Poco/UniqueAccessExpireCache.h index 17db35072..f1d6a36d7 100644 --- a/Foundation/include/Poco/UniqueAccessExpireCache.h +++ b/Foundation/include/Poco/UniqueAccessExpireCache.h @@ -57,13 +57,10 @@ public: { } - ~UniqueAccessExpireCache() - { - } + ~UniqueAccessExpireCache() = default; -private: - UniqueAccessExpireCache(const UniqueAccessExpireCache& aCache); - UniqueAccessExpireCache& operator = (const UniqueAccessExpireCache& aCache); + UniqueAccessExpireCache(const UniqueAccessExpireCache& aCache) = delete; + UniqueAccessExpireCache& operator=(const UniqueAccessExpireCache& aCache) = delete; }; diff --git a/Foundation/include/Poco/UniqueAccessExpireLRUCache.h b/Foundation/include/Poco/UniqueAccessExpireLRUCache.h index c8bbddde8..e1fe6f32e 100644 --- a/Foundation/include/Poco/UniqueAccessExpireLRUCache.h +++ b/Foundation/include/Poco/UniqueAccessExpireLRUCache.h @@ -55,13 +55,10 @@ public: this->_strategy.pushBack(new UniqueAccessExpireStrategy()); } - ~UniqueAccessExpireLRUCache() - { - } + ~UniqueAccessExpireLRUCache() = default; -private: - UniqueAccessExpireLRUCache(const UniqueAccessExpireLRUCache& aCache); - UniqueAccessExpireLRUCache& operator = (const UniqueAccessExpireLRUCache& aCache); + UniqueAccessExpireLRUCache(const UniqueAccessExpireLRUCache& aCache) = delete; + UniqueAccessExpireLRUCache& operator=(const UniqueAccessExpireLRUCache& aCache) = delete; }; diff --git a/Foundation/include/Poco/UniqueAccessExpireStrategy.h b/Foundation/include/Poco/UniqueAccessExpireStrategy.h index 811a350e5..5cfcd03e5 100644 --- a/Foundation/include/Poco/UniqueAccessExpireStrategy.h +++ b/Foundation/include/Poco/UniqueAccessExpireStrategy.h @@ -48,22 +48,18 @@ class UniqueAccessExpireStrategy: public AbstractStrategy /// which returns the timespan for how long an object will be valid without being accessed. { public: - typedef std::pair KeyExpire; - typedef std::multimap TimeIndex; - typedef typename TimeIndex::iterator IndexIterator; - typedef typename TimeIndex::const_iterator ConstIndexIterator; - typedef std::map Keys; - typedef typename Keys::iterator Iterator; + using KeyExpire = std::pair; + using TimeIndex = std::multimap; + using IndexIterator = typename TimeIndex::iterator; + using ConstIndexIterator = typename TimeIndex::const_iterator; + using Keys = std::map; + using Iterator = typename Keys::iterator; public: - UniqueAccessExpireStrategy() + UniqueAccessExpireStrategy() = default; /// Create an unique expire strategy. - { - } - ~UniqueAccessExpireStrategy() - { - } + ~UniqueAccessExpireStrategy() = default; void onAdd(const void*, const KeyValueArgs & args) { diff --git a/Foundation/include/Poco/UniqueExpireCache.h b/Foundation/include/Poco/UniqueExpireCache.h index 9c1b67fb9..f3add6474 100644 --- a/Foundation/include/Poco/UniqueExpireCache.h +++ b/Foundation/include/Poco/UniqueExpireCache.h @@ -56,13 +56,10 @@ public: { } - ~UniqueExpireCache() - { - } + ~UniqueExpireCache() = default; -private: - UniqueExpireCache(const UniqueExpireCache& aCache); - UniqueExpireCache& operator = (const UniqueExpireCache& aCache); + UniqueExpireCache(const UniqueExpireCache& aCache) = delete; + UniqueExpireCache& operator=(const UniqueExpireCache& aCache) = delete; }; diff --git a/Foundation/include/Poco/UniqueExpireLRUCache.h b/Foundation/include/Poco/UniqueExpireLRUCache.h index 1c25a0eff..751a2db99 100644 --- a/Foundation/include/Poco/UniqueExpireLRUCache.h +++ b/Foundation/include/Poco/UniqueExpireLRUCache.h @@ -54,13 +54,10 @@ public: this->_strategy.pushBack(new UniqueExpireStrategy()); } - ~UniqueExpireLRUCache() - { - } + ~UniqueExpireLRUCache() = default; -private: - UniqueExpireLRUCache(const UniqueExpireLRUCache& aCache); - UniqueExpireLRUCache& operator = (const UniqueExpireLRUCache& aCache); + UniqueExpireLRUCache(const UniqueExpireLRUCache& aCache) = delete; + UniqueExpireLRUCache& operator=(const UniqueExpireLRUCache& aCache) = delete; }; diff --git a/Foundation/include/Poco/UniqueExpireStrategy.h b/Foundation/include/Poco/UniqueExpireStrategy.h index 12858af9c..24d627798 100644 --- a/Foundation/include/Poco/UniqueExpireStrategy.h +++ b/Foundation/include/Poco/UniqueExpireStrategy.h @@ -46,21 +46,17 @@ class UniqueExpireStrategy: public AbstractStrategy /// which returns the absolute timepoint when the entry will be invalidated. { public: - typedef std::multimap TimeIndex; - typedef typename TimeIndex::iterator IndexIterator; - typedef typename TimeIndex::const_iterator ConstIndexIterator; - typedef std::map Keys; - typedef typename Keys::iterator Iterator; + using TimeIndex = std::multimap; + using IndexIterator = typename TimeIndex::iterator; + using ConstIndexIterator = typename TimeIndex::const_iterator; + using Keys = std::map; + using Iterator = typename Keys::iterator; public: - UniqueExpireStrategy() + UniqueExpireStrategy() = default; /// Create an unique expire strategy. - { - } - ~UniqueExpireStrategy() - { - } + ~UniqueExpireStrategy() = default; void onAdd(const void*, const KeyValueArgs & args) { diff --git a/Foundation/include/Poco/ValidArgs.h b/Foundation/include/Poco/ValidArgs.h index 04afd775a..2e89db75a 100644 --- a/Foundation/include/Poco/ValidArgs.h +++ b/Foundation/include/Poco/ValidArgs.h @@ -40,9 +40,9 @@ public: { } - ~ValidArgs() - { - } + ~ValidArgs() = default; + + ValidArgs &operator=(const ValidArgs& args) = delete; const TKey& key() const { @@ -62,9 +62,6 @@ public: protected: const TKey& _key; bool _isValid; - -private: - ValidArgs& operator = (const ValidArgs& args); }; diff --git a/Foundation/include/Poco/Windows1250Encoding.h b/Foundation/include/Poco/Windows1250Encoding.h index 35a470740..9c3c6c853 100644 --- a/Foundation/include/Poco/Windows1250Encoding.h +++ b/Foundation/include/Poco/Windows1250Encoding.h @@ -31,14 +31,14 @@ class Foundation_API Windows1250Encoding: public TextEncoding { public: Windows1250Encoding(); - ~Windows1250Encoding(); - const char* canonicalName() const; - bool isA(const std::string& encodingName) const; - const CharacterMap& characterMap() const; - int convert(const unsigned char* bytes) const; - int convert(int ch, unsigned char* bytes, int length) const; - int queryConvert(const unsigned char* bytes, int length) const; - int sequenceLength(const unsigned char* bytes, int length) const; + ~Windows1250Encoding() override; + const char* canonicalName() const override; + bool isA(const std::string& encodingName) const override; + const CharacterMap& characterMap() const override; + int convert(const unsigned char* bytes) const override; + int convert(int ch, unsigned char* bytes, int length) const override; + int queryConvert(const unsigned char* bytes, int length) const override; + int sequenceLength(const unsigned char* bytes, int length) const override; private: static const char* _names[]; diff --git a/Foundation/include/Poco/Windows1251Encoding.h b/Foundation/include/Poco/Windows1251Encoding.h index d44ba8d2b..c1915961b 100644 --- a/Foundation/include/Poco/Windows1251Encoding.h +++ b/Foundation/include/Poco/Windows1251Encoding.h @@ -31,14 +31,14 @@ class Foundation_API Windows1251Encoding: public TextEncoding { public: Windows1251Encoding(); - ~Windows1251Encoding(); - const char* canonicalName() const; - bool isA(const std::string& encodingName) const; - const CharacterMap& characterMap() const; - int convert(const unsigned char* bytes) const; - int convert(int ch, unsigned char* bytes, int length) const; - int queryConvert(const unsigned char* bytes, int length) const; - int sequenceLength(const unsigned char* bytes, int length) const; + ~Windows1251Encoding() override; + const char* canonicalName() const override; + bool isA(const std::string& encodingName) const override; + const CharacterMap& characterMap() const override; + int convert(const unsigned char* bytes) const override; + int convert(int ch, unsigned char* bytes, int length) const override; + int queryConvert(const unsigned char* bytes, int length) const override; + int sequenceLength(const unsigned char* bytes, int length) const override; private: static const char* _names[]; diff --git a/Foundation/include/Poco/Windows1252Encoding.h b/Foundation/include/Poco/Windows1252Encoding.h index cd35a29d7..a7ccc1e16 100644 --- a/Foundation/include/Poco/Windows1252Encoding.h +++ b/Foundation/include/Poco/Windows1252Encoding.h @@ -30,14 +30,14 @@ class Foundation_API Windows1252Encoding: public TextEncoding { public: Windows1252Encoding(); - ~Windows1252Encoding(); - const char* canonicalName() const; - bool isA(const std::string& encodingName) const; - const CharacterMap& characterMap() const; - int convert(const unsigned char* bytes) const; - int convert(int ch, unsigned char* bytes, int length) const; - int queryConvert(const unsigned char* bytes, int length) const; - int sequenceLength(const unsigned char* bytes, int length) const; + ~Windows1252Encoding() override; + const char* canonicalName() const override; + bool isA(const std::string& encodingName) const override; + const CharacterMap& characterMap() const override; + int convert(const unsigned char* bytes) const override; + int convert(int ch, unsigned char* bytes, int length) const override; + int queryConvert(const unsigned char* bytes, int length) const override; + int sequenceLength(const unsigned char* bytes, int length) const override; private: static const char* _names[];