summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-29 16:40:50 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-12-30 04:31:10 +0000
commit4f702a21dea7b192328cc904f7c644c0ac7f8418 (patch)
treec1d4e858db0cf6392f454ac66f88aef2263f57f2
parentAdd missing links to pthread (gcc-5.3 fix) (diff)
downloadproject2-4f702a21dea7b192328cc904f7c644c0ac7f8418.tar.bz2
project2-4f702a21dea7b192328cc904f7c644c0ac7f8418.tar.xz
project2-4f702a21dea7b192328cc904f7c644c0ac7f8418.zip
Compatibility with libdbpp-*-1 - non-const Connections
-rw-r--r--project2/sql/rdbmsDataSource.cpp8
-rw-r--r--project2/sql/rdbmsDataSource.h10
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<std::thread::id> 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;
};