Skip to content
Snippets Groups Projects
Commit 8e502332 authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'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.
parent c2f63a36
No related merge requests found
################################################################################
# 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 )
......@@ -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() );
......
......@@ -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
/**
......
......@@ -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");
......
......@@ -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;
......
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