diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-06-07 15:39:03 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-06-07 15:39:03 +0100 |
commit | b0ea3e1156bf23b9992c8a01658fa3d8d9303275 (patch) | |
tree | 177f0e173e56d95bb3c00abaddacce3ddb4c1376 /project2/sql/rdbmsDataSource.cpp | |
parent | Non-static ICE proxy and destroy the local communicator handle (diff) | |
download | project2-b0ea3e1156bf23b9992c8a01658fa3d8d9303275.tar.bz2 project2-b0ea3e1156bf23b9992c8a01658fa3d8d9303275.tar.xz project2-b0ea3e1156bf23b9992c8a01658fa3d8d9303275.zip |
Default constructor and proper copy operator for ConnectionRef
Diffstat (limited to 'project2/sql/rdbmsDataSource.cpp')
-rw-r--r-- | project2/sql/rdbmsDataSource.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/project2/sql/rdbmsDataSource.cpp b/project2/sql/rdbmsDataSource.cpp index 90dd09a..b0989b9 100644 --- a/project2/sql/rdbmsDataSource.cpp +++ b/project2/sql/rdbmsDataSource.cpp @@ -262,6 +262,10 @@ RdbmsDataSource::ConnectionInfo::operator<(const RdbmsDataSource::ConnectionInfo return ((typeId < other.typeId) || ((typeId == other.typeId) && (dsn < other.dsn))); } +RdbmsDataSource::ConnectionRef::ConnectionRef() +{ +} + RdbmsDataSource::ConnectionRef::ConnectionRef(const ConnectionPtr & c) : conn(c) { @@ -275,6 +279,17 @@ RdbmsDataSource::ConnectionRef::~ConnectionRef() conn->decRef(); } +RdbmsDataSource::ConnectionRef & +RdbmsDataSource::ConnectionRef::operator=(const RdbmsDataSource::ConnectionRef & other) +{ + if (conn) + conn->decRef(); + conn = other.conn; + if (conn) + conn->incRef(); + return *this; +} + const DB::Connection * RdbmsDataSource::ConnectionRef::operator->() const { |