ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
AthenaPoolCnvSvc::TPCnvElt< CNV, TPCNV > Class Template Reference

Helper for calling a TP converter from an Athena converter. More...

#include <TPCnvElt.h>

Collaboration diagram for AthenaPoolCnvSvc::TPCnvElt< CNV, TPCNV >:

Public Types

typedef TPCNV::Trans_t Trans_t
 Make available the persistent and transient types. More...
 
typedef TPCNV::Pers_t Pers_t
 

Public Member Functions

 TPCnvElt ()
 Constructor. More...
 
std::unique_ptr< Trans_tcreateTransient (CNV &parent, const std::string &key, MsgStream &msg)
 Read the persistent object and convert it to transient. More...
 
bool persToTrans (CNV &parent, Trans_t *trans, const std::string &key, MsgStream &msg)
 Read the persistent object and convert it to transient. More...
 

Private Attributes

Guid m_guid
 GUID for the persistent class we read. More...
 
TPCNV m_cnv
 The underlying TP converter. More...
 

Detailed Description

template<class CNV, class TPCNV>
class AthenaPoolCnvSvc::TPCnvElt< CNV, TPCNV >

Helper for calling a TP converter from an Athena converter.

This is used to allow calling one out of a templated list of TP converters. The methods here test if the current guid matches the guid for this converter, and calls it if so.

CNV is the top-level pool converter (that reads the persistent object). TPCNV is the TP converter class to be called. For the case where no conversion is to be done, use T_TPCnvNull<TRANS> for the TP converter class.

Definition at line 60 of file TPCnvElt.h.

Member Typedef Documentation

◆ Pers_t

template<class CNV , class TPCNV >
typedef TPCNV::Pers_t AthenaPoolCnvSvc::TPCnvElt< CNV, TPCNV >::Pers_t

Definition at line 65 of file TPCnvElt.h.

◆ Trans_t

template<class CNV , class TPCNV >
typedef TPCNV::Trans_t AthenaPoolCnvSvc::TPCnvElt< CNV, TPCNV >::Trans_t

Make available the persistent and transient types.

Definition at line 64 of file TPCnvElt.h.

Constructor & Destructor Documentation

◆ TPCnvElt()

template<class CNV , class TPCNV >
AthenaPoolCnvSvc::TPCnvElt< CNV, TPCNV >::TPCnvElt ( )

Constructor.

Member Function Documentation

◆ createTransient()

template<class CNV , class TPCNV >
std::unique_ptr<Trans_t> AthenaPoolCnvSvc::TPCnvElt< CNV, TPCNV >::createTransient ( CNV &  parent,
const std::string &  key,
MsgStream &  msg 
)

Read the persistent object and convert it to transient.

Parameters
parentThe top-level pool converter object.
keyThe SG key of the object being read.
msgMsgStream for error reporting.

Returns a newly-allocated object. If the type of the persistent object on the file does not match the type that this converter handles, return nullptr. Other errors are reported by raising exceptions.

◆ persToTrans()

template<class CNV , class TPCNV >
bool AthenaPoolCnvSvc::TPCnvElt< CNV, TPCNV >::persToTrans ( CNV &  parent,
Trans_t trans,
const std::string &  key,
MsgStream &  msg 
)

Read the persistent object and convert it to transient.

Parameters
parentThe top-level pool converter object.
transThe transient object to modify.
keyThe SG key of the object being read.
msgMsgStream for error reporting.

Overwrites the provided transient object. If the type of the persistent object on the file does not match the type that this converter handles, returns false. Other errors are reported by raising exceptions.

Member Data Documentation

◆ m_cnv

template<class CNV , class TPCNV >
TPCNV AthenaPoolCnvSvc::TPCnvElt< CNV, TPCNV >::m_cnv
private

The underlying TP converter.

Definition at line 109 of file TPCnvElt.h.

◆ m_guid

template<class CNV , class TPCNV >
Guid AthenaPoolCnvSvc::TPCnvElt< CNV, TPCNV >::m_guid
private

GUID for the persistent class we read.

Definition at line 106 of file TPCnvElt.h.


The documentation for this class was generated from the following file: