ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaPoolCnvSvc Namespace Reference

Classes

class  ExcCaughtException
 Exception — Caught an exception during conversion. More...
class  ExcNoDictForClass
 Exception — Can't find dictionary information for class. More...
class  ExcUnsupportedVersion
 Exception — Unsupported persistent version of CLASS found. More...
class  TPCnvElt
 Helper for calling a TP converter from an Athena converter. More...
class  TPCnvElt< CNV, T_TPCnvNull< TRANS > >
 Helper for calling a TP converter from an Athena converter. More...
class  TPCnvList
 Helper for calling TP converters from an Athena converter. More...

Functions

void debugCreateTransient (CLID clid)
 Called by templated converters at the start of createTransient.
void debugCreatePersistent (CLID clid)
 Called by templated converters at the start of createPersistent.
void throwExcNoDictForClass (const std::type_info &ti)
 Throw a AthenaPoolCnvSvc::ExcNoDictForClass exception.
void throwExcUnsupportedVersion (const std::type_info &ti, const Guid &guid)
 Throw a AthenaPoolCnvSvc::ExcUnsupportedVersion exception.
void throwExcCaughtException (const char *fnname, const char *action, const std::exception &ex, const std::type_info &ti, const std::string &key)
 Throw a AthenaPoolCnvSvc::ExcCaughtException exception.
template<class TPCNV, typename std::enable_if_t< std::is_base_of_v< ITPConverter, TPCNV > > * = nullptr>
std::unique_ptr< typename TPCNV::Pers_t > createPersistent (TPCNV &cnv, const typename TPCNV::Trans_t *transObj, const std::string &key, MsgStream &log)
 Create a persistent object from a transient object.
template<class TPCNV, typename std::enable_if_t< std::is_base_of_v< ITPConverter, TPCNV > > * = nullptr>
std::unique_ptr< typename TPCNV::Trans_t > createTransient (TPCNV &cnv, const typename TPCNV::Pers_t *persObj, const std::string &key, MsgStream &log)
 Create a transient object from a persistent object.
Guid guidFromTypeinfo (const std::type_info &ti)
 Given a type_info, get the corresponding pool guid.
std::string excNoDictForClass_format (const std::type_info &ti)
 Helper: format exception error string.
std::string excUnsupportedVersion_format (const std::type_info &ti, const Guid &guid)
 Helper: format exception error string.
std::string excCaughtException_format (const char *fnname, const char *action, const std::exception &ex, const std::type_info &ti, const std::string &key)
 Helper: format exception error string.

Function Documentation

◆ createPersistent()

template<class TPCNV, typename std::enable_if_t< std::is_base_of_v< ITPConverter, TPCNV > > * = nullptr>
std::unique_ptr< typename TPCNV::Pers_t > AthenaPoolCnvSvc::createPersistent ( TPCNV & cnv,
const typename TPCNV::Trans_t * transObj,
const std::string & key,
MsgStream & log )

Create a persistent object from a transient object.

Parameters
cnvThe TP converter to call.
transObjThe transient object to convert.
TheSG key of the object.
logFor logging messages.

This version is used when CNV derives from ITPConverter. We call TPCNV::createPersistentWithKey().

Parameters
cnvThe TP converter to call.
transObjThe transient object to convert.
TheSG key of the object.
logFor logging messages.

This version is used when CNV does not derivce from ITPConverter. We create the persistent object directly and call TPCnv::transToPers().

Definition at line 53 of file T_AthenaPoolCreateFuncs.h.

57{
58 return std::unique_ptr<typename TPCNV::Pers_t>
59 (cnv.createPersistentWithKey (transObj, key, log));
60}

◆ createTransient()

template<class TPCNV, typename std::enable_if_t< std::is_base_of_v< ITPConverter, TPCNV > > * = nullptr>
std::unique_ptr< typename TPCNV::Trans_t > AthenaPoolCnvSvc::createTransient ( TPCNV & cnv,
const typename TPCNV::Pers_t * persObj,
const std::string & key,
MsgStream & log )

Create a transient object from a persistent object.

Parameters
cnvThe TP converter to call.
persObjThe persistent object to convert.
TheSG key of the object.
logFor logging messages.

This version is used when CNV derives from ITPConverter. We call TPCNV::createTransientWithKey().

Parameters
cnvThe TP converter to call.
persObjThe persistent object to convert.
TheSG key of the object.
logFor logging messages.

This version is used when CNV does not derivce from ITPConverter. We create the transient object directly and call TPCnv::persToTrans().

Definition at line 100 of file T_AthenaPoolCreateFuncs.h.

104{
105 return std::unique_ptr<typename TPCNV::Trans_t>
106 (cnv.createTransientWithKey (persObj, key, log));
107}

◆ debugCreatePersistent()

void AthenaPoolCnvSvc::debugCreatePersistent ( CLID clid)

Called by templated converters at the start of createPersistent.

Parameters
clidThe CLID of the class being converted.

Definition at line 37 of file Database/AthenaPOOL/AthenaPoolCnvSvc/src/debug.cxx.

38{
39}

◆ debugCreateTransient()

void AthenaPoolCnvSvc::debugCreateTransient ( CLID clid)

Called by templated converters at the start of createTransient.

Parameters
clidThe CLID of the class being converted.

Definition at line 26 of file Database/AthenaPOOL/AthenaPoolCnvSvc/src/debug.cxx.

27{
28}

◆ excCaughtException_format()

std::string AthenaPoolCnvSvc::excCaughtException_format ( const char * fnname,
const char * action,
const std::exception & ex,
const std::type_info & ti,
const std::string & key )

Helper: format exception error string.

Definition at line 92 of file Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx.

97{
98 return std::format("AthenaPoolCnvSvc::::ExcCaughtException: Caught exception in {} while {}{}/{}: {}: {}",
99 fnname, action, System::typeinfoName(ti), key,
100 System::typeinfoName(typeid(ex)), ex.what());
101}

◆ excNoDictForClass_format()

std::string AthenaPoolCnvSvc::excNoDictForClass_format ( const std::type_info & ti)

Helper: format exception error string.

Definition at line 24 of file Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx.

25{
26 return std::string("AthenaPoolCnvSvc::::ExcNoDictForClass: "
27 "Can't find dictionary information for class: ") +
28 System::typeinfoName(ti);
29}

◆ excUnsupportedVersion_format()

std::string AthenaPoolCnvSvc::excUnsupportedVersion_format ( const std::type_info & ti,
const Guid & guid )

Helper: format exception error string.

Definition at line 56 of file Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx.

58{
59 return std::string("AthenaPoolCnvSvc::::ExcUnsupportedVersion: "
60 "Unsupported persistent version of ") +
61 System::typeinfoName(ti) + " found; guid: " + guid.toString();
62}

◆ guidFromTypeinfo()

Guid AthenaPoolCnvSvc::guidFromTypeinfo ( const std::type_info & ti)

Given a type_info, get the corresponding pool guid.

Parameters
titype_info to look for.

Throws an exception on errors.

Definition at line 32 of file TPCnvElt.cxx.

33{
34 RootType temp = RootType(ti);
35 return pool::DbReflex::guid ((temp) ? temp : RootType(pool::DbTypeInfo::typeName(ti)));
36}
TTypeAdapter RootType
Definition RootType.h:211
static Guid guid(const RootType &id)
Determine Guid (normalized string form) from reflection type.
static const std::string typeName(const std::type_info &typ)
Access type name by type identifier from RTTI.

◆ throwExcCaughtException()

void AthenaPoolCnvSvc::throwExcCaughtException ( const char * fnname,
const char * action,
const std::exception & ex,
const std::type_info & ti,
const std::string & key )

Throw a AthenaPoolCnvSvc::ExcCaughtException exception.

Parameters
fnnameName of the function being executed.
actionWhat we were doing when we caught the exception.
exThe caught exception.
tiThe class being thinned.
keyKey of the class being thinned.

Will also print a stack trace if exctrace is enabled.

Definition at line 132 of file Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx.

137{
138 std::cout.flush();
139 std::cerr.flush();
141 throw ExcCaughtException (fnname, action, ex, ti, key);
142}
void exctrace(const std::exception &e, IOFD fd=IOFD_INVALID)
Print out information for the last exception.
Definition exctrace.cxx:59

◆ throwExcNoDictForClass()

void AthenaPoolCnvSvc::throwExcNoDictForClass ( const std::type_info & ti)

Throw a AthenaPoolCnvSvc::ExcNoDictForClass exception.

Parameters
tiThe requested class.

Definition at line 46 of file Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx.

47{
48 throw ExcNoDictForClass (ti);
49}

◆ throwExcUnsupportedVersion()

void AthenaPoolCnvSvc::throwExcUnsupportedVersion ( const std::type_info & ti,
const Guid & guid )

Throw a AthenaPoolCnvSvc::ExcUnsupportedVersion exception.

Parameters
tiThe class being read.
guidThe GUID of the persistent class.

Definition at line 82 of file Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx.

83{
84 throw ExcUnsupportedVersion (ti, guid);
85}