ATLAS Offline Software
Loading...
Searching...
No Matches
ITPConverter.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7#include "GaudiKernel/MsgStream.h"
8#include <stdexcept>
9
10static
12{
13 static const char *const ignore_error = getenv("ATHENA_TP_IGNORE_NOT_FOUND");
14 if( ignore_error ) return;
15 static const char * const do_abort = getenv("ATHENA_TP_DIE_ON_NOT_FOUND");
16 if( do_abort ) abort();
17 throw std::runtime_error( "TP converter not found" );
18}
19
20
21void
22ITPConverter::converterNotFound( const std::type_info& converterType,
23 ITPConverter *c,
24 const std::string& typeName,
25 MsgStream& log ) const
26{
27 log << MSG::ERROR << ">>>>>> in parent TP converter " << typeid(*this).name()
28 << ": could not find matching TP converter for type " << typeName << endmsg;
29 if( c ) {
30 log << MSG::ERROR << " - found incompatible converter of type "
31 << typeid(*c).name() << endmsg;
32 }
33 log << MSG::ERROR << " Converter handle type was " << converterType.name() << endmsg;
35}
36
37
38
39void
41 ITPConverter *c,
42 const std::string& reqCnvTypeName,
43 MsgStream& log ) const
44{
45 log << MSG::ERROR << ">>>>>> in parent TP converter " << typeid(*this).name()
46 << " requested TP converter for TP type ID " << typeID << " not found " << endmsg;
47 if( c ) {
48 log << MSG::ERROR << " - found converter " << typeid(*c).name()
49 << " for " << c->transientTInfo().name()
50 << " with an incompatible base type " << c->transBaseTInfo().name()
51 << endmsg;
52 }
53 log << MSG::ERROR << " Converter handle type was " << reqCnvTypeName << endmsg;
55}
56
57
#define endmsg
static void errorHandler()
Defines the base ITPConverter class interface for all TP converters.
virtual void converterNotFound(const std::type_info &converterType, ITPConverter *c, const std::string &typeName, MsgStream &log) const
method called when the right TP converter was not found during writing
virtual const TPObjRef::typeID_t & typeID() const =0
Return TP typeID for persistent objects produced by this converter.