data housekeeping

- removed naked pointers from Data interfaces
- fixed GH #82: name conflict in Data::Keywords::bind
- fixed GH #157: MySQL: cannot bind to 'long' data type on
Windows/Visual C++
- fixed GH #158: MySQL: MYSQL_BIND 'is_unsigned' member is not set
This commit is contained in:
Aleksandar Fabijanic
2013-04-28 12:34:07 -05:00
parent c6207985d8
commit a50823c5a8
34 changed files with 669 additions and 597 deletions

View File

@@ -54,54 +54,53 @@ class MySQL_API Binder: public Poco::Data::AbstractBinder
/// Binds placeholders in the sql query to the provided values. Performs data types mapping.
{
public:
typedef SharedPtr<Binder> Ptr;
Binder();
/// Creates the Binder.
virtual ~Binder();
/// Destroys the Binder.
virtual void bind(std::size_t pos, const Poco::Int8& val, Direction dir);
/// Binds an Int8.
virtual void bind(std::size_t pos, const Poco::UInt8& val, Direction dir);
/// Binds an UInt8.
virtual void bind(std::size_t pos, const Poco::Int16& val, Direction dir);
/// Binds an Int16.
virtual void bind(std::size_t pos, const Poco::UInt16& val, Direction dir);
/// Binds an UInt16.
virtual void bind(std::size_t pos, const Poco::Int32& val, Direction dir);
/// Binds an Int32.
virtual void bind(std::size_t pos, const Poco::UInt32& val, Direction dir);
/// Binds an UInt32.
virtual void bind(std::size_t pos, const Poco::Int64& val, Direction dir);
/// Binds an Int64.
virtual void bind(std::size_t pos, const Poco::UInt64& val, Direction dir);
/// Binds an UInt64.
#ifndef POCO_LONG_IS_64_BIT
virtual void bind(std::size_t pos, const long& val, Direction dir = PD_IN);
/// Binds a long.
virtual void bind(std::size_t pos, const unsigned long& val, Direction dir = PD_IN);
/// Binds an unsigned long.
#endif
virtual void bind(std::size_t pos, const bool& val, Direction dir);
/// Binds a boolean.
virtual void bind(std::size_t pos, const float& val, Direction dir);
/// Binds a float.
virtual void bind(std::size_t pos, const double& val, Direction dir);
/// Binds a double.
virtual void bind(std::size_t pos, const char& val, Direction dir);
/// Binds a single character.
@@ -154,27 +153,27 @@ public:
virtual void bind(std::size_t pos, const std::vector<Poco::Int32>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::deque<Poco::Int32>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::list<Poco::Int32>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::vector<Poco::UInt32>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::deque<Poco::UInt32>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::list<Poco::UInt32>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::vector<Poco::Int64>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::deque<Poco::Int64>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::list<Poco::Int64>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::vector<Poco::UInt64>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::deque<Poco::UInt64>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::list<Poco::UInt64>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::vector<bool>& val, Direction dir = PD_IN);
virtual void bind(std::size_t pos, const std::deque<bool>& val, Direction dir = PD_IN);
@@ -261,7 +260,7 @@ private:
{
}
void realBind(std::size_t pos, enum_field_types type, const void* buffer, int length);
void realBind(std::size_t pos, enum_field_types type, const void* buffer, int length, bool isUnsigned = false);
/// Common bind implementation
private:

View File

@@ -62,6 +62,8 @@ class MySQL_API Extractor: public Poco::Data::AbstractExtractor
/// If NULL is received, the incoming val value is not changed and false is returned
{
public:
typedef SharedPtr<Extractor> Ptr;
Extractor(StatementExecutor& st, ResultMetadata& md);
/// Creates the Extractor.

View File

@@ -59,7 +59,6 @@ class MySQL_API MySQLStatementImpl: public Poco::Data::StatementImpl
/// Implements statement functionality needed for MySQL
{
public:
MySQLStatementImpl(SessionImpl& s);
/// Creates the MySQLStatementImpl.
@@ -69,7 +68,7 @@ public:
protected:
virtual std::size_t columnsReturned() const;
/// Returns number of columns returned by query.
/// Returns number of columns returned by query.
virtual std::size_t affectedRowCount() const;
/// Returns the number of affected rows.
@@ -97,10 +96,10 @@ protected:
virtual void bindImpl();
/// Binds parameters
virtual AbstractExtractor& extractor();
virtual Poco::Data::AbstractExtractor::Ptr extractor();
/// Returns the concrete extractor used by the statement.
virtual AbstractBinder& binder();
virtual Poco::Data::AbstractBinder::Ptr binder();
/// Returns the concrete binder used by the statement.
private:
@@ -113,8 +112,8 @@ private:
StatementExecutor _stmt;
ResultMetadata _metadata;
Binder _binder;
Extractor _extractor;
Binder::Ptr _pBinder;
Extractor::Ptr _pExtractor;
int _hasNext;
};