From c2f63a369af11a5203a9d985efac0f8033c5862d Mon Sep 17 00:00:00 2001 From: Atlas-Software Librarian <Atlas-Software.Librarian@cern.ch> Date: Fri, 8 Apr 2016 16:36:00 +0200 Subject: [PATCH] 'CMakeLists.txt' (XMLCatalog-00-01-10) * Tagging XMLCatalog-00-01-10. * Fix placement of using directives. 2015-03-11 scott snyder <snyder@bnl.gov> * Tagging XMLCatalog-00-01-09. * src/PoolXMLFileCatalog.cpp (getNode): Fix coverity warning (shadowed parameter). 2015-02-23 Charles Leggett * Tagging XMLCatalog-00-01-08 * Another fix to compile with new Gaudi plugin service, using variable-length template lists, with backward compatibility 2015-02-23 Charles Leggett * Tagging XMLCatalog-00-01-07. * Fix to compile with new Gaudi plugin service, using ... (Long ChangeLog diff - truncated) --- Database/APR/XMLCatalog/CMakeLists.txt | 30 +++++++++++++++++++ .../XMLCatalog/XMLCatalog/XMLFileCatalog.h | 7 ++++- .../XMLCatalog/XMLMetaDataCatalog.h | 7 ++++- Database/APR/XMLCatalog/src/DTDRedirect.cpp | 2 ++ Database/APR/XMLCatalog/src/DTDRedirect.h | 6 ++-- .../APR/XMLCatalog/src/PoolXMLFileCatalog.cpp | 8 +++-- .../APR/XMLCatalog/src/PoolXMLFileCatalog.h | 5 ++-- .../XMLCatalog/src/XMLDOMErrorMessanger.cpp | 2 ++ .../APR/XMLCatalog/src/XMLDOMErrorMessanger.h | 10 +++---- 9 files changed, 62 insertions(+), 15 deletions(-) create mode 100644 Database/APR/XMLCatalog/CMakeLists.txt diff --git a/Database/APR/XMLCatalog/CMakeLists.txt b/Database/APR/XMLCatalog/CMakeLists.txt new file mode 100644 index 000000000000..1b3affecab7b --- /dev/null +++ b/Database/APR/XMLCatalog/CMakeLists.txt @@ -0,0 +1,30 @@ +################################################################################ +# Package: XMLCatalog +################################################################################ + +# Declare the package name: +atlas_subdir( XMLCatalog ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + Database/APR/FileCatalog + GaudiKernel + PRIVATE + Database/PersistentDataModel + TestPolicy ) + +# External dependencies: +find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) +find_package( CppUnit ) +find_package( XercesC ) + +# Component(s) in the package: +atlas_add_library( XMLCatalog + src/*.cpp + PUBLIC_HEADERS XMLCatalog + PRIVATE_INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${CPPUNIT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} + LINK_LIBRARIES FileCatalog GaudiKernel + PRIVATE_LINK_LIBRARIES ${XERCESC_LIBRARIES} ${CPPUNIT_LIBRARIES} ${CORAL_LIBRARIES} PersistentDataModel ) + +# Component list generation: +atlas_generate_componentslist( XMLCatalog ) diff --git a/Database/APR/XMLCatalog/XMLCatalog/XMLFileCatalog.h b/Database/APR/XMLCatalog/XMLCatalog/XMLFileCatalog.h index 7d79a8cc5f7b..b98f7d76f4c1 100755 --- a/Database/APR/XMLCatalog/XMLCatalog/XMLFileCatalog.h +++ b/Database/APR/XMLCatalog/XMLCatalog/XMLFileCatalog.h @@ -10,6 +10,7 @@ #ifdef HAVE_GAUDI_PLUGINSVC #include "Gaudi/PluginService.h" #endif +#include "GAUDI_VERSION.h" namespace pool { @@ -26,7 +27,11 @@ class XMLMetaDataCatalog; class XMLFileCatalog: public FCImpl{ public: #ifdef HAVE_GAUDI_PLUGINSVC -typedef Gaudi::PluginService::Factory0<FCImpl*> Factory; + #if GAUDI_VERSION > CALC_GAUDI_VERSION(25, 3) + typedef Gaudi::PluginService::Factory<FCImpl*> Factory; + #else + typedef Gaudi::PluginService::Factory0<FCImpl*> Factory; + #endif #endif /**Default constructor. */ diff --git a/Database/APR/XMLCatalog/XMLCatalog/XMLMetaDataCatalog.h b/Database/APR/XMLCatalog/XMLCatalog/XMLMetaDataCatalog.h index 357c72f1799c..0513bb55d211 100755 --- a/Database/APR/XMLCatalog/XMLCatalog/XMLMetaDataCatalog.h +++ b/Database/APR/XMLCatalog/XMLCatalog/XMLMetaDataCatalog.h @@ -10,6 +10,7 @@ #ifdef HAVE_GAUDI_PLUGINSVC #include "Gaudi/PluginService.h" #endif +#include "GAUDI_VERSION.h" namespace pool { class FCImpl; @@ -19,7 +20,11 @@ class XMLFileCatalog; class XMLMetaDataCatalog: public FCMetaImpl{ public: #ifdef HAVE_GAUDI_PLUGINSVC -typedef Gaudi::PluginService::Factory1<FCMetaImpl*, FCImpl*> Factory; + #if GAUDI_VERSION > CALC_GAUDI_VERSION(25, 3) + typedef Gaudi::PluginService::Factory<FCMetaImpl*, FCImpl*> Factory; + #else + typedef Gaudi::PluginService::Factory1<FCMetaImpl*, FCImpl*> Factory; + #endif #endif /// Defsult Constructor diff --git a/Database/APR/XMLCatalog/src/DTDRedirect.cpp b/Database/APR/XMLCatalog/src/DTDRedirect.cpp index d9f7a3251fb0..1f8662857438 100755 --- a/Database/APR/XMLCatalog/src/DTDRedirect.cpp +++ b/Database/APR/XMLCatalog/src/DTDRedirect.cpp @@ -13,6 +13,8 @@ #include <string> #include <iostream> +using namespace xercesc; + static const char* inmemdtd = "\ <!ELEMENT POOLFILECATALOG (META*,File*)>\ <!ELEMENT META EMPTY>\ diff --git a/Database/APR/XMLCatalog/src/DTDRedirect.h b/Database/APR/XMLCatalog/src/DTDRedirect.h index 366d0e5779b4..9c4b9f343b1b 100755 --- a/Database/APR/XMLCatalog/src/DTDRedirect.h +++ b/Database/APR/XMLCatalog/src/DTDRedirect.h @@ -8,14 +8,14 @@ #include "xercesc/sax/EntityResolver.hpp" #include "xercesc/sax/InputSource.hpp" -using namespace xercesc; +//using namespace xercesc; -class DTDRedirect : public EntityResolver +class DTDRedirect : public xercesc::EntityResolver { public: DTDRedirect() {} ~DTDRedirect() {} - InputSource* resolveEntity + xercesc::InputSource* resolveEntity ( const XMLCh* const publicId , const XMLCh* const systemId diff --git a/Database/APR/XMLCatalog/src/PoolXMLFileCatalog.cpp b/Database/APR/XMLCatalog/src/PoolXMLFileCatalog.cpp index 542126962199..362e0f83d79c 100755 --- a/Database/APR/XMLCatalog/src/PoolXMLFileCatalog.cpp +++ b/Database/APR/XMLCatalog/src/PoolXMLFileCatalog.cpp @@ -21,6 +21,8 @@ #include <fstream> #include <stdexcept> +using namespace xercesc; + const std::string pool::PoolXMLFileCatalog::MainNode = "POOLFILECATALOG"; const std::string pool::PoolXMLFileCatalog::METANode = "META"; @@ -1173,9 +1175,9 @@ pool::PoolXMLFileCatalog::getNode(const std::string& nodename, MyNode = mem_pfn[attrname]; if (!MyNode) { // back compatibility with POOL_1_3_3 - XMLCh* attr = pool::_toDOMS(attrname); - MyNode = doc->getElementById(attr); - XMLString::release(&attr); + XMLCh* attr2 = pool::_toDOMS(attrname); + MyNode = doc->getElementById(attr2); + XMLString::release(&attr2); } } } diff --git a/Database/APR/XMLCatalog/src/PoolXMLFileCatalog.h b/Database/APR/XMLCatalog/src/PoolXMLFileCatalog.h index aaba25777671..8cbeea93c560 100755 --- a/Database/APR/XMLCatalog/src/PoolXMLFileCatalog.h +++ b/Database/APR/XMLCatalog/src/PoolXMLFileCatalog.h @@ -15,8 +15,6 @@ #include "xercesc/dom/DOMNode.hpp" #include <xercesc/parsers/XercesDOMParser.hpp> -using namespace xercesc; - namespace pool { @@ -257,6 +255,9 @@ namespace pool { std::string getfiletype(const std::string& pfn); private: + typedef xercesc::DOMNode DOMNode; + typedef xercesc::DOMDocument DOMDocument; + typedef xercesc::XercesDOMParser XercesDOMParser; DOMNode* getNode(const std::string & nodename, const std::string & attr, const std::string & attrname); diff --git a/Database/APR/XMLCatalog/src/XMLDOMErrorMessanger.cpp b/Database/APR/XMLCatalog/src/XMLDOMErrorMessanger.cpp index f8933e6ab480..528fca5551d6 100755 --- a/Database/APR/XMLCatalog/src/XMLDOMErrorMessanger.cpp +++ b/Database/APR/XMLCatalog/src/XMLDOMErrorMessanger.cpp @@ -17,6 +17,8 @@ #include <string> #include <stdexcept> +using namespace xercesc; + // Global streaming operator for DOMString is defined in DOMPrint.cpp //extern ostream& operator<<(ostream& target, const DOMString& s); diff --git a/Database/APR/XMLCatalog/src/XMLDOMErrorMessanger.h b/Database/APR/XMLCatalog/src/XMLDOMErrorMessanger.h index 34ae01ef5ef3..a2df7c646c60 100755 --- a/Database/APR/XMLCatalog/src/XMLDOMErrorMessanger.h +++ b/Database/APR/XMLCatalog/src/XMLDOMErrorMessanger.h @@ -6,11 +6,11 @@ #include "xercesc/sax/ErrorHandler.hpp" #include <iostream> -using namespace xercesc; +//using namespace xercesc; namespace pool{ -class XMLDOMErrorMessanger : public ErrorHandler +class XMLDOMErrorMessanger : public xercesc::ErrorHandler { public: // ----------------------------------------------------------------------- @@ -26,9 +26,9 @@ public: // ----------------------------------------------------------------------- // Implementation of the error handler interface // ----------------------------------------------------------------------- - void warning(const SAXParseException& toCatch); - void error(const SAXParseException& toCatch); - void fatalError(const SAXParseException& toCatch); + void warning(const xercesc::SAXParseException& toCatch); + void error(const xercesc::SAXParseException& toCatch); + void fatalError(const xercesc::SAXParseException& toCatch); void resetErrors(); // ----------------------------------------------------------------------- -- GitLab