9#include "GaudiKernel/System.h"
20 const std::string& name,
21 const IInterface* parent) :
27 declareInterface< TrigSerTPTool >(
this );
31 "use AthDictLoaderSvc instead of plain ROOT" );
57 return StatusCode::SUCCESS;
63 ITPCnvBase* cnvtr = m_convertesCache[persistent];
73 m_convertesCache[persistent] = cnvtr;
78 std::string &persName )
const
88 const auto tpItr =
m_TPmap.find( clname );
91 <<
"Transient class " << clname
92 <<
" is not in the T/P Converter map";
95 persName = tpItr->second;
99 ATH_MSG_ERROR(
"T/P Converter for transient class " << tpItr->first
100 <<
" persistent class " << persName <<
" could not be retrieved");
105 const std::string persname =
107 TClass *persObjCl =
getClass( persname );
110 persptr = persObjCl->New();
111 ATH_MSG_DEBUG(
"created object of " << persptr <<
" at " << persptr );
114 <<
"Couldn't find dictionary for type " << persname;
119 ATH_MSG_DEBUG(
"invoking TP for " << clname <<
" at " << ptr );
122 persName = std::move(persname);
126 catch(
const std::runtime_error& e ){
129 const std::string issue = e.what();
130 if( issue.find(
"is deprecated" ) != std::string::npos ) {
134 REPORT_MESSAGE( MSG::ERROR ) <<
"An exception occurred: " << e.what();
143 std::string& transName )
const
154 <<
"T/P Converter for persistent class "
155 << persName <<
" could not be retrieved";
163 TClass *transCl =
getClass( transName );
166 trans = transCl->New();
176 catch (
const std::runtime_error& e){
177 REPORT_MESSAGE( MSG::ERROR ) <<
"An exception occurred: " << e.what();
190 const auto tpItr =
m_TPmap.find( transClassName );
193 <<
"Transient class " << transClassName
194 <<
" is not in the T/P Converter map";
195 static const std::string dummy(
"" );
200 return tpItr->second;
209 cl = TClass::GetClass( cname.c_str() );
#define ATH_CHECK
Evaluate an expression and check for errors.
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE(LVL)
Report a message.
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