ATLAS Offline Software
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
AthenaPoolCnvTPExtension Class Referenceabstract

#include <AthenaPoolCnvTPExtension.h>

Inheritance diagram for AthenaPoolCnvTPExtension:
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. More...
 
virtual bool registerExtendingCnv (IConverter *cnv)
 
void usingTPCnvForReading (TopLevelTPCnvBase &baseTLPcnv)
 
virtual 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. More...
 
virtual void readObject (const std::string &)
 Read the extending object. More...
 
virtual AthenaConverterTLPExtensionclone ()
 Clone this Athena Converter. More...
 
virtual void wasClonedFrom (AthenaConverterTLPExtension *)
 Remember the original converter that this one was cloned from. More...
 
virtual bool needsCloning () const
 Find out if this converter needs to be cloned Returns true if this converter was already registered once. More...
 
virtual const std::string name () const
 Get name of this converter (anything that identifies it) More...
 
virtual TopLevelTPCnvBasegetTopLevelTPCnv ()=0
 returns the main top-level TP converter More...
 
unsigned short getTPCnvID ()
 Returns the ID of the main top-level TP converter. More...
 
TopLevelTPCnvBasegetTopLevelTPCnvForReading ()
 returns the current top-level TP converter. More...
 
void resetTPCnvForReading ()
 Reset to 0 the TL TP converter for reading. More...
 
virtual void readExtendingObjects (void *baseObj)
 Read all component persistent objects. More...
 
virtual void deletePersistentObjects ()
 Delete persistent objects held by attached extending converters (used mainly in case of abort) More...
 

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 More...
 
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 More...
 
std::vector< AthenaConverterTLPExtension * > m_clonedExtendingCnvs
 list of duplicated converters to delete at the end held in the original converter More...
 

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 ( )
inlinevirtualinherited

Clone this Athena Converter.

Returns the cloned instance

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 }

◆ getTopLevelTPCnv()

virtual TopLevelTPCnvBase* AthenaConverterTLPExtension::getTopLevelTPCnv ( )
pure virtualinherited

returns the main top-level TP converter

  • To be implemented in the actual Converter implementation *

Implemented in JetCollectionCnv, TrackCollectionCnv, SegmentCollectionCnv, and VxContainerCnv.

◆ 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; }

◆ 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  {
24  return getTopLevelTPCnv()->getConverterID();
25 }

◆ name()

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

Get name of this converter (anything that identifies it)

Returns
Name of this converter

Definition at line 85 of file AthenaConverterTLPExtension.h.

85 { return "Extended Athena TP Converter"; }

◆ needsCloning()

virtual bool AthenaConverterTLPExtension::needsCloning ( ) const
inlinevirtualinherited

Find out if this converter needs to be cloned Returns true if this converter was already registered once.

Definition at line 80 of file AthenaConverterTLPExtension.h.

80 { return false; }

◆ 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 ) {
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 }

◆ readObject()

virtual void AthenaConverterTLPExtension::readObject ( const std::string &  )
inlinevirtualinherited

Read the extending object.

Parameters
token[IN] Token of the object to read

Definition at line 65 of file AthenaConverterTLPExtension.h.

65 { }

◆ 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  }

◆ 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 AthenaPoolCnvTPExtension::usingTPCnvForReading ( TopLevelTPCnvBase baseTLPcnv)
inline

Definition at line 31 of file AthenaPoolCnvTPExtension.h.

31  {
33  }

◆ usingTPCnvForReading() [2/2]

void AthenaConverterTLPExtension::usingTPCnvForReading ( void *  cnv)
protectedinherited

Definition at line 59 of file AthenaConverterTLPExtension.cxx.

60 {
61  usingTPCnvForReading( *reinterpret_cast<TopLevelTPCnvBase*>( cnv ) );
62 }

◆ wasClonedFrom()

virtual void AthenaConverterTLPExtension::wasClonedFrom ( AthenaConverterTLPExtension )
inlinevirtualinherited

Remember the original converter that this one was cloned from.

Parameters
converter[IN] the original converter

Definition at line 75 of file AthenaConverterTLPExtension.h.

75 {}

◆ writeObject()

virtual 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) Retursn Token for the written object

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:
TPCnvTokenList_p1
Definition: TPCnvTokenList_p1.h:55
TopLevelTPCnvBase::getConverterID
virtual unsigned short getConverterID()=0
TopLevelTPCnvBase::addTPConvertersForReadingTo
virtual void addTPConvertersForReadingTo(TopLevelTPCnvBase *dest)
copy all extending converters from this top level converter to "dest" top level converter - for readi...
Definition: TopLevelTPCnvBase.cxx:78
TopLevelTPCnvBase::getTokenListVarFrom
virtual TPCnvTokenList_p1 * getTokenListVarFrom(void *persObj)=0
Return the list of tokens to the objects extending the object NOT owned by this converter.
TopLevelTPCnvBase::deleteTLPersObject
virtual void deleteTLPersObject()=0
Delete the persistent object owned by the converter.
AthenaPoolCnvTPExtension
Definition: AthenaPoolCnvTPExtension.h:15
skel.it
it
Definition: skel.GENtoEVGEN.py:423
AthenaConverterTLPExtension::m_TLCnvForReading
TopLevelTPCnvBase * m_TLCnvForReading
additional Top Level TP converter used only for reading tells which converter is used in case of read...
Definition: AthenaConverterTLPExtension.h:147
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
AthenaConverterTLPExtension::getTopLevelTPCnv
virtual TopLevelTPCnvBase * getTopLevelTPCnv()=0
returns the main top-level TP converter
AthenaConverterTLPExtension
This class is used to add functionality to a standard AthenaConverter.
Definition: AthenaConverterTLPExtension.h:43
AthenaConverterTLPExtension::m_extCnvMapMap
extCnvMapMap_t m_extCnvMapMap
Definition: AthenaConverterTLPExtension.h:141
AthenaConverterTLPExtension::m_extendingConverters
extCnvMap_t m_extendingConverters
map of Athena converters extending this one
Definition: AthenaConverterTLPExtension.h:136
AthenaConverterTLPExtension::m_clonedExtendingCnvs
std::vector< AthenaConverterTLPExtension * > m_clonedExtendingCnvs
list of duplicated converters to delete at the end held in the original converter
Definition: AthenaConverterTLPExtension.h:151
TopLevelTPCnvBase
Base class for top-level TP converters.
Definition: TopLevelTPCnvBase.h:32
AthenaConverterTLPExtension::extCnvMap_t
std::map< unsigned, AthenaConverterTLPExtension * > extCnvMap_t
Definition: AthenaConverterTLPExtension.h:133
AthenaConverterTLPExtension::deletePersistentObjects
virtual void deletePersistentObjects()
Delete persistent objects held by attached extending converters (used mainly in case of abort)
Definition: AthenaConverterTLPExtension.cxx:148
python.compressB64.c
def c
Definition: compressB64.py:93
AthenaConverterTLPExtension::usingTPCnvForReading
void usingTPCnvForReading(TopLevelTPCnvBase &cnv)
Sets top-level TP converter to be used for reading the next object.
Definition: AthenaConverterTLPExtension.cxx:65
AthenaConverterTLPExtension::registerExtendingCnv
virtual bool registerExtendingCnv(AthenaConverterTLPExtension *cnv)
Register extending converter (that is, another converter that will extent this converter) and all his...
Definition: AthenaConverterTLPExtension.cxx:28