mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 11:31:53 +01:00
data fixes (getters constness, string any handling)
This commit is contained in:
@@ -41,13 +41,13 @@ public:
|
||||
typedef void (C::*FeatureSetter)(const std::string&, bool);
|
||||
/// The setter method for a feature.
|
||||
|
||||
typedef bool (C::*FeatureGetter)(const std::string&);
|
||||
typedef bool (C::*FeatureGetter)(const std::string&) const;
|
||||
/// The getter method for a feature.
|
||||
|
||||
typedef void (C::*PropertySetter)(const std::string&, const Poco::Any&);
|
||||
/// The setter method for a property.
|
||||
|
||||
typedef Poco::Any (C::*PropertyGetter)(const std::string&);
|
||||
typedef Poco::Any (C::*PropertyGetter)(const std::string&) const;
|
||||
/// The getter method for a property.
|
||||
|
||||
AbstractSessionImpl(const std::string& connectionString,
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
_storage = Poco::RefAnyCast<std::string>(value);
|
||||
}
|
||||
|
||||
Poco::Any getStorage(const std::string& name="")
|
||||
Poco::Any getStorage(const std::string& name="") const
|
||||
/// Returns the storage type
|
||||
{
|
||||
return _storage;
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
_handle = handle;
|
||||
}
|
||||
|
||||
Poco::Any getHandle(const std::string& name="")
|
||||
Poco::Any getHandle(const std::string& name="") const
|
||||
/// Returns the native session handle.
|
||||
{
|
||||
return _handle;
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
_bulk = bulk;
|
||||
}
|
||||
|
||||
bool getBulk(const std::string& name="")
|
||||
bool getBulk(const std::string& name="") const
|
||||
/// Returns the execution type
|
||||
{
|
||||
return _bulk;
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
_emptyStringIsNull = emptyStringIsNull;
|
||||
}
|
||||
|
||||
bool getEmptyStringIsNull(const std::string& name="")
|
||||
bool getEmptyStringIsNull(const std::string& name="") const
|
||||
/// Returns the setting for the behavior regarding empty variable
|
||||
/// length strings. See setEmptyStringIsNull(const std::string&, bool)
|
||||
/// and this class documentation for feature rationale and details.
|
||||
@@ -250,7 +250,7 @@ public:
|
||||
_forceEmptyString = forceEmptyString;
|
||||
}
|
||||
|
||||
bool getForceEmptyString(const std::string& name="")
|
||||
bool getForceEmptyString(const std::string& name="") const
|
||||
/// Returns the setting for the behavior regarding empty variable
|
||||
/// length strings. See setForceEmptyString(const std::string&, bool)
|
||||
/// and this class documentation for feature rationale and details.
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "Poco/Data/SessionImpl.h"
|
||||
#include "Poco/Data/PooledSessionHolder.h"
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/AutoPtr.h"
|
||||
|
||||
|
||||
@@ -43,22 +44,21 @@ public:
|
||||
~PooledSessionImpl();
|
||||
/// Destroys the PooledSessionImpl.
|
||||
|
||||
// SessionImpl
|
||||
StatementImpl* createStatementImpl();
|
||||
StatementImpl::Ptr createStatementImpl();
|
||||
void begin();
|
||||
void commit();
|
||||
void rollback();
|
||||
void open(const std::string& connect = "");
|
||||
void close();
|
||||
bool isConnected();
|
||||
bool isConnected() const;
|
||||
void setConnectionTimeout(std::size_t timeout);
|
||||
std::size_t getConnectionTimeout();
|
||||
bool canTransact();
|
||||
bool isTransaction();
|
||||
std::size_t getConnectionTimeout() const;
|
||||
bool canTransact() const;
|
||||
bool isTransaction()const ;
|
||||
void setTransactionIsolation(Poco::UInt32);
|
||||
Poco::UInt32 getTransactionIsolation();
|
||||
bool hasTransactionIsolation(Poco::UInt32);
|
||||
bool isTransactionIsolation(Poco::UInt32);
|
||||
Poco::UInt32 getTransactionIsolation() const;
|
||||
bool hasTransactionIsolation(Poco::UInt32) const;
|
||||
bool isTransactionIsolation(Poco::UInt32) const;
|
||||
const std::string& connectorName() const;
|
||||
void setFeature(const std::string& name, bool state);
|
||||
bool getFeature(const std::string& name);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "Poco/Data/Statement.h"
|
||||
#include "Poco/Data/StatementCreator.h"
|
||||
#include "Poco/Data/Binding.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Poco/AutoPtr.h"
|
||||
#include "Poco/Any.h"
|
||||
#include <algorithm>
|
||||
@@ -191,7 +192,7 @@ public:
|
||||
return _statementCreator << t;
|
||||
}
|
||||
|
||||
StatementImpl* createStatementImpl();
|
||||
SharedPtr<StatementImpl> createStatementImpl();
|
||||
/// Creates a StatementImpl.
|
||||
|
||||
void open(const std::string& connect = "");
|
||||
@@ -313,7 +314,7 @@ private:
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline StatementImpl* Session::createStatementImpl()
|
||||
inline SharedPtr<StatementImpl> Session::createStatementImpl()
|
||||
{
|
||||
return _pImpl->createStatementImpl();
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "Poco/RefCountedObject.h"
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/Format.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Poco/AutoPtr.h"
|
||||
#include "Poco/Any.h"
|
||||
|
||||
|
||||
@@ -37,6 +39,8 @@ class Data_API SessionImpl: public Poco::RefCountedObject
|
||||
/// SessionImpl objects are noncopyable.
|
||||
{
|
||||
public:
|
||||
typedef Poco::AutoPtr<SessionImpl> Ptr;
|
||||
|
||||
static const std::size_t LOGIN_TIMEOUT_INFINITE = 0;
|
||||
/// Infinite connection/login timeout.
|
||||
|
||||
@@ -56,7 +60,7 @@ public:
|
||||
virtual ~SessionImpl();
|
||||
/// Destroys the SessionImpl.
|
||||
|
||||
virtual StatementImpl* createStatementImpl() = 0;
|
||||
virtual Poco::SharedPtr<StatementImpl> createStatementImpl() = 0;
|
||||
/// Creates a StatementImpl.
|
||||
|
||||
virtual void open(const std::string& connectionString = "") = 0;
|
||||
@@ -70,7 +74,7 @@ public:
|
||||
virtual void close() = 0;
|
||||
/// Closes the connection.
|
||||
|
||||
virtual bool isConnected() = 0;
|
||||
virtual bool isConnected() const = 0;
|
||||
/// Returns true if session is connected, false otherwise.
|
||||
|
||||
void setLoginTimeout(std::size_t timeout);
|
||||
@@ -82,7 +86,7 @@ public:
|
||||
virtual void setConnectionTimeout(std::size_t timeout) = 0;
|
||||
/// Sets the session connection timeout value.
|
||||
|
||||
virtual std::size_t getConnectionTimeout() = 0;
|
||||
virtual std::size_t getConnectionTimeout() const = 0;
|
||||
/// Returns the session connection timeout value.
|
||||
|
||||
void reconnect();
|
||||
@@ -97,23 +101,23 @@ public:
|
||||
virtual void rollback() = 0;
|
||||
/// Aborts a transaction.
|
||||
|
||||
virtual bool canTransact() = 0;
|
||||
virtual bool canTransact() const = 0;
|
||||
/// Returns true if session has transaction capabilities.
|
||||
|
||||
virtual bool isTransaction() = 0;
|
||||
virtual bool isTransaction() const = 0;
|
||||
/// Returns true iff a transaction is a transaction is in progress, false otherwise.
|
||||
|
||||
virtual void setTransactionIsolation(Poco::UInt32) = 0;
|
||||
/// Sets the transaction isolation level.
|
||||
|
||||
virtual Poco::UInt32 getTransactionIsolation() = 0;
|
||||
virtual Poco::UInt32 getTransactionIsolation() const = 0;
|
||||
/// Returns the transaction isolation level.
|
||||
|
||||
virtual bool hasTransactionIsolation(Poco::UInt32) = 0;
|
||||
virtual bool hasTransactionIsolation(Poco::UInt32) const = 0;
|
||||
/// Returns true iff the transaction isolation level corresponding
|
||||
/// to the supplied bitmask is supported.
|
||||
|
||||
virtual bool isTransactionIsolation(Poco::UInt32) = 0;
|
||||
virtual bool isTransactionIsolation(Poco::UInt32) const = 0;
|
||||
/// Returns true iff the transaction isolation level corresponds
|
||||
/// to the supplied bitmask.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user