Commit e3965ccc authored by Steven Murray's avatar Steven Murray
Browse files

Namespaced cta::make_unique to not conflict with std::make_unique on newer compilers

parent c35ba985
......@@ -33,11 +33,11 @@ std::unique_ptr<Catalogue> CatalogueFactory::create(const rdbms::Login &login, c
try {
switch(login.dbType) {
case rdbms::Login::DBTYPE_IN_MEMORY:
return make_unique<InMemoryCatalogue>(nbConns);
return cta::make_unique<InMemoryCatalogue>(nbConns);
case rdbms::Login::DBTYPE_ORACLE:
return make_unique<OracleCatalogue>(login.username, login.password, login.database, nbConns);
return cta::make_unique<OracleCatalogue>(login.username, login.password, login.database, nbConns);
case rdbms::Login::DBTYPE_SQLITE:
return make_unique<SqliteCatalogue>(login.database, nbConns);
return cta::make_unique<SqliteCatalogue>(login.database, nbConns);
case rdbms::Login::DBTYPE_NONE:
throw exception::Exception("Cannot create a catalogue without a database type");
default:
......
......@@ -86,7 +86,7 @@ common::dataStructures::ArchiveFile OracleCatalogue::deleteArchiveFile(const std
std::unique_ptr<common::dataStructures::ArchiveFile> archiveFile;
while(selectRset->next()) {
if(nullptr == archiveFile.get()) {
archiveFile = make_unique<common::dataStructures::ArchiveFile>();
archiveFile = cta::make_unique<common::dataStructures::ArchiveFile>();
archiveFile->archiveFileID = selectRset->columnUint64("ARCHIVE_FILE_ID");
archiveFile->diskInstance = selectRset->columnText("DISK_INSTANCE_NAME");
......
......@@ -1954,7 +1954,7 @@ common::dataStructures::MountPolicy *RdbmsCatalogue::getRequesterGroupMountPolic
stmt->bindString(":REQUESTER_GROUP_NAME", requesterGroupName);
auto rset = stmt->executeQuery();
if(rset->next()) {
auto policy = make_unique<common::dataStructures::MountPolicy>();
auto policy = cta::make_unique<common::dataStructures::MountPolicy>();
policy->name = rset->columnText("MOUNT_POLICY_NAME");
......@@ -2150,7 +2150,7 @@ common::dataStructures::MountPolicy *RdbmsCatalogue::getRequesterMountPolicy(
stmt->bindString(":REQUESTER_NAME", requesterName);
auto rset = stmt->executeQuery();
if(rset->next()) {
auto policy = make_unique<common::dataStructures::MountPolicy>();
auto policy = cta::make_unique<common::dataStructures::MountPolicy>();
policy->name = rset->columnText("MOUNT_POLICY_NAME");
......@@ -2494,7 +2494,7 @@ void RdbmsCatalogue::insertArchiveFile(rdbms::Conn &conn, const ArchiveFileRow &
std::unique_ptr<ArchiveFileItor> RdbmsCatalogue::getArchiveFileItor(const ArchiveFileSearchCriteria &searchCriteria,
const uint64_t nbArchiveFilesToPrefetch) const {
try {
return make_unique<ArchiveFileItorImpl>(*this, nbArchiveFilesToPrefetch, searchCriteria);
return cta::make_unique<ArchiveFileItorImpl>(*this, nbArchiveFilesToPrefetch, searchCriteria);
} catch(exception::Exception &ex) {
throw exception::Exception(std::string(__FUNCTION__) + " failed: " + ex.getMessage().str());
}
......@@ -3382,7 +3382,7 @@ std::unique_ptr<common::dataStructures::ArchiveFile> RdbmsCatalogue::getArchiveF
std::unique_ptr<common::dataStructures::ArchiveFile> archiveFile;
while (rset->next()) {
if(nullptr == archiveFile.get()) {
archiveFile = make_unique<common::dataStructures::ArchiveFile>();
archiveFile = cta::make_unique<common::dataStructures::ArchiveFile>();
archiveFile->archiveFileID = rset->columnUint64("ARCHIVE_FILE_ID");
archiveFile->diskInstance = rset->columnText("DISK_INSTANCE_NAME");
......
......@@ -84,7 +84,7 @@ common::dataStructures::ArchiveFile SqliteCatalogue::deleteArchiveFile(const std
std::unique_ptr<rdbms::Rset> selectRset(selectStmt->executeQuery());
while(selectRset->next()) {
if(nullptr == archiveFile.get()) {
archiveFile = make_unique<common::dataStructures::ArchiveFile>();
archiveFile = cta::make_unique<common::dataStructures::ArchiveFile>();
archiveFile->archiveFileID = selectRset->columnUint64("ARCHIVE_FILE_ID");
archiveFile->diskInstance = selectRset->columnText("DISK_INSTANCE_NAME");
......
......@@ -32,11 +32,11 @@ std::unique_ptr<ConnFactory> ConnFactoryFactory::create(const Login &login) {
try {
switch(login.dbType) {
case rdbms::Login::DBTYPE_IN_MEMORY:
return make_unique<SqliteConnFactory>(":memory:");
return cta::make_unique<SqliteConnFactory>(":memory:");
case rdbms::Login::DBTYPE_ORACLE:
return make_unique<OcciConnFactory>(login.username, login.password, login.database);
return cta::make_unique<OcciConnFactory>(login.username, login.password, login.database);
case rdbms::Login::DBTYPE_SQLITE:
return make_unique<SqliteConnFactory>(login.database);
return cta::make_unique<SqliteConnFactory>(login.database);
case rdbms::Login::DBTYPE_NONE:
throw exception::Exception("Cannot create a catalogue without a database type");
default:
......
......@@ -31,11 +31,11 @@ std::unique_ptr<ConnFactory> ConnFactoryFactory::create(const Login &login) {
try {
switch(login.dbType) {
case rdbms::Login::DBTYPE_IN_MEMORY:
return make_unique<SqliteConnFactory>(":memory:");
return cta::make_unique<SqliteConnFactory>(":memory:");
case rdbms::Login::DBTYPE_ORACLE:
throw exception::Exception("OCCI support disabled at compile time");
case rdbms::Login::DBTYPE_SQLITE:
return make_unique<SqliteConnFactory>(login.database);
return cta::make_unique<SqliteConnFactory>(login.database);
case rdbms::Login::DBTYPE_NONE:
throw exception::Exception("Cannot create a catalogue without a database type");
default:
......
......@@ -87,7 +87,7 @@ std::unique_ptr<Stmt> OcciConn::createStmt(const std::string &sql) {
throw exception::Exception("oracle::occi::createStatement() returned a nullptr pointer");
}
return make_unique<OcciStmt>(sql, *this, stmt);
return cta::make_unique<OcciStmt>(sql, *this, stmt);
} catch(exception::Exception &ex) {
throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + sql + ": " +
ex.getMessage().str());
......
......@@ -58,7 +58,7 @@ std::unique_ptr<Conn> OcciEnv::createConn(
throw exception::Exception("oracle::occi::createConnection() returned a nullptr pointer");
}
return make_unique<OcciConn>(m_env, conn);
return cta::make_unique<OcciConn>(m_env, conn);
} catch(exception::Exception &ex) {
throw exception::Exception(std::string(__FUNCTION__) + " failed: " + ex.getMessage().str());
} catch(std::exception &se) {
......
......@@ -119,7 +119,7 @@ std::unique_ptr<Rset> OcciStmt::executeQuery() {
using namespace oracle;
try {
return make_unique<OcciRset>(*this, m_stmt->executeQuery());
return cta::make_unique<OcciRset>(*this, m_stmt->executeQuery());
} catch(exception::Exception &ex) {
throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " +
ex.getMessage().str());
......
......@@ -92,7 +92,7 @@ std::unique_ptr<Stmt> SqliteConn::createStmt(const std::string &sql) {
throw exception::Exception(msg);
}
return make_unique<SqliteStmt>(*this, sql, stmt);
return cta::make_unique<SqliteStmt>(*this, sql, stmt);
} catch(exception::Exception &ex) {
throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + sql + ": " +
ex.getMessage().str());
......
......@@ -42,7 +42,7 @@ SqliteConnFactory::~SqliteConnFactory() throw() {
//------------------------------------------------------------------------------
std::unique_ptr<Conn> SqliteConnFactory::create() {
try {
return make_unique<SqliteConn>(m_filename);
return cta::make_unique<SqliteConn>(m_filename);
} catch(exception::Exception &ex) {
throw exception::Exception(std::string(__FUNCTION__) + " failed: " + ex.getMessage().str());
}
......
......@@ -114,7 +114,7 @@ void SqliteStmt::bindString(const std::string &paramName, const std::string &par
// executeQuery
//------------------------------------------------------------------------------
std::unique_ptr<Rset> SqliteStmt::executeQuery() {
return make_unique<SqliteRset>(*this);
return cta::make_unique<SqliteRset>(*this);
}
//------------------------------------------------------------------------------
......
......@@ -87,9 +87,9 @@ public:
const SchedulerTestParam &param = GetParam();
m_db = param.dbFactory.create();
const uint64_t nbConns = 1;
//m_catalogue = make_unique<catalogue::SchemaCreatingSqliteCatalogue>(m_tempSqliteFile.path(), nbConns);
m_catalogue = make_unique<catalogue::InMemoryCatalogue>(nbConns);
m_scheduler = make_unique<Scheduler>(*m_catalogue, *m_db, 5, 2*1000*1000);
//m_catalogue = cta::make_unique<catalogue::SchemaCreatingSqliteCatalogue>(m_tempSqliteFile.path(), nbConns);
m_catalogue = cta::make_unique<catalogue::InMemoryCatalogue>(nbConns);
m_scheduler = cta::make_unique<Scheduler>(*m_catalogue, *m_db, 5, 2*1000*1000);
}
virtual void TearDown() {
......
......@@ -116,9 +116,9 @@ public:
const DataTransferSessionTestParam &param = GetParam();
m_db = param.dbFactory.create();
const uint64_t nbConns = 1;
//m_catalogue = make_unique<catalogue::SchemaCreatingSqliteCatalogue>(m_tempSqliteFile.path(), nbConns);
m_catalogue = make_unique<catalogue::InMemoryCatalogue>(nbConns);
m_scheduler = make_unique<Scheduler>(*m_catalogue, *m_db, 5, 2*1000*1000);
//m_catalogue = cta::make_unique<catalogue::SchemaCreatingSqliteCatalogue>(m_tempSqliteFile.path(), nbConns);
m_catalogue = cta::make_unique<catalogue::InMemoryCatalogue>(nbConns);
m_scheduler = cta::make_unique<Scheduler>(*m_catalogue, *m_db, 5, 2*1000*1000);
strncpy(m_tmpDir, "/tmp/DataTransferSessionTestXXXXXX", sizeof(m_tmpDir));
if(!mkdtemp(m_tmpDir)) {
......
......@@ -271,7 +271,7 @@ XrdCtaFilesystem::XrdCtaFilesystem():
const rdbms::Login catalogueLogin = rdbms::Login::parseFile("/etc/cta/cta_catalogue_db.conf");
const uint64_t nbConns = 1;
m_catalogue = catalogue::CatalogueFactory::create(catalogueLogin, nbConns);
m_scheduler = make_unique<cta::Scheduler>(*m_catalogue, m_scheddb, 5, 2*1000*1000);
m_scheduler = cta::make_unique<cta::Scheduler>(*m_catalogue, m_scheddb, 5, 2*1000*1000);
// If the backend is a VFS, make sure we don't delete it on exit.
// If not, nevermind.
......
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