Commit 5acc3454 authored by Steven Murray's avatar Steven Murray
Browse files

Split cta::catalogue into cta::catalogue and cta::rdbms

parent 51c159dc
......@@ -20,7 +20,7 @@
#include <string>
namespace cta {
namespace catalogue {
namespace rdbms {
/**
* A map from column name to column index and type.
......@@ -91,5 +91,5 @@ private:
}; // class ColumnNameToIdxAndType
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -16,13 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/DbConn.hpp"
#include "DbConn.hpp"
#include "common/exception/Exception.hpp"
#include <memory>
namespace cta {
namespace catalogue {
namespace rdbms {
//------------------------------------------------------------------------------
// destructor
......@@ -42,5 +42,5 @@ void DbConn::executeNonQuery(const std::string &sql) {
}
}
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -18,10 +18,10 @@
#pragma once
#include "catalogue/DbStmt.hpp"
#include "DbStmt.hpp"
namespace cta {
namespace catalogue {
namespace rdbms {
/**
* Abstract class that specifies the interface to a database connection.
......@@ -67,5 +67,5 @@ public:
}; // class DbConn
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -16,14 +16,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/DbLogin.hpp"
#include "DbLogin.hpp"
#include "common/exception/Exception.hpp"
#include "common/utils/utils.hpp"
#include <fstream>
namespace cta {
namespace catalogue {
namespace rdbms {
//------------------------------------------------------------------------------
// s_fileFormat
......
......@@ -23,7 +23,7 @@
#include <string>
namespace cta {
namespace catalogue {
namespace rdbms {
/**
* A set of database login details.
......@@ -142,5 +142,5 @@ struct DbLogin {
}; // class DbLogin
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -16,10 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/DbLoginFactory.hpp"
#include "DbLoginFactory.hpp"
namespace cta {
namespace catalogue {
namespace rdbms {
//------------------------------------------------------------------------------
// destructor
......@@ -27,5 +27,5 @@ namespace catalogue {
DbLoginFactory::~DbLoginFactory() {
}
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -18,10 +18,10 @@
#pragma once
#include "catalogue/DbLogin.hpp"
#include "DbLogin.hpp"
namespace cta {
namespace catalogue {
namespace rdbms {
/**
* Abstract class specifying the interface to a factory of DbLogin objects.
......@@ -43,5 +43,5 @@ public:
}; // class DbLogin
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/DbLogin.hpp"
#include "DbLogin.hpp"
#include "common/exception/Exception.hpp"
#include <gtest/gtest.h>
......@@ -24,7 +24,7 @@
namespace unitTests {
class cta_catalogue_DbLoginTest : public ::testing::Test {
class cta_rdbms_DbLoginTest : public ::testing::Test {
protected:
virtual void SetUp() {
......@@ -34,8 +34,8 @@ protected:
}
};
TEST_F(cta_catalogue_DbLoginTest, constructor) {
using namespace cta::catalogue;
TEST_F(cta_rdbms_DbLoginTest, constructor) {
using namespace cta::rdbms;
const DbLogin inMemoryLogin(DbLogin::DBTYPE_IN_MEMORY, "", "", "");
ASSERT_EQ(DbLogin::DBTYPE_IN_MEMORY, inMemoryLogin.dbType);
......@@ -56,8 +56,8 @@ TEST_F(cta_catalogue_DbLoginTest, constructor) {
ASSERT_EQ(std::string("filename"), sqliteLogin.database);
}
TEST_F(cta_catalogue_DbLoginTest, parseStream_in_memory) {
using namespace cta::catalogue;
TEST_F(cta_rdbms_DbLoginTest, parseStream_in_memory) {
using namespace cta::rdbms;
std::stringstream inputStream;
inputStream << "# A comment" << std::endl;
......@@ -77,8 +77,8 @@ TEST_F(cta_catalogue_DbLoginTest, parseStream_in_memory) {
ASSERT_TRUE(dbLogin.database.empty());
}
TEST_F(cta_catalogue_DbLoginTest, parseStream_oracle) {
using namespace cta::catalogue;
TEST_F(cta_rdbms_DbLoginTest, parseStream_oracle) {
using namespace cta::rdbms;
std::stringstream inputStream;
inputStream << "# A comment" << std::endl;
......@@ -98,8 +98,8 @@ TEST_F(cta_catalogue_DbLoginTest, parseStream_oracle) {
ASSERT_EQ(std::string("database"), dbLogin.database);
}
TEST_F(cta_catalogue_DbLoginTest, parseStream_sqlite) {
using namespace cta::catalogue;
TEST_F(cta_rdbms_DbLoginTest, parseStream_sqlite) {
using namespace cta::rdbms;
std::stringstream inputStream;
inputStream << "# A comment" << std::endl;
......@@ -119,9 +119,9 @@ TEST_F(cta_catalogue_DbLoginTest, parseStream_sqlite) {
ASSERT_EQ(std::string("filename"), dbLogin.database);
}
TEST_F(cta_catalogue_DbLoginTest, parseStream_invalid) {
TEST_F(cta_rdbms_DbLoginTest, parseStream_invalid) {
using namespace cta;
using namespace cta::catalogue;
using namespace cta::rdbms;
std::stringstream inputStream;
inputStream << "# A comment" << std::endl;
......
......@@ -16,11 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/DbRset.hpp"
#include "catalogue/NullDbValue.hpp"
#include "DbRset.hpp"
#include "NullDbValue.hpp"
namespace cta {
namespace catalogue {
namespace rdbms {
//------------------------------------------------------------------------------
// destructor
......@@ -60,5 +60,5 @@ uint64_t DbRset::columnUint64(const std::string &colName) const {
}
}
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -24,7 +24,7 @@
#include <string>
namespace cta {
namespace catalogue {
namespace rdbms {
/**
* Abstract class specificing the interface to the result set of an sql query.
......@@ -104,5 +104,5 @@ public:
}; // class DbRset
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -16,10 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/DbStmt.hpp"
#include "DbStmt.hpp"
namespace cta {
namespace catalogue {
namespace rdbms {
//------------------------------------------------------------------------------
// destructor
......@@ -27,5 +27,5 @@ namespace catalogue {
DbStmt::~DbStmt() throw() {
}
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -18,13 +18,13 @@
#pragma once
#include "catalogue/DbRset.hpp"
#include "DbRset.hpp"
#include <stdint.h>
#include <string>
namespace cta {
namespace catalogue {
namespace rdbms {
/**
* Abstract class specifying the interface to a database statement.
......@@ -88,5 +88,5 @@ public:
}; // class DbStmt
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -16,10 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/NullDbValue.hpp"
#include "NullDbValue.hpp"
namespace cta {
namespace catalogue {
namespace rdbms {
//------------------------------------------------------------------------------
// constructor
......@@ -28,5 +28,5 @@ NullDbValue::NullDbValue(const std::string &context, const bool embedBacktrace):
Exception(context, embedBacktrace) {
}
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -21,7 +21,7 @@
#include "common/exception/Exception.hpp"
namespace cta {
namespace catalogue {
namespace rdbms {
/**
* An exception class representing an unexpected encounter with a NULL database
......@@ -42,5 +42,5 @@ public:
}; // class NullDbValue
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -16,16 +16,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/OcciConn.hpp"
#include "catalogue/OcciEnv.hpp"
#include "catalogue/OcciStmt.hpp"
#include "OcciConn.hpp"
#include "OcciEnv.hpp"
#include "OcciStmt.hpp"
#include "common/exception/Exception.hpp"
#include <stdexcept>
#include <string>
namespace cta {
namespace catalogue {
namespace rdbms {
//------------------------------------------------------------------------------
// constructor
......@@ -117,5 +117,5 @@ void OcciConn::rollback() {
}
}
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -18,13 +18,13 @@
#pragma once
#include "catalogue/DbConn.hpp"
#include "DbConn.hpp"
#include <occi.h>
#include <mutex>
namespace cta {
namespace catalogue {
namespace rdbms {
/**
* Forward declaraion to avoid a circular dependency beween OcciConn and
......@@ -118,5 +118,5 @@ private:
}; // class OcciConn
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -16,15 +16,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/DbLogin.hpp"
#include "catalogue/OcciConn.hpp"
#include "catalogue/OcciEnv.hpp"
#include "DbLogin.hpp"
#include "OcciConn.hpp"
#include "OcciEnv.hpp"
#include "common/exception/Exception.hpp"
#include <stdexcept>
namespace cta {
namespace catalogue {
namespace rdbms {
//------------------------------------------------------------------------------
// constructor
......@@ -82,5 +82,5 @@ OcciConn *OcciEnv::createConn(
}
}
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -21,7 +21,7 @@
#include <occi.h>
namespace cta {
namespace catalogue {
namespace rdbms {
class OcciConn;
......@@ -84,5 +84,5 @@ private:
}; // class OcciEnv
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -16,17 +16,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/OcciEnvSingleton.hpp"
#include "catalogue/OcciConn.hpp"
#include "catalogue/OcciEnv.hpp"
#include "OcciEnvSingleton.hpp"
#include "OcciConn.hpp"
#include "OcciEnv.hpp"
#include "catalogue/RdbmsCatalogue.hpp"
#include "catalogue/SqliteConn.hpp"
#include "SqliteConn.hpp"
#include "common/exception/Exception.hpp"
#include <memory>
namespace cta {
namespace catalogue {
namespace rdbms {
//------------------------------------------------------------------------------
// s_mutex
......@@ -62,5 +62,5 @@ OcciEnvSingleton &OcciEnvSingleton::instance() {
OcciEnvSingleton::OcciEnvSingleton() {
}
} // namespace catalogue
} // namespace rdbms
} // namespace cta
......@@ -18,13 +18,13 @@
#pragma once
#include "catalogue/OcciEnv.hpp"
#include "OcciEnv.hpp"
#include <memory>
#include <mutex>
namespace cta {
namespace catalogue {
namespace rdbms {
/**
* A singleton version of OcciEnv.
......@@ -67,5 +67,5 @@ private:
}; // class OcciEnvSingleton
} // namespace catalogue
} // namespace rdbms
} // namespace cta
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment