fixes for macos/clang

This commit is contained in:
Günter Obiltschnig
2020-01-09 11:53:03 +01:00
parent 1bf40a0cd2
commit 03d1dd9822
41 changed files with 389 additions and 1317 deletions

View File

@@ -140,7 +140,7 @@ public:
virtual void bind(std::size_t pos, const std::list<Poco::UInt32>& val, Direction dir = PD_IN);
/// Binds an UInt32 list.
virtual void bind(std::size_t pos, const Poco::Int64& val, Direction dir = PD_IN) = 0;
/// Binds an Int64.
@@ -165,7 +165,6 @@ public:
virtual void bind(std::size_t pos, const std::list<Poco::UInt64>& val, Direction dir = PD_IN);
/// Binds an UInt64 list.
#ifndef POCO_LONG_IS_64_BIT
virtual void bind(std::size_t pos, const long& val, Direction dir = PD_IN) = 0;
/// Binds a long.
@@ -180,7 +179,6 @@ public:
virtual void bind(std::size_t pos, const std::list<long>& val, Direction dir = PD_IN);
/// Binds a long list.
#endif
virtual void bind(std::size_t pos, const bool& val, Direction dir = PD_IN) = 0;
/// Binds a boolean.
@@ -331,7 +329,7 @@ public:
void bind(std::size_t pos, const Any& val, Direction dir = PD_IN);
/// Binds an Any.
void bind(std::size_t pos, const Poco::Dynamic::Var& val, Direction dir = PD_IN);
/// Binds a Var.

View File

@@ -155,7 +155,6 @@ public:
virtual bool extract(std::size_t pos, std::list<Poco::UInt64>& val);
/// Extracts an UInt64 list.
#ifndef POCO_LONG_IS_64_BIT
virtual bool extract(std::size_t pos, long& val) = 0;
/// Extracts a long. Returns false if null was received.
@@ -170,7 +169,6 @@ public:
virtual bool extract(std::size_t pos, std::list<long>& val);
/// Extracts a long list.
#endif
virtual bool extract(std::size_t pos, bool& val) = 0;
/// Extracts a boolean. Returns false if null was received.

View File

@@ -51,9 +51,9 @@ class Data_API AbstractPreparator
/// (and memory output locations) before extracting data, e.g. ODBC.
/// Extract works as two-phase extract: first we call prepare once, then extract n-times.
/// There are cases (bulk operations using std::vector storage) when extract is called only once.
/// The value passed to a prepare() call is not used by the prepare, serving only as an indication
/// of the data type being prepared, thus all values are passed as const references.
/// Implementing this interface is not mandatory for a connector. Connectors that only extract data
/// The value passed to a prepare() call is not used by the prepare, serving only as an indication
/// of the data type being prepared, thus all values are passed as const references.
/// Implementing this interface is not mandatory for a connector. Connectors that only extract data
/// after SQL execution (e.g. SQLite) do not need this functionality at all.
{
public:
@@ -161,7 +161,6 @@ public:
virtual void prepare(std::size_t pos, const std::list<Poco::UInt64>& val);
/// Prepares an UInt64 list.
#ifndef POCO_LONG_IS_64_BIT
virtual void prepare(std::size_t pos, const long&) = 0;
/// Prepares a long.
@@ -176,7 +175,6 @@ public:
virtual void prepare(std::size_t pos, const std::list<long>& val);
/// Prepares a long list.
#endif
virtual void prepare(std::size_t pos, const bool&) = 0;
/// Prepares a boolean.
@@ -306,7 +304,7 @@ public:
virtual void prepare(std::size_t pos, const std::deque<Time>& val);
/// Prepares a Time deque.
virtual void prepare(std::size_t pos, const std::list<Time>& val);
/// Prepares a Time list.

View File

@@ -211,16 +211,14 @@ inline void swap(LOB<T>& b1, LOB<T>& b2)
namespace std
{
template<>
inline void swap<Poco::Data::BLOB>(Poco::Data::BLOB& b1,
Poco::Data::BLOB& b2)
inline void swap<Poco::Data::BLOB>(Poco::Data::BLOB& b1, Poco::Data::BLOB& b2) noexcept
/// Full template specalization of std:::swap for BLOB
{
b1.swap(b2);
}
template<>
inline void swap<Poco::Data::CLOB>(Poco::Data::CLOB& c1,
Poco::Data::CLOB& c2)
inline void swap<Poco::Data::CLOB>(Poco::Data::CLOB& c1, Poco::Data::CLOB& c2) noexcept
/// Full template specalization of std:::swap for CLOB
{
c1.swap(c2);
@@ -248,7 +246,7 @@ public:
~VarHolderImpl()
{
}
const std::type_info& type() const
{
return typeid(Poco::Data::BLOB);
@@ -263,7 +261,7 @@ public:
{
return cloneHolder(pVarHolder, _val);
}
const Poco::Data::BLOB& value() const
{
return _val;
@@ -286,7 +284,7 @@ public:
~VarHolderImpl()
{
}
const std::type_info& type() const
{
return typeid(Poco::Data::CLOB);
@@ -301,7 +299,7 @@ public:
{
return cloneHolder(pVarHolder, _val);
}
const Poco::Data::CLOB& value() const
{
return _val;

View File

@@ -81,11 +81,11 @@ public:
/// Advances by one position and returns current position.
RowIterator operator ++ (int) const;
/// Advances by one position and returns copy of the iterator with
/// Advances by one position and returns copy of the iterator with
/// previous current position.
const RowIterator& operator -- () const;
/// Goes back by one position and returns copy of the iterator with
/// Goes back by one position and returns copy of the iterator with
/// previous current position.
RowIterator operator -- (int) const;
@@ -105,15 +105,15 @@ private:
RowIterator();
void increment() const;
/// Increments the iterator position by one.
/// Increments the iterator position by one.
/// Throws RangeException if position is out of range.
void decrement() const;
/// Decrements the iterator position by one.
/// Decrements the iterator position by one.
/// Throws RangeException if position is out of range.
void setPosition(std::size_t pos) const;
/// Sets the iterator position.
/// Sets the iterator position.
/// Throws RangeException if position is out of range.
RecordSet* _pRecordSet;
@@ -144,8 +144,7 @@ inline bool RowIterator::operator != (const RowIterator& other) const
namespace std
{
template<>
inline void swap<Poco::Data::RowIterator>(Poco::Data::RowIterator& s1,
Poco::Data::RowIterator& s2)
inline void swap<Poco::Data::RowIterator>(Poco::Data::RowIterator& s1, Poco::Data::RowIterator& s2) noexcept
/// Full template specalization of std:::swap for RowIterator
{
s1.swap(s2);

View File

@@ -40,46 +40,46 @@ class Data_API Session
/// A Session holds a connection to a Database and creates Statement objects.
///
/// Sessions are always created via the SessionFactory:
///
///
/// Session ses(SessionFactory::instance().create(connectorKey, connectionString));
///
///
/// where the first param presents the type of session one wants to create (e.g., for SQLite one would choose "SQLite",
/// for ODBC the key is "ODBC") and the second param is the connection string that the session implementation
/// for ODBC the key is "ODBC") and the second param is the connection string that the session implementation
/// requires to connect to the database. The format of the connection string is specific to the actual connector.
///
/// A simpler form to create the session is to pass the connector key and connection string directly to
/// the Session constructor.
///
/// A concrete example to open an SQLite database stored in the file "dummy.db" would be
///
///
/// Session ses("SQLite", "dummy.db");
///
///
/// Via a Session one can create two different types of statements. First, statements that should only be executed once and immediately, and
/// second, statements that should be executed multiple times, using a separate execute() call.
/// The simple one is immediate execution:
///
///
/// ses << "CREATE TABLE Dummy (data INTEGER(10))", now;
///
/// The now at the end of the statement is required, otherwise the statement
/// would not be executed.
///
///
/// If one wants to reuse a Statement (and avoid the overhead of repeatedly parsing an SQL statement)
/// one uses an explicit Statement object and its execute() method:
///
///
/// int i = 0;
/// Statement stmt = (ses << "INSERT INTO Dummy VALUES(:data)", use(i));
///
///
/// for (i = 0; i < 100; ++i)
/// {
/// stmt.execute();
/// }
///
///
/// The above example assigns the variable i to the ":data" placeholder in the SQL query. The query is parsed and compiled exactly
/// once, but executed 100 times. At the end the values 0 to 99 will be present in the Table "DUMMY".
///
/// A faster implementaton of the above code will simply create a vector of int
/// and use the vector as parameter to the use clause (you could also use set or multiset instead):
///
///
/// std::vector<int> data;
/// for (int i = 0; i < 100; ++i)
/// {
@@ -105,15 +105,15 @@ class Data_API Session
/// }
///
/// The "into" keyword is used to inform the statement where output results should be placed. The limit value ensures
/// that during each run at most 50 rows are retrieved. Assuming Dummy contains 100 rows, retData will contain 50
/// that during each run at most 50 rows are retrieved. Assuming Dummy contains 100 rows, retData will contain 50
/// elements after the first run and 100 after the second run, i.e.
/// the collection is not cleared between consecutive runs. After the second execute stmt.done() will return true.
///
/// A prepared Statement will behave exactly the same but a further call to execute() will simply reset the Statement,
/// A prepared Statement will behave exactly the same but a further call to execute() will simply reset the Statement,
/// execute it again and append more data to the result set.
///
/// Note that it is possible to append several "bind" or "into" clauses to the statement. Theoretically, one could also have several
/// limit clauses but only the last one that was added will be effective.
/// limit clauses but only the last one that was added will be effective.
/// Also several preconditions must be met concerning binds and intos.
/// Take the following example:
///
@@ -123,8 +123,8 @@ class Data_API Session
/// ses << "INSERT INTO Person (LastName, Age) VALUES(:ln, :age)", use(nameVec), use(ageVec);
///
/// The size of all use parameters MUST be the same, otherwise an exception is thrown. Furthermore,
/// the amount of use clauses must match the number of wildcards in the query (to be more precise:
/// each binding has a numberOfColumnsHandled() value which defaults to 1. The sum of all these values
/// the amount of use clauses must match the number of wildcards in the query (to be more precise:
/// each binding has a numberOfColumnsHandled() value which defaults to 1. The sum of all these values
/// must match the wildcard count in the query.
/// However, this is only important if you have written your own TypeHandler specializations.
/// If you plan to map complex object types to tables see the TypeHandler documentation.
@@ -140,13 +140,13 @@ class Data_API Session
///
/// std::vector<Person> people;
/// ses << "SELECT * FROM PERSON", into(people);
///
///
/// Mixing constants or variables with manipulators is allowed provided there are corresponding placeholders for the constants provided in
/// the SQL string, such as in following example:
///
/// std::vector<Person> people;
/// ses << "SELECT * FROM %s", into(people), "PERSON";
///
///
/// Formatting only kicks in if there are values to be injected into the SQL string, otherwise it is skipped.
/// If the formatting will occur and the percent sign is part of the query itself, it can be passed to the query by entering it twice (%%).
/// However, if no formatting is used, one percent sign is sufficient as the string will be passed unaltered.
@@ -203,10 +203,10 @@ public:
void open(const std::string& connect = "");
/// Opens the session using the supplied string.
/// Can also be used with default empty string to
/// Can also be used with default empty string to
/// reconnect a disconnected session.
/// If the connection is not established,
/// a ConnectionFailedException is thrown.
/// If the connection is not established,
/// a ConnectionFailedException is thrown.
/// Zero timout means indefinite
void close();
@@ -267,7 +267,7 @@ public:
static std::string uri(const std::string& connector,
const std::string& connectionString);
/// Utility function that teturns the URI formatted from supplied
/// Utility function that teturns the URI formatted from supplied
/// arguments as "connector:///connectionString".
void setFeature(const std::string& name, bool state);
@@ -278,7 +278,7 @@ public:
///
/// Throws a NotSupportedException if the requested feature is
/// not supported by the underlying implementation.
bool getFeature(const std::string& name) const;
/// Look up the state of a feature.
///
@@ -489,8 +489,7 @@ inline void swap(Session& s1, Session& s2)
namespace std
{
template<>
inline void swap<Poco::Data::Session>(Poco::Data::Session& s1,
Poco::Data::Session& s2)
inline void swap<Poco::Data::Session>(Poco::Data::Session& s1, Poco::Data::Session& s2) noexcept
/// Full template specalization of std:::swap for Session
{
s1.swap(s2);

View File

@@ -258,13 +258,12 @@ public:
Statement& operator , (Poco::Int32 value);
/// Adds the value to the list of values to be supplied to the SQL string formatting function.
#ifndef POCO_LONG_IS_64_BIT
Statement& operator , (long value);
/// Adds the value to the list of values to be supplied to the SQL string formatting function.
Statement& operator , (unsigned long value);
/// Adds the value to the list of values to be supplied to the SQL string formatting function.
#endif
Statement& operator , (Poco::UInt64 value);
/// Adds the value to the list of values to be supplied to the SQL string formatting function.
@@ -573,7 +572,6 @@ inline Statement& Statement::operator , (Poco::Int32 value)
}
#ifndef POCO_LONG_IS_64_BIT
inline Statement& Statement::operator , (long value)
{
return commaPODImpl(value);
@@ -584,7 +582,6 @@ inline Statement& Statement::operator , (unsigned long value)
{
return commaPODImpl(value);
}
#endif
inline Statement& Statement::operator , (Poco::UInt64 value)
@@ -815,8 +812,7 @@ inline void swap(Statement& s1, Statement& s2)
namespace std
{
template<>
inline void swap<Poco::Data::Statement>(Poco::Data::Statement& s1,
Poco::Data::Statement& s2)
inline void swap<Poco::Data::Statement>(Poco::Data::Statement& s1, Poco::Data::Statement& s2) noexcept
/// Full template specalization of std:::swap for Statement
{
s1.swap(s2);