Skip to content
Snippets Groups Projects
Commit 042f39aa authored by Steven Murray's avatar Steven Murray
Browse files

Renamed wrapper::Conn to wrapper::ConnWrapper for cta/CTA#401

parent fe08957e
No related branches found
No related tags found
No related merge requests found
Showing
with 32 additions and 32 deletions
......@@ -19,7 +19,7 @@
#pragma once
#include "rdbms/StmtPool.hpp"
#include "rdbms/wrapper/Conn.hpp"
#include "rdbms/wrapper/ConnWrapper.hpp"
#include <iostream>
#include <memory>
......@@ -81,7 +81,7 @@ struct ConnAndStmts {
* prepared statements. This means the conn member-variable must be declared
* before the stmtPool member-variable.
*/
std::unique_ptr<wrapper::Conn> conn;
std::unique_ptr<wrapper::ConnWrapper> conn;
/**
* Pool of prepared statements.
......
......@@ -22,7 +22,7 @@
#include "common/threading/Mutex.hpp"
#include "rdbms/ConnAndStmts.hpp"
#include "rdbms/Conn.hpp"
#include "rdbms/wrapper/Conn.hpp"
#include "rdbms/wrapper/ConnWrapper.hpp"
#include "rdbms/wrapper/ConnFactory.hpp"
#include <list>
......
......@@ -18,7 +18,7 @@
#include "common/exception/Exception.hpp"
#include "common/threading/MutexLocker.hpp"
#include "rdbms/wrapper/Conn.hpp"
#include "rdbms/wrapper/ConnWrapper.hpp"
#include "rdbms/StmtPool.hpp"
namespace cta {
......@@ -27,7 +27,7 @@ namespace rdbms {
//------------------------------------------------------------------------------
// getStmt
//------------------------------------------------------------------------------
Stmt StmtPool::getStmt(wrapper::Conn &conn, const std::string &sql) {
Stmt StmtPool::getStmt(wrapper::ConnWrapper &conn, const std::string &sql) {
threading::MutexLocker locker(m_stmtsMutex);
auto itor = m_stmts.find(sql);
......
......@@ -33,7 +33,7 @@ namespace cta {
namespace rdbms {
namespace wrapper {
class Conn;
class ConnWrapper;
class Stmt;
}
......@@ -51,7 +51,7 @@ public:
* @param sql The SQL statement.
* @return The prepared statement.
*/
Stmt getStmt(wrapper::Conn &conn, const std::string &sql);
Stmt getStmt(wrapper::ConnWrapper &conn, const std::string &sql);
/**
* Returns the number of cached statements currently in the pool.
......
......@@ -28,7 +28,7 @@ include_directories (${ORACLE-INSTANTCLIENT_INCLUDE_DIRS})
set (RDBMS_WRAPPER_LIB_SRC_FILES
ColumnNameToIdx.cpp
ColumnNameToIdxAndType.cpp
Conn.cpp
ConnWrapper.cpp
ConnFactory.cpp
Rset.cpp
Stmt.cpp
......
......@@ -18,7 +18,7 @@
#pragma once
#include "rdbms/wrapper/Conn.hpp"
#include "rdbms/wrapper/ConnWrapper.hpp"
#include <memory>
......@@ -42,7 +42,7 @@ public:
*
* @return A newly created database connection.
*/
virtual std::unique_ptr<Conn> create() = 0;
virtual std::unique_ptr<ConnWrapper> create() = 0;
}; // class ConnFactory
......
......@@ -18,7 +18,7 @@
#include "common/exception/Exception.hpp"
#include "common/utils/utils.hpp"
#include "rdbms/wrapper/Conn.hpp"
#include "rdbms/wrapper/ConnWrapper.hpp"
namespace cta {
namespace rdbms {
......@@ -27,7 +27,7 @@ namespace wrapper {
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
Conn::~Conn() {
ConnWrapper::~ConnWrapper() {
}
} // namespace wrapper
......
......@@ -33,13 +33,13 @@ namespace wrapper {
/**
* Abstract class that specifies the interface to a database connection.
*/
class Conn {
class ConnWrapper {
public:
/**
* Destructor.
*/
virtual ~Conn() = 0;
virtual ~ConnWrapper() = 0;
/**
* Idempotent close() method. The destructor calls this method.
......@@ -113,7 +113,7 @@ public:
*/
virtual std::list<std::string> getSequenceNames() = 0;
}; // class Conn
}; // class ConnWrapper
} // namespace wrapper
} // namespace rdbms
......
......@@ -19,7 +19,7 @@
#pragma once
#include "common/threading/Mutex.hpp"
#include "rdbms/wrapper/Conn.hpp"
#include "rdbms/wrapper/ConnWrapper.hpp"
struct st_mysql;
typedef st_mysql MYSQL;
......@@ -30,7 +30,7 @@ namespace wrapper {
class MysqlStmt;
class MysqlConn: public Conn {
class MysqlConn: public ConnWrapper {
public:
/**
......
......@@ -45,7 +45,7 @@ MysqlConnFactory::~MysqlConnFactory() {
//------------------------------------------------------------------------------
// create
//------------------------------------------------------------------------------
std::unique_ptr<Conn> MysqlConnFactory::create() {
std::unique_ptr<ConnWrapper> MysqlConnFactory::create() {
try {
return cta::make_unique<MysqlConn>(m_host, m_user, m_passwd, m_db, m_port);
} catch(exception::Exception &ex) {
......
......@@ -56,7 +56,7 @@ public:
*
* @return A newly created database connection.
*/
std::unique_ptr<Conn> create() override;
std::unique_ptr<ConnWrapper> create() override;
private:
......
......@@ -20,7 +20,7 @@
#include "common/threading/MutexLocker.hpp"
#include "common/threading/RWLock.hpp"
#include "rdbms/wrapper/Conn.hpp"
#include "rdbms/wrapper/ConnWrapper.hpp"
#include <occi.h>
......@@ -37,7 +37,7 @@ class OcciStmt;
/**
* A convenience wrapper around a connection to an OCCI database.
*/
class OcciConn: public Conn {
class OcciConn: public ConnWrapper {
public:
/**
......
......@@ -46,7 +46,7 @@ OcciConnFactory::~OcciConnFactory() {
//------------------------------------------------------------------------------
// create
//------------------------------------------------------------------------------
std::unique_ptr<Conn> OcciConnFactory::create() {
std::unique_ptr<ConnWrapper> OcciConnFactory::create() {
try {
return OcciEnvSingleton::instance().createConn(m_username, m_password, m_database);
} catch(exception::Exception &ex) {
......
......@@ -52,7 +52,7 @@ public:
*
* @return A newly created database connection.
*/
std::unique_ptr<Conn> create() override;
std::unique_ptr<ConnWrapper> create() override;
private:
......
......@@ -49,7 +49,7 @@ OcciEnv::~OcciEnv() {
//------------------------------------------------------------------------------
// createConn
//------------------------------------------------------------------------------
std::unique_ptr<Conn> OcciEnv::createConn(
std::unique_ptr<ConnWrapper> OcciEnv::createConn(
const std::string &username,
const std::string &password,
const std::string &database) {
......
......@@ -18,7 +18,7 @@
#pragma once
#include "rdbms/wrapper/Conn.hpp"
#include "rdbms/wrapper/ConnWrapper.hpp"
#include <memory>
#include <occi.h>
......@@ -58,7 +58,7 @@ public:
* @param database The name of the database.
* @return The newly created OCCI connection.
*/
std::unique_ptr<Conn> createConn(
std::unique_ptr<ConnWrapper> createConn(
const std::string &username,
const std::string &password,
const std::string &database);
......
......@@ -19,7 +19,7 @@
#pragma once
#include "common/threading/RWLock.hpp"
#include "rdbms/wrapper/Conn.hpp"
#include "rdbms/wrapper/ConnWrapper.hpp"
#include "rdbms/wrapper/Postgres.hpp"
#include <list>
......@@ -34,7 +34,7 @@ namespace wrapper {
class PostgresStmt;
class PostgresRset;
class PostgresConn: public Conn {
class PostgresConn: public ConnWrapper {
public:
/**
......
......@@ -43,7 +43,7 @@ PostgresConnFactory::~PostgresConnFactory() {
//------------------------------------------------------------------------------
// create
//------------------------------------------------------------------------------
std::unique_ptr<Conn> PostgresConnFactory::create() {
std::unique_ptr<ConnWrapper> PostgresConnFactory::create() {
try {
return cta::make_unique<PostgresConn>(m_conninfo);
} catch(exception::Exception &ex) {
......
......@@ -50,7 +50,7 @@ public:
*
* @return A newly created database connection.
*/
std::unique_ptr<Conn> create() override;
std::unique_ptr<ConnWrapper> create() override;
private:
......
......@@ -19,7 +19,7 @@
#pragma once
#include "common/threading/Mutex.hpp"
#include "rdbms/wrapper/Conn.hpp"
#include "rdbms/wrapper/ConnWrapper.hpp"
#include <sqlite3.h>
......@@ -36,7 +36,7 @@ class SqliteStmt;
/**
* A convenience wrapper around a connection to an SQLite database.
*/
class SqliteConn: public Conn {
class SqliteConn: public ConnWrapper {
public:
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment