From 8e502332f9223c0520b6a9ebc8af08a2e81a210e Mon Sep 17 00:00:00 2001 From: Atlas-Software Librarian <Atlas-Software.Librarian@cern.ch> Date: Fri, 8 Apr 2016 16:36:42 +0200 Subject: [PATCH] 'CMakeLists.txt' (RelationalCollection-00-02-08) * Tagging RelationalCollection-00-02-08. * Fix clang warnings: auto_ptr -> unique_ptr. 2015-02-23 Charles Leggett * Tagging RelationalCollection-00-02-07 * Fix to compile with new Gaudi plugin service, using variable-length template lists, with backward compatibility 2015-02-23 scott snyder <snyder@bnl.gov> * Tagging RelationalCollection-00-02-06. * Fix to compile with new Gaudi plugin service, using variable-length template lists. --- .../APR/RelationalCollection/CMakeLists.txt | 27 +++++++++++++++++++ .../src/RelationalCollection.cpp | 10 +++---- .../src/RelationalCollection.h | 7 ++++- .../src/RelationalCollectionMetadata.cpp | 8 +++--- .../tests/WriteUpdate/TestDriver.cpp | 4 +-- 5 files changed, 44 insertions(+), 12 deletions(-) create mode 100644 Database/APR/RelationalCollection/CMakeLists.txt diff --git a/Database/APR/RelationalCollection/CMakeLists.txt b/Database/APR/RelationalCollection/CMakeLists.txt new file mode 100644 index 000000000000..956ca4cf3f15 --- /dev/null +++ b/Database/APR/RelationalCollection/CMakeLists.txt @@ -0,0 +1,27 @@ +################################################################################ +# Package: RelationalCollection +################################################################################ + +# Declare the package name: +atlas_subdir( RelationalCollection ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PRIVATE + Database/APR/CollectionBase + Database/APR/POOLCore + Database/PersistentDataModel + GaudiKernel + TestPolicy ) + +# External dependencies: +find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) + +# Component(s) in the package: +atlas_add_library( RelationalCollection + src/*.cpp + NO_PUBLIC_HEADERS + PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} + PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} CollectionBase POOLCore PersistentDataModel GaudiKernel ) + +# Component list generation: +atlas_generate_componentslist( RelationalCollection ) diff --git a/Database/APR/RelationalCollection/src/RelationalCollection.cpp b/Database/APR/RelationalCollection/src/RelationalCollection.cpp index 201ac157900f..d5a59cab5eff 100644 --- a/Database/APR/RelationalCollection/src/RelationalCollection.cpp +++ b/Database/APR/RelationalCollection/src/RelationalCollection.cpp @@ -168,7 +168,7 @@ pool::RelationalCollection::RelationalCollection::open() if( isOpen() ) return; // Get connection service. - auto_ptr<coral::ConnectionService> connectionService( new coral::ConnectionService() ); + unique_ptr<coral::ConnectionService> connectionService( new coral::ConnectionService() ); coral::MessageStream log( "pool::RelationalCollection::open" ); // Retrieve a connection handle. bool readOnly = ( m_mode == pool::ICollection::READ ); @@ -891,7 +891,7 @@ initialize() const string init_procedure = "POOL_COLLECTION_INIT"; bool procedureExists( false ); try { - std::auto_ptr<coral::IQuery> query( m_session->schema("SYS").newQuery() ); + std::unique_ptr<coral::IQuery> query( m_session->schema("SYS").newQuery() ); coral::AttributeList output; output.extend( "count(*)", "int"); query->addToOutputList("count(*)"); @@ -1380,7 +1380,7 @@ retrieveColumnDescriptions( const std::string& fragmentName, // Retrieve column names and types for this fragment and insert into collection description object. coral::ITable& descriptionsTable = nominalSchema.tableHandle( RelationalCollectionNames::nameOfCollectionDescriptionsTable() ); - std::auto_ptr<coral::IQuery> descQuery( descriptionsTable.newQuery() ); + std::unique_ptr<coral::IQuery> descQuery( descriptionsTable.newQuery() ); descQuery->addToOutputList( RelationalCollectionNames::collectionVariableNameVariableInCollectionDescriptionsTable() ); descQuery->addToOutputList( RelationalCollectionNames::collectionVariableTypeVariableInCollectionDescriptionsTable() ); descQuery->addToOutputList( RelationalCollectionNames::collectionVariableMaxSizeVariableInCollectionDescriptionsTable() ); @@ -1484,7 +1484,7 @@ pool::RelationalCollection::RelationalCollection:: createLinkIdToTokenKeyMaps( const std::string& fragmentName ) { // Query the links table. - auto_ptr<coral::IQuery> query( m_session->nominalSchema().newQuery() ); + unique_ptr<coral::IQuery> query( m_session->nominalSchema().newQuery() ); query->addToTableList( m_linksTableNameForCollectionFragmentName[fragmentName] ); // Select all columns from links table and order by link ID. @@ -2221,7 +2221,7 @@ pool::RelationalCollection::RelationalCollection:: retrieveFragmentTableNames( const std::string& fragmentName ) { // Retrieve data and links table names for this collection fragment and insert in private maps. - std::auto_ptr<coral::IQuery> query( + std::unique_ptr<coral::IQuery> query( m_session->nominalSchema().tableHandle( RelationalCollectionNames::nameOfCollectionHeadersTable() ).newQuery() ); query->addToOutputList( RelationalCollectionNames::dataTableNameVariableInCollectionHeadersTable() ); diff --git a/Database/APR/RelationalCollection/src/RelationalCollection.h b/Database/APR/RelationalCollection/src/RelationalCollection.h index dc7b72b27429..6bd0fe00b1df 100755 --- a/Database/APR/RelationalCollection/src/RelationalCollection.h +++ b/Database/APR/RelationalCollection/src/RelationalCollection.h @@ -15,6 +15,7 @@ #ifdef HAVE_GAUDI_PLUGINSVC #include "Gaudi/PluginService.h" #endif +#include "GAUDI_VERSION.h" #include <map> @@ -50,7 +51,11 @@ namespace pool { { public: #ifdef HAVE_GAUDI_PLUGINSVC -typedef Gaudi::PluginService::Factory3<ICollection*, const ICollectionDescription*, ICollection::OpenMode, ISession*> Factory; + #if GAUDI_VERSION > CALC_GAUDI_VERSION(25, 3) + typedef Gaudi::PluginService::Factory<ICollection*, const ICollectionDescription*, ICollection::OpenMode, ISession*> Factory; + #else + typedef Gaudi::PluginService::Factory3<ICollection*, const ICollectionDescription*, ICollection::OpenMode, ISession*> Factory; + #endif #endif /** diff --git a/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.cpp b/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.cpp index adf3556b2e09..a2bc0ef57e34 100644 --- a/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.cpp +++ b/Database/APR/RelationalCollection/src/RelationalCollectionMetadata.cpp @@ -108,7 +108,7 @@ namespace pool { { if( !m_metadataTable ) return 0; - std::auto_ptr<coral::IQuery> query( m_metadataTable->newQuery() ); + std::unique_ptr<coral::IQuery> query( m_metadataTable->newQuery() ); query->setCondition( RelationalCollectionBindVariables::whereClauseForMetadata(), m_whereDataForMetadata ); query->limitReturnedRows( 1, 0 ); query->addToOutputList( "count(*)"); @@ -129,7 +129,7 @@ namespace pool { map<string,bool>::iterator ki= m_keyInfo.find( key ); if( ki != m_keyInfo.end() ) return ki->second; - std::auto_ptr<coral::IQuery> query( m_metadataTable->newQuery() ); + std::unique_ptr<coral::IQuery> query( m_metadataTable->newQuery() ); m_whereDataForMetadataKey[1].data<std::string>() = key; query->addToOutputList( RelationalCollectionNames::collectionNameColumn() ); query->setCondition( RelationalCollectionBindVariables::whereClauseForMetadataKey(), m_whereDataForMetadataKey ); @@ -146,7 +146,7 @@ namespace pool { { if( !m_metadataTable ) return 0; - std::auto_ptr<coral::IQuery> query( m_metadataTable->newQuery() ); + std::unique_ptr<coral::IQuery> query( m_metadataTable->newQuery() ); m_whereDataForMetadataKey[1].data<std::string>() = key; query->setCondition( RelationalCollectionBindVariables::whereClauseForMetadataKey(), m_whereDataForMetadataKey ); query->limitReturnedRows( 1, 0 ); @@ -314,7 +314,7 @@ namespace pool { { if( !m_metadataTable ) return end(); - std::auto_ptr<coral::IQuery> query( m_metadataTable->newQuery() ); + std::unique_ptr<coral::IQuery> query( m_metadataTable->newQuery() ); coral::AttributeList output; output.extend( "key", "string"); diff --git a/Database/APR/RelationalCollection/tests/WriteUpdate/TestDriver.cpp b/Database/APR/RelationalCollection/tests/WriteUpdate/TestDriver.cpp index 6531a41249af..fc134b92363c 100644 --- a/Database/APR/RelationalCollection/tests/WriteUpdate/TestDriver.cpp +++ b/Database/APR/RelationalCollection/tests/WriteUpdate/TestDriver.cpp @@ -48,7 +48,7 @@ void TestDriver::write() { cout << "Creationg CollectionService" << endl; - auto_ptr<pool::CollectionService> serviceHandle( new pool::CollectionService() ); + unique_ptr<pool::CollectionService> serviceHandle( new pool::CollectionService() ); cout << "Creating a collection description object" << endl; @@ -118,7 +118,7 @@ TestDriver::write() void TestDriver::update() { - auto_ptr<pool::CollectionService> serviceHandle( new pool::CollectionService ); + unique_ptr<pool::CollectionService> serviceHandle( new pool::CollectionService ); // Create a collection description object. cout << "Getting handle to existing collection" << endl; -- GitLab