ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaPoolCnvTPExtension Class Referenceabstract

#include <AthenaPoolCnvTPExtension.h>

Inherits AthenaConverterTLPExtension.

Inherited by T_AthenaPoolExtendingCnv< InDetTrack, InDetTrack_PERS >, T_AthenaPoolExtendingCnv< TPCnv::MuonMeasurements, MuonMeasurements_PERS >, T_AthenaPoolExtendingCnv< JetTagInfo, Analysis::JetTagInfo_tlp3 >, T_AthenaPoolExtendingCnv< TPCnv::MuonCaloEnergies, MuonCaloEnergies_PERS >, T_AthenaPoolExtendingCnv< MVFVxContainer, MVFVxContainer_PERS >, JetCollectionCnv, SegmentCollectionCnv, T_AthenaPoolExtendingCnv< TRANS, PERS >, TrackCollectionCnv, and VxContainerCnv.

Collaboration diagram for AthenaPoolCnvTPExtension:

Public Member Functions

 AthenaPoolCnvTPExtension ()
virtual bool registerExtendingCnv (AthenaConverterTLPExtension *cnv)
 Register extending converter (that is, another converter that will extent this converter) and all his elemental converters.
virtual bool registerExtendingCnv (IConverter *cnv)
void usingTPCnvForReading (TopLevelTPCnvBase &baseTLPcnv)
virtual std::unique_ptr< const TokenwriteObject (const std::string &, const std::string &)
 Writes the extending persistent object created by this converter Called from the EXTENDED (principal) Athena converter Implemented only in EXTENDING Athena converters.
virtual void readObject (const std::string &)
 Read the extending object.
virtual AthenaConverterTLPExtensionclone ()
 Clone this Athena Converter.
virtual void wasClonedFrom (AthenaConverterTLPExtension *)
 Remember the original converter that this one was cloned from.
virtual bool needsCloning () const
 Find out if this converter needs to be cloned Returns true if this converter was already registered once.
virtual const std::string name () const
 Get name of this converter (anything that identifies it)
virtual TopLevelTPCnvBasegetTopLevelTPCnv ()=0
 returns the main top-level TP converter
unsigned short getTPCnvID ()
 Returns the ID of the main top-level TP converter.
TopLevelTPCnvBasegetTopLevelTPCnvForReading ()
 returns the current top-level TP converter.
void resetTPCnvForReading ()
 Reset to 0 the TL TP converter for reading.
virtual void readExtendingObjects (void *baseObj)
 Read all component persistent objects.
virtual void deletePersistentObjects ()
 Delete persistent objects held by attached extending converters (used mainly in case of abort)

Protected Types

typedef std::map< unsigned, AthenaConverterTLPExtension * > extCnvMap_t
typedef std::map< TopLevelTPCnvBase *, extCnvMap_t * > extCnvMapMap_t

Protected Member Functions

void usingTPCnvForReading (void *cnv)

Protected Attributes

extCnvMap_t m_extendingConverters
 map of Athena converters extending this one
extCnvMapMap_t m_extCnvMapMap
TopLevelTPCnvBasem_TLCnvForReading
 additional Top Level TP converter used only for reading tells which converter is used in case of reading old versions (as different versions have different converters) NOT owned byt his class
std::vector< AthenaConverterTLPExtension * > m_clonedExtendingCnvs
 list of duplicated converters to delete at the end held in the original converter

Detailed Description

Definition at line 14 of file AthenaPoolCnvTPExtension.h.

Member Typedef Documentation

◆ extCnvMap_t

typedef std::map<unsigned, AthenaConverterTLPExtension*> AthenaConverterTLPExtension::extCnvMap_t
protectedinherited

Definition at line 133 of file AthenaConverterTLPExtension.h.

◆ extCnvMapMap_t

Definition at line 138 of file AthenaConverterTLPExtension.h.

Constructor & Destructor Documentation

◆ AthenaPoolCnvTPExtension()

AthenaPoolCnvTPExtension::AthenaPoolCnvTPExtension ( )
inline

Definition at line 17 of file AthenaPoolCnvTPExtension.h.

17{}

Member Function Documentation

◆ clone()

virtual AthenaConverterTLPExtension * AthenaConverterTLPExtension::clone ( void )
inlinevirtualinherited

Clone this Athena Converter.

Returns the cloned instance

Reimplemented in InDetTrackCnv, JetTagInfoCnv, MuonCaloEnergiesCnv, MuonMeasurementsCnv, and MVFVxContainerCnv.

Definition at line 70 of file AthenaConverterTLPExtension.h.

70{ return 0; }

◆ deletePersistentObjects()

void AthenaConverterTLPExtension::deletePersistentObjects ( )
virtualinherited

Delete persistent objects held by attached extending converters (used mainly in case of abort)

Definition at line 148 of file AthenaConverterTLPExtension.cxx.

149{
150 for( extCnvMap_t::const_iterator cnv = m_extendingConverters.begin();
151 cnv != m_extendingConverters.end(); ++cnv ) {
152 cnv->second->deletePersistentObjects();
153 }
154 for( size_t c = 0; c < m_clonedExtendingCnvs.size(); c++ )
156
158 // Can not do that - sometimes the converter is an automatic variable that is gone already
159 //if( m_TLCnvForReading ) m_TLCnvForReading->deleteTLPersObject();
160}
std::vector< AthenaConverterTLPExtension * > m_clonedExtendingCnvs
list of duplicated converters to delete at the end held in the original converter
virtual TopLevelTPCnvBase * getTopLevelTPCnv()=0
returns the main top-level TP converter
extCnvMap_t m_extendingConverters
map of Athena converters extending this one
virtual void deletePersistentObjects()
Delete persistent objects held by attached extending converters (used mainly in case of abort)
virtual void deleteTLPersObject()=0
Delete the persistent object owned by the converter.

◆ getTopLevelTPCnv()

◆ getTopLevelTPCnvForReading()

TopLevelTPCnvBase * AthenaConverterTLPExtension::getTopLevelTPCnvForReading ( )
inlineinherited

returns the current top-level TP converter.

This converter may be different from the main one in case of schema evolution

Definition at line 100 of file AthenaConverterTLPExtension.h.

100{ return m_TLCnvForReading; }
TopLevelTPCnvBase * m_TLCnvForReading
additional Top Level TP converter used only for reading tells which converter is used in case of read...

◆ getTPCnvID()

unsigned short AthenaConverterTLPExtension::getTPCnvID ( )
inherited

Returns the ID of the main top-level TP converter.

Definition at line 23 of file AthenaConverterTLPExtension.cxx.

23 {
25}
virtual unsigned short getConverterID()=0

◆ name()

virtual const std::string AthenaConverterTLPExtension::name ( ) const
inlinevirtualinherited

◆ needsCloning()

virtual bool AthenaConverterTLPExtension::needsCloning ( ) const
inlinevirtualinherited

◆ readExtendingObjects()

void AthenaConverterTLPExtension::readExtendingObjects ( void * baseObj)
virtualinherited

Read all component persistent objects.

Parameters
baseObj[IN] pointer to the principal persistent object holding the list of tokens for all component persistent objects to read

Definition at line 99 of file AthenaConverterTLPExtension.cxx.

100{
101 // m_TLCnvForReading may be 0 if reading pre-TP object
102 if( m_TLCnvForReading ) {
103 TPCnvTokenList_p1 *tokens = m_TLCnvForReading->getTokenListVarFrom( baseObj );
104 if( tokens && tokens->size() ) {
105 // find which extending converter "set" to use
106 extCnvMap_t *extendingConverters;
108 // use the newest TP converters
109 extendingConverters = &m_extendingConverters;
110 } else {
111 extCnvMapMap_t::const_iterator extCnvMapIter = m_extCnvMapMap.find(m_TLCnvForReading);
112 if( extCnvMapIter == m_extCnvMapMap.end() ) {
113 throw std::runtime_error("Extending TP converter not available");
114 }
115 extendingConverters = extCnvMapIter->second;
116 }
117 // load the remaining "pieces" of this object
118 for( TPCnvTokenList_p1::const_iterator it = tokens->begin(); it != tokens->end(); ++it ) {
119 if( it->token().size() < 36 ) {
120 ostringstream err;
121 err << "Corrupted Token in the list of extensions. Token='" << it->token() << "'"
122 << " CnvID=" << it->converterID() << ", Token list size=" << tokens->size();
123 throw std::runtime_error(err.str());
124 }
125 extCnvMap_t::const_iterator cnv = extendingConverters->find( it->converterID() );
126 if( cnv == extendingConverters->end() ) {
127 ostringstream err;
128 err << "Extending TP converter not loaded! "
129 << "missing ExtCnvID=" << it->converterID()
130 << " corresponding POOL token: " << it->token();
131 throw std::runtime_error(err.str());
132 }
133// std::cout << "--->>--- readExtendingObjects: "
134// << " converter ID=" << it->converterID()
135// << " token=" << it->token() << ", AP converter=" << cnv->second << std::endl;
136
137 cnv->second->readObject( it->token() );
138 TopLevelTPCnvBase *extTPCnv = cnv->second->getTopLevelTPCnvForReading();
140 }
141 }
142 }
143}
std::map< unsigned, AthenaConverterTLPExtension * > extCnvMap_t
virtual void addTPConvertersForReadingTo(TopLevelTPCnvBase *dest)
copy all extending converters from this top level converter to "dest" top level converter - for readi...

◆ readObject()

◆ registerExtendingCnv() [1/2]

virtual bool AthenaPoolCnvTPExtension::registerExtendingCnv ( AthenaConverterTLPExtension * cnv)
inlinevirtual

Register extending converter (that is, another converter that will extent this converter) and all his elemental converters.

Parameters
cnv[IN] pointer to extending Athena converter

Reimplemented from AthenaConverterTLPExtension.

Definition at line 19 of file AthenaPoolCnvTPExtension.h.

19 {
21 }
virtual bool registerExtendingCnv(AthenaConverterTLPExtension *cnv)
Register extending converter (that is, another converter that will extent this converter) and all his...

◆ registerExtendingCnv() [2/2]

virtual bool AthenaPoolCnvTPExtension::registerExtendingCnv ( IConverter * cnv)
inlinevirtual

Definition at line 23 of file AthenaPoolCnvTPExtension.h.

23 {
24 AthenaConverterTLPExtension *extending_converter = dynamic_cast<AthenaPoolCnvTPExtension*>(cnv);
25 // if the converter passed is not an extending converter, we can't do anything
26 if( !extending_converter )
27 throw std::runtime_error("Attempt to register extending AthenaPool converter that does not inherit from AthenaPoolCnvTPExtension");
28 return AthenaConverterTLPExtension::registerExtendingCnv( extending_converter );
29 }

◆ resetTPCnvForReading()

void AthenaConverterTLPExtension::resetTPCnvForReading ( )
inlineinherited

Reset to 0 the TL TP converter for reading.

Prevents the use of the previous TP converter if none was set before reading the next object Called automatically after reading an object.

Definition at line 111 of file AthenaConverterTLPExtension.h.

111{ m_TLCnvForReading = 0; }

◆ usingTPCnvForReading() [1/2]

void AthenaConverterTLPExtension::usingTPCnvForReading ( void * cnv)
protectedinherited

Definition at line 59 of file AthenaConverterTLPExtension.cxx.

60{
61 usingTPCnvForReading( *reinterpret_cast<TopLevelTPCnvBase*>( cnv ) );
62}
void usingTPCnvForReading(TopLevelTPCnvBase &cnv)
Sets top-level TP converter to be used for reading the next object.

◆ usingTPCnvForReading() [2/2]

void AthenaPoolCnvTPExtension::usingTPCnvForReading ( TopLevelTPCnvBase & baseTLPcnv)
inline

Definition at line 31 of file AthenaPoolCnvTPExtension.h.

31 {
33 }

◆ wasClonedFrom()

◆ writeObject()

virtual std::unique_ptr< const Token > AthenaConverterTLPExtension::writeObject ( const std::string & ,
const std::string &  )
inlinevirtualinherited

Writes the extending persistent object created by this converter Called from the EXTENDED (principal) Athena converter Implemented only in EXTENDING Athena converters.

Parameters
key[in] StoreGet object key (in APR used to determine storage container placement) Returns Token for the written object

Reimplemented in T_AthenaPoolExtendingCnv< TRANS, PERS >, T_AthenaPoolExtendingCnv< InDetTrack, InDetTrack_PERS >, T_AthenaPoolExtendingCnv< JetTagInfo, Analysis::JetTagInfo_tlp3 >, T_AthenaPoolExtendingCnv< MVFVxContainer, MVFVxContainer_PERS >, T_AthenaPoolExtendingCnv< TPCnv::MuonCaloEnergies, MuonCaloEnergies_PERS >, and T_AthenaPoolExtendingCnv< TPCnv::MuonMeasurements, MuonMeasurements_PERS >.

Definition at line 60 of file AthenaConverterTLPExtension.h.

60{ return 0; }

Member Data Documentation

◆ m_clonedExtendingCnvs

std::vector< AthenaConverterTLPExtension* > AthenaConverterTLPExtension::m_clonedExtendingCnvs
protectedinherited

list of duplicated converters to delete at the end held in the original converter

Definition at line 151 of file AthenaConverterTLPExtension.h.

◆ m_extCnvMapMap

extCnvMapMap_t AthenaConverterTLPExtension::m_extCnvMapMap
protectedinherited

Definition at line 141 of file AthenaConverterTLPExtension.h.

◆ m_extendingConverters

extCnvMap_t AthenaConverterTLPExtension::m_extendingConverters
protectedinherited

map of Athena converters extending this one

Definition at line 136 of file AthenaConverterTLPExtension.h.

◆ m_TLCnvForReading

TopLevelTPCnvBase* AthenaConverterTLPExtension::m_TLCnvForReading
protectedinherited

additional Top Level TP converter used only for reading tells which converter is used in case of reading old versions (as different versions have different converters) NOT owned byt his class

Definition at line 147 of file AthenaConverterTLPExtension.h.


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