31 int extendingTPLCnvID = extending_converter->
getTPCnvID();
35 error <<
"Conflicting TP converter IDs when registering extending Athena Converter. ID=" << extendingTPLCnvID;
36 throw runtime_error(
error.str() );
40 cloned_converter = extending_converter;
44 cloned_converter = extending_converter->
clone();
45 if( !cloned_converter ) {
47 error <<
"Extending TP converter neeeds to define clone() method. Converter: " << extending_converter->
name();
48 throw runtime_error(
error.str() );
81 if( !cloned_converter ) {
84 error <<
" TPCNVINFO: ERROR! This extending TP converter does not define clone() method. "
85 <<
" Converter: " << cnvI->second->name();
86 cerr <<
error.str() << endl;
87 throw runtime_error(
error.str() );
91 (*newCnvMap)[ cloned_converter->
getTPCnvID() ] = cloned_converter;
104 if( tokens && tokens->size() ) {
113 throw std::runtime_error(
"Extending TP converter not available");
115 extendingConverters = extCnvMapIter->second;
118 for( TPCnvTokenList_p1::const_iterator it = tokens->begin(); it != tokens->end(); ++it ) {
119 if( it->token().size() < 36 ) {
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());
125 extCnvMap_t::const_iterator cnv = extendingConverters->find( it->converterID() );
126 if( cnv == extendingConverters->end() ) {
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());
137 cnv->second->readObject( it->token() );
152 cnv->second->deletePersistentObjects();
169 for( extCnvMapMap_t::const_iterator mmiter =
m_extCnvMapMap.begin();
171 delete mmiter->second;
Extensions to AthenaConverters used to implement TP separation.
This file contains the class definition for the Token class (migrated from POOL).
Defines the base class for top-level TP converters.
virtual const std::string name() const
Get name of this converter (anything that identifies it)
virtual void readExtendingObjects(void *baseObj)
Read all component persistent objects.
std::vector< AthenaConverterTLPExtension * > m_clonedExtendingCnvs
list of duplicated converters to delete at the end held in the original converter
virtual AthenaConverterTLPExtension * clone()
Clone this Athena Converter.
AthenaConverterTLPExtension()
Constructor.
virtual void wasClonedFrom(AthenaConverterTLPExtension *)
Remember the original converter that this one was cloned from.
void usingTPCnvForReading(TopLevelTPCnvBase &cnv)
Sets top-level TP converter to be used for reading the next object.
virtual TopLevelTPCnvBase * getTopLevelTPCnv()=0
returns the main top-level TP converter
virtual bool registerExtendingCnv(AthenaConverterTLPExtension *cnv)
Register extending converter (that is, another converter that will extent this converter) and all his...
TopLevelTPCnvBase * m_TLCnvForReading
additional Top Level TP converter used only for reading tells which converter is used in case of read...
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 ~AthenaConverterTLPExtension()
Destructor.
virtual bool needsCloning() const
Find out if this converter needs to be cloned Returns true if this converter was already registered o...
extCnvMapMap_t m_extCnvMapMap
unsigned short getTPCnvID()
Returns the ID of the main top-level TP converter.
std::map< unsigned, AthenaConverterTLPExtension * > extCnvMap_t
vector of TPCnvToken_p1 Each top-level persistent object that has extentions needs a data member of t...
Base class for top-level TP converters.
virtual void addTPConvertersForReadingTo(TopLevelTPCnvBase *dest)
copy all extending converters from this top level converter to "dest" top level converter - for readi...
virtual unsigned short getConverterID()=0
virtual void deleteTLPersObject()=0
Delete the persistent object owned by the converter.