mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-27 00:35:23 +01:00
merge some changes from develop branch; modernize and clean-up code; remove support for compiling without POCO_WIN32_UTF8
This commit is contained in:
parent
7c177b6f89
commit
1bf40a0cd2
@ -9,7 +9,7 @@
|
||||
|
||||
#include "CppUnit/CppUnit.h"
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
|
||||
|
||||
namespace CppUnit {
|
||||
@ -33,7 +33,7 @@ inline std::string estring(std::string& expandedString)
|
||||
inline std::string estring(int number)
|
||||
{
|
||||
char buffer[50];
|
||||
sprintf(buffer, "%d", number);
|
||||
std::snprintf(buffer, sizeof(buffer), "%d", number);
|
||||
return std::string (buffer);
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ inline std::string estring(int number)
|
||||
inline std::string estring(long number)
|
||||
{
|
||||
char buffer[50];
|
||||
sprintf(buffer, "%ld", number);
|
||||
std::snprintf(buffer, sizeof(buffer), "%ld", number);
|
||||
return std::string (buffer);
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ inline std::string estring(long number)
|
||||
inline std::string estring(double number)
|
||||
{
|
||||
char buffer[50];
|
||||
sprintf(buffer, "%lf", number);
|
||||
std::snprintf(buffer, sizeof(buffer), "%lf", number);
|
||||
return std::string(buffer);
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ inline std::string estring(double number)
|
||||
inline std::string estring(const void* ptr)
|
||||
{
|
||||
char buffer[50];
|
||||
sprintf(buffer, "%p", ptr);
|
||||
std::snprintf(buffer, sizeof(buffer), "%p", ptr);
|
||||
return std::string(buffer);
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
typedef NullType NullData;
|
||||
using NullData = NullType;
|
||||
|
||||
|
||||
namespace Keywords {
|
||||
@ -53,7 +53,7 @@ class Data_API AbstractBinder
|
||||
/// Interface for Binding data types to placeholders.
|
||||
{
|
||||
public:
|
||||
typedef SharedPtr<AbstractBinder> Ptr;
|
||||
using Ptr = SharedPtr<AbstractBinder>;
|
||||
|
||||
enum Direction
|
||||
/// Binding direction for a parameter.
|
||||
|
@ -37,8 +37,8 @@ class Data_API AbstractBinding
|
||||
/// AbstractBinding connects a value with a placeholder via an AbstractBinder interface.
|
||||
{
|
||||
public:
|
||||
typedef SharedPtr<AbstractBinding> Ptr;
|
||||
typedef AbstractBinder::Ptr BinderPtr;
|
||||
using Ptr = SharedPtr<AbstractBinding>;
|
||||
using BinderPtr = AbstractBinder::Ptr;
|
||||
|
||||
enum Direction
|
||||
{
|
||||
@ -100,9 +100,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
typedef std::vector<AbstractBinding::Ptr> AbstractBindingVec;
|
||||
typedef std::deque<AbstractBinding::Ptr> AbstractBindingDeq;
|
||||
typedef std::list<AbstractBinding::Ptr> AbstractBindingLst;
|
||||
using AbstractBindingVec = std::vector<AbstractBinding::Ptr>;
|
||||
using AbstractBindingDeq = std::deque<AbstractBinding::Ptr>;
|
||||
using AbstractBindingLst = std::list<AbstractBinding::Ptr>;
|
||||
|
||||
|
||||
//
|
||||
|
@ -43,9 +43,9 @@ class Data_API AbstractExtraction
|
||||
/// retrieved via an AbstractExtractor.
|
||||
{
|
||||
public:
|
||||
typedef SharedPtr<AbstractExtraction> Ptr;
|
||||
typedef SharedPtr<AbstractExtractor> ExtractorPtr;
|
||||
typedef SharedPtr<AbstractPreparator> PreparatorPtr;
|
||||
using Ptr = SharedPtr<AbstractExtraction>;
|
||||
using ExtractorPtr = SharedPtr<AbstractExtractor>;
|
||||
using PreparatorPtr = SharedPtr<AbstractPreparator>;
|
||||
|
||||
AbstractExtraction(Poco::UInt32 limit = Limit::LIMIT_UNLIMITED,
|
||||
Poco::UInt32 position = 0, bool bulk = false);
|
||||
@ -172,12 +172,12 @@ private:
|
||||
};
|
||||
|
||||
|
||||
typedef std::vector<AbstractExtraction::Ptr> AbstractExtractionVec;
|
||||
typedef std::vector<AbstractExtractionVec> AbstractExtractionVecVec;
|
||||
typedef std::deque<AbstractExtraction::Ptr> AbstractExtractionDeq;
|
||||
typedef std::vector<AbstractExtractionDeq> AbstractExtractionDeqVec;
|
||||
typedef std::list<AbstractExtraction::Ptr> AbstractExtractionLst;
|
||||
typedef std::vector<AbstractExtractionLst> AbstractExtractionLstVec;
|
||||
using AbstractExtractionVec = std::vector<AbstractExtraction::Ptr>;
|
||||
using AbstractExtractionVecVec = std::vector<AbstractExtractionVec>;
|
||||
using AbstractExtractionDeq = std::deque<AbstractExtraction::Ptr>;
|
||||
using AbstractExtractionDeqVec = std::vector<AbstractExtractionDeq>;
|
||||
using AbstractExtractionLst = std::list<AbstractExtraction::Ptr>;
|
||||
using AbstractExtractionLstVec = std::vector<AbstractExtractionLst>;
|
||||
|
||||
|
||||
//
|
||||
|
@ -51,7 +51,7 @@ class Data_API AbstractExtractor
|
||||
/// If an extractor receives null it is not allowed to change val!
|
||||
{
|
||||
public:
|
||||
typedef SharedPtr<AbstractExtractor> Ptr;
|
||||
using Ptr = SharedPtr<AbstractExtractor>;
|
||||
|
||||
AbstractExtractor();
|
||||
/// Creates the AbstractExtractor.
|
||||
|
@ -32,8 +32,8 @@ class Data_API AbstractPreparation
|
||||
/// Interface for calling the appropriate AbstractPreparator method
|
||||
{
|
||||
public:
|
||||
typedef SharedPtr<AbstractPreparation> Ptr;
|
||||
typedef AbstractPreparator::Ptr PreparatorPtr;
|
||||
using Ptr = SharedPtr<AbstractPreparation>;
|
||||
using PreparatorPtr = AbstractPreparator::Ptr;
|
||||
|
||||
AbstractPreparation(PreparatorPtr pPreparator);
|
||||
/// Creates the AbstractPreparation.
|
||||
|
@ -57,7 +57,7 @@ class Data_API AbstractPreparator
|
||||
/// after SQL execution (e.g. SQLite) do not need this functionality at all.
|
||||
{
|
||||
public:
|
||||
typedef SharedPtr<AbstractPreparator> Ptr;
|
||||
using Ptr = SharedPtr<AbstractPreparator>;
|
||||
|
||||
AbstractPreparator(Poco::UInt32 length = 1u);
|
||||
/// Creates the AbstractPreparator.
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
/// Creates the AbstractSessionImpl.
|
||||
///
|
||||
/// Adds "storage" property and sets the default internal storage container
|
||||
/// type to std::deque.
|
||||
/// type to std::vector.
|
||||
/// The storage is created by statements automatically whenever a query
|
||||
/// returning results is executed but external storage is provided by the user.
|
||||
/// Storage type can be reconfigured at runtime both globally (for the
|
||||
@ -296,8 +296,8 @@ private:
|
||||
PropertyGetter getter;
|
||||
};
|
||||
|
||||
typedef std::map<std::string, Feature> FeatureMap;
|
||||
typedef std::map<std::string, Property> PropertyMap;
|
||||
using FeatureMap = std::map<std::string, Feature>;
|
||||
using PropertyMap = std::map<std::string, Property>;
|
||||
|
||||
FeatureMap _features;
|
||||
PropertyMap _properties;
|
||||
|
@ -70,8 +70,8 @@ public:
|
||||
/// Sets the archive threshold.
|
||||
|
||||
protected:
|
||||
typedef Poco::SharedPtr<Session> SessionPtr;
|
||||
typedef Poco::SharedPtr<Statement> StatementPtr;
|
||||
using SessionPtr = Poco::SharedPtr<Session>;
|
||||
using StatementPtr = Poco::SharedPtr<Statement>;
|
||||
|
||||
Session& session();
|
||||
|
||||
|
@ -26,7 +26,7 @@ namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
typedef Transaction AutoTransaction;
|
||||
using AutoTransaction = Transaction;
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
@ -51,10 +51,10 @@ class Binding: public AbstractBinding
|
||||
/// function. An attempt to pass a constant by reference shall result in compile-time error.
|
||||
{
|
||||
public:
|
||||
typedef T ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Binding<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = T;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Binding<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
explicit Binding(T& val,
|
||||
const std::string& name = "",
|
||||
@ -121,10 +121,10 @@ class CopyBinding: public AbstractBinding
|
||||
/// Variables can be passed as either copies or references (i.e. using either use() or bind()).
|
||||
{
|
||||
public:
|
||||
typedef T ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef CopyBinding<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = T;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = CopyBinding<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
explicit CopyBinding(T& val,
|
||||
const std::string& name = "",
|
||||
@ -184,10 +184,10 @@ class Binding<const char*>: public AbstractBinding
|
||||
/// Binding const char* specialization wraps char pointer into string.
|
||||
{
|
||||
public:
|
||||
typedef const char* ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Binding<const char*> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = const char*;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Binding<const char*>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
explicit Binding(const char* pVal,
|
||||
const std::string& name = "",
|
||||
@ -246,10 +246,10 @@ class CopyBinding<const char*>: public AbstractBinding
|
||||
/// Binding const char* specialization wraps char pointer into string.
|
||||
{
|
||||
public:
|
||||
typedef const char* ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef CopyBinding<const char*> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = const char*;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = CopyBinding<const char*>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
explicit CopyBinding(const char* pVal,
|
||||
const std::string& name = "",
|
||||
@ -303,14 +303,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class Binding<std::vector<T> >: public AbstractBinding
|
||||
class Binding<std::vector<T>>: public AbstractBinding
|
||||
/// Specialization for std::vector.
|
||||
{
|
||||
public:
|
||||
typedef std::vector<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<Binding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::vector<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<Binding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit Binding(std::vector<T>& val,
|
||||
const std::string& name = "",
|
||||
@ -369,15 +369,15 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class CopyBinding<std::vector<T> >: public AbstractBinding
|
||||
class CopyBinding<std::vector<T>>: public AbstractBinding
|
||||
/// Specialization for std::vector.
|
||||
{
|
||||
public:
|
||||
|
||||
typedef std::vector<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<CopyBinding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::vector<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<CopyBinding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit CopyBinding(std::vector<T>& val,
|
||||
const std::string& name = "",
|
||||
@ -436,7 +436,7 @@ private:
|
||||
|
||||
|
||||
template <>
|
||||
class Binding<std::vector<bool> >: public AbstractBinding
|
||||
class Binding<std::vector<bool>>: public AbstractBinding
|
||||
/// Specialization for std::vector<bool>.
|
||||
/// This specialization is necessary due to the nature of std::vector<bool>.
|
||||
/// For details, see the standard library implementation of std::vector<bool>
|
||||
@ -451,10 +451,10 @@ class Binding<std::vector<bool> >: public AbstractBinding
|
||||
/// Only IN binding is supported.
|
||||
{
|
||||
public:
|
||||
typedef std::vector<bool> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<Binding<ValType> > Ptr;
|
||||
typedef ValType::const_iterator Iterator;
|
||||
using ValType = std::vector<bool>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<Binding<ValType>>;
|
||||
using Iterator = ValType::const_iterator;
|
||||
|
||||
explicit Binding(const std::vector<bool>& val,
|
||||
const std::string& name = "",
|
||||
@ -500,7 +500,6 @@ public:
|
||||
poco_assert_dbg(canBind());
|
||||
TypeHandler<bool>::bind(pos, *_begin, getBinder(), getDirection());
|
||||
++_begin;
|
||||
|
||||
}
|
||||
|
||||
void reset()
|
||||
@ -518,7 +517,7 @@ private:
|
||||
|
||||
|
||||
template <>
|
||||
class CopyBinding<std::vector<bool> >: public AbstractBinding
|
||||
class CopyBinding<std::vector<bool>>: public AbstractBinding
|
||||
/// Specialization for std::vector<bool>.
|
||||
/// This specialization is necessary due to the nature of std::vector<bool>.
|
||||
/// For details, see the standard library implementation of std::vector<bool>
|
||||
@ -533,10 +532,10 @@ class CopyBinding<std::vector<bool> >: public AbstractBinding
|
||||
/// Only IN binding is supported.
|
||||
{
|
||||
public:
|
||||
typedef std::vector<bool> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<CopyBinding<ValType> > Ptr;
|
||||
typedef ValType::const_iterator Iterator;
|
||||
using ValType = std::vector<bool>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<CopyBinding<ValType>>;
|
||||
using Iterator = ValType::const_iterator;
|
||||
|
||||
explicit CopyBinding(const std::vector<bool>& val,
|
||||
const std::string& name = "",
|
||||
@ -598,14 +597,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class Binding<std::list<T> >: public AbstractBinding
|
||||
class Binding<std::list<T>>: public AbstractBinding
|
||||
/// Specialization for std::list.
|
||||
{
|
||||
public:
|
||||
typedef std::list<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<Binding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::list<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<Binding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit Binding(std::list<T>& val,
|
||||
const std::string& name = "",
|
||||
@ -663,14 +662,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class CopyBinding<std::list<T> >: public AbstractBinding
|
||||
class CopyBinding<std::list<T>>: public AbstractBinding
|
||||
/// Specialization for std::list.
|
||||
{
|
||||
public:
|
||||
typedef typename std::list<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<CopyBinding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = typename std::list<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<CopyBinding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit CopyBinding(ValType& val,
|
||||
const std::string& name = "",
|
||||
@ -728,14 +727,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class Binding<std::deque<T> >: public AbstractBinding
|
||||
class Binding<std::deque<T>>: public AbstractBinding
|
||||
/// Specialization for std::deque.
|
||||
{
|
||||
public:
|
||||
typedef std::deque<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<Binding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::deque<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<Binding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit Binding(std::deque<T>& val,
|
||||
const std::string& name = "",
|
||||
@ -793,14 +792,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class CopyBinding<std::deque<T> >: public AbstractBinding
|
||||
class CopyBinding<std::deque<T>>: public AbstractBinding
|
||||
/// Specialization for std::deque.
|
||||
{
|
||||
public:
|
||||
typedef std::deque<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<CopyBinding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::deque<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<CopyBinding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit CopyBinding(std::deque<T>& val,
|
||||
const std::string& name = "",
|
||||
@ -858,14 +857,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class Binding<std::set<T> >: public AbstractBinding
|
||||
class Binding<std::set<T>>: public AbstractBinding
|
||||
/// Specialization for std::set.
|
||||
{
|
||||
public:
|
||||
typedef std::set<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<Binding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::set<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<Binding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit Binding(std::set<T>& val,
|
||||
const std::string& name = "",
|
||||
@ -923,14 +922,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class CopyBinding<std::set<T> >: public AbstractBinding
|
||||
class CopyBinding<std::set<T>>: public AbstractBinding
|
||||
/// Specialization for std::set.
|
||||
{
|
||||
public:
|
||||
typedef std::set<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<CopyBinding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::set<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<CopyBinding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit CopyBinding(std::set<T>& val,
|
||||
const std::string& name = "",
|
||||
@ -988,14 +987,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class Binding<std::multiset<T> >: public AbstractBinding
|
||||
class Binding<std::multiset<T>>: public AbstractBinding
|
||||
/// Specialization for std::multiset.
|
||||
{
|
||||
public:
|
||||
typedef std::multiset<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<Binding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::multiset<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<Binding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit Binding(std::multiset<T>& val,
|
||||
const std::string& name = "",
|
||||
@ -1053,14 +1052,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class CopyBinding<std::multiset<T> >: public AbstractBinding
|
||||
class CopyBinding<std::multiset<T>>: public AbstractBinding
|
||||
/// Specialization for std::multiset.
|
||||
{
|
||||
public:
|
||||
typedef std::multiset<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<CopyBinding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::multiset<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<CopyBinding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit CopyBinding(std::multiset<T>& val,
|
||||
const std::string& name = "",
|
||||
@ -1118,14 +1117,14 @@ private:
|
||||
|
||||
|
||||
template <class K, class V>
|
||||
class Binding<std::map<K, V> >: public AbstractBinding
|
||||
class Binding<std::map<K, V>>: public AbstractBinding
|
||||
/// Specialization for std::map.
|
||||
{
|
||||
public:
|
||||
typedef std::map<K, V> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<Binding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::map<K, V>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<Binding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit Binding(std::map<K, V>& val,
|
||||
const std::string& name = "",
|
||||
@ -1183,14 +1182,14 @@ private:
|
||||
|
||||
|
||||
template <class K, class V>
|
||||
class CopyBinding<std::map<K, V> >: public AbstractBinding
|
||||
class CopyBinding<std::map<K, V>>: public AbstractBinding
|
||||
/// Specialization for std::map.
|
||||
{
|
||||
public:
|
||||
typedef std::map<K, V> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<CopyBinding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::map<K, V>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<CopyBinding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit CopyBinding(std::map<K, V>& val,
|
||||
const std::string& name = "",
|
||||
@ -1248,14 +1247,14 @@ private:
|
||||
|
||||
|
||||
template <class K, class V>
|
||||
class Binding<std::multimap<K, V> >: public AbstractBinding
|
||||
class Binding<std::multimap<K, V>>: public AbstractBinding
|
||||
/// Specialization for std::multimap.
|
||||
{
|
||||
public:
|
||||
typedef std::multimap<K, V> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<Binding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::multimap<K, V>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<Binding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit Binding(std::multimap<K, V>& val,
|
||||
const std::string& name = "",
|
||||
@ -1313,14 +1312,14 @@ private:
|
||||
|
||||
|
||||
template <class K, class V>
|
||||
class CopyBinding<std::multimap<K, V> >: public AbstractBinding
|
||||
class CopyBinding<std::multimap<K, V>>: public AbstractBinding
|
||||
/// Specialization for std::multimap.
|
||||
{
|
||||
public:
|
||||
typedef std::multimap<K, V> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef SharedPtr<CopyBinding<ValType> > Ptr;
|
||||
typedef typename ValType::const_iterator Iterator;
|
||||
using ValType = std::multimap<K, V>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Ptr = SharedPtr<CopyBinding<ValType>>;
|
||||
using Iterator = typename ValType::const_iterator;
|
||||
|
||||
explicit CopyBinding(std::multimap<K, V>& val,
|
||||
const std::string& name = "",
|
||||
|
@ -95,7 +95,7 @@ template <typename T>
|
||||
AbstractBinding::Ptr use(const std::vector<T>& t, BulkFnType, const std::string& name = "")
|
||||
/// Convenience function for a more compact BulkBinding creation for std::vector.
|
||||
{
|
||||
return new BulkBinding<std::vector<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
return new BulkBinding<std::vector<T>>(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
}
|
||||
|
||||
|
||||
@ -103,7 +103,7 @@ template <typename T>
|
||||
AbstractBinding::Ptr in(const std::vector<T>& t, BulkFnType, const std::string& name = "")
|
||||
/// Convenience function for a more compact BulkBinding creation for std::vector.
|
||||
{
|
||||
return new BulkBinding<std::vector<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
return new BulkBinding<std::vector<T>>(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
}
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ template <typename T>
|
||||
AbstractBinding::Ptr use(const std::deque<T>& t, BulkFnType, const std::string& name = "")
|
||||
/// Convenience function for a more compact BulkBinding creation for std::deque.
|
||||
{
|
||||
return new BulkBinding<std::deque<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
return new BulkBinding<std::deque<T>>(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
}
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ template <typename T>
|
||||
AbstractBinding::Ptr in(const std::deque<T>& t, BulkFnType, const std::string& name = "")
|
||||
/// Convenience function for a more compact BulkBinding creation for std::deque.
|
||||
{
|
||||
return new BulkBinding<std::deque<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
return new BulkBinding<std::deque<T>>(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
}
|
||||
|
||||
|
||||
@ -127,7 +127,7 @@ template <typename T>
|
||||
AbstractBinding::Ptr use(const std::list<T>& t, BulkFnType, const std::string& name = "")
|
||||
/// Convenience function for a more compact BulkBinding creation for std::list.
|
||||
{
|
||||
return new BulkBinding<std::list<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
return new BulkBinding<std::list<T>>(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
}
|
||||
|
||||
|
||||
@ -135,7 +135,7 @@ template <typename T>
|
||||
AbstractBinding::Ptr in(const std::list<T>& t, BulkFnType, const std::string& name = "")
|
||||
/// Convenience function for a more compact BulkBinding creation for std::list.
|
||||
{
|
||||
return new BulkBinding<std::list<T> >(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
return new BulkBinding<std::list<T>>(t, static_cast<Poco::UInt32>(t.size()), name);
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,11 +38,11 @@ class BulkExtraction: public AbstractExtraction
|
||||
/// - std::list
|
||||
{
|
||||
public:
|
||||
typedef C ValType;
|
||||
typedef typename C::value_type CValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef BulkExtraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = C;
|
||||
using CValType = typename C::value_type;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = BulkExtraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
BulkExtraction(C& result, Poco::UInt32 limit, const Position& pos = Position(0)):
|
||||
AbstractExtraction(limit, pos.value(), true),
|
||||
@ -146,11 +146,11 @@ class InternalBulkExtraction: public BulkExtraction<C>
|
||||
/// InternalBulkExtraction objects can not be copied or assigned.
|
||||
{
|
||||
public:
|
||||
typedef C ValType;
|
||||
typedef typename C::value_type CValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef InternalBulkExtraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = C;
|
||||
using CValType = typename C::value_type;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = InternalBulkExtraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
InternalBulkExtraction(C& result,
|
||||
Column<C>* pColumn,
|
||||
@ -212,7 +212,7 @@ AbstractExtraction::Ptr into(std::vector<T>& t, const Bulk& bulk, const Position
|
||||
/// Convenience function to allow for a more compact creation of an extraction object
|
||||
/// with std::vector bulk extraction support.
|
||||
{
|
||||
return new BulkExtraction<std::vector<T> >(t, bulk.size(), pos);
|
||||
return new BulkExtraction<std::vector<T>>(t, bulk.size(), pos);
|
||||
}
|
||||
|
||||
|
||||
@ -223,7 +223,7 @@ AbstractExtraction::Ptr into(std::vector<T>& t, BulkFnType, const Position& pos
|
||||
{
|
||||
Poco::UInt32 size = static_cast<Poco::UInt32>(t.size());
|
||||
if (0 == size) throw InvalidArgumentException("Zero length not allowed.");
|
||||
return new BulkExtraction<std::vector<T> >(t, size, pos);
|
||||
return new BulkExtraction<std::vector<T>>(t, size, pos);
|
||||
}
|
||||
|
||||
|
||||
@ -232,7 +232,7 @@ AbstractExtraction::Ptr into(std::deque<T>& t, const Bulk& bulk, const Position&
|
||||
/// Convenience function to allow for a more compact creation of an extraction object
|
||||
/// with std::deque bulk extraction support.
|
||||
{
|
||||
return new BulkExtraction<std::deque<T> >(t, bulk.size(), pos);
|
||||
return new BulkExtraction<std::deque<T>>(t, bulk.size(), pos);
|
||||
}
|
||||
|
||||
|
||||
@ -243,7 +243,7 @@ AbstractExtraction::Ptr into(std::deque<T>& t, BulkFnType, const Position& pos =
|
||||
{
|
||||
Poco::UInt32 size = static_cast<Poco::UInt32>(t.size());
|
||||
if (0 == size) throw InvalidArgumentException("Zero length not allowed.");
|
||||
return new BulkExtraction<std::deque<T> >(t, size, pos);
|
||||
return new BulkExtraction<std::deque<T>>(t, size, pos);
|
||||
}
|
||||
|
||||
|
||||
@ -252,7 +252,7 @@ AbstractExtraction::Ptr into(std::list<T>& t, const Bulk& bulk, const Position&
|
||||
/// Convenience function to allow for a more compact creation of an extraction object
|
||||
/// with std::list bulk extraction support.
|
||||
{
|
||||
return new BulkExtraction<std::list<T> >(t, bulk.size(), pos);
|
||||
return new BulkExtraction<std::list<T>>(t, bulk.size(), pos);
|
||||
}
|
||||
|
||||
|
||||
@ -263,7 +263,7 @@ AbstractExtraction::Ptr into(std::list<T>& t, BulkFnType, const Position& pos =
|
||||
{
|
||||
Poco::UInt32 size = static_cast<Poco::UInt32>(t.size());
|
||||
if (0 == size) throw InvalidArgumentException("Zero length not allowed.");
|
||||
return new BulkExtraction<std::list<T> >(t, size, pos);
|
||||
return new BulkExtraction<std::list<T>>(t, size, pos);
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,12 +39,12 @@ class Column
|
||||
/// This class owns the data assigned to it and deletes the storage on destruction.
|
||||
{
|
||||
public:
|
||||
typedef C Container;
|
||||
typedef Poco::SharedPtr<C> ContainerPtr;
|
||||
typedef typename C::const_iterator Iterator;
|
||||
typedef typename C::const_reverse_iterator RIterator;
|
||||
typedef typename C::size_type Size;
|
||||
typedef typename C::value_type Type;
|
||||
using Container = C;
|
||||
using ContainerPtr = Poco::SharedPtr<C>;
|
||||
using Iterator = typename C::const_iterator;
|
||||
using RIterator = typename C::const_reverse_iterator;
|
||||
using Size = typename C::size_type;
|
||||
using Type = typename C::value_type;
|
||||
|
||||
Column(const MetaColumn& metaColumn, Container* pData):
|
||||
_metaColumn(metaColumn),
|
||||
@ -62,6 +62,13 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
Column(Column&& col) noexcept:
|
||||
_metaColumn(std::move(col._metaColumn)),
|
||||
_pData(std::move(col._pData))
|
||||
/// Creates the Column.
|
||||
{
|
||||
}
|
||||
|
||||
~Column()
|
||||
/// Destroys the Column.
|
||||
{
|
||||
@ -75,6 +82,14 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
Column& operator = (Column&& col) noexcept
|
||||
/// Assignment operator.
|
||||
{
|
||||
_metaColumn = std::move(col._metaColumn);
|
||||
_pData = std::move(col._pData);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void swap(Column& other)
|
||||
/// Swaps the column with another one.
|
||||
{
|
||||
@ -172,7 +187,7 @@ private:
|
||||
|
||||
|
||||
template <>
|
||||
class Column<std::vector<bool> >
|
||||
class Column<std::vector<bool>>
|
||||
/// The std::vector<bool> specialization for the Column class.
|
||||
///
|
||||
/// This specialization is necessary due to the nature of std::vector<bool>.
|
||||
@ -186,11 +201,11 @@ class Column<std::vector<bool> >
|
||||
/// column data.
|
||||
{
|
||||
public:
|
||||
typedef std::vector<bool> Container;
|
||||
typedef Poco::SharedPtr<Container> ContainerPtr;
|
||||
typedef Container::const_iterator Iterator;
|
||||
typedef Container::const_reverse_iterator RIterator;
|
||||
typedef Container::size_type Size;
|
||||
using Container = std::vector<bool>;
|
||||
using ContainerPtr = Poco::SharedPtr<Container>;
|
||||
using Iterator = Container::const_iterator;
|
||||
using RIterator = Container::const_reverse_iterator;
|
||||
using Size = Container::size_type;
|
||||
|
||||
Column(const MetaColumn& metaColumn, Container* pData):
|
||||
_metaColumn(metaColumn),
|
||||
@ -325,15 +340,15 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class Column<std::list<T> >
|
||||
class Column<std::list<T>>
|
||||
/// Column specialization for std::list
|
||||
{
|
||||
public:
|
||||
typedef std::list<T> Container;
|
||||
typedef Poco::SharedPtr<Container> ContainerPtr;
|
||||
typedef typename Container::const_iterator Iterator;
|
||||
typedef typename Container::const_reverse_iterator RIterator;
|
||||
typedef typename Container::size_type Size;
|
||||
using Container = std::list<T>;
|
||||
using ContainerPtr = Poco::SharedPtr<Container>;
|
||||
using Iterator = typename Container::const_iterator;
|
||||
using RIterator = typename Container::const_reverse_iterator;
|
||||
using Size = typename Container::size_type;
|
||||
|
||||
Column(const MetaColumn& metaColumn, std::list<T>* pData):
|
||||
_metaColumn(metaColumn),
|
||||
|
@ -27,8 +27,8 @@ namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
template <typename T> class LOB;
|
||||
typedef LOB<unsigned char> BLOB;
|
||||
typedef LOB<char> CLOB;
|
||||
using BLOB = LOB<unsigned char>;
|
||||
using CLOB = LOB<char>;
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
@ -42,10 +42,10 @@ class Extraction: public AbstractExtraction
|
||||
/// Concrete Data Type specific extraction of values from a query result set.
|
||||
{
|
||||
public:
|
||||
typedef T ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Extraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = T;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Extraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
Extraction(T& result, const Position& pos = Position(0)):
|
||||
AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
|
||||
@ -129,15 +129,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class Extraction<std::vector<T> >: public AbstractExtraction
|
||||
class Extraction<std::vector<T>>: public AbstractExtraction
|
||||
/// Vector Data Type specialization for extraction of values from a query result set.
|
||||
{
|
||||
public:
|
||||
|
||||
typedef std::vector<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Extraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = std::vector<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Extraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
Extraction(std::vector<T>& result, const Position& pos = Position(0)):
|
||||
AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
|
||||
@ -220,14 +219,14 @@ private:
|
||||
|
||||
|
||||
template <>
|
||||
class Extraction<std::vector<bool> >: public AbstractExtraction
|
||||
class Extraction<std::vector<bool>>: public AbstractExtraction
|
||||
/// Vector bool specialization for extraction of values from a query result set.
|
||||
{
|
||||
public:
|
||||
typedef std::vector<bool> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Extraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = std::vector<bool>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Extraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
Extraction(std::vector<bool>& result, const Position& pos = Position(0)):
|
||||
AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
|
||||
@ -312,14 +311,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class Extraction<std::list<T> >: public AbstractExtraction
|
||||
class Extraction<std::list<T>>: public AbstractExtraction
|
||||
/// List Data Type specialization for extraction of values from a query result set.
|
||||
{
|
||||
public:
|
||||
typedef std::list<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Extraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = std::list<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Extraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
Extraction(std::list<T>& result, const Position& pos = Position(0)):
|
||||
AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
|
||||
@ -402,14 +401,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class Extraction<std::deque<T> >: public AbstractExtraction
|
||||
class Extraction<std::deque<T>>: public AbstractExtraction
|
||||
/// Deque Data Type specialization for extraction of values from a query result set.
|
||||
{
|
||||
public:
|
||||
typedef std::deque<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Extraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = std::deque<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Extraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
Extraction(std::deque<T>& result, const Position& pos = Position(0)):
|
||||
AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
|
||||
@ -504,10 +503,10 @@ class InternalExtraction: public Extraction<C>
|
||||
/// InternalExtraction objects can not be copied or assigned.
|
||||
{
|
||||
public:
|
||||
typedef typename C::value_type ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Extraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = typename C::value_type;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Extraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
|
||||
InternalExtraction(C& result, Column<C>* pColumn, const Position& pos = Position(0)):
|
||||
@ -561,15 +560,15 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class Extraction<std::set<T> >: public AbstractExtraction
|
||||
class Extraction<std::set<T>>: public AbstractExtraction
|
||||
/// Set Data Type specialization for extraction of values from a query result set.
|
||||
{
|
||||
public:
|
||||
typedef std::set<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Extraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
typedef typename ValType::iterator Iterator;
|
||||
using ValType = std::set<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Extraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
using Iterator = typename ValType::iterator;
|
||||
|
||||
Extraction(std::set<T>& result, const Position& pos = Position(0)):
|
||||
AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
|
||||
@ -626,14 +625,14 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class Extraction<std::multiset<T> >: public AbstractExtraction
|
||||
class Extraction<std::multiset<T>>: public AbstractExtraction
|
||||
/// Multiset Data Type specialization for extraction of values from a query result set.
|
||||
{
|
||||
public:
|
||||
typedef std::multiset<T> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Extraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = std::multiset<T>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Extraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
Extraction(std::multiset<T>& result, const Position& pos = Position(0)):
|
||||
AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
|
||||
@ -690,14 +689,14 @@ private:
|
||||
|
||||
|
||||
template <class K, class V>
|
||||
class Extraction<std::map<K, V> >: public AbstractExtraction
|
||||
class Extraction<std::map<K, V>>: public AbstractExtraction
|
||||
/// Map Data Type specialization for extraction of values from a query result set.
|
||||
{
|
||||
public:
|
||||
typedef std::map<K, V> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Extraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = std::map<K, V>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Extraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
Extraction(std::map<K, V>& result, const Position& pos = Position(0)):
|
||||
AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
|
||||
@ -754,14 +753,14 @@ private:
|
||||
|
||||
|
||||
template <class K, class V>
|
||||
class Extraction<std::multimap<K, V> >: public AbstractExtraction
|
||||
class Extraction<std::multimap<K, V>>: public AbstractExtraction
|
||||
/// Multimap Data Type specialization for extraction of values from a query result set.
|
||||
{
|
||||
public:
|
||||
typedef std::multimap<K, V> ValType;
|
||||
typedef SharedPtr<ValType> ValPtr;
|
||||
typedef Extraction<ValType> Type;
|
||||
typedef SharedPtr<Type> Ptr;
|
||||
using ValType = std::multimap<K, V>;
|
||||
using ValPtr = SharedPtr<ValType>;
|
||||
using Type = Extraction<ValType>;
|
||||
using Ptr = SharedPtr<Type>;
|
||||
|
||||
Extraction(std::multimap<K, V>& result, const Position& pos = Position(0)):
|
||||
AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
|
||||
|
@ -41,10 +41,10 @@ class LOB
|
||||
/// a convenient way to access the data in a LOB.
|
||||
{
|
||||
public:
|
||||
typedef typename std::vector<T>::const_iterator Iterator;
|
||||
typedef T ValueType;
|
||||
typedef typename std::vector<T> Container;
|
||||
typedef Poco::SharedPtr<Container> ContentPtr;
|
||||
using Iterator = typename std::vector<T>::const_iterator;
|
||||
using ValueType = T;
|
||||
using Container = std::vector<T>;
|
||||
using ContentPtr = Poco::SharedPtr<Container>;
|
||||
|
||||
LOB(): _pContent(new std::vector<T>())
|
||||
/// Creates an empty LOB.
|
||||
@ -74,6 +74,10 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
LOB(LOB&& other) noexcept: _pContent(std::move(other._pContent))
|
||||
{
|
||||
}
|
||||
|
||||
~LOB()
|
||||
/// Destroys the LOB.
|
||||
{
|
||||
@ -87,6 +91,12 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
LOB& operator = (LOB&& other) noexcept
|
||||
{
|
||||
_pContent = std::move(other._pContent);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator == (const LOB& other) const
|
||||
/// Compares for equality LOB by value.
|
||||
{
|
||||
@ -180,8 +190,8 @@ private:
|
||||
};
|
||||
|
||||
|
||||
typedef LOB<unsigned char> BLOB;
|
||||
typedef LOB<char> CLOB;
|
||||
using BLOB = LOB<unsigned char>;
|
||||
using CLOB = LOB<char>;
|
||||
|
||||
|
||||
//
|
||||
|
@ -30,7 +30,7 @@ namespace Data {
|
||||
|
||||
|
||||
template <typename T>
|
||||
class LOBStreamBuf: public BasicUnbufferedStreamBuf<T, std::char_traits<T> >
|
||||
class LOBStreamBuf: public BasicUnbufferedStreamBuf<T, std::char_traits<T>>
|
||||
/// This is the streambuf class used for reading from and writing to a LOB.
|
||||
{
|
||||
public:
|
||||
@ -46,8 +46,8 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
typedef std::char_traits<T> TraitsType;
|
||||
typedef BasicUnbufferedStreamBuf<T, TraitsType> BaseType;
|
||||
using TraitsType = std::char_traits<T>;
|
||||
using BaseType = BasicUnbufferedStreamBuf<T, TraitsType>;
|
||||
|
||||
typename BaseType::int_type readFromDevice()
|
||||
{
|
||||
@ -101,7 +101,7 @@ protected:
|
||||
|
||||
|
||||
template <typename T>
|
||||
class LOBOutputStream: public LOBIOS<T>, public std::basic_ostream<T, std::char_traits<T> >
|
||||
class LOBOutputStream: public LOBIOS<T>, public std::basic_ostream<T, std::char_traits<T>>
|
||||
/// An output stream for writing to a LOB.
|
||||
{
|
||||
public:
|
||||
@ -120,7 +120,7 @@ public:
|
||||
|
||||
|
||||
template <typename T>
|
||||
class LOBInputStream: public LOBIOS<T>, public std::basic_istream<T, std::char_traits<T> >
|
||||
class LOBInputStream: public LOBIOS<T>, public std::basic_istream<T, std::char_traits<T>>
|
||||
/// An input stream for reading from a LOB.
|
||||
{
|
||||
public:
|
||||
@ -138,11 +138,11 @@ public:
|
||||
};
|
||||
|
||||
|
||||
typedef LOBOutputStream<unsigned char> BLOBOutputStream;
|
||||
typedef LOBOutputStream<char> CLOBOutputStream;
|
||||
using BLOBOutputStream = LOBOutputStream<unsigned char>;
|
||||
using CLOBOutputStream = LOBOutputStream<char>;
|
||||
|
||||
typedef LOBInputStream<unsigned char> BLOBInputStream;
|
||||
typedef LOBInputStream<char> CLOBInputStream;
|
||||
using BLOBInputStream = LOBInputStream<unsigned char>;
|
||||
using CLOBInputStream = LOBInputStream<char>;
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
@ -29,7 +29,7 @@ class Data_API Limit
|
||||
/// Limit stores information how many rows a query should return.
|
||||
{
|
||||
public:
|
||||
typedef Poco::UInt32 SizeT;
|
||||
using SizeT = Poco::UInt32;
|
||||
|
||||
enum Type
|
||||
{
|
||||
|
@ -64,7 +64,22 @@ public:
|
||||
bool nullable = false);
|
||||
/// Creates the MetaColumn.
|
||||
|
||||
virtual ~MetaColumn();
|
||||
MetaColumn(const MetaColumn& other);
|
||||
/// Copy constructor.
|
||||
|
||||
MetaColumn(MetaColumn&& other) noexcept;
|
||||
/// Move constructor.
|
||||
|
||||
MetaColumn& operator = (const MetaColumn& other);
|
||||
/// Assignment operator.
|
||||
|
||||
MetaColumn& operator = (MetaColumn&& other) noexcept;
|
||||
/// Assignment operator.
|
||||
|
||||
void swap(MetaColumn& other);
|
||||
/// Swaps the contents with another instance.
|
||||
|
||||
~MetaColumn();
|
||||
/// Destroys the MetaColumn.
|
||||
|
||||
const std::string& name() const;
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
void setConnectionTimeout(std::size_t timeout);
|
||||
std::size_t getConnectionTimeout() const;
|
||||
bool canTransact() const;
|
||||
bool isTransaction()const ;
|
||||
bool isTransaction() const;
|
||||
void setTransactionIsolation(Poco::UInt32);
|
||||
Poco::UInt32 getTransactionIsolation() const;
|
||||
bool hasTransactionIsolation(Poco::UInt32) const;
|
||||
|
@ -60,7 +60,7 @@ private:
|
||||
|
||||
|
||||
template<typename T>
|
||||
class Preparation<std::vector<T> >: public AbstractPreparation
|
||||
class Preparation<std::vector<T>>: public AbstractPreparation
|
||||
/// Preparation specialization for std::vector.
|
||||
/// This specialization is needed for bulk operations to enforce
|
||||
/// the whole vector preparation, rather than only individual contained values.
|
||||
@ -82,7 +82,7 @@ public:
|
||||
void prepare()
|
||||
/// Prepares data.
|
||||
{
|
||||
TypeHandler<std::vector<T> >::prepare(_pos, _val, preparation());
|
||||
TypeHandler<std::vector<T>>::prepare(_pos, _val, preparation());
|
||||
}
|
||||
|
||||
private:
|
||||
@ -92,7 +92,7 @@ private:
|
||||
|
||||
|
||||
template<typename T>
|
||||
class Preparation<std::deque<T> >: public AbstractPreparation
|
||||
class Preparation<std::deque<T>>: public AbstractPreparation
|
||||
/// Preparation specialization for std::deque.
|
||||
/// This specialization is needed for bulk operations to enforce
|
||||
/// the whole deque preparation, rather than only individual contained values.
|
||||
@ -114,7 +114,7 @@ public:
|
||||
void prepare()
|
||||
/// Prepares data.
|
||||
{
|
||||
TypeHandler<std::deque<T> >::prepare(_pos, _val, preparation());
|
||||
TypeHandler<std::deque<T>>::prepare(_pos, _val, preparation());
|
||||
}
|
||||
|
||||
private:
|
||||
@ -124,7 +124,7 @@ private:
|
||||
|
||||
|
||||
template<typename T>
|
||||
class Preparation<std::list<T> >: public AbstractPreparation
|
||||
class Preparation<std::list<T>>: public AbstractPreparation
|
||||
/// Preparation specialization for std::list.
|
||||
/// This specialization is needed for bulk operations to enforce
|
||||
/// the whole list preparation, rather than only individual contained values.
|
||||
@ -146,7 +146,7 @@ public:
|
||||
void prepare()
|
||||
/// Prepares data.
|
||||
{
|
||||
TypeHandler<std::list<T> >::prepare(_pos, _val, preparation());
|
||||
TypeHandler<std::list<T>>::prepare(_pos, _val, preparation());
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -69,9 +69,9 @@ class Data_API RecordSet: private Statement
|
||||
/// a limit for the Statement.
|
||||
{
|
||||
public:
|
||||
typedef std::map<std::size_t, Row*> RowMap;
|
||||
typedef const RowIterator ConstIterator;
|
||||
typedef RowIterator Iterator;
|
||||
using RowMap = std::map<std::size_t, Row*>;
|
||||
using ConstIterator = const RowIterator;
|
||||
using Iterator = RowIterator;
|
||||
|
||||
using Statement::isNull;
|
||||
using Statement::subTotalRowCount;
|
||||
@ -107,15 +107,24 @@ public:
|
||||
RecordSet(const RecordSet& other);
|
||||
/// Copy-creates the recordset.
|
||||
|
||||
RecordSet(RecordSet&& other) noexcept;
|
||||
/// Move-creates the recordset.
|
||||
|
||||
~RecordSet();
|
||||
/// Destroys the RecordSet.
|
||||
|
||||
void setRowFormatter(RowFormatter::Ptr pRowFormatter);
|
||||
/// Assigns the row formatter to the statement and all recordset rows.
|
||||
|
||||
Statement& operator = (const Statement& stmt);
|
||||
RecordSet& operator = (const Statement& stmt);
|
||||
/// Assignment operator.
|
||||
|
||||
RecordSet& operator = (const RecordSet& other);
|
||||
/// Assignment operator.
|
||||
|
||||
RecordSet& operator = (RecordSet&& other) noexcept;
|
||||
/// Move assignment.
|
||||
|
||||
std::size_t rowCount() const;
|
||||
/// Returns the number of rows in the RecordSet.
|
||||
/// The number of rows reported is dependent on filtering.
|
||||
@ -159,12 +168,12 @@ public:
|
||||
{
|
||||
if (isBulkExtraction())
|
||||
{
|
||||
typedef InternalBulkExtraction<C> E;
|
||||
using E = InternalBulkExtraction<C>;
|
||||
return columnImpl<C,E>(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef InternalExtraction<C> E;
|
||||
using E = InternalExtraction<C>;
|
||||
return columnImpl<C,E>(name);
|
||||
}
|
||||
}
|
||||
@ -175,12 +184,12 @@ public:
|
||||
{
|
||||
if (isBulkExtraction())
|
||||
{
|
||||
typedef InternalBulkExtraction<C> E;
|
||||
using E = InternalBulkExtraction<C>;
|
||||
return columnImpl<C,E>(pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef InternalExtraction<C> E;
|
||||
using E = InternalExtraction<C>;
|
||||
return columnImpl<C,E>(pos);
|
||||
}
|
||||
}
|
||||
@ -200,18 +209,18 @@ public:
|
||||
{
|
||||
case STORAGE_VECTOR:
|
||||
{
|
||||
typedef typename std::vector<T> C;
|
||||
using C = typename std::vector<T>;
|
||||
return column<C>(col).value(row);
|
||||
}
|
||||
case STORAGE_LIST:
|
||||
{
|
||||
typedef typename std::list<T> C;
|
||||
using C = typename std::list<T>;
|
||||
return column<C>(col).value(row);
|
||||
}
|
||||
case STORAGE_DEQUE:
|
||||
case STORAGE_UNKNOWN:
|
||||
{
|
||||
typedef typename std::deque<T> C;
|
||||
using C = typename std::deque<T>;
|
||||
return column<C>(col).value(row);
|
||||
}
|
||||
default:
|
||||
@ -230,18 +239,18 @@ public:
|
||||
{
|
||||
case STORAGE_VECTOR:
|
||||
{
|
||||
typedef typename std::vector<T> C;
|
||||
using C = typename std::vector<T>;
|
||||
return column<C>(name).value(row);
|
||||
}
|
||||
case STORAGE_LIST:
|
||||
{
|
||||
typedef typename std::list<T> C;
|
||||
using C = typename std::list<T>;
|
||||
return column<C>(name).value(row);
|
||||
}
|
||||
case STORAGE_DEQUE:
|
||||
case STORAGE_UNKNOWN:
|
||||
{
|
||||
typedef typename std::deque<T> C;
|
||||
using C = typename std::deque<T>;
|
||||
return column<C>(name).value(row);
|
||||
}
|
||||
default:
|
||||
@ -404,8 +413,8 @@ private:
|
||||
std::size_t columnPosition(const std::string& name) const
|
||||
/// Returns the position of the column with specified name.
|
||||
{
|
||||
typedef typename C::value_type T;
|
||||
typedef const E* ExtractionVecPtr;
|
||||
using T = typename C::value_type;
|
||||
using ExtractionVecPtr = const E*;
|
||||
|
||||
bool typeFound = false;
|
||||
|
||||
@ -443,8 +452,8 @@ private:
|
||||
const Column<C>& columnImpl(std::size_t pos) const
|
||||
/// Returns the reference to column at specified position.
|
||||
{
|
||||
typedef typename C::value_type T;
|
||||
typedef const E* ExtractionVecPtr;
|
||||
using T = typename C::value_type;
|
||||
using ExtractionVecPtr = const E*;
|
||||
|
||||
const AbstractExtractionVec& rExtractions = extractions();
|
||||
|
||||
@ -532,13 +541,20 @@ inline std::size_t RecordSet::columnCount() const
|
||||
}
|
||||
|
||||
|
||||
inline Statement& RecordSet::operator = (const Statement& stmt)
|
||||
inline RecordSet& RecordSet::operator = (const Statement& stmt)
|
||||
{
|
||||
reset(stmt);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline RecordSet& RecordSet::operator = (const RecordSet& other)
|
||||
{
|
||||
reset(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline Poco::Dynamic::Var RecordSet::value(const std::string& name)
|
||||
{
|
||||
return value(name, _currentRow);
|
||||
|
@ -57,9 +57,9 @@ class Data_API Row
|
||||
/// The stream operator is provided for Row data type as a free-standing function.
|
||||
{
|
||||
public:
|
||||
typedef RowFormatter::NameVec NameVec;
|
||||
typedef RowFormatter::NameVecPtr NameVecPtr;
|
||||
typedef RowFormatter::ValueVec ValueVec;
|
||||
using NameVec = RowFormatter::NameVec;
|
||||
using NameVecPtr = RowFormatter::NameVecPtr;
|
||||
using ValueVec = RowFormatter::ValueVec;
|
||||
|
||||
enum ComparisonType
|
||||
{
|
||||
@ -69,14 +69,14 @@ public:
|
||||
COMPARE_AS_STRING
|
||||
};
|
||||
|
||||
typedef Tuple<std::size_t, ComparisonType> SortTuple;
|
||||
typedef std::vector<SortTuple> SortMap;
|
||||
using SortTuple = Tuple<std::size_t, ComparisonType>;
|
||||
using SortMap = std::vector<SortTuple>;
|
||||
/// The type for map holding fields used for sorting criteria.
|
||||
/// Fields are added sequentially and have precedence that
|
||||
/// corresponds to field adding sequence order (rather than field's
|
||||
/// position in the row).
|
||||
/// This requirement rules out use of std::map due to its sorted nature.
|
||||
typedef SharedPtr<SortMap> SortMapPtr;
|
||||
using SortMapPtr = SharedPtr<SortMap>;
|
||||
|
||||
Row();
|
||||
/// Creates the Row.
|
||||
|
@ -68,11 +68,11 @@ public:
|
||||
};
|
||||
|
||||
typedef bool (*CompT)(const Poco::Dynamic::Var&, const Poco::Dynamic::Var&);
|
||||
typedef AutoPtr<RowFilter> Ptr;
|
||||
typedef std::map<std::string, Comparison> Comparisons;
|
||||
typedef Tuple<Poco::Dynamic::Var, Comparison, LogicOperator> ComparisonEntry;
|
||||
typedef std::multimap<std::string, ComparisonEntry> ComparisonMap;
|
||||
typedef std::map<AutoPtr<RowFilter>, LogicOperator> FilterMap;
|
||||
using Ptr = AutoPtr<RowFilter>;
|
||||
using Comparisons = std::map<std::string, Comparison>;
|
||||
using ComparisonEntry = Tuple<Poco::Dynamic::Var, Comparison, LogicOperator>;
|
||||
using ComparisonMap = std::multimap<std::string, ComparisonEntry>;
|
||||
using FilterMap = std::map<AutoPtr<RowFilter>, LogicOperator>;
|
||||
|
||||
RowFilter(RecordSet* pRecordSet);
|
||||
/// Creates the top-level RowFilter and associates it with the recordset.
|
||||
|
@ -68,10 +68,10 @@ class Data_API RowFormatter
|
||||
///
|
||||
{
|
||||
public:
|
||||
typedef SharedPtr<RowFormatter> Ptr;
|
||||
typedef std::vector<std::string> NameVec;
|
||||
typedef SharedPtr<std::vector<std::string> > NameVecPtr;
|
||||
typedef std::vector<Poco::Dynamic::Var> ValueVec;
|
||||
using Ptr = SharedPtr<RowFormatter>;
|
||||
using NameVec = std::vector<std::string>;
|
||||
using NameVecPtr = SharedPtr<std::vector<std::string>>;
|
||||
using ValueVec = std::vector<Poco::Dynamic::Var>;
|
||||
|
||||
static const int INVALID_ROW_COUNT = -1;
|
||||
|
||||
|
@ -36,11 +36,11 @@ class Data_API RowIterator
|
||||
/// RowIterator class.
|
||||
{
|
||||
public:
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
typedef Row value_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef Row* pointer;
|
||||
typedef Row& reference;
|
||||
using iterator_category = std::bidirectional_iterator_tag;
|
||||
using value_type = Row;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using pointer = Row*;
|
||||
using reference = Row&;
|
||||
|
||||
static const std::size_t POSITION_END;
|
||||
/// End position indicator.
|
||||
@ -53,12 +53,18 @@ public:
|
||||
RowIterator(const RowIterator& other);
|
||||
/// Creates a copy of other RowIterator.
|
||||
|
||||
RowIterator(RowIterator&& other) noexcept;
|
||||
/// Move constructor.
|
||||
|
||||
~RowIterator();
|
||||
/// Destroys the RowIterator.
|
||||
|
||||
RowIterator& operator = (const RowIterator& other);
|
||||
/// Assigns the other RowIterator.
|
||||
|
||||
RowIterator& operator = (RowIterator&& other) noexcept;
|
||||
/// Move assignment.
|
||||
|
||||
bool operator == (const RowIterator& other) const;
|
||||
/// Equality operator.
|
||||
|
||||
|
@ -61,6 +61,8 @@ class Data_API SQLChannel: public Poco::Channel
|
||||
/// a risk of long blocking periods in case of remote server communication delays.
|
||||
{
|
||||
public:
|
||||
using Ptr = Poco::AutoPtr<SQLChannel>;
|
||||
|
||||
SQLChannel();
|
||||
/// Creates SQLChannel.
|
||||
|
||||
@ -140,10 +142,10 @@ protected:
|
||||
~SQLChannel();
|
||||
|
||||
private:
|
||||
typedef Poco::SharedPtr<Session> SessionPtr;
|
||||
typedef Poco::SharedPtr<Statement> StatementPtr;
|
||||
typedef Poco::Message::Priority Priority;
|
||||
typedef Poco::SharedPtr<ArchiveStrategy> StrategyPtr;
|
||||
using SessionPtr = Poco::SharedPtr<Session>;
|
||||
using StatementPtr = Poco::SharedPtr<Statement>;
|
||||
using Priority = Poco::Message::Priority;
|
||||
using StrategyPtr = Poco::SharedPtr<ArchiveStrategy>;
|
||||
|
||||
void initLogStatement();
|
||||
/// Initiallizes the log statement.
|
||||
|
@ -176,9 +176,15 @@ public:
|
||||
Session(const Session&);
|
||||
/// Creates a session by copying another one.
|
||||
|
||||
Session(Session&&) noexcept;
|
||||
/// Creates a session by moving another one.
|
||||
|
||||
Session& operator = (const Session&);
|
||||
/// Assignment operator.
|
||||
|
||||
Session& operator = (Session&&) noexcept;
|
||||
/// Move assignment.
|
||||
|
||||
~Session();
|
||||
/// Destroys the Session.
|
||||
|
||||
|
@ -39,7 +39,7 @@ class Data_API SessionImpl: public Poco::RefCountedObject
|
||||
/// SessionImpl objects are noncopyable.
|
||||
{
|
||||
public:
|
||||
typedef Poco::AutoPtr<SessionImpl> Ptr;
|
||||
using Ptr = Poco::AutoPtr<SessionImpl>;
|
||||
|
||||
static const std::size_t LOGIN_TIMEOUT_INFINITE = 0;
|
||||
/// Infinite connection/login timeout.
|
||||
|
@ -30,9 +30,9 @@ class Data_API SimpleRowFormatter: public RowFormatter
|
||||
/// A simple row formatting class.
|
||||
{
|
||||
public:
|
||||
//typedef RowFormatter::NameVec NameVec;
|
||||
//typedef RowFormatter::NameVecPtr NameVecPtr;
|
||||
//typedef RowFormatter::ValueVec ValueVec;
|
||||
//using NameVec = RowFormatter::NameVec;
|
||||
//using NameVecPtr = RowFormatter::NameVecPtr;
|
||||
//using ValueVec = RowFormatter::ValueVec;
|
||||
|
||||
static const int DEFAULT_COLUMN_WIDTH = 16;
|
||||
static const int DEFAULT_SPACING = 1;
|
||||
|
@ -74,10 +74,10 @@ class Data_API Statement
|
||||
public:
|
||||
typedef void (*Manipulator)(Statement&);
|
||||
|
||||
typedef ActiveResult<std::size_t> Result;
|
||||
typedef SharedPtr<Result> ResultPtr;
|
||||
typedef ActiveMethod<std::size_t, bool, StatementImpl> AsyncExecMethod;
|
||||
typedef SharedPtr<AsyncExecMethod> AsyncExecMethodPtr;
|
||||
using Result = ActiveResult<std::size_t>;
|
||||
using ResultPtr = SharedPtr<Result>;
|
||||
using AsyncExecMethod = ActiveMethod<std::size_t, bool, StatementImpl>;
|
||||
using AsyncExecMethodPtr = SharedPtr<AsyncExecMethod>;
|
||||
|
||||
static const int WAIT_FOREVER = -1;
|
||||
|
||||
@ -115,9 +115,15 @@ public:
|
||||
/// synchronized prior to copy operation (i.e. is copied while executing),
|
||||
/// this constructor shall synchronize it.
|
||||
|
||||
Statement(Statement&& other) noexcept;
|
||||
/// Move constructor.
|
||||
|
||||
Statement& operator = (const Statement& stmt);
|
||||
/// Assignment operator.
|
||||
|
||||
Statement& operator = (Statement&& stmt) noexcept;
|
||||
/// Move assignment.
|
||||
|
||||
void swap(Statement& other);
|
||||
/// Swaps the statement with another one.
|
||||
|
||||
@ -379,7 +385,7 @@ public:
|
||||
/// Statement takes the ownership of the formatter.
|
||||
|
||||
protected:
|
||||
typedef StatementImpl::Ptr ImplPtr;
|
||||
using ImplPtr = StatementImpl::Ptr;
|
||||
|
||||
const AbstractExtractionVec& extractions() const;
|
||||
/// Returns the extractions vector.
|
||||
@ -406,7 +412,6 @@ protected:
|
||||
/// Returns the underlying session.
|
||||
|
||||
private:
|
||||
|
||||
const Result& doAsyncExec(bool reset = true);
|
||||
/// Asynchronously executes the statement.
|
||||
|
||||
|
@ -41,11 +41,17 @@ public:
|
||||
StatementCreator(const StatementCreator& other);
|
||||
/// Creates a StatementCreator by copying another one.
|
||||
|
||||
StatementCreator(StatementCreator&& other) noexcept;
|
||||
/// Creates a StatementCreator by moving another one.
|
||||
|
||||
~StatementCreator();
|
||||
/// Destroys the StatementCreator.
|
||||
|
||||
StatementCreator& operator = (const StatementCreator& other);
|
||||
/// Assignment operator.
|
||||
|
||||
StatementCreator& operator = (StatementCreator&& other) noexcept;
|
||||
/// Assignment operator.
|
||||
|
||||
void swap(StatementCreator& other);
|
||||
/// Swaps the StatementCreator with another one.
|
||||
|
@ -48,7 +48,7 @@ class Data_API StatementImpl
|
||||
/// StatementImpl's are noncopyable.
|
||||
{
|
||||
public:
|
||||
typedef Poco::SharedPtr<StatementImpl> Ptr;
|
||||
using Ptr = Poco::SharedPtr<StatementImpl>;
|
||||
|
||||
enum State
|
||||
{
|
||||
@ -243,11 +243,11 @@ protected:
|
||||
/// session is queried for container type setting. If the
|
||||
/// session container type setting is found, it is used.
|
||||
/// 3. If neither session nor statement have the internal
|
||||
/// container type set, std::deque is used.
|
||||
/// container type set, std::vector is used.
|
||||
///
|
||||
/// Supported internal extraction container types are:
|
||||
/// - std::deque (default)
|
||||
/// - std::vector
|
||||
/// - std::vector (default)
|
||||
/// - std::deque
|
||||
/// - std::list
|
||||
|
||||
SessionImpl& session();
|
||||
@ -317,7 +317,7 @@ private:
|
||||
/// Resets extraction so it can be reused again.
|
||||
|
||||
template <class C>
|
||||
SharedPtr<InternalExtraction<C> > createExtract(const MetaColumn& mc)
|
||||
SharedPtr<InternalExtraction<C>> createExtract(const MetaColumn& mc)
|
||||
{
|
||||
C* pData = new C;
|
||||
Column<C>* pCol = new Column<C>(mc, pData);
|
||||
@ -325,7 +325,7 @@ private:
|
||||
}
|
||||
|
||||
template <class C>
|
||||
SharedPtr<InternalBulkExtraction<C> > createBulkExtract(const MetaColumn& mc)
|
||||
SharedPtr<InternalBulkExtraction<C>> createBulkExtract(const MetaColumn& mc)
|
||||
{
|
||||
C* pData = new C;
|
||||
Column<C>* pCol = new Column<C>(mc, pData);
|
||||
@ -346,7 +346,7 @@ private:
|
||||
/// overrides the session setting for storage, otherwise the
|
||||
/// session setting is used.
|
||||
/// If neither this statement nor the session have the storage
|
||||
/// type set, std::deque is the default container type used.
|
||||
/// type set, std::vector is the default container type used.
|
||||
{
|
||||
std::string storage;
|
||||
|
||||
@ -368,23 +368,23 @@ private:
|
||||
if (0 == icompare(DEQUE, storage))
|
||||
{
|
||||
if (!isBulkExtraction())
|
||||
addExtract(createExtract<std::deque<T> >(mc));
|
||||
addExtract(createExtract<std::deque<T>>(mc));
|
||||
else
|
||||
addExtract(createBulkExtract<std::deque<T> >(mc));
|
||||
addExtract(createBulkExtract<std::deque<T>>(mc));
|
||||
}
|
||||
else if (0 == icompare(VECTOR, storage))
|
||||
{
|
||||
if (!isBulkExtraction())
|
||||
addExtract(createExtract<std::vector<T> >(mc));
|
||||
addExtract(createExtract<std::vector<T>>(mc));
|
||||
else
|
||||
addExtract(createBulkExtract<std::vector<T> >(mc));
|
||||
addExtract(createBulkExtract<std::vector<T>>(mc));
|
||||
}
|
||||
else if (0 == icompare(LIST, storage))
|
||||
{
|
||||
if (!isBulkExtraction())
|
||||
addExtract(createExtract<std::list<T> >(mc));
|
||||
addExtract(createExtract<std::list<T>>(mc));
|
||||
else
|
||||
addExtract(createBulkExtract<std::list<T> >(mc));
|
||||
addExtract(createBulkExtract<std::list<T>>(mc));
|
||||
}
|
||||
}
|
||||
|
||||
@ -430,7 +430,7 @@ private:
|
||||
StatementImpl(const StatementImpl& stmt);
|
||||
StatementImpl& operator = (const StatementImpl& stmt);
|
||||
|
||||
typedef std::vector<std::size_t> CountVec;
|
||||
using CountVec = std::vector<std::size_t>;
|
||||
|
||||
State _state;
|
||||
Limit _extrLimit;
|
||||
|
@ -145,7 +145,7 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class TypeHandler<std::deque<T> >: public AbstractTypeHandler
|
||||
class TypeHandler<std::deque<T>>: public AbstractTypeHandler
|
||||
/// Specialization of type handler for std::deque.
|
||||
{
|
||||
public:
|
||||
@ -180,7 +180,7 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class TypeHandler<std::vector<T> >: public AbstractTypeHandler
|
||||
class TypeHandler<std::vector<T>>: public AbstractTypeHandler
|
||||
/// Specialization of type handler for std::vector.
|
||||
{
|
||||
public:
|
||||
@ -215,7 +215,7 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class TypeHandler<std::list<T> >: public AbstractTypeHandler
|
||||
class TypeHandler<std::list<T>>: public AbstractTypeHandler
|
||||
/// Specialization of type handler for std::list.
|
||||
{
|
||||
public:
|
||||
@ -249,7 +249,7 @@ private:
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class TypeHandler<Nullable<T> >
|
||||
class TypeHandler<Nullable<T>>
|
||||
/// Specialization of type handler for Nullable.
|
||||
{
|
||||
public:
|
||||
@ -363,11 +363,11 @@ template <class T0,
|
||||
class T17,
|
||||
class T18,
|
||||
class T19>
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19> >
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -493,11 +493,11 @@ template <class T0,
|
||||
class T16,
|
||||
class T17,
|
||||
class T18>
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18> >
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -618,11 +618,11 @@ template <class T0,
|
||||
class T15,
|
||||
class T16,
|
||||
class T17>
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17> >
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -738,11 +738,11 @@ template <class T0,
|
||||
class T14,
|
||||
class T15,
|
||||
class T16>
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16> >
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -853,11 +853,11 @@ template <class T0,
|
||||
class T13,
|
||||
class T14,
|
||||
class T15>
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15> >
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -963,11 +963,11 @@ template <class T0,
|
||||
class T12,
|
||||
class T13,
|
||||
class T14>
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> >
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1068,11 +1068,11 @@ template <class T0,
|
||||
class T11,
|
||||
class T12,
|
||||
class T13>
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13> >
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1168,11 +1168,11 @@ template <class T0,
|
||||
class T10,
|
||||
class T11,
|
||||
class T12>
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12> >
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1263,11 +1263,11 @@ template <class T0,
|
||||
class T9,
|
||||
class T10,
|
||||
class T11>
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11> >
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1353,11 +1353,11 @@ template <class T0,
|
||||
class T8,
|
||||
class T9,
|
||||
class T10>
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> >
|
||||
class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1429,11 +1429,11 @@ private:
|
||||
|
||||
|
||||
template <class T0, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1501,11 +1501,11 @@ private:
|
||||
|
||||
|
||||
template <class T0, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, NullTypeList> >
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, NullTypeList>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, NullTypeList> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, NullTypeList> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, NullTypeList>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, NullTypeList>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1569,11 +1569,11 @@ private:
|
||||
|
||||
|
||||
template <class T0, class T1, class T2, class T3, class T4, class T5, class T6, class T7>
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, NullTypeList> >
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, NullTypeList>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, NullTypeList> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, NullTypeList> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, NullTypeList>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, NullTypeList>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1633,11 +1633,11 @@ private:
|
||||
|
||||
|
||||
template <class T0, class T1, class T2, class T3, class T4, class T5, class T6>
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, NullTypeList> >
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, NullTypeList>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, NullTypeList> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, NullTypeList> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, NullTypeList>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, NullTypeList>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1693,11 +1693,11 @@ private:
|
||||
|
||||
|
||||
template <class T0, class T1, class T2, class T3, class T4, class T5>
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, NullTypeList> >
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, NullTypeList>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, NullTypeList> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, NullTypeList> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, NullTypeList>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, T5, NullTypeList>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1749,11 +1749,11 @@ private:
|
||||
|
||||
|
||||
template <class T0, class T1, class T2, class T3, class T4>
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, NullTypeList> >
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, NullTypeList>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, NullTypeList> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, NullTypeList> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, NullTypeList>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, T4, NullTypeList>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1801,11 +1801,11 @@ private:
|
||||
|
||||
|
||||
template <class T0, class T1, class T2, class T3>
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, NullTypeList> >
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, T3, NullTypeList>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, NullTypeList> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, NullTypeList> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, NullTypeList>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, T3, NullTypeList>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1849,11 +1849,11 @@ private:
|
||||
|
||||
|
||||
template <class T0, class T1, class T2>
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, NullTypeList> >
|
||||
class TypeHandler<Poco::Tuple<T0, T1, T2, NullTypeList>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, NullTypeList> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, NullTypeList> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, NullTypeList>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, T2, NullTypeList>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1893,11 +1893,11 @@ private:
|
||||
|
||||
|
||||
template <class T0, class T1>
|
||||
class TypeHandler<Poco::Tuple<T0, T1, NullTypeList> >
|
||||
class TypeHandler<Poco::Tuple<T0, T1, NullTypeList>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, NullTypeList> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, T1, NullTypeList> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, NullTypeList>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0, T1, NullTypeList>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1933,11 +1933,11 @@ private:
|
||||
|
||||
|
||||
template <class T0>
|
||||
class TypeHandler<Poco::Tuple<T0, NullTypeList> >
|
||||
class TypeHandler<Poco::Tuple<T0, NullTypeList>>
|
||||
{
|
||||
public:
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, NullTypeList> >::CONSTREFTYPE TupleConstRef;
|
||||
typedef typename Poco::TypeWrapper<Poco::Tuple<T0, NullTypeList> >::REFTYPE TupleRef;
|
||||
using TupleConstRef = typename Poco::TypeWrapper<Poco::Tuple<T0, NullTypeList>>::CONSTREFTYPE;
|
||||
using TupleRef = typename Poco::TypeWrapper<Poco::Tuple<T0, NullTypeList>>::REFTYPE;
|
||||
|
||||
static void bind(std::size_t pos, TupleConstRef tuple, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
@ -1970,7 +1970,7 @@ private:
|
||||
|
||||
|
||||
template <class K, class V>
|
||||
class TypeHandler<std::pair<K, V> >: public AbstractTypeHandler
|
||||
class TypeHandler<std::pair<K, V>>: public AbstractTypeHandler
|
||||
{
|
||||
public:
|
||||
static void bind(std::size_t pos, const std::pair<K, V>& obj, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
@ -2006,7 +2006,7 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class TypeHandler<Poco::AutoPtr<T> >: public AbstractTypeHandler
|
||||
class TypeHandler<Poco::AutoPtr<T>>: public AbstractTypeHandler
|
||||
/// Specialization of type handler for Poco::AutoPtr
|
||||
{
|
||||
public:
|
||||
@ -2046,7 +2046,7 @@ private:
|
||||
|
||||
|
||||
template <class T>
|
||||
class TypeHandler<Poco::SharedPtr<T> >: public AbstractTypeHandler
|
||||
class TypeHandler<Poco::SharedPtr<T>>: public AbstractTypeHandler
|
||||
/// Specialization of type handler for Poco::SharedPtr
|
||||
{
|
||||
public:
|
||||
|
@ -45,9 +45,61 @@ MetaColumn::MetaColumn(std::size_t position,
|
||||
}
|
||||
|
||||
|
||||
MetaColumn::MetaColumn(const MetaColumn& other):
|
||||
_name(other._name),
|
||||
_length(other._length),
|
||||
_precision(other._precision),
|
||||
_position(other._position),
|
||||
_type(other._type),
|
||||
_nullable(other._nullable)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
MetaColumn::MetaColumn(MetaColumn&& other) noexcept:
|
||||
_name(std::move(other._name)),
|
||||
_length(other._length),
|
||||
_precision(other._precision),
|
||||
_position(other._position),
|
||||
_type(other._type),
|
||||
_nullable(other._nullable)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
MetaColumn::~MetaColumn()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
MetaColumn& MetaColumn::operator = (const MetaColumn& other)
|
||||
{
|
||||
MetaColumn tmp(other);
|
||||
swap(tmp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
MetaColumn& MetaColumn::operator = (MetaColumn&& other) noexcept
|
||||
{
|
||||
_name = std::move(other._name);
|
||||
_length = other._length;
|
||||
_precision = other._precision;
|
||||
_position = other._position;
|
||||
_type = other._type;
|
||||
_nullable = other._nullable;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void MetaColumn::swap(MetaColumn& other)
|
||||
{
|
||||
std::swap(_name, other._name);
|
||||
std::swap(_length, other._length);
|
||||
std::swap(_precision, other._precision);
|
||||
std::swap(_position, other._position);
|
||||
std::swap(_type, other._type);
|
||||
std::swap(_nullable, other._nullable);
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
@ -69,6 +69,17 @@ RecordSet::RecordSet(const RecordSet& other):
|
||||
}
|
||||
|
||||
|
||||
RecordSet::RecordSet(RecordSet&& other) noexcept:
|
||||
Statement(std::move(other)),
|
||||
_currentRow(std::move(other._currentRow)),
|
||||
_pBegin(std::move(other._pBegin)),
|
||||
_pEnd(std::move(other._pEnd)),
|
||||
_pFilter(std::move(other._pFilter)),
|
||||
_totalRowCount(std::move(other._totalRowCount))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
RecordSet::~RecordSet()
|
||||
{
|
||||
try
|
||||
@ -87,6 +98,19 @@ RecordSet::~RecordSet()
|
||||
}
|
||||
|
||||
|
||||
RecordSet& RecordSet::operator = (RecordSet&& other) noexcept
|
||||
{
|
||||
Statement::operator = (std::move(other));
|
||||
_currentRow = std::move(other._currentRow);
|
||||
_pBegin = std::move(other._pBegin);
|
||||
_pEnd = std::move(other._pEnd);
|
||||
_pFilter = std::move(other._pFilter);
|
||||
_totalRowCount = std::move(other._totalRowCount);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void RecordSet::reset(const Statement& stmt)
|
||||
{
|
||||
delete _pBegin;
|
||||
|
@ -40,6 +40,12 @@ RowIterator::RowIterator(const RowIterator& other):
|
||||
}
|
||||
|
||||
|
||||
RowIterator::RowIterator(RowIterator&& other) noexcept:
|
||||
_pRecordSet(std::move(other._pRecordSet)),
|
||||
_position(std::move(other._position))
|
||||
{
|
||||
}
|
||||
|
||||
RowIterator::~RowIterator()
|
||||
{
|
||||
}
|
||||
@ -53,6 +59,14 @@ RowIterator& RowIterator::operator = (const RowIterator& other)
|
||||
}
|
||||
|
||||
|
||||
RowIterator& RowIterator::operator = (RowIterator&& other) noexcept
|
||||
{
|
||||
_pRecordSet = std::move(other._pRecordSet);
|
||||
_position = std::move(other._position);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void RowIterator::swap(RowIterator& other)
|
||||
{
|
||||
using std::swap;
|
||||
|
@ -244,7 +244,7 @@ std::string SQLChannel::getProperty(const std::string& name) const
|
||||
}
|
||||
else if (name == PROP_ARCHIVE_TABLE)
|
||||
{
|
||||
return _pArchiveStrategy ? _pArchiveStrategy->getDestination() : "" ;
|
||||
return _pArchiveStrategy ? _pArchiveStrategy->getDestination() : "";
|
||||
}
|
||||
else if (name == PROP_MAX_AGE)
|
||||
{
|
||||
|
@ -48,12 +48,19 @@ Session::Session(const std::string& connection,
|
||||
}
|
||||
|
||||
|
||||
Session::Session(const Session& other): _pImpl(other._pImpl),
|
||||
Session::Session(const Session& other):
|
||||
_pImpl(other._pImpl),
|
||||
_statementCreator(other._pImpl)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Session::Session(Session&& other) noexcept:
|
||||
_pImpl(std::move(other._pImpl)),
|
||||
_statementCreator(std::move(other._pImpl))
|
||||
{
|
||||
}
|
||||
|
||||
Session::~Session()
|
||||
{
|
||||
}
|
||||
@ -67,6 +74,14 @@ Session& Session::operator = (const Session& other)
|
||||
}
|
||||
|
||||
|
||||
Session& Session::operator = (Session&& other) noexcept
|
||||
{
|
||||
_pImpl = std::move(other._pImpl);
|
||||
_statementCreator = std::move(other._statementCreator);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void Session::swap(Session& other)
|
||||
{
|
||||
using std::swap;
|
||||
|
@ -53,6 +53,17 @@ Statement::Statement(const Statement& stmt):
|
||||
}
|
||||
|
||||
|
||||
Statement::Statement(Statement&& stmt) noexcept:
|
||||
_pImpl(std::move(stmt._pImpl)),
|
||||
_async(std::move(stmt._async)),
|
||||
_pResult(std::move(stmt._pResult)),
|
||||
_pAsyncExec(std::move(stmt._pAsyncExec)),
|
||||
_arguments(std::move(stmt._arguments)),
|
||||
_pRowFormatter(std::move(stmt._pRowFormatter))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Statement::~Statement()
|
||||
{
|
||||
}
|
||||
@ -66,6 +77,18 @@ Statement& Statement::operator = (const Statement& stmt)
|
||||
}
|
||||
|
||||
|
||||
Statement& Statement::operator = (Statement&& stmt) noexcept
|
||||
{
|
||||
_pImpl = std::move(stmt._pImpl);
|
||||
_async = std::move(stmt._async);
|
||||
_pResult = std::move(stmt._pResult);
|
||||
_pAsyncExec = std::move(stmt._pAsyncExec);
|
||||
_arguments = std::move(stmt._arguments);
|
||||
_pRowFormatter = std::move(stmt._pRowFormatter);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Statement::swap(Statement& other)
|
||||
{
|
||||
using std::swap;
|
||||
|
@ -37,6 +37,12 @@ StatementCreator::StatementCreator(const StatementCreator& other):
|
||||
}
|
||||
|
||||
|
||||
StatementCreator::StatementCreator(StatementCreator&& other) noexcept:
|
||||
_ptrImpl(std::move(other._ptrImpl))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
StatementCreator& StatementCreator::operator = (const StatementCreator& other)
|
||||
{
|
||||
StatementCreator tmp(other);
|
||||
@ -45,6 +51,12 @@ StatementCreator& StatementCreator::operator = (const StatementCreator& other)
|
||||
}
|
||||
|
||||
|
||||
StatementCreator& StatementCreator::operator = (StatementCreator&& other) noexcept
|
||||
{
|
||||
_ptrImpl = std::move(other._ptrImpl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void StatementCreator::swap(StatementCreator& other)
|
||||
{
|
||||
using std::swap;
|
||||
|
@ -482,7 +482,7 @@ void DataTest::testColumnVector()
|
||||
pData->push_back(4);
|
||||
pData->push_back(5);
|
||||
|
||||
Column<std::vector<int> > c(mc, pData);
|
||||
Column<std::vector<int>> c(mc, pData);
|
||||
|
||||
assertTrue (c.rowCount() == 5);
|
||||
assertTrue (c[0] == 1);
|
||||
@ -503,7 +503,7 @@ void DataTest::testColumnVector()
|
||||
}
|
||||
catch (RangeException&) { }
|
||||
|
||||
Column<std::vector<int> > c1 = c;
|
||||
Column<std::vector<int>> c1 = c;
|
||||
|
||||
assertTrue (c1.rowCount() == 5);
|
||||
assertTrue (c1[0] == 1);
|
||||
@ -512,7 +512,7 @@ void DataTest::testColumnVector()
|
||||
assertTrue (c1[3] == 4);
|
||||
assertTrue (c1[4] == 5);
|
||||
|
||||
Column<std::vector<int> > c2(c1);
|
||||
Column<std::vector<int>> c2(c1);
|
||||
|
||||
assertTrue (c2.rowCount() == 5);
|
||||
assertTrue (c2[0] == 1);
|
||||
@ -547,8 +547,8 @@ void DataTest::testColumnVector()
|
||||
pV2->push_back(3);
|
||||
pV2->push_back(2);
|
||||
pV2->push_back(1);
|
||||
Column<std::vector<int> > c3(mc, pV1);
|
||||
Column<std::vector<int> > c4(mc, pV2);
|
||||
Column<std::vector<int>> c3(mc, pV1);
|
||||
Column<std::vector<int>> c4(mc, pV2);
|
||||
|
||||
Poco::Data::swap(c3, c4);
|
||||
assertTrue (c3[0] == 5);
|
||||
@ -589,7 +589,7 @@ void DataTest::testColumnVectorBool()
|
||||
pData->push_back(false);
|
||||
pData->push_back(true);
|
||||
|
||||
Column<std::vector<bool> > c(mc, pData);
|
||||
Column<std::vector<bool>> c(mc, pData);
|
||||
|
||||
assertTrue (c.rowCount() == 5);
|
||||
assertTrue (c[0] == true);
|
||||
@ -606,7 +606,7 @@ void DataTest::testColumnVectorBool()
|
||||
}
|
||||
catch (RangeException&) { }
|
||||
|
||||
Column<std::vector<bool> > c1 = c;
|
||||
Column<std::vector<bool>> c1 = c;
|
||||
|
||||
assertTrue (c1.rowCount() == 5);
|
||||
assertTrue (c1[0] == true);
|
||||
@ -615,7 +615,7 @@ void DataTest::testColumnVectorBool()
|
||||
assertTrue (c1[3] == false);
|
||||
assertTrue (c1[4] == true);
|
||||
|
||||
Column<std::vector<bool> > c2(c1);
|
||||
Column<std::vector<bool>> c2(c1);
|
||||
|
||||
assertTrue (c2.rowCount() == 5);
|
||||
assertTrue (c2[0] == true);
|
||||
@ -642,8 +642,8 @@ void DataTest::testColumnVectorBool()
|
||||
|
||||
void DataTest::testColumnDeque()
|
||||
{
|
||||
typedef std::deque<int> ContainerType;
|
||||
typedef Column<ContainerType> ColumnType;
|
||||
using ContainerType = std::deque<int>;
|
||||
using ColumnType = Column<ContainerType>;
|
||||
|
||||
MetaColumn mc(0, "mc", MetaColumn::FDT_DOUBLE, 2, 3, true);
|
||||
|
||||
@ -759,8 +759,8 @@ void DataTest::testColumnDeque()
|
||||
|
||||
void DataTest::testColumnList()
|
||||
{
|
||||
typedef std::list<int> ContainerType;
|
||||
typedef Column<ContainerType> ColumnType;
|
||||
using ContainerType = std::list<int>;
|
||||
using ColumnType = Column<ContainerType>;
|
||||
|
||||
MetaColumn mc(0, "mc", MetaColumn::FDT_DOUBLE, 2, 3, true);
|
||||
|
||||
|
@ -48,7 +48,7 @@ bool TestStatementImpl::canBind() const
|
||||
void TestStatementImpl::bindImpl()
|
||||
{
|
||||
// bind
|
||||
typedef Poco::Data::AbstractBindingVec Bindings;
|
||||
using Bindings = Poco::Data::AbstractBindingVec;
|
||||
Bindings& binds = bindings();
|
||||
if (binds.empty())
|
||||
return;
|
||||
|
@ -39,13 +39,13 @@ class AbstractCache
|
||||
/// An AbstractCache is the interface of all caches.
|
||||
{
|
||||
public:
|
||||
FIFOEvent<const KeyValueArgs<TKey, TValue >, TEventMutex > Add;
|
||||
FIFOEvent<const KeyValueArgs<TKey, TValue >, TEventMutex > Update;
|
||||
FIFOEvent<const TKey, TEventMutex> Remove;
|
||||
FIFOEvent<const TKey, TEventMutex> Get;
|
||||
FIFOEvent<const EventArgs, TEventMutex> Clear;
|
||||
FIFOEvent<const KeyValueArgs<TKey, TValue>, TEventMutex> Add;
|
||||
FIFOEvent<const KeyValueArgs<TKey, TValue>, TEventMutex> Update;
|
||||
FIFOEvent<const TKey, TEventMutex> Remove;
|
||||
FIFOEvent<const TKey, TEventMutex> Get;
|
||||
FIFOEvent<const EventArgs, TEventMutex> Clear;
|
||||
|
||||
typedef std::map<TKey, SharedPtr<TValue > > DataHolder;
|
||||
typedef std::map<TKey, SharedPtr<TValue>> DataHolder;
|
||||
typedef typename DataHolder::iterator Iterator;
|
||||
typedef typename DataHolder::const_iterator ConstIterator;
|
||||
typedef std::set<TKey> KeySet;
|
||||
@ -85,7 +85,7 @@ public:
|
||||
/// If for the key already an entry exists, it will be overwritten.
|
||||
/// The difference to add is that no remove or add events are thrown in this case,
|
||||
/// just a simply silent update is performed
|
||||
/// If the key doesnot exist the behavior is equal to add, ie. an add event is thrown
|
||||
/// If the key does not exist the behavior is equal to add, ie. an add event is thrown
|
||||
{
|
||||
typename TMutex::ScopedLock lock(_mutex);
|
||||
doUpdate(key, val);
|
||||
@ -105,7 +105,7 @@ public:
|
||||
/// If for the key already an entry exists, it will be overwritten.
|
||||
/// The difference to add is that no remove or add events are thrown in this case,
|
||||
/// just an Update is thrown
|
||||
/// If the key doesnot exist the behavior is equal to add, ie. an add event is thrown
|
||||
/// If the key does not exist the behavior is equal to add, ie. an add event is thrown
|
||||
{
|
||||
typename TMutex::ScopedLock lock(_mutex);
|
||||
doUpdate(key, val);
|
||||
@ -177,30 +177,30 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
mutable FIFOEvent<ValidArgs<TKey> > IsValid;
|
||||
mutable FIFOEvent<KeySet> Replace;
|
||||
mutable FIFOEvent<ValidArgs<TKey>> IsValid;
|
||||
mutable FIFOEvent<KeySet> Replace;
|
||||
|
||||
void initialize()
|
||||
/// Sets up event registration.
|
||||
{
|
||||
Add += Delegate<TStrategy, const KeyValueArgs<TKey, TValue> >(&_strategy, &TStrategy::onAdd);
|
||||
Update += Delegate<TStrategy, const KeyValueArgs<TKey, TValue> >(&_strategy, &TStrategy::onUpdate);
|
||||
Add += Delegate<TStrategy, const KeyValueArgs<TKey, TValue>>(&_strategy, &TStrategy::onAdd);
|
||||
Update += Delegate<TStrategy, const KeyValueArgs<TKey, TValue>>(&_strategy, &TStrategy::onUpdate);
|
||||
Remove += Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onRemove);
|
||||
Get += Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onGet);
|
||||
Clear += Delegate<TStrategy, const EventArgs>(&_strategy, &TStrategy::onClear);
|
||||
IsValid += Delegate<TStrategy, ValidArgs<TKey> >(&_strategy, &TStrategy::onIsValid);
|
||||
IsValid += Delegate<TStrategy, ValidArgs<TKey>>(&_strategy, &TStrategy::onIsValid);
|
||||
Replace += Delegate<TStrategy, KeySet>(&_strategy, &TStrategy::onReplace);
|
||||
}
|
||||
|
||||
void uninitialize()
|
||||
/// Reverts event registration.
|
||||
{
|
||||
Add -= Delegate<TStrategy, const KeyValueArgs<TKey, TValue> >(&_strategy, &TStrategy::onAdd );
|
||||
Update -= Delegate<TStrategy, const KeyValueArgs<TKey, TValue> >(&_strategy, &TStrategy::onUpdate);
|
||||
Add -= Delegate<TStrategy, const KeyValueArgs<TKey, TValue>>(&_strategy, &TStrategy::onAdd );
|
||||
Update -= Delegate<TStrategy, const KeyValueArgs<TKey, TValue>>(&_strategy, &TStrategy::onUpdate);
|
||||
Remove -= Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onRemove);
|
||||
Get -= Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onGet);
|
||||
Clear -= Delegate<TStrategy, const EventArgs>(&_strategy, &TStrategy::onClear);
|
||||
IsValid -= Delegate<TStrategy, ValidArgs<TKey> >(&_strategy, &TStrategy::onIsValid);
|
||||
IsValid -= Delegate<TStrategy, ValidArgs<TKey>>(&_strategy, &TStrategy::onIsValid);
|
||||
Replace -= Delegate<TStrategy, KeySet>(&_strategy, &TStrategy::onReplace);
|
||||
}
|
||||
|
||||
|
@ -244,14 +244,16 @@ public:
|
||||
strategy.notify(pSender, args);
|
||||
}
|
||||
|
||||
bool hasDelegates() const {
|
||||
bool hasDelegates() const
|
||||
/// Returns true if there are registered delegates.
|
||||
{
|
||||
return !empty();
|
||||
}
|
||||
|
||||
ActiveResult<TArgs> notifyAsync(const void* pSender, const TArgs& args)
|
||||
/// Sends a notification to all registered delegates. The order is
|
||||
/// determined by the TStrategy. This method is not blocking and will
|
||||
/// immediately return. The delegates are invoked in a seperate thread.
|
||||
/// immediately return. The delegates are invoked in a separate thread.
|
||||
/// Call activeResult.wait() to wait until the notification has ended.
|
||||
/// While executing, other objects can change the delegate list. These changes don't
|
||||
/// influence the current active notifications but are activated with
|
||||
@ -293,6 +295,7 @@ public:
|
||||
}
|
||||
|
||||
bool isEnabled() const
|
||||
/// Returns true if event is enabled.
|
||||
{
|
||||
typename TMutex::ScopedLock lock(_mutex);
|
||||
return _enabled;
|
||||
@ -342,7 +345,7 @@ protected:
|
||||
}
|
||||
|
||||
TStrategy _strategy; /// The strategy used to notify observers.
|
||||
bool _enabled; /// Stores if an event is enabled. Notfies on disabled events have no effect
|
||||
bool _enabled; /// Stores if an event is enabled. Notifies on disabled events have no effect
|
||||
/// but it is possible to change the observers.
|
||||
mutable TMutex _mutex;
|
||||
|
||||
@ -453,7 +456,7 @@ public:
|
||||
ActiveResult<void> notifyAsync(const void* pSender)
|
||||
/// Sends a notification to all registered delegates. The order is
|
||||
/// determined by the TStrategy. This method is not blocking and will
|
||||
/// immediately return. The delegates are invoked in a seperate thread.
|
||||
/// immediately return. The delegates are invoked in a separate thread.
|
||||
/// Call activeResult.wait() to wait until the notification has ended.
|
||||
/// While executing, other objects can change the delegate list. These changes don't
|
||||
/// influence the current active notifications but are activated with
|
||||
@ -542,7 +545,7 @@ protected:
|
||||
}
|
||||
|
||||
TStrategy _strategy; /// The strategy used to notify observers.
|
||||
bool _enabled; /// Stores if an event is enabled. Notfies on disabled events have no effect
|
||||
bool _enabled; /// Stores if an event is enabled. Notifies on disabled events have no effect
|
||||
/// but it is possible to change the observers.
|
||||
mutable TMutex _mutex;
|
||||
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
virtual void onReplace(const void* pSender, std::set<TKey>& elemsToRemove) = 0;
|
||||
/// Used by the Strategy to indicate which elements should be removed from
|
||||
/// the cache. Note that onReplace does not change the current list of keys.
|
||||
/// The cache object is reponsible to remove the elements.
|
||||
/// The cache object is responsible to remove the elements.
|
||||
};
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@ class AccessExpireLRUCache: public AbstractCache<TKey, TValue, StrategyCollectio
|
||||
/// but also limits the size of the cache (per default: 1024).
|
||||
{
|
||||
public:
|
||||
AccessExpireLRUCache(long cacheSize = 1024, Timestamp::TimeDiff expire = 600000):
|
||||
AccessExpireLRUCache(std::size_t cacheSize = 1024, Timestamp::TimeDiff expire = 600000):
|
||||
AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue>, TMutex, TEventMutex >(StrategyCollection<TKey, TValue>())
|
||||
{
|
||||
this->_strategy.pushBack(new LRUStrategy<TKey, TValue>(cacheSize));
|
||||
|
@ -55,7 +55,7 @@ class Foundation_API ActiveDispatcher: protected Runnable
|
||||
/// {
|
||||
/// }
|
||||
///
|
||||
/// ActiveMethod<std::string, std::string, ActiveObject, ActiveStarter<ActiveDispatcher> > exampleActiveMethod;
|
||||
/// ActiveMethod<std::string, std::string, ActiveObject, ActiveStarter<ActiveDispatcher>> exampleActiveMethod;
|
||||
///
|
||||
/// protected:
|
||||
/// std::string exampleActiveMethodImpl(const std::string& arg)
|
||||
|
@ -28,7 +28,7 @@
|
||||
namespace Poco {
|
||||
|
||||
|
||||
template <class ResultType, class ArgType, class OwnerType, class StarterType = ActiveStarter<OwnerType> >
|
||||
template <class ResultType, class ArgType, class OwnerType, class StarterType = ActiveStarter<OwnerType>>
|
||||
class ActiveMethod
|
||||
/// An active method is a method that, when called, executes
|
||||
/// in its own thread. ActiveMethod's take exactly one
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
ActiveResultHolder():
|
||||
_pData(0),
|
||||
_pExc(0),
|
||||
_event(false)
|
||||
_event(Event::EVENT_MANUALRESET)
|
||||
/// Creates an ActiveResultHolder.
|
||||
{
|
||||
}
|
||||
@ -147,7 +147,7 @@ class ActiveResultHolder<void>: public RefCountedObject
|
||||
public:
|
||||
ActiveResultHolder():
|
||||
_pExc(0),
|
||||
_event(false)
|
||||
_event(Event::EVENT_MANUALRESET)
|
||||
/// Creates an ActiveResultHolder.
|
||||
{
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ class ActiveRunnableBase: public Runnable, public RefCountedObject
|
||||
/// The base class for all ActiveRunnable instantiations.
|
||||
{
|
||||
public:
|
||||
typedef AutoPtr<ActiveRunnableBase> Ptr;
|
||||
using Ptr = AutoPtr<ActiveRunnableBase>;
|
||||
};
|
||||
|
||||
|
||||
|
@ -82,7 +82,7 @@ public:
|
||||
_runnable(*pOwner, method),
|
||||
_stopped(true),
|
||||
_running(false),
|
||||
_done(false)
|
||||
_done(Event::EVENT_MANUALRESET)
|
||||
/// Creates the activity. Call start() to
|
||||
/// start it.
|
||||
{
|
||||
@ -134,8 +134,6 @@ public:
|
||||
void stop()
|
||||
/// Requests to stop the activity.
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
_stopped = true;
|
||||
}
|
||||
|
||||
@ -195,8 +193,8 @@ private:
|
||||
|
||||
C* _pOwner;
|
||||
RunnableAdapterType _runnable;
|
||||
volatile bool _stopped;
|
||||
volatile bool _running;
|
||||
std::atomic<bool> _stopped;
|
||||
std::atomic<bool> _running;
|
||||
Event _done;
|
||||
FastMutex _mutex;
|
||||
};
|
||||
|
@ -14,233 +14,12 @@
|
||||
//
|
||||
|
||||
|
||||
// Adapted for POCO from LLVM Compiler Infrastructure code:
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source License
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines the AlignOf function that computes alignments for
|
||||
// arbitrary types.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
#ifndef Foundation_Alignment_INCLUDED
|
||||
#define Foundation_Alignment_INCLUDED
|
||||
|
||||
|
||||
#ifndef Foundation_AlignOf_INCLUDED
|
||||
#define Foundation_AlignOf_INCLUDED
|
||||
#include <type_traits>
|
||||
#define POCO_HAVE_ALIGNMENT
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
#ifdef POCO_ENABLE_CPP11
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
#define POCO_HAVE_ALIGNMENT
|
||||
|
||||
|
||||
#else
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct AlignmentCalcImpl
|
||||
{
|
||||
char x;
|
||||
T t;
|
||||
private:
|
||||
AlignmentCalcImpl() {} // Never instantiate.
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct AlignOf
|
||||
/// A templated class that contains an enum value representing
|
||||
/// the alignment of the template argument. For example,
|
||||
/// AlignOf<int>::Alignment represents the alignment of type "int". The
|
||||
/// alignment calculated is the minimum alignment, and not necessarily
|
||||
/// the "desired" alignment returned by GCC's __alignof__ (for example). Note
|
||||
/// that because the alignment is an enum value, it can be used as a
|
||||
/// compile-time constant (e.g., for template instantiation).
|
||||
{
|
||||
enum
|
||||
{
|
||||
Alignment = static_cast<unsigned int>(sizeof(AlignmentCalcImpl<T>) - sizeof(T))
|
||||
};
|
||||
|
||||
enum { Alignment_GreaterEqual_2Bytes = Alignment >= 2 ? 1 : 0 };
|
||||
enum { Alignment_GreaterEqual_4Bytes = Alignment >= 4 ? 1 : 0 };
|
||||
enum { Alignment_GreaterEqual_8Bytes = Alignment >= 8 ? 1 : 0 };
|
||||
enum { Alignment_GreaterEqual_16Bytes = Alignment >= 16 ? 1 : 0 };
|
||||
|
||||
enum { Alignment_LessEqual_2Bytes = Alignment <= 2 ? 1 : 0 };
|
||||
enum { Alignment_LessEqual_4Bytes = Alignment <= 4 ? 1 : 0 };
|
||||
enum { Alignment_LessEqual_8Bytes = Alignment <= 8 ? 1 : 0 };
|
||||
enum { Alignment_LessEqual_16Bytes = Alignment <= 16 ? 1 : 0 };
|
||||
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline unsigned alignOf()
|
||||
/// A templated function that returns the minimum alignment of
|
||||
/// of a type. This provides no extra functionality beyond the AlignOf
|
||||
/// class besides some cosmetic cleanliness. Example usage:
|
||||
/// alignOf<int>() returns the alignment of an int.
|
||||
{
|
||||
return AlignOf<T>::Alignment;
|
||||
}
|
||||
|
||||
|
||||
template <std::size_t Alignment> struct AlignedCharArrayImpl;
|
||||
/// Helper for building an aligned character array type.
|
||||
///
|
||||
/// This template is used to explicitly build up a collection of aligned
|
||||
/// character types. We have to build these up using a macro and explicit
|
||||
/// specialization to cope with old versions of MSVC and GCC where only an
|
||||
/// integer literal can be used to specify an alignment constraint. Once built
|
||||
/// up here, we can then begin to indirect between these using normal C++
|
||||
/// template parameters.
|
||||
|
||||
|
||||
// MSVC requires special handling here.
|
||||
#ifndef _MSC_VER
|
||||
|
||||
#ifdef POCO_COMPILER_CLANG
|
||||
|
||||
#if __has_feature(cxx_alignas)
|
||||
#define POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
|
||||
template <> struct AlignedCharArrayImpl<x> \
|
||||
{ \
|
||||
char aligned alignas(x); \
|
||||
}
|
||||
#define POCO_HAVE_ALIGNMENT
|
||||
#endif
|
||||
|
||||
#elif defined(__GNUC__) || defined(__IBM_ATTRIBUTES)
|
||||
|
||||
#define POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
|
||||
template <> struct AlignedCharArrayImpl<x> \
|
||||
{ \
|
||||
char aligned __attribute__((aligned(x))); \
|
||||
}
|
||||
#define POCO_HAVE_ALIGNMENT
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef POCO_HAVE_ALIGNMENT
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(2);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(4);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(16);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(32);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(64);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(128);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(512);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1024);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(2048);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(4096);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8192);
|
||||
|
||||
#undef POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT
|
||||
#endif // POCO_HAVE_ALIGNMENT
|
||||
|
||||
#else // _MSC_VER
|
||||
|
||||
// We provide special variations of this template for the most common
|
||||
// alignments because __declspec(align(...)) doesn't actually work when it is
|
||||
// a member of a by-value function argument in MSVC, even if the alignment
|
||||
// request is something reasonably like 8-byte or 16-byte.
|
||||
template <> struct AlignedCharArrayImpl<1> { char aligned; };
|
||||
template <> struct AlignedCharArrayImpl<2> { short aligned; };
|
||||
template <> struct AlignedCharArrayImpl<4> { int aligned; };
|
||||
template <> struct AlignedCharArrayImpl<8> { double aligned; };
|
||||
|
||||
#define POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
|
||||
template <> struct AlignedCharArrayImpl<x> { \
|
||||
__declspec(align(x)) char aligned; \
|
||||
}
|
||||
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(16);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(32);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(64);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(128);
|
||||
|
||||
#if (_MSC_VER > 1600) // MSVC 2010 complains on alignment larger than 128
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(512);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1024);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(2048);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(4096);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8192);
|
||||
#endif // _MSC_VER > 1600
|
||||
|
||||
// Any larger and MSVC complains.
|
||||
#undef POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT
|
||||
|
||||
#define POCO_HAVE_ALIGNMENT
|
||||
#endif // _MSC_VER
|
||||
|
||||
// POCO_HAVE_ALIGNMENT will be defined on the pre-C++11 platforms/compilers where
|
||||
// it can be reliably determined and used. Uncomment the line below to explicitly
|
||||
// disable use of alignment even for those platforms.
|
||||
// #undef POCO_HAVE_ALIGNMENT
|
||||
|
||||
|
||||
#ifdef POCO_HAVE_ALIGNMENT
|
||||
|
||||
template <typename T1, typename T2 = char, typename T3 = char, typename T4 = char>
|
||||
union AlignedCharArrayUnion
|
||||
/// This union template exposes a suitably aligned and sized character
|
||||
/// array member which can hold elements of any of up to four types.
|
||||
///
|
||||
/// These types may be arrays, structs, or any other types. The goal is to
|
||||
/// produce a union type containing a character array which, when used, forms
|
||||
/// storage suitable to placement new any of these types over. Support for more
|
||||
/// than four types can be added at the cost of more boiler plate.
|
||||
{
|
||||
private:
|
||||
class AlignerImpl
|
||||
{
|
||||
T1 t1;
|
||||
T2 t2;
|
||||
T3 t3;
|
||||
T4 t4;
|
||||
|
||||
AlignerImpl(); // Never defined or instantiated.
|
||||
};
|
||||
|
||||
union SizerImpl
|
||||
{
|
||||
char arr1[sizeof(T1)];
|
||||
char arr2[sizeof(T2)];
|
||||
char arr3[sizeof(T3)];
|
||||
char arr4[sizeof(T4)];
|
||||
};
|
||||
|
||||
public:
|
||||
char buffer[sizeof(SizerImpl)];
|
||||
/// The character array buffer for use by clients.
|
||||
///
|
||||
/// No other member of this union should be referenced. They exist purely to
|
||||
/// constrain the layout of this character array.
|
||||
|
||||
private:
|
||||
Poco::AlignedCharArrayImpl<AlignOf<AlignerImpl>::Alignment> _nonceMember;
|
||||
|
||||
};
|
||||
|
||||
#endif // POCO_HAVE_ALIGNMENT
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // POCO_ENABLE_CPP11
|
||||
|
||||
|
||||
#endif // Foundation_AlignOf_INCLUDED
|
||||
#endif // Foundation_Alignment_INCLUDED
|
||||
|
@ -33,16 +33,13 @@ namespace Dynamic {
|
||||
|
||||
class Var;
|
||||
class VarHolder;
|
||||
template <class> class VarHolderImpl;
|
||||
template <class T> class VarHolderImpl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_NO_SOO
|
||||
|
||||
#ifndef POCO_ENABLE_CPP11
|
||||
// C++11 needed for std::aligned_storage
|
||||
#error "Any SOO can only be enabled with C++11 support"
|
||||
#endif
|
||||
|
||||
template <typename PlaceholderT, unsigned int SizeV = POCO_SMALL_OBJECT_SIZE>
|
||||
union Placeholder
|
||||
@ -61,7 +58,7 @@ public:
|
||||
static const unsigned int value = SizeV;
|
||||
};
|
||||
|
||||
Placeholder ()
|
||||
Placeholder()
|
||||
{
|
||||
erase();
|
||||
}
|
||||
@ -96,7 +93,7 @@ private:
|
||||
typedef typename std::aligned_storage<SizeV + 1>::type AlignerType;
|
||||
|
||||
PlaceholderT* pHolder;
|
||||
mutable char holder [SizeV + 1];
|
||||
mutable char holder[SizeV + 1];
|
||||
AlignerType aligner;
|
||||
|
||||
friend class Any;
|
||||
@ -121,7 +118,6 @@ union Placeholder
|
||||
/// where the object was allocated (0 => heap, 1 => local).
|
||||
{
|
||||
public:
|
||||
|
||||
Placeholder ()
|
||||
{
|
||||
}
|
||||
@ -136,7 +132,7 @@ public:
|
||||
private:
|
||||
#endif
|
||||
|
||||
PlaceholderT* pHolder;
|
||||
PlaceholderT* pHolder;
|
||||
|
||||
friend class Any;
|
||||
friend class Dynamic::Var;
|
||||
@ -201,7 +197,7 @@ public:
|
||||
Any& swap(Any& other)
|
||||
/// Swaps the content of the two Anys.
|
||||
///
|
||||
/// When small object optimizaton is enabled, swap only
|
||||
/// When small object optimization is enabled, swap only
|
||||
/// has no-throw guarantee when both (*this and other)
|
||||
/// objects are allocated on the heap.
|
||||
{
|
||||
@ -270,14 +266,10 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
class ValueHolder
|
||||
{
|
||||
public:
|
||||
|
||||
virtual ~ValueHolder()
|
||||
{
|
||||
}
|
||||
virtual ~ValueHolder() = default;
|
||||
|
||||
virtual const std::type_info & type() const = 0;
|
||||
virtual void clone(Placeholder<ValueHolder>*) const = 0;
|
||||
@ -427,9 +419,7 @@ private:
|
||||
class ValueHolder
|
||||
{
|
||||
public:
|
||||
virtual ~ValueHolder()
|
||||
{
|
||||
}
|
||||
virtual ~ValueHolder() = default;
|
||||
|
||||
virtual const std::type_info& type() const = 0;
|
||||
virtual ValueHolder* clone() const = 0;
|
||||
@ -457,7 +447,7 @@ private:
|
||||
ValueType _held;
|
||||
|
||||
private:
|
||||
Holder & operator=(const Holder &);
|
||||
Holder & operator = (const Holder &);
|
||||
};
|
||||
|
||||
ValueHolder* content() const
|
||||
@ -476,6 +466,14 @@ private:
|
||||
template <typename ValueType>
|
||||
friend ValueType* UnsafeAnyCast(Any*);
|
||||
|
||||
template <typename ValueType>
|
||||
friend const ValueType& RefAnyCast(const Any&);
|
||||
|
||||
template <typename ValueType>
|
||||
friend ValueType& RefAnyCast(Any&);
|
||||
|
||||
template <typename ValueType>
|
||||
friend ValueType AnyCast(Any&);
|
||||
};
|
||||
|
||||
|
||||
@ -514,14 +512,26 @@ ValueType AnyCast(Any& operand)
|
||||
/// Example Usage:
|
||||
/// MyType tmp = AnyCast<MyType>(anAny).
|
||||
/// Will throw a BadCastException if the cast fails.
|
||||
/// Dont use an AnyCast in combination with references, i.e. MyType& tmp = ... or const MyType& tmp = ...
|
||||
/// Do not use an AnyCast in combination with references, i.e. MyType& tmp = ... or const MyType& tmp = ...
|
||||
/// Some compilers will accept this code although a copy is returned. Use the RefAnyCast in
|
||||
/// these cases.
|
||||
{
|
||||
typedef typename TypeWrapper<ValueType>::TYPE NonRef;
|
||||
|
||||
NonRef* result = AnyCast<NonRef>(&operand);
|
||||
if (!result) throw BadCastException("Failed to convert between Any types");
|
||||
if (!result)
|
||||
{
|
||||
std::string s = "RefAnyCast: Failed to convert between Any types ";
|
||||
if (operand._pHolder)
|
||||
{
|
||||
s.append(1, '(');
|
||||
s.append(operand._pHolder->type().name());
|
||||
s.append(" => ");
|
||||
s.append(typeid(ValueType).name());
|
||||
s.append(1, ')');
|
||||
}
|
||||
throw BadCastException(s);
|
||||
}
|
||||
return *result;
|
||||
}
|
||||
|
||||
@ -533,7 +543,7 @@ ValueType AnyCast(const Any& operand)
|
||||
/// Example Usage:
|
||||
/// MyType tmp = AnyCast<MyType>(anAny).
|
||||
/// Will throw a BadCastException if the cast fails.
|
||||
/// Dont use an AnyCast in combination with references, i.e. MyType& tmp = ... or const MyType& = ...
|
||||
/// Do not use an AnyCast in combination with references, i.e. MyType& tmp = ... or const MyType& = ...
|
||||
/// Some compilers will accept this code although a copy is returned. Use the RefAnyCast in
|
||||
/// these cases.
|
||||
{
|
||||
@ -551,7 +561,15 @@ const ValueType& RefAnyCast(const Any & operand)
|
||||
/// const MyType& tmp = RefAnyCast<MyType>(anAny);
|
||||
{
|
||||
ValueType* result = AnyCast<ValueType>(const_cast<Any*>(&operand));
|
||||
if (!result) throw BadCastException("RefAnyCast: Failed to convert between const Any types");
|
||||
std::string s = "RefAnyCast: Failed to convert between Any types ";
|
||||
if (operand._pHolder)
|
||||
{
|
||||
s.append(1, '(');
|
||||
s.append(operand._pHolder->type().name());
|
||||
s.append(" => ");
|
||||
s.append(typeid(ValueType).name());
|
||||
s.append(1, ')');
|
||||
}
|
||||
return *result;
|
||||
}
|
||||
|
||||
@ -564,7 +582,19 @@ ValueType& RefAnyCast(Any& operand)
|
||||
/// MyType& tmp = RefAnyCast<MyType>(anAny);
|
||||
{
|
||||
ValueType* result = AnyCast<ValueType>(&operand);
|
||||
if (!result) throw BadCastException("RefAnyCast: Failed to convert between Any types");
|
||||
if (!result)
|
||||
{
|
||||
std::string s = "RefAnyCast: Failed to convert between Any types ";
|
||||
if (operand._pHolder)
|
||||
{
|
||||
s.append(1, '(');
|
||||
s.append(operand._pHolder->type().name());
|
||||
s.append(" => ");
|
||||
s.append(typeid(ValueType).name());
|
||||
s.append(1, ')');
|
||||
}
|
||||
throw BadCastException(s);
|
||||
}
|
||||
return *result;
|
||||
}
|
||||
|
||||
|
@ -24,12 +24,15 @@
|
||||
#ifndef Foundation_Array_INCLUDED
|
||||
#define Foundation_Array_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Bugcheck.h"
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
template<class T, std::size_t N>
|
||||
class Array
|
||||
/// STL container like C-style array replacement class.
|
||||
@ -37,9 +40,7 @@ class Array
|
||||
/// This implementation is based on the idea of Nicolai Josuttis.
|
||||
/// 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;
|
||||
@ -158,7 +159,8 @@ public:
|
||||
|
||||
enum { static_size = N };
|
||||
|
||||
void swap (Array<T,N>& y) {
|
||||
void swap (Array<T,N>& y)
|
||||
{
|
||||
std::swap_ranges(begin(),end(),y.begin());
|
||||
}
|
||||
|
||||
@ -173,7 +175,8 @@ public:
|
||||
return elems;
|
||||
}
|
||||
|
||||
T* c_array(){
|
||||
T* c_array()
|
||||
{
|
||||
/// Use array as C array (direct read/write access to data)
|
||||
return elems;
|
||||
}
|
||||
@ -193,12 +196,12 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
T elems[N];
|
||||
/// Fixed-size array of elements of type T, public specifier used to make this class a aggregate.
|
||||
|
||||
};
|
||||
|
||||
|
||||
// comparisons
|
||||
template<class T, std::size_t N>
|
||||
bool operator== (const Array<T,N>& x, const Array<T,N>& y)
|
||||
@ -206,36 +209,42 @@ bool operator== (const Array<T,N>& x, const Array<T,N>& y)
|
||||
return std::equal(x.begin(), x.end(), y.begin());
|
||||
}
|
||||
|
||||
|
||||
template<class T, std::size_t N>
|
||||
bool operator< (const Array<T,N>& x, const Array<T,N>& y)
|
||||
{
|
||||
return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
|
||||
}
|
||||
|
||||
|
||||
template<class T, std::size_t N>
|
||||
bool operator!= (const Array<T,N>& x, const Array<T,N>& y)
|
||||
{
|
||||
return !(x==y);
|
||||
}
|
||||
|
||||
|
||||
template<class T, std::size_t N>
|
||||
bool operator> (const Array<T,N>& x, const Array<T,N>& y)
|
||||
{
|
||||
return y<x;
|
||||
}
|
||||
|
||||
|
||||
template<class T, std::size_t N>
|
||||
bool operator<= (const Array<T,N>& x, const Array<T,N>& y)
|
||||
{
|
||||
return !(y<x);
|
||||
}
|
||||
|
||||
|
||||
template<class T, std::size_t N>
|
||||
bool operator>= (const Array<T,N>& x, const Array<T,N>& y)
|
||||
{
|
||||
return !(x<y);
|
||||
}
|
||||
|
||||
|
||||
template<class T, std::size_t N>
|
||||
inline void swap (Array<T,N>& x, Array<T,N>& y)
|
||||
/// global swap()
|
||||
@ -243,7 +252,9 @@ inline void swap (Array<T,N>& x, Array<T,N>& y)
|
||||
x.swap(y);
|
||||
}
|
||||
|
||||
|
||||
}// namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Array_INCLUDED
|
||||
|
||||
|
@ -103,6 +103,9 @@ public:
|
||||
/// Returns true iff the given character is an uppercase alphabetic
|
||||
/// character.
|
||||
|
||||
static bool isPrintable(int ch);
|
||||
/// Returns true iff the given character is printable.
|
||||
|
||||
static int toLower(int ch);
|
||||
/// If the given character is an uppercase character,
|
||||
/// return its lowercase counterpart, otherwise return
|
||||
@ -196,6 +199,12 @@ inline bool Ascii::isUpper(int ch)
|
||||
}
|
||||
|
||||
|
||||
inline bool Ascii::isPrintable(int ch)
|
||||
{
|
||||
return hasProperties(ch, ACP_PRINT);
|
||||
}
|
||||
|
||||
|
||||
inline int Ascii::toLower(int ch)
|
||||
{
|
||||
if (isUpper(ch))
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "Poco/Thread.h"
|
||||
#include "Poco/Mutex.h"
|
||||
#include "Poco/Runnable.h"
|
||||
#include "Poco/AutoPtr.h"
|
||||
#include "Poco/NotificationQueue.h"
|
||||
|
||||
|
||||
@ -40,15 +41,17 @@ class Foundation_API AsyncChannel: public Channel, public Runnable
|
||||
/// then processed by a separate thread.
|
||||
{
|
||||
public:
|
||||
AsyncChannel(Channel* pChannel = 0, Thread::Priority prio = Thread::PRIO_NORMAL);
|
||||
using Ptr = AutoPtr<AsyncChannel>;
|
||||
|
||||
AsyncChannel(Channel::Ptr pChannel = 0, Thread::Priority prio = Thread::PRIO_NORMAL);
|
||||
/// Creates the AsyncChannel and connects it to
|
||||
/// the given channel.
|
||||
|
||||
void setChannel(Channel* pChannel);
|
||||
void setChannel(Channel::Ptr pChannel);
|
||||
/// Connects the AsyncChannel to the given target channel.
|
||||
/// All messages will be forwarded to this channel.
|
||||
|
||||
Channel* getChannel() const;
|
||||
Channel::Ptr getChannel() const;
|
||||
/// Returns the target channel.
|
||||
|
||||
void open();
|
||||
@ -86,7 +89,7 @@ protected:
|
||||
void setPriority(const std::string& value);
|
||||
|
||||
private:
|
||||
Channel* _pChannel;
|
||||
Channel::Ptr _pChannel;
|
||||
Thread _thread;
|
||||
FastMutex _threadMutex;
|
||||
FastMutex _channelMutex;
|
||||
|
@ -19,33 +19,7 @@
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#if POCO_OS == POCO_OS_WINDOWS_NT
|
||||
#include "Poco/UnWindows.h"
|
||||
#elif POCO_OS == POCO_OS_MAC_OS_X
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101200 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000 || __TV_OS_VERSION_MAX_ALLOWED >= 100000 || __WATCH_OS_VERSION_MAX_ALLOWED >= 30000
|
||||
#if __cplusplus >= 201103L
|
||||
#ifndef POCO_HAVE_STD_ATOMICS
|
||||
#define POCO_HAVE_STD_ATOMICS
|
||||
#endif
|
||||
#else
|
||||
#include <libkern/OSAtomic.h>
|
||||
#endif
|
||||
#else
|
||||
#include <libkern/OSAtomic.h>
|
||||
#endif
|
||||
#elif ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2) || __GNUC__ > 4) && (defined(__x86_64__) || defined(__i386__))
|
||||
#if !defined(POCO_HAVE_GCC_ATOMICS) && !defined(POCO_NO_GCC_ATOMICS)
|
||||
#define POCO_HAVE_GCC_ATOMICS
|
||||
#endif
|
||||
#elif ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) || __GNUC__ > 4)
|
||||
#if !defined(POCO_HAVE_GCC_ATOMICS) && !defined(POCO_NO_GCC_ATOMICS)
|
||||
#define POCO_HAVE_GCC_ATOMICS
|
||||
#endif
|
||||
#endif // POCO_OS
|
||||
#include "Poco/Mutex.h"
|
||||
#ifdef POCO_HAVE_STD_ATOMICS
|
||||
#include <atomic>
|
||||
#endif
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@ -57,81 +31,53 @@ class Foundation_API AtomicCounter
|
||||
/// use in a multithreaded environment.
|
||||
///
|
||||
/// Typical usage of AtomicCounter is for implementing
|
||||
/// reference counting and similar things.
|
||||
///
|
||||
/// On some platforms, the implementation of AtomicCounter
|
||||
/// is based on atomic primitives specific to the platform
|
||||
/// (such as InterlockedIncrement, etc. on Windows), and
|
||||
/// thus very efficient. On platforms that do not support
|
||||
/// atomic primitives, operations are guarded by a FastMutex.
|
||||
///
|
||||
/// The following platforms currently have atomic
|
||||
/// primitives:
|
||||
/// - Windows
|
||||
/// - Mac OS X
|
||||
/// - GCC 4.1+ (Intel platforms only)
|
||||
/// reference counting and similar functionality.
|
||||
{
|
||||
public:
|
||||
typedef int ValueType; /// The underlying integer type.
|
||||
|
||||
|
||||
AtomicCounter();
|
||||
/// Creates a new AtomicCounter and initializes it to zero.
|
||||
|
||||
|
||||
explicit AtomicCounter(ValueType initialValue);
|
||||
/// Creates a new AtomicCounter and initializes it with
|
||||
/// the given value.
|
||||
|
||||
|
||||
AtomicCounter(const AtomicCounter& counter);
|
||||
/// Creates the counter by copying another one.
|
||||
|
||||
|
||||
~AtomicCounter();
|
||||
/// Destroys the AtomicCounter.
|
||||
|
||||
AtomicCounter& operator = (const AtomicCounter& counter);
|
||||
/// Assigns the value of another AtomicCounter.
|
||||
|
||||
|
||||
AtomicCounter& operator = (ValueType value);
|
||||
/// Assigns a value to the counter.
|
||||
|
||||
operator ValueType () const;
|
||||
/// Returns the value of the counter.
|
||||
|
||||
/// Converts the AtomicCounter to ValueType.
|
||||
|
||||
ValueType value() const;
|
||||
/// Returns the value of the counter.
|
||||
|
||||
|
||||
ValueType operator ++ (); // prefix
|
||||
/// Increments the counter and returns the result.
|
||||
|
||||
|
||||
ValueType operator ++ (int); // postfix
|
||||
/// Increments the counter and returns the previous value.
|
||||
|
||||
|
||||
ValueType operator -- (); // prefix
|
||||
/// Decrements the counter and returns the result.
|
||||
|
||||
|
||||
ValueType operator -- (int); // postfix
|
||||
/// Decrements the counter and returns the previous value.
|
||||
|
||||
|
||||
bool operator ! () const;
|
||||
/// Returns true if the counter is zero, false otherwise.
|
||||
|
||||
private:
|
||||
#if defined(POCO_HAVE_STD_ATOMICS)
|
||||
typedef std::atomic<int> ImplType;
|
||||
#elif POCO_OS == POCO_OS_WINDOWS_NT
|
||||
typedef volatile LONG ImplType;
|
||||
#elif POCO_OS == POCO_OS_MAC_OS_X
|
||||
typedef int32_t ImplType;
|
||||
#elif defined(POCO_HAVE_GCC_ATOMICS)
|
||||
typedef int ImplType;
|
||||
#else // generic implementation based on FastMutex
|
||||
struct ImplType
|
||||
{
|
||||
mutable FastMutex mutex;
|
||||
volatile int value;
|
||||
};
|
||||
#endif // POCO_OS
|
||||
|
||||
ImplType _counter;
|
||||
std::atomic<int> _counter;
|
||||
};
|
||||
|
||||
|
||||
@ -139,17 +85,12 @@ private:
|
||||
// inlines
|
||||
//
|
||||
|
||||
|
||||
#if defined(POCO_HAVE_STD_ATOMICS)
|
||||
//
|
||||
// C++11 atomics
|
||||
//
|
||||
inline AtomicCounter::operator AtomicCounter::ValueType () const
|
||||
{
|
||||
return _counter.load();
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::value() const
|
||||
{
|
||||
return _counter.load();
|
||||
@ -161,7 +102,7 @@ inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
|
||||
return ++_counter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
|
||||
{
|
||||
return _counter++;
|
||||
@ -173,244 +114,19 @@ inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
|
||||
return --_counter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
|
||||
{
|
||||
return _counter--;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline bool AtomicCounter::operator ! () const
|
||||
{
|
||||
return _counter.load() == 0;
|
||||
}
|
||||
|
||||
|
||||
#elif POCO_OS == POCO_OS_WINDOWS_NT
|
||||
//
|
||||
// Windows
|
||||
//
|
||||
inline AtomicCounter::operator AtomicCounter::ValueType () const
|
||||
{
|
||||
return _counter;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::value() const
|
||||
{
|
||||
return _counter;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
|
||||
{
|
||||
return InterlockedIncrement(&_counter);
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
|
||||
{
|
||||
ValueType result = InterlockedIncrement(&_counter);
|
||||
return --result;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
|
||||
{
|
||||
return InterlockedDecrement(&_counter);
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
|
||||
{
|
||||
ValueType result = InterlockedDecrement(&_counter);
|
||||
return ++result;
|
||||
}
|
||||
|
||||
|
||||
inline bool AtomicCounter::operator ! () const
|
||||
{
|
||||
return _counter == 0;
|
||||
}
|
||||
|
||||
|
||||
#elif POCO_OS == POCO_OS_MAC_OS_X
|
||||
//
|
||||
// Mac OS X
|
||||
//
|
||||
inline AtomicCounter::operator AtomicCounter::ValueType () const
|
||||
{
|
||||
return _counter;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::value() const
|
||||
{
|
||||
return _counter;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
|
||||
{
|
||||
return OSAtomicIncrement32(&_counter);
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
|
||||
{
|
||||
ValueType result = OSAtomicIncrement32(&_counter);
|
||||
return --result;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
|
||||
{
|
||||
return OSAtomicDecrement32(&_counter);
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
|
||||
{
|
||||
ValueType result = OSAtomicDecrement32(&_counter);
|
||||
return ++result;
|
||||
}
|
||||
|
||||
|
||||
inline bool AtomicCounter::operator ! () const
|
||||
{
|
||||
return _counter == 0;
|
||||
}
|
||||
|
||||
#elif defined(POCO_HAVE_GCC_ATOMICS)
|
||||
//
|
||||
// GCC 4.1+ atomic builtins.
|
||||
//
|
||||
inline AtomicCounter::operator AtomicCounter::ValueType () const
|
||||
{
|
||||
return _counter;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::value() const
|
||||
{
|
||||
return _counter;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
|
||||
{
|
||||
return __sync_add_and_fetch(&_counter, 1);
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
|
||||
{
|
||||
return __sync_fetch_and_add(&_counter, 1);
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
|
||||
{
|
||||
return __sync_sub_and_fetch(&_counter, 1);
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
|
||||
{
|
||||
return __sync_fetch_and_sub(&_counter, 1);
|
||||
}
|
||||
|
||||
|
||||
inline bool AtomicCounter::operator ! () const
|
||||
{
|
||||
return _counter == 0;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
//
|
||||
// Generic implementation based on FastMutex
|
||||
//
|
||||
inline AtomicCounter::operator AtomicCounter::ValueType () const
|
||||
{
|
||||
ValueType result;
|
||||
{
|
||||
FastMutex::ScopedLock lock(_counter.mutex);
|
||||
result = _counter.value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::value() const
|
||||
{
|
||||
ValueType result;
|
||||
{
|
||||
FastMutex::ScopedLock lock(_counter.mutex);
|
||||
result = _counter.value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
|
||||
{
|
||||
ValueType result;
|
||||
{
|
||||
FastMutex::ScopedLock lock(_counter.mutex);
|
||||
result = ++_counter.value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
|
||||
{
|
||||
ValueType result;
|
||||
{
|
||||
FastMutex::ScopedLock lock(_counter.mutex);
|
||||
result = _counter.value++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
|
||||
{
|
||||
ValueType result;
|
||||
{
|
||||
FastMutex::ScopedLock lock(_counter.mutex);
|
||||
result = --_counter.value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
|
||||
{
|
||||
ValueType result;
|
||||
{
|
||||
FastMutex::ScopedLock lock(_counter.mutex);
|
||||
result = _counter.value--;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline bool AtomicCounter::operator ! () const
|
||||
{
|
||||
bool result;
|
||||
{
|
||||
FastMutex::ScopedLock lock(_counter.mutex);
|
||||
result = _counter.value == 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#endif // POCO_OS
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
|
@ -14,9 +14,6 @@
|
||||
//
|
||||
|
||||
|
||||
#ifdef POCO_HAVE_STD_ATOMICS
|
||||
|
||||
|
||||
#ifndef Foundation_AtomicFlag_INCLUDED
|
||||
#define Foundation_AtomicFlag_INCLUDED
|
||||
|
||||
@ -67,10 +64,10 @@ class Foundation_API AtomicFlag
|
||||
/// while (++i < 10) myClass.myFunc();
|
||||
{
|
||||
public:
|
||||
AtomicFlag();
|
||||
AtomicFlag() = default;
|
||||
/// Creates AtomicFlag.
|
||||
|
||||
~AtomicFlag();
|
||||
~AtomicFlag() = default;
|
||||
/// Destroys AtomicFlag.
|
||||
|
||||
bool set();
|
||||
@ -98,6 +95,7 @@ private:
|
||||
// inlines
|
||||
//
|
||||
|
||||
|
||||
inline bool AtomicFlag::set()
|
||||
{
|
||||
return _flag.test_and_set(std::memory_order_acquire);
|
||||
@ -121,5 +119,3 @@ inline AtomicFlag::operator bool ()
|
||||
|
||||
#endif // Foundation_AtomicFlag_INCLUDED
|
||||
|
||||
|
||||
#endif // POCO_HAVE_STD_ATOMICS
|
||||
|
@ -61,7 +61,7 @@ class AutoPtr
|
||||
/// Note that AutoPtr allows casting of its encapsulated data types.
|
||||
{
|
||||
public:
|
||||
AutoPtr(): _ptr(0)
|
||||
AutoPtr(): _ptr(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@ -79,6 +79,11 @@ public:
|
||||
if (_ptr) _ptr->duplicate();
|
||||
}
|
||||
|
||||
AutoPtr(AutoPtr&& ptr) noexcept: _ptr(std::move(ptr._ptr))
|
||||
{
|
||||
ptr._ptr = nullptr;
|
||||
}
|
||||
|
||||
template <class Other>
|
||||
AutoPtr(const AutoPtr<Other>& ptr): _ptr(const_cast<Other*>(ptr.get()))
|
||||
{
|
||||
@ -139,7 +144,7 @@ public:
|
||||
if (_ptr)
|
||||
{
|
||||
_ptr->release();
|
||||
_ptr = 0;
|
||||
_ptr = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,6 +178,14 @@ public:
|
||||
{
|
||||
return assign(ptr);
|
||||
}
|
||||
|
||||
AutoPtr& operator = (AutoPtr&& ptr) noexcept
|
||||
{
|
||||
if (_ptr) _ptr->release();
|
||||
_ptr = std::move(ptr._ptr);
|
||||
ptr._ptr = nullptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class Other>
|
||||
AutoPtr& operator = (const AutoPtr<Other>& ptr)
|
||||
@ -264,12 +277,12 @@ public:
|
||||
|
||||
bool operator ! () const
|
||||
{
|
||||
return _ptr == 0;
|
||||
return _ptr == nullptr;
|
||||
}
|
||||
|
||||
bool isNull() const
|
||||
{
|
||||
return _ptr == 0;
|
||||
return _ptr == nullptr;
|
||||
}
|
||||
|
||||
C* duplicate()
|
||||
@ -380,6 +393,13 @@ inline void swap(AutoPtr<C>& p1, AutoPtr<C>& p2)
|
||||
}
|
||||
|
||||
|
||||
template<typename T, typename... Args>
|
||||
AutoPtr<T> makeAuto(Args&&... args)
|
||||
{
|
||||
return AutoPtr<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ template <class C>
|
||||
class AutoReleasePool
|
||||
/// An AutoReleasePool implements simple garbage collection for
|
||||
/// reference-counted objects.
|
||||
/// It temporarily takes ownwership of reference-counted objects that
|
||||
/// It temporarily takes ownership of reference-counted objects that
|
||||
/// nobody else wants to take ownership of and releases them
|
||||
/// at a later, appropriate point in time.
|
||||
///
|
||||
|
@ -82,6 +82,8 @@ class Foundation_API Base32Decoder: public Base32DecoderIOS, public std::istream
|
||||
/// This istream base32-decodes all data
|
||||
/// read from the istream connected to it.
|
||||
///
|
||||
/// The class implements RFC 4648 - https://tools.ietf.org/html/rfc4648
|
||||
///
|
||||
/// Note: For performance reasons, the characters
|
||||
/// are read directly from the given istream's
|
||||
/// underlying streambuf, so the state
|
||||
|
@ -89,6 +89,8 @@ class Foundation_API Base32Encoder: public Base32EncoderIOS, public std::ostream
|
||||
/// writing data, to ensure proper
|
||||
/// completion of the encoding operation.
|
||||
///
|
||||
/// The class implements RFC 4648 - https://tools.ietf.org/html/rfc4648
|
||||
///
|
||||
/// Note: The characters are directly written
|
||||
/// to the ostream's streambuf, thus bypassing
|
||||
/// the ostream. The ostream's state is therefore
|
||||
|
@ -86,6 +86,8 @@ class Foundation_API Base64Decoder: public Base64DecoderIOS, public std::istream
|
||||
/// This istream base64-decodes all data
|
||||
/// read from the istream connected to it.
|
||||
///
|
||||
/// The class implements RFC 4648 - https://tools.ietf.org/html/rfc4648
|
||||
///
|
||||
/// Note: For performance reasons, the characters
|
||||
/// are read directly from the given istream's
|
||||
/// underlying streambuf, so the state
|
||||
|
@ -117,6 +117,8 @@ class Foundation_API Base64Encoder: public Base64EncoderIOS, public std::ostream
|
||||
/// writing data, to ensure proper
|
||||
/// completion of the encoding operation.
|
||||
///
|
||||
/// The class implements RFC 4648 - https://tools.ietf.org/html/rfc4648
|
||||
///
|
||||
/// Note: The characters are directly written
|
||||
/// to the ostream's streambuf, thus bypassing
|
||||
/// the ostream. The ostream's state is therefore
|
||||
|
@ -29,7 +29,7 @@ namespace Poco {
|
||||
|
||||
template <class TArgs, class TMutex = FastMutex>
|
||||
class BasicEvent: public AbstractEvent <
|
||||
TArgs, DefaultStrategy<TArgs, AbstractDelegate<TArgs> >,
|
||||
TArgs, DefaultStrategy<TArgs, AbstractDelegate<TArgs>>,
|
||||
AbstractDelegate<TArgs>,
|
||||
TMutex
|
||||
>
|
||||
|
@ -94,9 +94,9 @@ public:
|
||||
Poco::UInt32 size(static_cast<Poco::UInt32>(value.size()));
|
||||
|
||||
*this << size;
|
||||
for (typename std::vector<T>::const_iterator it = value.begin(); it != value.end(); ++it)
|
||||
for (const auto& v: value)
|
||||
{
|
||||
*this << *it;
|
||||
*this << v;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
@ -36,16 +36,16 @@ class Buffer
|
||||
/// is needed.
|
||||
{
|
||||
public:
|
||||
Buffer(std::size_t capacity):
|
||||
_capacity(capacity),
|
||||
_used(capacity),
|
||||
Buffer(std::size_t length):
|
||||
_capacity(length),
|
||||
_used(length),
|
||||
_ptr(0),
|
||||
_ownMem(true)
|
||||
/// Creates and allocates the Buffer.
|
||||
{
|
||||
if (capacity > 0)
|
||||
if (length > 0)
|
||||
{
|
||||
_ptr = new T[capacity];
|
||||
_ptr = new T[length];
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,6 +94,19 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
Buffer(Buffer&& other) :
|
||||
/// Copy constructor.
|
||||
_capacity(other._capacity),
|
||||
_used(other._used),
|
||||
_ptr(other._ptr),
|
||||
_ownMem(other._ownMem)
|
||||
{
|
||||
other._capacity = 0;
|
||||
other._used = 0;
|
||||
other._ownMem = false;
|
||||
other._ptr = nullptr;
|
||||
}
|
||||
|
||||
Buffer& operator = (const Buffer& other)
|
||||
/// Assignment operator.
|
||||
{
|
||||
@ -106,6 +119,25 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
Buffer& operator = (Buffer&& other)
|
||||
/// Assignment operator.
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
_capacity = other._capacity;
|
||||
_used = other._used;
|
||||
_ptr = other._ptr;
|
||||
_ownMem = other._ownMem;
|
||||
|
||||
other._capacity = 0;
|
||||
other._used = 0;
|
||||
other._ownMem = false;
|
||||
other._ptr = nullptr;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
~Buffer()
|
||||
/// Destroys the Buffer.
|
||||
{
|
||||
@ -225,6 +257,7 @@ public:
|
||||
swap(_ptr, other._ptr);
|
||||
swap(_capacity, other._capacity);
|
||||
swap(_used, other._used);
|
||||
swap(_ownMem, other._ownMem);
|
||||
}
|
||||
|
||||
bool operator == (const Buffer& other) const
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
return new char_type[static_cast<std::size_t>(size)];
|
||||
}
|
||||
|
||||
static void deallocate(char_type* ptr, std::streamsize /*size*/) throw()
|
||||
static void deallocate(char_type* ptr, std::streamsize /*size*/) noexcept
|
||||
{
|
||||
delete [] ptr;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
namespace Poco {
|
||||
|
||||
|
||||
template <typename ch, typename tr, typename ba = BufferAllocator<ch> >
|
||||
template <typename ch, typename tr, typename ba = BufferAllocator<ch>>
|
||||
class BasicBufferedBidirectionalStreamBuf: public std::basic_streambuf<ch, tr>
|
||||
/// This is an implementation of a buffered bidirectional
|
||||
/// streambuf that greatly simplifies the implementation of
|
||||
@ -170,9 +170,9 @@ private:
|
||||
// instantiations in different libraries.
|
||||
//
|
||||
#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS)
|
||||
template class Foundation_API BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char> >;
|
||||
template class Foundation_API BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char>>;
|
||||
#endif
|
||||
typedef BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char> > BufferedBidirectionalStreamBuf;
|
||||
typedef BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char>> BufferedBidirectionalStreamBuf;
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
@ -29,7 +29,7 @@
|
||||
namespace Poco {
|
||||
|
||||
|
||||
template <typename ch, typename tr, typename ba = BufferAllocator<ch> >
|
||||
template <typename ch, typename tr, typename ba = BufferAllocator<ch>>
|
||||
class BasicBufferedStreamBuf: public std::basic_streambuf<ch, tr>
|
||||
/// This is an implementation of a buffered streambuf
|
||||
/// that greatly simplifies the implementation of
|
||||
@ -59,13 +59,20 @@ public:
|
||||
_pBuffer(Allocator::allocate(_bufsize)),
|
||||
_mode(mode)
|
||||
{
|
||||
this->setg(_pBuffer + 4, _pBuffer + 4, _pBuffer + 4);
|
||||
this->setg(_pBuffer + 4, _pBuffer + 4, _pBuffer + 4);
|
||||
this->setp(_pBuffer, _pBuffer + _bufsize);
|
||||
}
|
||||
|
||||
~BasicBufferedStreamBuf()
|
||||
{
|
||||
Allocator::deallocate(_pBuffer, _bufsize);
|
||||
try
|
||||
{
|
||||
Allocator::deallocate(_pBuffer, _bufsize);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
poco_unexpected();
|
||||
}
|
||||
}
|
||||
|
||||
virtual int_type overflow(int_type c)
|
||||
@ -162,9 +169,9 @@ private:
|
||||
// instantiations in different libraries.
|
||||
//
|
||||
#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS)
|
||||
template class Foundation_API BasicBufferedStreamBuf<char, std::char_traits<char> >;
|
||||
template class Foundation_API BasicBufferedStreamBuf<char, std::char_traits<char>>;
|
||||
#endif
|
||||
typedef BasicBufferedStreamBuf<char, std::char_traits<char> > BufferedStreamBuf;
|
||||
typedef BasicBufferedStreamBuf<char, std::char_traits<char>> BufferedStreamBuf;
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
@ -36,6 +36,8 @@ public:
|
||||
static UInt16 flipBytes(UInt16 value);
|
||||
static Int32 flipBytes(Int32 value);
|
||||
static UInt32 flipBytes(UInt32 value);
|
||||
static float flipBytes(float value);
|
||||
static double flipBytes(double value);
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
static Int64 flipBytes(Int64 value);
|
||||
static UInt64 flipBytes(UInt64 value);
|
||||
@ -94,6 +96,21 @@ public:
|
||||
static Int64 fromNetwork(Int64 value);
|
||||
static UInt64 fromNetwork (UInt64 value);
|
||||
#endif
|
||||
|
||||
private:
|
||||
template<typename T>
|
||||
static T flip(T value)
|
||||
{
|
||||
T flip = value;
|
||||
std::size_t halfSize = sizeof(T) / 2;
|
||||
char* flipP = reinterpret_cast<char*>(&flip);
|
||||
|
||||
for (std::size_t i = 0; i < halfSize; i++)
|
||||
{
|
||||
std::swap(flipP[i], flipP[sizeof(T) - i - 1]);
|
||||
}
|
||||
return flip;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -150,6 +167,18 @@ inline Int32 ByteOrder::flipBytes(Int32 value)
|
||||
}
|
||||
|
||||
|
||||
inline float ByteOrder::flipBytes(float value)
|
||||
{
|
||||
return flip(value);
|
||||
}
|
||||
|
||||
|
||||
inline double ByteOrder::flipBytes(double value)
|
||||
{
|
||||
return flip(value);
|
||||
}
|
||||
|
||||
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
inline UInt64 ByteOrder::flipBytes(UInt64 value)
|
||||
{
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "Poco/Configurable.h"
|
||||
#include "Poco/Mutex.h"
|
||||
#include "Poco/RefCountedObject.h"
|
||||
#include "Poco/AutoPtr.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@ -38,6 +39,8 @@ class Foundation_API Channel: public Configurable, public RefCountedObject
|
||||
/// of getProperty() and setProperty().
|
||||
{
|
||||
public:
|
||||
using Ptr = AutoPtr<Channel>;
|
||||
|
||||
Channel();
|
||||
/// Creates the channel and initializes
|
||||
/// the reference count to one.
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define POCO_LIBRARY_API __declspec(dllexport)
|
||||
#elif defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#define POCO_LIBRARY_API __attribute__ ((visibility ("default")))
|
||||
#else
|
||||
#define POCO_LIBRARY_API
|
||||
#endif
|
||||
@ -94,6 +96,10 @@ extern "C" \
|
||||
pManifest->insert(new Poco::MetaObject<cls, _Base>(#cls));
|
||||
|
||||
|
||||
#define POCO_EXPORT_INTERFACE(cls, itf) \
|
||||
pManifest->insert(new Poco::MetaObject<cls, _Base>(itf));
|
||||
|
||||
|
||||
#define POCO_EXPORT_SINGLETON(cls) \
|
||||
pManifest->insert(new Poco::MetaSingleton<cls, _Base>(#cls));
|
||||
|
||||
|
@ -132,10 +132,10 @@ public:
|
||||
virtual ~ClassLoader()
|
||||
/// Destroys the ClassLoader.
|
||||
{
|
||||
for (typename LibraryMap::const_iterator it = _map.begin(); it != _map.end(); ++it)
|
||||
for (auto& p: _map)
|
||||
{
|
||||
delete it->second.pLibrary;
|
||||
delete it->second.pManifest;
|
||||
delete p.second.pLibrary;
|
||||
delete p.second.pManifest;
|
||||
}
|
||||
}
|
||||
|
||||
@ -247,9 +247,9 @@ public:
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
for (typename LibraryMap::const_iterator it = _map.begin(); it != _map.end(); ++it)
|
||||
for (const auto& p: _map)
|
||||
{
|
||||
const Manif* pManif = it->second.pManifest;
|
||||
const Manif* pManif = p.second.pManifest;
|
||||
typename Manif::Iterator itm = pManif->find(className);
|
||||
if (itm != pManif->end())
|
||||
return *itm;
|
||||
|
@ -28,7 +28,7 @@ class Foundation_API Clock
|
||||
/// A Clock stores a monotonic* clock value
|
||||
/// with (theoretical) microseconds resolution.
|
||||
/// Clocks can be compared with each other
|
||||
/// and simple arithmetics are supported.
|
||||
/// and simple arithmetic is supported.
|
||||
///
|
||||
/// [*] Note that Clock values are only monotonic if
|
||||
/// the operating system provides a monotonic clock.
|
||||
@ -108,7 +108,7 @@ public:
|
||||
|
||||
static ClockDiff resolution();
|
||||
/// Returns the resolution in units per second.
|
||||
/// Since the Clock clas has microsecond resolution,
|
||||
/// Since the Clock class has microsecond resolution,
|
||||
/// the returned value is always 1000000.
|
||||
|
||||
static ClockDiff accuracy();
|
||||
|
@ -18,16 +18,6 @@
|
||||
#define Foundation_Config_INCLUDED
|
||||
|
||||
|
||||
// Define to enable Windows Unicode (UTF-8) support
|
||||
// NOTE: As of POCO C++ Libraries release 1.6.0, compiling POCO
|
||||
// without POCO_WIN32_UTF8 defined on Windows is deprecated.
|
||||
#define POCO_WIN32_UTF8
|
||||
|
||||
|
||||
// Define to enable C++11 support
|
||||
// #define POCO_ENABLE_CPP11
|
||||
|
||||
|
||||
// Define to disable implicit linking
|
||||
// #define POCO_NO_AUTOMATIC_LIBS
|
||||
|
||||
|
@ -43,6 +43,8 @@ class Foundation_API ConsoleChannel: public Channel
|
||||
/// same stream.
|
||||
{
|
||||
public:
|
||||
using Ptr = AutoPtr<ConsoleChannel>;
|
||||
|
||||
ConsoleChannel();
|
||||
/// Creates the channel and attaches std::clog.
|
||||
|
||||
|
@ -46,34 +46,34 @@ public:
|
||||
~CountingStreamBuf();
|
||||
/// Destroys the CountingStream.
|
||||
|
||||
int chars() const;
|
||||
std::streamsize chars() const;
|
||||
/// Returns the total number of characters.
|
||||
|
||||
int lines() const;
|
||||
std::streamsize lines() const;
|
||||
/// Returns the total number of lines.
|
||||
|
||||
int pos() const;
|
||||
std::streamsize pos() const;
|
||||
/// Returns the number of characters on the current line.
|
||||
|
||||
void reset();
|
||||
/// Resets all counters.
|
||||
|
||||
void setCurrentLineNumber(int line);
|
||||
void setCurrentLineNumber(std::streamsize line);
|
||||
/// Sets the current line number.
|
||||
///
|
||||
/// This is mainly useful when parsing C/C++
|
||||
/// preprocessed source code containing #line directives.
|
||||
|
||||
int getCurrentLineNumber() const;
|
||||
std::streamsize getCurrentLineNumber() const;
|
||||
/// Returns the current line number (same as lines()).
|
||||
|
||||
void addChars(int chars);
|
||||
void addChars(std::streamsize chars);
|
||||
/// Add to the total number of characters.
|
||||
|
||||
void addLines(int lines);
|
||||
void addLines(std::streamsize lines);
|
||||
/// Add to the total number of lines.
|
||||
|
||||
void addPos(int pos);
|
||||
void addPos(std::streamsize pos);
|
||||
/// Add to the number of characters on the current line.
|
||||
|
||||
protected:
|
||||
@ -83,9 +83,9 @@ protected:
|
||||
private:
|
||||
std::istream* _pIstr;
|
||||
std::ostream* _pOstr;
|
||||
int _chars;
|
||||
int _lines;
|
||||
int _pos;
|
||||
std::streamsize _chars;
|
||||
std::streamsize _lines;
|
||||
std::streamsize _pos;
|
||||
};
|
||||
|
||||
|
||||
@ -110,34 +110,34 @@ public:
|
||||
~CountingIOS();
|
||||
/// Destroys the stream.
|
||||
|
||||
int chars() const;
|
||||
std::streamsize chars() const;
|
||||
/// Returns the total number of characters.
|
||||
|
||||
int lines() const;
|
||||
std::streamsize lines() const;
|
||||
/// Returns the total number of lines.
|
||||
|
||||
int pos() const;
|
||||
std::streamsize pos() const;
|
||||
/// Returns the number of characters on the current line.
|
||||
|
||||
void reset();
|
||||
/// Resets all counters.
|
||||
|
||||
void setCurrentLineNumber(int line);
|
||||
void setCurrentLineNumber(std::streamsize line);
|
||||
/// Sets the current line number.
|
||||
///
|
||||
/// This is mainly useful when parsing C/C++
|
||||
/// preprocessed source code containing #line directives.
|
||||
|
||||
int getCurrentLineNumber() const;
|
||||
std::streamsize getCurrentLineNumber() const;
|
||||
/// Returns the current line number (same as lines()).
|
||||
|
||||
void addChars(int chars);
|
||||
void addChars(std::streamsize chars);
|
||||
/// Add to the total number of characters.
|
||||
|
||||
void addLines(int lines);
|
||||
void addLines(std::streamsize lines);
|
||||
/// Add to the total number of lines.
|
||||
|
||||
void addPos(int pos);
|
||||
void addPos(std::streamsize pos);
|
||||
/// Add to the number of characters on the current line.
|
||||
|
||||
CountingStreamBuf* rdbuf();
|
||||
@ -183,49 +183,49 @@ public:
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline int CountingStreamBuf::chars() const
|
||||
inline std::streamsize CountingStreamBuf::chars() const
|
||||
{
|
||||
return _chars;
|
||||
}
|
||||
|
||||
|
||||
inline int CountingStreamBuf::lines() const
|
||||
inline std::streamsize CountingStreamBuf::lines() const
|
||||
{
|
||||
return _lines;
|
||||
}
|
||||
|
||||
|
||||
inline int CountingStreamBuf::pos() const
|
||||
inline std::streamsize CountingStreamBuf::pos() const
|
||||
{
|
||||
return _pos;
|
||||
}
|
||||
|
||||
|
||||
inline int CountingStreamBuf::getCurrentLineNumber() const
|
||||
inline std::streamsize CountingStreamBuf::getCurrentLineNumber() const
|
||||
{
|
||||
return _lines;
|
||||
}
|
||||
|
||||
|
||||
inline int CountingIOS::chars() const
|
||||
inline std::streamsize CountingIOS::chars() const
|
||||
{
|
||||
return _buf.chars();
|
||||
}
|
||||
|
||||
|
||||
inline int CountingIOS::lines() const
|
||||
inline std::streamsize CountingIOS::lines() const
|
||||
{
|
||||
return _buf.lines();
|
||||
}
|
||||
|
||||
|
||||
inline int CountingIOS::pos() const
|
||||
inline std::streamsize CountingIOS::pos() const
|
||||
{
|
||||
return _buf.pos();
|
||||
}
|
||||
|
||||
|
||||
inline int CountingIOS::getCurrentLineNumber() const
|
||||
inline std::streamsize CountingIOS::getCurrentLineNumber() const
|
||||
{
|
||||
return _buf.getCurrentLineNumber();
|
||||
}
|
||||
|
@ -107,9 +107,11 @@ public:
|
||||
/// * day is from 1 to 31.
|
||||
/// * hour is from 0 to 23.
|
||||
/// * minute is from 0 to 59.
|
||||
/// * second is from 0 to 60 (allowing leap seconds).
|
||||
/// * second is from 0 to 60.
|
||||
/// * millisecond is from 0 to 999.
|
||||
/// * microsecond is from 0 to 999.
|
||||
///
|
||||
/// Throws an InvalidArgumentException if an argument date is out of range.
|
||||
|
||||
DateTime(double julianDay);
|
||||
/// Creates a DateTime for the given Julian day.
|
||||
@ -141,9 +143,11 @@ public:
|
||||
/// * day is from 1 to 31.
|
||||
/// * hour is from 0 to 23.
|
||||
/// * minute is from 0 to 59.
|
||||
/// * second is from 0 to 60 (allowing leap seconds).
|
||||
/// * second is from 0 to 60.
|
||||
/// * millisecond is from 0 to 999.
|
||||
/// * microsecond is from 0 to 999.
|
||||
///
|
||||
/// Throws an InvalidArgumentException if an argument date is out of range.
|
||||
|
||||
void swap(DateTime& dateTime);
|
||||
/// Swaps the DateTime with another one.
|
||||
@ -164,11 +168,11 @@ public:
|
||||
/// on a Saturday, week 1 will be the week starting on Monday, January 3.
|
||||
/// January 1 and 2 will fall within week 0 (or the last week of the previous year).
|
||||
///
|
||||
/// For 2007, which starts on a Monday, week 1 will be the week startung on Monday, January 1.
|
||||
/// For 2007, which starts on a Monday, week 1 will be the week starting on Monday, January 1.
|
||||
/// There will be no week 0 in 2007.
|
||||
|
||||
int day() const;
|
||||
/// Returns the day witin the month (1 to 31).
|
||||
/// Returns the day within the month (1 to 31).
|
||||
|
||||
int dayOfWeek() const;
|
||||
/// Returns the weekday (0 to 6, where
|
||||
@ -254,7 +258,7 @@ protected:
|
||||
/// Computes the Julian day for an UTC time.
|
||||
|
||||
static double toJulianDay(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0);
|
||||
/// Computes the Julian day for a gregorian calendar date and time.
|
||||
/// Computes the Julian day for a Gregorian calendar date and time.
|
||||
/// See <http://vsg.cape.com/~pbaum/date/jdimp.htm>, section 2.3.1 for the algorithm.
|
||||
|
||||
static Timestamp::UtcTimeVal toUtcTime(double julianDay);
|
||||
@ -287,6 +291,21 @@ private:
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
|
||||
|
||||
inline double DateTime::toJulianDay(Timestamp::UtcTimeVal utcTime)
|
||||
{
|
||||
double utcDays = double(utcTime)/864000000000.0;
|
||||
return utcDays + 2299160.5; // first day of Gregorian reform (Oct 15 1582)
|
||||
}
|
||||
|
||||
|
||||
inline Timestamp::UtcTimeVal DateTime::toUtcTime(double julianDay)
|
||||
{
|
||||
return Timestamp::UtcTimeVal((julianDay - 2299160.5)*864000000000.0);
|
||||
}
|
||||
|
||||
|
||||
inline Timestamp DateTime::timestamp() const
|
||||
{
|
||||
return Timestamp::fromUtcTime(_utcTime);
|
||||
|
@ -101,7 +101,7 @@ public:
|
||||
static int parseDayOfWeek(std::string::const_iterator& it, const std::string::const_iterator& end);
|
||||
/// Tries to interpret the given range as a weekday name. The range must be at least
|
||||
/// three characters long.
|
||||
/// Returns the weekday number (0 .. 6, where 0 = Synday, 1 = Monday, etc.) if the
|
||||
/// Returns the weekday number (0 .. 6, where 0 = Sunday, 1 = Monday, etc.) if the
|
||||
/// weekday name is valid. Otherwise throws a SyntaxException.
|
||||
|
||||
protected:
|
||||
|
@ -35,10 +35,10 @@ class DefaultStrategy: public NotificationStrategy<TArgs, TDelegate>
|
||||
/// order in which they have been registered.
|
||||
{
|
||||
public:
|
||||
typedef TDelegate* DelegateHandle;
|
||||
typedef SharedPtr<TDelegate> DelegatePtr;
|
||||
typedef std::vector<DelegatePtr> Delegates;
|
||||
typedef typename Delegates::iterator Iterator;
|
||||
using DelegateHandle = TDelegate*;
|
||||
using DelegatePtr = SharedPtr<TDelegate>;
|
||||
using Delegates = std::vector<DelegatePtr>;
|
||||
using Iterator = typename Delegates::iterator;
|
||||
|
||||
public:
|
||||
DefaultStrategy()
|
||||
@ -132,10 +132,10 @@ class DefaultStrategy<void,TDelegate>: public NotificationStrategy<void, TDelega
|
||||
/// order in which they have been registered.
|
||||
{
|
||||
public:
|
||||
typedef TDelegate* DelegateHandle;
|
||||
typedef SharedPtr<TDelegate> DelegatePtr;
|
||||
typedef std::vector<DelegatePtr> Delegates;
|
||||
typedef typename Delegates::iterator Iterator;
|
||||
using DelegateHandle = TDelegate*;
|
||||
using DelegatePtr = SharedPtr<TDelegate>;
|
||||
using Delegates = std::vector<DelegatePtr>;
|
||||
using Iterator = typename Delegates::iterator;
|
||||
|
||||
public:
|
||||
DefaultStrategy()
|
||||
|
@ -36,7 +36,7 @@ class Foundation_API DigestEngine
|
||||
/// digest.
|
||||
{
|
||||
public:
|
||||
typedef std::vector<unsigned char> Digest;
|
||||
using Digest = std::vector<unsigned char>;
|
||||
|
||||
DigestEngine();
|
||||
virtual ~DigestEngine();
|
||||
|
@ -31,8 +31,8 @@ namespace Poco {
|
||||
class Foundation_API TraverseBase
|
||||
{
|
||||
public:
|
||||
typedef std::stack<DirectoryIterator> Stack;
|
||||
typedef std::function<UInt16(const Stack&)> DepthFun;
|
||||
using Stack = std::stack<DirectoryIterator>;
|
||||
using DepthFun = std::function<UInt16(const Stack&)>;
|
||||
|
||||
enum
|
||||
{
|
||||
@ -82,7 +82,7 @@ private:
|
||||
SiblingsFirstTraverse(const SiblingsFirstTraverse&);
|
||||
SiblingsFirstTraverse& operator=(const SiblingsFirstTraverse&);
|
||||
|
||||
std::stack<std::queue<std::string> > _dirsStack;
|
||||
std::stack<std::queue<std::string>> _dirsStack;
|
||||
};
|
||||
|
||||
|
||||
|
@ -33,7 +33,7 @@ class Pair
|
||||
/// Pair allows to define a pair of values.
|
||||
{
|
||||
public:
|
||||
typedef typename std::pair<K, Var> Data;
|
||||
using Data = typename std::pair<K, Var>;
|
||||
|
||||
Pair(): _data()
|
||||
/// Creates an empty Pair
|
||||
@ -96,7 +96,7 @@ public:
|
||||
std::string toString()
|
||||
{
|
||||
std::string str;
|
||||
Var(*this).convert<std::string>(str);
|
||||
Var(*this).template convert<std::string>(str);
|
||||
return str;
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ private:
|
||||
|
||||
|
||||
template <>
|
||||
class VarHolderImpl<Pair<std::string> >: public VarHolder
|
||||
class VarHolderImpl<Pair<std::string>>: public VarHolder
|
||||
{
|
||||
public:
|
||||
VarHolderImpl(const Pair<std::string>& val): _val(val)
|
||||
@ -255,7 +255,7 @@ private:
|
||||
|
||||
|
||||
template <>
|
||||
class VarHolderImpl<Pair<int> >: public VarHolder
|
||||
class VarHolderImpl<Pair<int>>: public VarHolder
|
||||
{
|
||||
public:
|
||||
VarHolderImpl(const Pair<int>& val): _val(val)
|
||||
|
@ -32,7 +32,7 @@ namespace Poco {
|
||||
namespace Dynamic {
|
||||
|
||||
|
||||
template <typename K, typename M = std::map<K, Var>, typename S = std::set<K> >
|
||||
template <typename K, typename M = std::map<K, Var>, typename S = std::set<K>>
|
||||
class Struct
|
||||
/// Struct allows to define a named collection of Var objects.
|
||||
{
|
||||
@ -44,7 +44,7 @@ public:
|
||||
typedef typename Struct<K>::Data::value_type ValueType;
|
||||
typedef typename Struct<K>::Data::size_type SizeType;
|
||||
typedef typename std::pair<typename Struct<K, M, S>::Iterator, bool> InsRetVal;
|
||||
typedef typename Poco::SharedPtr<Struct<K, M, S> > Ptr;
|
||||
typedef typename Poco::SharedPtr<Struct<K, M, S>> Ptr;
|
||||
|
||||
Struct(): _data()
|
||||
/// Creates an empty Struct
|
||||
@ -62,16 +62,12 @@ public:
|
||||
assignMap(val);
|
||||
}
|
||||
|
||||
#ifdef POCO_ENABLE_CPP11
|
||||
|
||||
template <typename T>
|
||||
Struct(const OrderedMap<K, T>& val)
|
||||
{
|
||||
assignMap(val);
|
||||
}
|
||||
|
||||
#endif // POCO_ENABLE_CPP11
|
||||
|
||||
virtual ~Struct()
|
||||
/// Destroys the Struct.
|
||||
{
|
||||
@ -171,18 +167,24 @@ public:
|
||||
_data.erase(it);
|
||||
}
|
||||
|
||||
inline void clear()
|
||||
/// Remove all elements from the struct
|
||||
{
|
||||
_data.clear();
|
||||
}
|
||||
|
||||
inline void swap(Struct& other)
|
||||
/// Swap content of Struct with another Struct
|
||||
{
|
||||
_data.swap(other._data);
|
||||
}
|
||||
|
||||
inline bool empty() const
|
||||
/// Returns true if the Struct doesn't contain any members
|
||||
{
|
||||
return _data.empty();
|
||||
}
|
||||
|
||||
inline void clear()
|
||||
/// Clears the Struct contents
|
||||
{
|
||||
_data.clear();
|
||||
}
|
||||
|
||||
SizeType size() const
|
||||
/// Returns the number of members the Struct contains
|
||||
{
|
||||
@ -199,10 +201,35 @@ public:
|
||||
return keys;
|
||||
}
|
||||
|
||||
inline Var getVar(const K& key) const
|
||||
/// Returns the var value of the element with the given name.
|
||||
/// Throws a NotFoundException if the key does not exist.
|
||||
{
|
||||
ConstIterator it = find(key);
|
||||
if(it == end())
|
||||
{
|
||||
throw NotFoundException("Key not found in Struct");
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
|
||||
template<typename DefT = Var>
|
||||
inline Var getVar(const K& key, const DefT& defaultValue) const
|
||||
/// Returns the var value of the element with the given name.
|
||||
/// or defaultValue if none is found.
|
||||
{
|
||||
ConstIterator it = find(key);
|
||||
if(it == end())
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
|
||||
std::string toString() const
|
||||
{
|
||||
std::string str;
|
||||
Var(*this).convert<std::string>(str);
|
||||
Var(*this).template convert<std::string>(str);
|
||||
return str;
|
||||
}
|
||||
|
||||
@ -222,7 +249,7 @@ private:
|
||||
|
||||
|
||||
template <>
|
||||
class VarHolderImpl<Struct<std::string, std::map<std::string, Var>, std::set<std::string> > >: public VarHolder
|
||||
class VarHolderImpl<Struct<std::string, std::map<std::string, Var>, std::set<std::string>>>: public VarHolder
|
||||
{
|
||||
public:
|
||||
typedef std::string KeyType;
|
||||
@ -408,7 +435,7 @@ private:
|
||||
|
||||
|
||||
template <>
|
||||
class VarHolderImpl<Struct<int, std::map<int, Var>, std::set<int> > > : public VarHolder
|
||||
class VarHolderImpl<Struct<int, std::map<int, Var>, std::set<int>>> : public VarHolder
|
||||
{
|
||||
public:
|
||||
typedef int KeyType;
|
||||
@ -593,11 +620,8 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#ifdef POCO_ENABLE_CPP11
|
||||
|
||||
|
||||
template <>
|
||||
class VarHolderImpl<Struct<std::string, Poco::OrderedMap<std::string, Var>, Poco::OrderedSet<std::string> > > : public VarHolder
|
||||
class VarHolderImpl<Struct<std::string, Poco::OrderedMap<std::string, Var>, Poco::OrderedSet<std::string>>> : public VarHolder
|
||||
{
|
||||
public:
|
||||
typedef std::string KeyType;
|
||||
@ -783,7 +807,7 @@ private:
|
||||
|
||||
|
||||
template <>
|
||||
class VarHolderImpl<Struct<int, Poco::OrderedMap<int, Var>, Poco::OrderedSet<int> > > : public VarHolder
|
||||
class VarHolderImpl<Struct<int, Poco::OrderedMap<int, Var>, Poco::OrderedSet<int>>> : public VarHolder
|
||||
{
|
||||
public:
|
||||
typedef int KeyType;
|
||||
@ -968,17 +992,12 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#endif // POCO_ENABLE_CPP11
|
||||
|
||||
|
||||
} // namespace Dynamic
|
||||
|
||||
|
||||
typedef Dynamic::Struct<std::string> DynamicStruct;
|
||||
typedef Dynamic::Struct<std::string, Poco::OrderedMap<std::string, Dynamic::Var>, Poco::OrderedSet<std::string>> OrderedDynamicStruct;
|
||||
|
||||
#ifdef POCO_ENABLE_CPP11
|
||||
typedef Dynamic::Struct<std::string, Poco::OrderedMap<std::string, Dynamic::Var>, Poco::OrderedSet<std::string> > OrderedDynamicStruct;
|
||||
#endif // POCO_ENABLE_CPP11
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
@ -81,9 +81,9 @@ class Foundation_API Var
|
||||
/// VarHolderImpl is available. For supported types, see VarHolder documentation.
|
||||
{
|
||||
public:
|
||||
typedef SharedPtr<Var> Ptr;
|
||||
typedef Poco::Dynamic::VarIterator Iterator;
|
||||
typedef const VarIterator ConstIterator;
|
||||
using Ptr = SharedPtr<Var>;
|
||||
using Iterator = Poco::Dynamic::VarIterator;
|
||||
using ConstIterator = const VarIterator;
|
||||
|
||||
Var();
|
||||
/// Creates an empty Var.
|
||||
@ -798,8 +798,7 @@ inline bool Var::isEmpty() const
|
||||
|
||||
inline bool Var::isArray() const
|
||||
{
|
||||
if (isEmpty() ||
|
||||
isString()) return false;
|
||||
if (isEmpty() || isString()) return false;
|
||||
|
||||
VarHolder* pHolder = content();
|
||||
return pHolder ? pHolder->isArray() : false;
|
||||
@ -2231,6 +2230,110 @@ inline bool operator >= (const long& other, const Var& da)
|
||||
}
|
||||
|
||||
|
||||
inline unsigned long operator + (const unsigned long& other, const Var& da)
|
||||
/// Addition operator for adding Var to unsigned long
|
||||
{
|
||||
return other + da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline unsigned long operator - (const unsigned long& other, const Var& da)
|
||||
/// Subtraction operator for subtracting Var from unsigned long
|
||||
{
|
||||
return other - da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline unsigned long operator * (const unsigned long& other, const Var& da)
|
||||
/// Multiplication operator for multiplying Var with unsigned long
|
||||
{
|
||||
return other * da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline unsigned long operator / (const unsigned long& other, const Var& da)
|
||||
/// Division operator for dividing Var with unsigned long
|
||||
{
|
||||
return other / da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline unsigned long operator += (unsigned long& other, const Var& da)
|
||||
/// Addition assignment operator for adding Var to unsigned long
|
||||
{
|
||||
return other += da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline unsigned long operator -= (unsigned long& other, const Var& da)
|
||||
/// Subtraction assignment operator for subtracting Var from unsigned long
|
||||
{
|
||||
return other -= da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline unsigned long operator *= (unsigned long& other, const Var& da)
|
||||
/// Multiplication assignment operator for multiplying Var with unsigned long
|
||||
{
|
||||
return other *= da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline unsigned long operator /= (unsigned long& other, const Var& da)
|
||||
/// Division assignment operator for dividing Var with unsigned long
|
||||
{
|
||||
return other /= da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline bool operator == (const unsigned long& other, const Var& da)
|
||||
/// Equality operator for comparing Var with unsigned long
|
||||
{
|
||||
if (da.isEmpty()) return false;
|
||||
return other == da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline bool operator != (const unsigned long& other, const Var& da)
|
||||
/// Inequality operator for comparing Var with unsigned long
|
||||
{
|
||||
if (da.isEmpty()) return true;
|
||||
return other != da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline bool operator < (const unsigned long& other, const Var& da)
|
||||
/// Less than operator for comparing Var with unsigned long
|
||||
{
|
||||
if (da.isEmpty()) return false;
|
||||
return other < da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline bool operator <= (const unsigned long& other, const Var& da)
|
||||
/// Less than or equal operator for comparing Var with unsigned long
|
||||
{
|
||||
if (da.isEmpty()) return false;
|
||||
return other <= da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline bool operator > (const unsigned long& other, const Var& da)
|
||||
/// Greater than operator for comparing Var with unsigned long
|
||||
{
|
||||
if (da.isEmpty()) return false;
|
||||
return other > da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
inline bool operator >= (const unsigned long& other, const Var& da)
|
||||
/// Greater than or equal operator for comparing Var with unsigned long
|
||||
{
|
||||
if (da.isEmpty()) return false;
|
||||
return other >= da.convert<unsigned long>();
|
||||
}
|
||||
|
||||
|
||||
#endif // POCO_LONG_IS_64_BIT
|
||||
|
||||
|
||||
|
@ -670,6 +670,7 @@ inline bool VarHolder::isDateTime() const
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
inline std::size_t VarHolder::size() const
|
||||
{
|
||||
return 1u;
|
||||
@ -3576,7 +3577,7 @@ private:
|
||||
|
||||
|
||||
template <typename T>
|
||||
class VarHolderImpl<std::vector<T> >: public VarHolder
|
||||
class VarHolderImpl<std::vector<T>>: public VarHolder
|
||||
{
|
||||
public:
|
||||
VarHolderImpl(const std::vector<T>& val): _val(val)
|
||||
@ -3641,7 +3642,7 @@ private:
|
||||
|
||||
|
||||
template <typename T>
|
||||
class VarHolderImpl<std::list<T> >: public VarHolder
|
||||
class VarHolderImpl<std::list<T>>: public VarHolder
|
||||
{
|
||||
public:
|
||||
VarHolderImpl(const std::list<T>& val): _val(val)
|
||||
@ -3716,7 +3717,7 @@ private:
|
||||
|
||||
|
||||
template <typename T>
|
||||
class VarHolderImpl<std::deque<T> >: public VarHolder
|
||||
class VarHolderImpl<std::deque<T>>: public VarHolder
|
||||
{
|
||||
public:
|
||||
VarHolderImpl(const std::deque<T>& val): _val(val)
|
||||
|
@ -45,9 +45,9 @@ public:
|
||||
/// Destroys the DynamicFactory and deletes the instantiators for
|
||||
/// all registered classes.
|
||||
{
|
||||
for (typename FactoryMap::iterator it = _map.begin(); it != _map.end(); ++it)
|
||||
for (auto& p: _map)
|
||||
{
|
||||
delete it->second;
|
||||
delete p.second;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,11 +44,21 @@ class Foundation_API Event: private EventImpl
|
||||
/// for an event to become signalled.
|
||||
{
|
||||
public:
|
||||
Event(bool autoReset = true);
|
||||
/// Creates the event. If autoReset is true,
|
||||
enum EventType
|
||||
{
|
||||
EVENT_MANUALRESET, /// Manual reset event
|
||||
EVENT_AUTORESET /// Auto-reset event
|
||||
};
|
||||
|
||||
explicit Event(EventType type = EVENT_AUTORESET);
|
||||
/// Creates the event. If type is EVENT_AUTORESET,
|
||||
/// the event is automatically reset after
|
||||
/// a wait() successfully returns.
|
||||
|
||||
//@ deprecated
|
||||
explicit Event(bool autoReset);
|
||||
/// Please use Event::Event(EventType) instead.
|
||||
|
||||
~Event();
|
||||
/// Destroys the event.
|
||||
|
||||
|
@ -33,6 +33,8 @@ class Foundation_API EventChannel: public Channel
|
||||
/// the logging framework.
|
||||
{
|
||||
public:
|
||||
using Ptr = AutoPtr<EventChannel>;
|
||||
|
||||
Poco::BasicEvent<const Message> messageLogged;
|
||||
/// Fired when a message is logged by calling the log() method.
|
||||
|
||||
|
@ -35,6 +35,8 @@ class Foundation_API EventLogChannel: public Channel
|
||||
/// containing the message definition resources can be found in $PATH.
|
||||
{
|
||||
public:
|
||||
using Ptr = AutoPtr<EventLogChannel>;
|
||||
|
||||
EventLogChannel();
|
||||
/// Creates the EventLogChannel.
|
||||
/// The name of the current application (or more correctly,
|
||||
@ -85,11 +87,7 @@ protected:
|
||||
static int getType(const Message& msg);
|
||||
static int getCategory(const Message& msg);
|
||||
void setUpRegistry() const;
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
static std::wstring findLibrary(const wchar_t* name);
|
||||
#else
|
||||
static std::string findLibrary(const char* name);
|
||||
#endif
|
||||
|
||||
private:
|
||||
std::string _name;
|
||||
|
@ -43,19 +43,19 @@ public:
|
||||
Exception(const Exception& exc);
|
||||
/// Copy constructor.
|
||||
|
||||
~Exception() throw();
|
||||
~Exception() noexcept;
|
||||
/// Destroys the exception and deletes the nested exception.
|
||||
|
||||
Exception& operator = (const Exception& exc);
|
||||
/// Assignment operator.
|
||||
|
||||
virtual const char* name() const throw();
|
||||
virtual const char* name() const noexcept;
|
||||
/// Returns a static string describing the exception.
|
||||
|
||||
virtual const char* className() const throw();
|
||||
virtual const char* className() const noexcept;
|
||||
/// Returns the name of the exception class.
|
||||
|
||||
virtual const char* what() const throw();
|
||||
virtual const char* what() const noexcept;
|
||||
/// Returns a static string describing the exception.
|
||||
///
|
||||
/// Same as name(), but for compatibility with std::exception.
|
||||
@ -146,10 +146,10 @@ inline int Exception::code() const
|
||||
CLS(const std::string& msg, const std::string& arg, int code = CODE); \
|
||||
CLS(const std::string& msg, const Poco::Exception& exc, int code = CODE); \
|
||||
CLS(const CLS& exc); \
|
||||
~CLS() throw(); \
|
||||
~CLS() noexcept; \
|
||||
CLS& operator = (const CLS& exc); \
|
||||
const char* name() const throw(); \
|
||||
const char* className() const throw(); \
|
||||
const char* name() const noexcept; \
|
||||
const char* className() const noexcept; \
|
||||
Poco::Exception* clone() const; \
|
||||
void rethrow() const; \
|
||||
};
|
||||
@ -173,7 +173,7 @@ inline int Exception::code() const
|
||||
CLS::CLS(const CLS& exc): BASE(exc) \
|
||||
{ \
|
||||
} \
|
||||
CLS::~CLS() throw() \
|
||||
CLS::~CLS() noexcept \
|
||||
{ \
|
||||
} \
|
||||
CLS& CLS::operator = (const CLS& exc) \
|
||||
@ -181,11 +181,11 @@ inline int Exception::code() const
|
||||
BASE::operator = (exc); \
|
||||
return *this; \
|
||||
} \
|
||||
const char* CLS::name() const throw() \
|
||||
const char* CLS::name() const noexcept \
|
||||
{ \
|
||||
return NAME; \
|
||||
} \
|
||||
const char* CLS::className() const throw() \
|
||||
const char* CLS::className() const noexcept \
|
||||
{ \
|
||||
return typeid(*this).name(); \
|
||||
} \
|
||||
|
@ -39,7 +39,7 @@ class ExpireLRUCache: public AbstractCache<TKey, TValue, StrategyCollection<TKey
|
||||
/// but also limits the size of the cache (per default: 1024).
|
||||
{
|
||||
public:
|
||||
ExpireLRUCache(long cacheSize = 1024, Timestamp::TimeDiff expire = 600000):
|
||||
ExpireLRUCache(std::size_t cacheSize = 1024, Timestamp::TimeDiff expire = 600000):
|
||||
AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue>, TMutex, TEventMutex>(StrategyCollection<TKey, TValue>())
|
||||
{
|
||||
this->_strategy.pushBack(new LRUStrategy<TKey, TValue>(cacheSize));
|
||||
|
@ -30,7 +30,7 @@ namespace Poco {
|
||||
template <class TArgs, class TMutex = FastMutex>
|
||||
class FIFOEvent: public AbstractEvent <
|
||||
TArgs,
|
||||
FIFOStrategy<TArgs, AbstractDelegate<TArgs> >,
|
||||
FIFOStrategy<TArgs, AbstractDelegate<TArgs>>,
|
||||
AbstractDelegate<TArgs>,
|
||||
TMutex
|
||||
>
|
||||
|
@ -23,14 +23,12 @@
|
||||
#include <vector>
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#if defined(_WIN32_WCE)
|
||||
#include "File_WINCE.h"
|
||||
#else
|
||||
#include "Poco/File_WIN32U.h"
|
||||
#endif
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#include "Poco/File_WIN32.h"
|
||||
#elif defined(POCO_VXWORKS)
|
||||
#include "Poco/File_VX.h"
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
@ -51,8 +49,7 @@ class Foundation_API File: private FileImpl
|
||||
/// platform-specific limitations regarding maximum length
|
||||
/// of the entire path and its components apply.
|
||||
///
|
||||
/// On Windows, if compiled with UTF-8 support (POCO_WIN32_UTF8)
|
||||
/// the implementation tries to work around the rather low
|
||||
/// On Windows, the implementation tries to work around the rather low
|
||||
/// 260 characters MAX_PATH limit by adding the "\\?\" prefix if
|
||||
/// a path is absolute and exceeds MAX_PATH characters in length.
|
||||
/// Note that various limitations regarding usage of the "\\?\"
|
||||
|
@ -44,8 +44,7 @@ class Foundation_API FileIOS: public virtual std::ios
|
||||
/// Use an InputLineEndingConverter or OutputLineEndingConverter
|
||||
/// if you require CR-LF translation.
|
||||
///
|
||||
/// On Windows platforms, if POCO_WIN32_UTF8 is #define'd,
|
||||
/// UTF-8 encoded Unicode paths are correctly handled.
|
||||
/// On Windows platforms, UTF-8 encoded Unicode paths are correctly handled.
|
||||
{
|
||||
public:
|
||||
FileIOS(std::ios::openmode defaultMode);
|
||||
@ -86,8 +85,7 @@ class Foundation_API FileInputStream: public FileIOS, public std::istream
|
||||
/// was specified.
|
||||
/// Use an InputLineEndingConverter if you require CR-LF translation.
|
||||
///
|
||||
/// On Windows platforms, if POCO_WIN32_UTF8 is #define'd,
|
||||
/// UTF-8 encoded Unicode paths are correctly handled.
|
||||
/// On Windows platforms, UTF-8 encoded Unicode paths are correctly handled.
|
||||
{
|
||||
public:
|
||||
FileInputStream();
|
||||
@ -117,8 +115,7 @@ class Foundation_API FileOutputStream: public FileIOS, public std::ostream
|
||||
/// was specified.
|
||||
/// Use an OutputLineEndingConverter if you require CR-LF translation.
|
||||
///
|
||||
/// On Windows platforms, if POCO_WIN32_UTF8 is #define'd,
|
||||
/// UTF-8 encoded Unicode paths are correctly handled.
|
||||
/// On Windows platforms, UTF-8 encoded Unicode paths are correctly handled.
|
||||
{
|
||||
public:
|
||||
FileOutputStream();
|
||||
@ -154,8 +151,7 @@ class Foundation_API FileStream: public FileIOS, public std::iostream
|
||||
/// read position and the write position simultaneously to the
|
||||
/// same value.
|
||||
///
|
||||
/// On Windows platforms, if POCO_WIN32_UTF8 is #define'd,
|
||||
/// UTF-8 encoded Unicode paths are correctly handled.
|
||||
/// On Windows platforms, UTF-8 encoded Unicode paths are correctly handled.
|
||||
{
|
||||
public:
|
||||
FileStream();
|
||||
|
@ -27,8 +27,8 @@ namespace Poco {
|
||||
class FileImpl
|
||||
{
|
||||
protected:
|
||||
|
||||
enum Options {
|
||||
enum Options
|
||||
{
|
||||
OPT_FAIL_ON_OVERWRITE_IMPL = 0x01
|
||||
};
|
||||
|
||||
|
@ -28,8 +28,8 @@ namespace Poco {
|
||||
class Foundation_API FileImpl
|
||||
{
|
||||
protected:
|
||||
|
||||
enum Options {
|
||||
enum Options
|
||||
{
|
||||
OPT_FAIL_ON_OVERWRITE_IMPL = 0x01
|
||||
};
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user