Skip to content
Snippets Groups Projects
Commit 45e8508b authored by Christopher Rob Jones's avatar Christopher Rob Jones
Browse files

RichCommonBase: Make objectLocation stand alone functions

parent 93c67361
No related branches found
No related tags found
2 merge requests!4386Merge master into FTRetinaSeedRawBanks,!4321RichFutureMCUtils: Add support for spillover events to RICH MC cheating algorithms
......@@ -43,6 +43,21 @@ namespace Rich {
namespace Future {
/** Returns the full location of the container in the Data Store
*
* @param pObj Data object
*
* @return Location of given data object
*/
template <typename TYPE>
inline auto objectLocation( const TYPE& pObj ) {
return ( pObj.registry() ? pObj.registry()->identifier() : "UnRegistered" );
}
template <typename TYPE>
inline auto objectLocation( const TYPE* pObj ) {
return ( !pObj ? "Null DataObject !" : objectLocation( *pObj ) );
}
  • Developer

    there is no need for templates here -- it actually relies on TYPE inheriting from DataObject, i.e. this could be:

    
        inline auto objectLocation( const DataObject& pObj ) {
          return ( pObj.registry() ? pObj.registry()->identifier() : "UnRegistered" );
        }
    
        inline auto objectLocation( const DataObject* pObj ) {
          return ( !pObj ? "Null DataObject !" : objectLocation( *pObj ) );
        }
    Edited by Gerhard Raven
  • Please register or sign in to reply
//-----------------------------------------------------------------------------
/** @class CommonBase RichCommonBase.h RichFutureKernel/RichCommonBase.h
*
......@@ -78,16 +93,6 @@ namespace Rich {
virtual StatusCode finalize() override;
public:
/** Returns the full location of the given object in the Data Store
*
* @param pObj Data object
*
* @return Location of given data object
*/
inline std::string objectLocation( const DataObject* pObj ) const {
return ( !pObj ? "Null DataObject !" : ( pObj->registry() ? pObj->registry()->identifier() : "UnRegistered" ) );
}
/** @brief Forced release of a particular tool
*
* Tools are automatically released during finalisation, so this method
......
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