From 4f702a21dea7b192328cc904f7c644c0ac7f8418 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 29 Dec 2015 16:40:50 +0000 Subject: Compatibility with libdbpp-*-1 - non-const Connections --- project2/sql/rdbmsDataSource.cpp | 8 ++++---- project2/sql/rdbmsDataSource.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/project2/sql/rdbmsDataSource.cpp b/project2/sql/rdbmsDataSource.cpp index 46e97a8..a3bb6a1 100644 --- a/project2/sql/rdbmsDataSource.cpp +++ b/project2/sql/rdbmsDataSource.cpp @@ -200,7 +200,7 @@ RdbmsDataSource::connectTo(const ConnectionInfo & dsn) } } -RdbmsDataSource::RdbmsConnection::RdbmsConnection(const DB::Connection * con, time_t kat) : +RdbmsDataSource::RdbmsConnection::RdbmsConnection(DB::Connection * const con, time_t kat) : connection(con), txOpen(false), lastUsedTime(0), @@ -288,19 +288,19 @@ RdbmsDataSource::ConnectionRef::operator=(const RdbmsDataSource::ConnectionRef & return *this; } -const DB::Connection * +DB::Connection * RdbmsDataSource::ConnectionRef::operator->() const { return conn->connection; } -const DB::Connection & +DB::Connection & RdbmsDataSource::ConnectionRef::operator*() const { return *conn->connection; } -const DB::Connection * +DB::Connection * RdbmsDataSource::ConnectionRef::get() const { return conn->connection; diff --git a/project2/sql/rdbmsDataSource.h b/project2/sql/rdbmsDataSource.h index 979cec6..373ed34 100644 --- a/project2/sql/rdbmsDataSource.h +++ b/project2/sql/rdbmsDataSource.h @@ -18,12 +18,12 @@ class RdbmsDataSource : public DataSource { class RdbmsConnection { public: - RdbmsConnection(const DB::Connection * connection, time_t kat); + RdbmsConnection(DB::Connection * const connection, time_t kat); ~RdbmsConnection(); void touch() const; bool isExpired() const; - const DB::Connection * const connection; + DB::Connection * const connection; bool txOpen; boost::optional threadId; @@ -45,9 +45,9 @@ class RdbmsDataSource : public DataSource { ~ConnectionRef(); ConnectionRef & operator=(const ConnectionRef &); - const DB::Connection * operator->() const; - const DB::Connection & operator*() const; - const DB::Connection * get() const; + DB::Connection * operator->() const; + DB::Connection & operator*() const; + DB::Connection * get() const; private: ConnectionPtr conn; }; -- cgit v1.2.3