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

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

View File

@@ -30,14 +30,14 @@ class Foundation_API ASCIIEncoding: public TextEncoding
{
public:
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[];

View File

@@ -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<void>
/// 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.

View File

@@ -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 TStrategy, class TDelegate, class TMutex>
class AbstractEvent<void, TStrategy, TDelegate, TMutex>
{
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);
};

View File

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

View File

@@ -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 <TKey, TValue>& args)
/// Updates an existing entry.

View File

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

View File

@@ -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;
};

View File

@@ -46,13 +46,10 @@ public:
this->_strategy.pushBack(new AccessExpireStrategy<TKey, TValue>(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;
};

View File

@@ -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 <set>
#include <map>
namespace Poco {
@@ -45,9 +37,7 @@ public:
{
}
~AccessExpireStrategy()
{
}
~AccessExpireStrategy() = default;
void onGet(const void*, const TKey& key)
{

View File

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

View File

@@ -72,9 +72,9 @@ class ActiveMethod
/// class can be used.
{
public:
typedef ResultType (OwnerType::*Callback)(const ArgType&);
typedef ActiveResult<ResultType> ActiveResultType;
typedef ActiveRunnable<ResultType, ArgType, OwnerType> ActiveRunnableType;
using Callback = ResultType (OwnerType::*)(const ArgType &);
using ActiveResultType = ActiveResult<ResultType>;
using ActiveRunnableType = ActiveRunnable<ResultType, ArgType, OwnerType>;
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 <ResultType, void, OwnerType, StarterType>
/// For methods that do not require an argument or a return value, simply use void.
{
public:
typedef ResultType (OwnerType::*Callback)(void);
typedef ActiveResult<ResultType> ActiveResultType;
typedef ActiveRunnable<ResultType, void, OwnerType> ActiveRunnableType;
using Callback = ResultType (OwnerType::*)();
using ActiveResultType = ActiveResult<ResultType>;
using ActiveRunnableType = ActiveRunnable<ResultType, void, OwnerType>;
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;
};

View File

@@ -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<void>: 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<ResultType> ActiveResultHolderType;
using ResultType = RT;
using ActiveResultHolderType = ActiveResultHolder<ResultType>;
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<void>
/// result from the execution thread back to the invocation thread.
{
public:
typedef ActiveResultHolder<void> ActiveResultHolderType;
using ActiveResultHolderType = ActiveResultHolder<void>;
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;
};

View File

@@ -43,8 +43,8 @@ class ActiveRunnable: public ActiveRunnableBase
/// See the ActiveMethod class for more information.
{
public:
typedef ResultType (OwnerType::*Callback)(const ArgType&);
typedef ActiveResult<ResultType> ActiveResultType;
using Callback = ResultType (OwnerType::*)(const ArgType &);
using ActiveResultType = ActiveResult<ResultType>;
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<void, ArgType, OwnerType>: public ActiveRunnableBase
/// See the ActiveMethod class for more information.
{
public:
typedef void (OwnerType::*Callback)(const ArgType&);
typedef ActiveResult<void> ActiveResultType;
using Callback = void (OwnerType::*)(const ArgType &);
using ActiveResultType = ActiveResult<void>;
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<ResultType, void, OwnerType>: public ActiveRunnableBase
/// See the ActiveMethod class for more information.
{
public:
typedef ResultType (OwnerType::*Callback)();
typedef ActiveResult<ResultType> ActiveResultType;
using Callback = ResultType (OwnerType::*)();
using ActiveResultType = ActiveResult<ResultType>;
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<void, void, OwnerType>: public ActiveRunnableBase
/// See the ActiveMethod class for more information.
{
public:
typedef void (OwnerType::*Callback)();
typedef ActiveResult<void> ActiveResultType;
using Callback = void (OwnerType::*)();
using ActiveResultType = ActiveResult<void>;
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

View File

@@ -74,8 +74,8 @@ class Activity: public Runnable
/// };
{
public:
typedef RunnableAdapter<C> RunnableAdapterType;
typedef typename RunnableAdapterType::Callback Callback;
using RunnableAdapterType = RunnableAdapter<C>;
using Callback = typename RunnableAdapterType::Callback;
Activity(C* pOwner, Callback method):
_pOwner(pOwner),
@@ -89,7 +89,7 @@ public:
poco_check_ptr (pOwner);
}
~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<bool> _stopped;

View File

@@ -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,20 +102,16 @@ 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)
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.

View File

@@ -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<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
reverse_iterator rbegin()
{

View File

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

View File

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

View File

@@ -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);

View File

@@ -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.

View File

@@ -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;
};

View File

@@ -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<C*> ObjectList;
using ObjectList = std::list<C *>;
ObjectList _list;
};

View File

@@ -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&);

View File

@@ -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&);

View File

@@ -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&);

View File

@@ -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&);

View File

@@ -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;
};

View File

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

View File

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

View File

@@ -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;

View File

@@ -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)
{

View File

@@ -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())
{

View File

@@ -43,15 +43,15 @@ class BasicBufferedStreamBuf: public std::basic_streambuf<ch, tr>
/// ostream, but not for an iostream.
{
protected:
typedef std::basic_streambuf<ch, tr> Base;
typedef std::basic_ios<ch, tr> 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<ch, tr>;
using IOS = std::basic_ios<ch, tr>;
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&);
};
//

View File

@@ -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);
};

View File

@@ -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&);

View File

@@ -51,11 +51,11 @@ class ClassLoader
/// library.
{
public:
typedef AbstractMetaObject<Base> Meta;
typedef Manifest<Base> Manif;
typedef void (*InitializeLibraryFunc)();
typedef void (*UninitializeLibraryFunc)();
typedef bool (*BuildManifestFunc)(ManifestBase*);
using Meta = AbstractMetaObject<Base>;
using Manif = Manifest<Base>;
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<std::string, LibraryInfo> LibraryMap;
using LibraryMap = std::map<std::string, LibraryInfo>;
class Iterator
/// The ClassLoader's very own iterator class.
{
public:
typedef std::pair<std::string, const Manif*> Pair;
using Pair = std::pair<std::string, const Manif *>;
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.

View File

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

View File

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

View File

@@ -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);
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();

View File

@@ -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.
};

View File

@@ -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:

View File

@@ -34,10 +34,10 @@ public:
DataURIStreamFactory();
/// Creates the DataURIStreamFactory.
~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.

View File

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

View File

@@ -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)
{

View File

@@ -77,7 +77,7 @@ public:
/// Please refer to the zlib documentation of deflateInit2() for a description
/// of the windowBits parameter.
~DeflatingStreamBuf();
~DeflatingStreamBuf() override;
/// Destroys the DeflatingStreamBuf.
int close();
@@ -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,7 +134,7 @@ public:
/// Please refer to the zlib documentation of deflateInit2() for a description
/// of the windowBits parameter.
~DeflatingIOS();
~DeflatingIOS() override;
/// Destroys the DeflatingIOS.
DeflatingStreamBuf* rdbuf();
@@ -169,7 +169,7 @@ public:
/// Please refer to the zlib documentation of deflateInit2() for a description
/// of the windowBits parameter.
~DeflatingOutputStream();
~DeflatingOutputStream() override;
/// Destroys the DeflatingOutputStream.
int close();
@@ -198,7 +198,7 @@ public:
/// Please refer to the zlib documentation of deflateInit2() for a description
/// of the windowBits parameter.
~DeflatingInputStream();
~DeflatingInputStream() override;
/// Destroys the DeflatingInputStream.
};

View File

@@ -32,7 +32,7 @@ template <class TObj, class TArgs, bool withSender = true>
class Delegate: public AbstractDelegate<TArgs>
{
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 TObj, class TArgs>
class Delegate<TObj, TArgs, false>: public AbstractDelegate<TArgs>
{
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 TObj>
class Delegate<TObj,void,true>: public AbstractDelegate<void>
{
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<void>& other) const
bool equals(const AbstractDelegate<void> &other) const override
{
const Delegate* pOtherDelegate = dynamic_cast<const Delegate*>(other.unwrap());
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
}
AbstractDelegate<void>* clone() const
AbstractDelegate<void> *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 TObj>
class Delegate<TObj, void, false>: public AbstractDelegate<void>
{
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<void>& other) const
bool equals(const AbstractDelegate<void> &other) const override
{
const Delegate* pOtherDelegate = dynamic_cast<const Delegate*>(other.unwrap());
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
}
AbstractDelegate<void>* clone() const
{
AbstractDelegate<void> *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();
};

View File

@@ -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();
};

View File

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

View File

@@ -34,12 +34,11 @@ class DynamicFactory
/// A factory that creates objects by class name.
{
public:
typedef AbstractInstantiator<Base> AbstractFactory;
using AbstractFactory = AbstractInstantiator<Base>;
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<std::string, AbstractFactory*> FactoryMap;
using FactoryMap = std::map<std::string, AbstractFactory *>;
FactoryMap _map;
mutable FastMutex _mutex;

View File

@@ -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

View File

@@ -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<std::string, std::string> StringMap;
using StringMap = std::map<std::string, std::string>;
static StringMap _map;
static FastMutex _mutex;

View File

@@ -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<std::string, std::string> StringMap;
using StringMap = std::map<std::string, std::string>;
static StringMap _map;
static FastMutex _mutex;

View File

@@ -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);

View File

@@ -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.
};

View File

@@ -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.

View File

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

View File

@@ -51,6 +51,8 @@ public:
delete _pDelegate;
}
Expire() = delete;
Expire& operator = (const Expire& expire)
{
if (&expire != this)
@@ -101,9 +103,6 @@ protected:
AbstractDelegate<TArgs>* _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<void>& other) const
bool equals(const AbstractDelegate<void>& other) const override
{
return other.equals(*_pDelegate);
}
AbstractDelegate<void>* clone() const
AbstractDelegate<void>* clone() const override
{
return new Expire(*this);
}
void disable()
void disable() override
{
_pDelegate->disable();
}
const AbstractDelegate<void>* unwrap() const
const AbstractDelegate<void>* unwrap() const override
{
return this->_pDelegate;
}
@@ -182,9 +183,6 @@ protected:
AbstractDelegate<void>* _pDelegate;
Timestamp::TimeDiff _expire;
Timestamp _creationTime;
private:
Expire();
};

View File

@@ -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;
};

View File

@@ -46,13 +46,10 @@ public:
this->_strategy.pushBack(new ExpireStrategy<TKey, TValue>(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;
};

View File

@@ -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 <set>
@@ -39,11 +39,11 @@ class ExpireStrategy: public AbstractStrategy<TKey, TValue>
/// An ExpireStrategy implements time based expiration of cache entries
{
public:
typedef std::multimap<Timestamp, TKey> TimeIndex;
typedef typename TimeIndex::iterator IndexIterator;
typedef typename TimeIndex::const_iterator ConstIndexIterator;
typedef std::map<TKey, IndexIterator> Keys;
typedef typename Keys::iterator Iterator;
using TimeIndex = std::multimap<Timestamp, TKey>;
using IndexIterator = typename TimeIndex::iterator;
using ConstIndexIterator = typename TimeIndex::const_iterator;
using Keys = std::map<TKey, IndexIterator>;
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 <TKey, TValue>& args)
{

View File

@@ -49,7 +49,7 @@ class BasicFIFOBuffer
/// is needed.
{
public:
typedef T Type;
using Type = T;
mutable Poco::BasicEvent<bool> 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<T> _buffer;
std::size_t _begin;
std::size_t _used;
@@ -548,8 +546,7 @@ private:
//
// We provide an instantiation for char
//
typedef BasicFIFOBuffer<char> FIFOBuffer;
using FIFOBuffer = BasicFIFOBuffer<char>;
} // namespace Poco

View File

@@ -49,15 +49,15 @@ public:
explicit FIFOBufferStreamBuf(std::size_t length);
/// Creates a FIFOBufferStreamBuf of the given length.
~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,7 +90,7 @@ public:
explicit FIFOIOS(std::size_t length);
/// Creates a FIFOIOS of the given length.
~FIFOIOS();
~FIFOIOS() override;
/// Destroys the FIFOIOS.
///
/// Flushes the buffer.
@@ -125,7 +125,7 @@ public:
explicit FIFOBufferStream(std::size_t length);
/// Creates a FIFOBufferStream of the given length.
~FIFOBufferStream();
~FIFOBufferStream() override;
/// Destroys the FIFOBufferStream.
///
/// Flushes the buffer.

View File

@@ -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;
};

View File

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

View File

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

View File

@@ -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;

View File

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

View File

@@ -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

View File

@@ -56,17 +56,17 @@ public:
Formatter();
/// Creates the formatter.
virtual ~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);
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.
};

View File

@@ -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;

View File

@@ -32,7 +32,7 @@ class FunctionDelegate: public AbstractDelegate<TArgs>
/// 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 TArgs>
class FunctionDelegate<TArgs, true, false>: public AbstractDelegate<TArgs>
{
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 TArgs, bool senderIsConst>
class FunctionDelegate<TArgs, false, senderIsConst>: public AbstractDelegate<TArgs>
{
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<void, true, true>: public AbstractDelegate<void>
/// 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<void>& other) const
bool equals(const AbstractDelegate<void> &other) const override
{
const FunctionDelegate* pOtherDelegate = dynamic_cast<const FunctionDelegate*>(other.unwrap());
return pOtherDelegate && _function == pOtherDelegate->_function;
}
AbstractDelegate<void>* clone() const
AbstractDelegate<void> *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<void, true, false>: public AbstractDelegate<void>
{
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<void>& other) const
bool equals(const AbstractDelegate<void> &other) const override
{
const FunctionDelegate* pOtherDelegate = dynamic_cast<const FunctionDelegate*>(other.unwrap());
return pOtherDelegate && _function == pOtherDelegate->_function;
}
AbstractDelegate<void>* clone() const
AbstractDelegate<void> *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 <bool senderIsConst>
class FunctionDelegate<void, false, senderIsConst>: public AbstractDelegate<void>
{
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<void>& other) const
bool equals(const AbstractDelegate<void> &other) const override
{
const FunctionDelegate* pOtherDelegate = dynamic_cast<const FunctionDelegate*>(other.unwrap());
return pOtherDelegate && _function == pOtherDelegate->_function;
}
AbstractDelegate<void>* clone() const
AbstractDelegate<void> *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();
};

View File

@@ -32,7 +32,7 @@ class FunctionPriorityDelegate: public AbstractPriorityDelegate<TArgs>
/// for use as a PriorityDelegate.
{
public:
typedef void (*NotifyFunction)(const void*, TArgs&);
using NotifyFunction = void (*)(const void *, TArgs &);
FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<TArgs>(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 TArgs>
class FunctionPriorityDelegate<TArgs, true, false>: public AbstractPriorityDelegate<TArgs>
{
public:
typedef void (*NotifyFunction)(void*, TArgs&);
using NotifyFunction = void (*)(void *, TArgs &);
FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<TArgs>(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 TArgs>
class FunctionPriorityDelegate<TArgs, false>: public AbstractPriorityDelegate<TArgs>
{
public:
typedef void (*NotifyFunction)(TArgs&);
using NotifyFunction = void (*)(TArgs &);
FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<TArgs>(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<void, true, true>: public AbstractPriorityDelegat
/// for use as a PriorityDelegate.
{
public:
typedef void (*NotifyFunction)(const void*);
using NotifyFunction = void (*)(const void *);
FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<void>(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<void>& other) const
bool equals(const AbstractDelegate<void>& other) const override
{
const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast<const FunctionPriorityDelegate*>(other.unwrap());
return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function;
}
AbstractDelegate<void>* clone() const
AbstractDelegate<void>* 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<void, true, false>: public AbstractPriorityDelegate<void>
{
public:
typedef void (*NotifyFunction)(void*);
using NotifyFunction = void (*)(void *);
FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<void>(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<void>& other) const
bool equals(const AbstractDelegate<void>& other) const override
{
const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast<const FunctionPriorityDelegate*>(other.unwrap());
return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function;
}
AbstractDelegate<void>* clone() const
AbstractDelegate<void>* 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<void, false>: public AbstractPriorityDelegate<void>
{
public:
typedef void (*NotifyFunction)();
using NotifyFunction = void (*)();
FunctionPriorityDelegate(NotifyFunction function, int prio):
AbstractPriorityDelegate<void>(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<void>& other) const
bool equals(const AbstractDelegate<void>& other) const override
{
const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast<const FunctionPriorityDelegate*>(other.unwrap());
return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _function == pOtherDelegate->_function;
}
AbstractDelegate<void>* clone() const
AbstractDelegate<void>* 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();
};

View File

@@ -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;

View File

@@ -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<ValueType, Hash> HashTable;
using HashTable = LinearHashTable<ValueType, Hash>;
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.

View File

@@ -44,11 +44,11 @@ class POCO_DEPRECATED("use LinearHashTable") HashTable
/// This class is NOT thread safe.
{
public:
typedef std::map<Key, Value> HashEntryMap;
typedef HashEntryMap** HashTableVector;
using HashEntryMap = std::map<Key, Value>;
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),

View File

@@ -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;
};

View File

@@ -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;
};

View File

@@ -66,7 +66,7 @@ public:
/// Please refer to the zlib documentation of inflateInit2() for a description
/// of the windowBits parameter.
~InflatingStreamBuf();
~InflatingStreamBuf() override;
/// Destroys the InflatingStreamBuf.
int close();
@@ -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,7 +127,7 @@ public:
/// Please refer to the zlib documentation of inflateInit2() for a description
/// of the windowBits parameter.
~InflatingIOS();
~InflatingIOS() override;
/// Destroys the InflatingIOS.
InflatingStreamBuf* rdbuf();
@@ -157,7 +157,7 @@ public:
/// Please refer to the zlib documentation of inflateInit2() for a description
/// of the windowBits parameter.
~InflatingOutputStream();
~InflatingOutputStream() override;
/// Destroys the InflatingOutputStream.
int close();
@@ -193,7 +193,7 @@ public:
/// Please refer to the zlib documentation of inflateInit2() for a description
/// of the windowBits parameter.
~InflatingInputStream();
~InflatingInputStream() override;
/// Destroys the InflatingInputStream.
void reset();

View File

@@ -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<Base>
/// constructor.
{
public:
Instantiator()
Instantiator() = default;
/// Creates the Instantiator.
{
}
virtual ~Instantiator()
virtual ~Instantiator() = default;
/// Destroys the Instantiator.
{
}
Base* createInstance() const
{

View File

@@ -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.

View File

@@ -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);
};

View File

@@ -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;
};

View File

@@ -36,12 +36,12 @@ class LRUStrategy: public AbstractStrategy<TKey, TValue>
/// An LRUStrategy implements least recently used cache replacement.
{
public:
typedef std::list<TKey> Keys;
typedef typename Keys::iterator Iterator;
typedef typename Keys::const_iterator ConstIterator;
typedef std::map<TKey, Iterator> KeyIndex;
typedef typename KeyIndex::iterator IndexIterator;
typedef typename KeyIndex::const_iterator ConstIndexIterator;
using Keys = std::list<TKey>;
using Iterator = typename Keys::iterator;
using ConstIterator = typename Keys::const_iterator;
using KeyIndex = std::map<TKey, Iterator>;
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 <TKey, TValue>& args)
{

View File

@@ -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[];

View File

@@ -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[];

View File

@@ -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[];

View File

@@ -56,7 +56,7 @@ public:
/// Creates the LineEndingConverterStreamBuf and connects it
/// to the given output stream.
~LineEndingConverterStreamBuf();
~LineEndingConverterStreamBuf() override;
/// Destroys the LineEndingConverterStream.
void setNewLine(const std::string& newLineCharacters);
@@ -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,7 +102,7 @@ public:
/// Creates the LineEndingConverterIOS and connects it
/// to the given output stream.
~LineEndingConverterIOS();
~LineEndingConverterIOS() override;
/// Destroys the stream.
void setNewLine(const std::string& newLineCharacters);
@@ -148,7 +148,7 @@ public:
/// Creates the LineEndingConverterInputStream and connects it
/// to the given input stream.
~InputLineEndingConverter();
~InputLineEndingConverter() override;
/// Destroys the stream.
};
@@ -170,7 +170,7 @@ public:
/// Creates the LineEndingConverterOutputStream and connects it
/// to the given input stream.
~OutputLineEndingConverter();
~OutputLineEndingConverter() override;
/// Destroys the LineEndingConverterOutputStream.
};

View File

@@ -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)

View File

@@ -40,7 +40,7 @@ public:
LogStreamBuf(Logger& logger, Message::Priority priority, std::size_t bufferCapacity = 0);
/// Creates the LogStream.
~LogStreamBuf();
~LogStreamBuf() override;
/// Destroys the LogStream.
void setPriority(Message::Priority priority);
@@ -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,7 +108,7 @@ public:
/// Creates the LogStream, using the logger identified
/// by loggerName, and sets the priority.
~LogStream();
~LogStream() override;
/// Destroys the LogStream.
LogStream& fatal();

View File

@@ -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<std::string, Ptr> LoggerMap;
using LoggerMap = std::map<std::string, Ptr>;
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<LoggerMap> LoggerMapPtr;
using LoggerMapPtr = std::unique_ptr<LoggerMap>;
Logger();
Logger(const Logger&);

View File

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

View File

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

View File

@@ -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]);

View File

@@ -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]);

View File

@@ -50,8 +50,8 @@ class Manifest: public ManifestBase
/// iterate over all the classes in a Manifest.
{
public:
typedef AbstractMetaObject<B> Meta;
typedef std::map<std::string, const Meta*> MetaMap;
using Meta = AbstractMetaObject<B>;
using MetaMap = std::map<std::string, const Meta *>;
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,12 +100,10 @@ public:
typename MetaMap::const_iterator _it;
};
Manifest()
Manifest() = default;
/// Creates an empty Manifest.
{
}
virtual ~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();
}

View File

@@ -79,7 +79,7 @@ private:
BLOCK_RESERVE = 128
};
typedef std::vector<char*> BlockVec;
using BlockVec = std::vector<char *>;
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<Bucket> BucketVec;
using Bucket = Block *;
using BucketVec = std::vector<Bucket>;
FastMemoryPool(std::size_t blocksPerBucket = POCO_FAST_MEMORY_POOL_PREALLOC, std::size_t bucketPreAlloc = 10, std::size_t maxAlloc = 0):
_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;

View File

@@ -42,13 +42,13 @@ class BasicMemoryStreamBuf: public std::basic_streambuf<ch, tr>
/// ostream, but not for an iostream.
{
protected:
typedef std::basic_streambuf<ch, tr> Base;
typedef std::basic_ios<ch, tr> 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<ch, tr>;
using IOS = std::basic_ios<ch, tr>;
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);
@@ -141,13 +143,13 @@ 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<char, std::char_traits<char>> MemoryStreamBuf;
using MemoryStreamBuf = BasicMemoryStreamBuf<char, std::char_traits<char>>;
class Foundation_API MemoryIOS: public virtual std::ios
/// The base class for MemoryInputStream and MemoryOutputStream.
@@ -191,7 +188,7 @@ public:
MemoryIOS(char* pBuffer, std::streamsize bufferSize);
/// Creates the basic stream.
~MemoryIOS();
~MemoryIOS() override;
/// Destroys the stream.
MemoryStreamBuf* rdbuf();
@@ -210,7 +207,7 @@ public:
/// Creates a MemoryInputStream for the given memory area,
/// ready for reading.
~MemoryInputStream();
~MemoryInputStream() override;
/// Destroys the MemoryInputStream.
};
@@ -223,7 +220,7 @@ public:
/// Creates a MemoryOutputStream for the given memory area,
/// ready for writing.
~MemoryOutputStream();
~MemoryOutputStream() override;
/// Destroys the MemoryInputStream.
std::streamsize charsWritten() const;

View File

@@ -50,6 +50,10 @@ public:
}
}
AbstractMetaObject() = delete;
AbstractMetaObject(const AbstractMetaObject&) = delete;
AbstractMetaObject& operator=(const AbstractMetaObject&) = delete;
const char* name() const
{
return _name;
@@ -110,11 +114,7 @@ public:
}
private:
AbstractMetaObject();
AbstractMetaObject(const AbstractMetaObject&);
AbstractMetaObject& operator = (const AbstractMetaObject&);
typedef std::set<B*> ObjectSet;
using ObjectSet = std::set<B *>;
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
{

View File

@@ -101,40 +101,40 @@ template <typename T>
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 <typename T>
struct TypeWrapper<const T>
{
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 <typename T>
struct TypeWrapper<const T&>
{
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 <typename T>
struct TypeWrapper<T&>
{
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 &;
};

View File

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

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