Skip to content
Snippets Groups Projects
Commit 3d84e7e4 authored by scott snyder's avatar scott snyder
Browse files

AthenaPoolCnvSvc: Allow specifying name used for error messages.

The MsgStream used for generating messages from AthenaPoolConverter had 
the name hardcoded as `AthenaPoolConverter'.  In some cases, downstream
code was using tricks to change this to something more meaningful.
Add an optional argument to the converter constructors to allow 
overriding the default with a more appropriate name.
parent 746f7f53
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,8 @@ public: ...@@ -69,7 +69,8 @@ public:
protected: protected:
/// Standard Service Constructor /// Standard Service Constructor
AthenaPoolConverter(const CLID& id, ISvcLocator* pSvcLocator); AthenaPoolConverter(const CLID& id, ISvcLocator* pSvcLocator,
const char* name = nullptr);
/// Write an object into POOL. /// Write an object into POOL.
/// @param pObj [IN] pointer to the transient object. /// @param pObj [IN] pointer to the transient object.
......
...@@ -25,7 +25,8 @@ class T_AthenaPoolCnvBase : public AthenaPoolConverter { ...@@ -25,7 +25,8 @@ class T_AthenaPoolCnvBase : public AthenaPoolConverter {
protected: protected:
/// Constructor /// Constructor
T_AthenaPoolCnvBase(ISvcLocator* svcloc); T_AthenaPoolCnvBase(ISvcLocator* svcloc,
const char* name = nullptr);
/// Gaudi Service Interface method implementations: /// Gaudi Service Interface method implementations:
virtual StatusCode initialize(); virtual StatusCode initialize();
......
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
//__________________________________________________________________________ //__________________________________________________________________________
template <class T> template <class T>
T_AthenaPoolCnvBase<T>::T_AthenaPoolCnvBase(ISvcLocator* svcloc) : AthenaPoolConverter(classID(), svcloc) { T_AthenaPoolCnvBase<T>::T_AthenaPoolCnvBase(ISvcLocator* svcloc,
const char* name /*= nullptr*/)
: AthenaPoolConverter(classID(), svcloc, name) {
} }
//______________________________________________________________________________ //______________________________________________________________________________
template <class T> template <class T>
......
...@@ -36,7 +36,8 @@ class T_AthenaPoolCustCnv : public T_AthenaPoolCnvBase<TRANS> { ...@@ -36,7 +36,8 @@ class T_AthenaPoolCustCnv : public T_AthenaPoolCnvBase<TRANS> {
protected: protected:
/// Constructor /// Constructor
T_AthenaPoolCustCnv(ISvcLocator* pSvcLocator); T_AthenaPoolCustCnv(ISvcLocator* pSvcLocator,
const char* name = nullptr);
/// Gaudi Service Interface method implementations: /// Gaudi Service Interface method implementations:
virtual StatusCode initialize(); virtual StatusCode initialize();
......
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
//__________________________________________________________________________ //__________________________________________________________________________
template <class TRANS, class PERS> template <class TRANS, class PERS>
T_AthenaPoolCustCnv<TRANS, PERS>::T_AthenaPoolCustCnv(ISvcLocator* pSvcLocator) : T_AthenaPoolCnvBase<TRANS>(pSvcLocator) { T_AthenaPoolCustCnv<TRANS, PERS>::T_AthenaPoolCustCnv(ISvcLocator* pSvcLocator,
const char* name /*= nullptr*/)
: T_AthenaPoolCnvBase<TRANS>(pSvcLocator, name) {
} }
//______________________________________________________________________________ //______________________________________________________________________________
template <class TRANS, class PERS> template <class TRANS, class PERS>
......
...@@ -34,7 +34,9 @@ public: ...@@ -34,7 +34,9 @@ public:
protected: protected:
/// Constructor /// Constructor
/// @param svcloc [IN] Gaudi service locator /// @param svcloc [IN] Gaudi service locator
T_AthenaPoolCustomCnv(ISvcLocator* pSvcLocator); /// @param name [IN] Optional name, for error reporting.
T_AthenaPoolCustomCnv(ISvcLocator* pSvcLocator,
const char* name = nullptr);
// the 2 following methods are allowed to throw std::runtime_error // the 2 following methods are allowed to throw std::runtime_error
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
#include <stdexcept> #include <stdexcept>
template <class TRANS, class PERS> template <class TRANS, class PERS>
T_AthenaPoolCustomCnv<TRANS, PERS>::T_AthenaPoolCustomCnv(ISvcLocator* pSvcLocator) : BaseType(pSvcLocator) { T_AthenaPoolCustomCnv<TRANS, PERS>::T_AthenaPoolCustomCnv(ISvcLocator* pSvcLocator,
const char* name /*= nullptr*/) : BaseType(pSvcLocator, name) {
} }
template <class TRANS, class PERS> template <class TRANS, class PERS>
......
...@@ -129,9 +129,11 @@ long AthenaPoolConverter::storageType() { ...@@ -129,9 +129,11 @@ long AthenaPoolConverter::storageType() {
return(POOL_StorageType); return(POOL_StorageType);
} }
//__________________________________________________________________________ //__________________________________________________________________________
AthenaPoolConverter::AthenaPoolConverter(const CLID& myCLID, ISvcLocator* pSvcLocator) : AthenaPoolConverter::AthenaPoolConverter(const CLID& myCLID, ISvcLocator* pSvcLocator,
const char* name /*= nullptr*/) :
::Converter(POOL_StorageType, myCLID, pSvcLocator), ::Converter(POOL_StorageType, myCLID, pSvcLocator),
::AthMessaging((pSvcLocator != nullptr ? msgSvc() : nullptr), "AthenaPoolConverter"), ::AthMessaging((pSvcLocator != nullptr ? msgSvc() : nullptr),
name ? name : "AthenaPoolConverter"),
m_athenaPoolCnvSvc("AthenaPoolCnvSvc", "AthenaPoolConverter"), m_athenaPoolCnvSvc("AthenaPoolCnvSvc", "AthenaPoolConverter"),
m_placement(nullptr), m_placement(nullptr),
m_placementHints(), m_placementHints(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment