9#include "GaudiKernel/System.h"
19 const std::string& name,
20 const IInterface* parent) :
26 declareInterface< TrigSerTPTool >(
this );
30 "use AthDictLoaderSvc instead of plain ROOT" );
56 return StatusCode::SUCCESS;
62 ITPCnvBase* cnvtr = m_convertesCache[persistent];
72 m_convertesCache[persistent] = cnvtr;
77 std::string &persName )
const
87 const auto tpItr =
m_TPmap.find( clname );
90 <<
"Transient class " << clname
91 <<
" is not in the T/P Converter map";
94 persName = tpItr->second;
98 ATH_MSG_ERROR(
"T/P Converter for transient class " << tpItr->first
99 <<
" persistent class " << persName <<
" could not be retrieved");
104 const std::string persname =
106 TClass *persObjCl =
getClass( persname );
109 persptr = persObjCl->New();
110 ATH_MSG_DEBUG(
"created object of " << persptr <<
" at " << persptr );
113 <<
"Couldn't find dictionary for type " << persname;
118 ATH_MSG_DEBUG(
"invoking TP for " << clname <<
" at " << ptr );
121 persName = std::move(persname);
125 catch(
const std::runtime_error& e ){
128 const std::string issue = e.what();
129 if( issue.find(
"is deprecated" ) != std::string::npos ) {
133 REPORT_MESSAGE( MSG::ERROR ) <<
"An exception occurred: " << e.what();
142 std::string& transName )
const
153 <<
"T/P Converter for persistent class "
154 << persName <<
" could not be retrieved";
162 TClass *transCl =
getClass( transName );
165 trans = transCl->New();
175 catch (
const std::runtime_error& e){
176 REPORT_MESSAGE( MSG::ERROR ) <<
"An exception occurred: " << e.what();
189 const auto tpItr =
m_TPmap.find( transClassName );
192 <<
"Transient class " << transClassName
193 <<
" is not in the T/P Converter map";
194 static const std::string dummy(
"" );
199 return tpItr->second;
208 cl = TClass::GetClass( cname.c_str() );
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE(LVL)
Report a message.
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual const std::type_info & transientTInfo() const =0
return C++ type id of the transient class this converter is for
virtual void persToTransWithKeyUntyped(const void *pers, void *trans, const std::string &, MsgStream &msg)
Convert persistent object representation to transient.
virtual void transToPersUntyped(const void *trans, void *pers, MsgStream &msg)=0
Convert transient object representation to persistent.
virtual const std::type_info & persistentTInfo() const =0
return C++ type id of the persistent class this converter is for