ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaConverterTLPExtension.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ATHENACONVERTER_TP_EXT_H
6#define ATHENACONVERTER_TP_EXT_H
7
12
14
16class IConverter;
17
18#include <vector>
19#include <string>
20#include <map>
21
43
45{
46public:
49
52
53
54 // ---- empty method stubs, implemented only in EXTENDED Athena converters
55
62 virtual std::unique_ptr<const Token> writeObject( const std::string& /*key*/, const std::string& /*output*/ ) { return 0; }
63
67 virtual void readObjectFromPool( const Token* ) { }
68
72 virtual AthenaConverterTLPExtension* clone() { return 0; }
73
78
82 virtual bool needsCloning() const { return false; }
83
87 virtual const std::string name() const { return "Extended Athena TP Converter"; }
88
89
93
94
95// --------------------------------------------------------------------------------
96
98 unsigned short getTPCnvID();
99
103
107
114
115
119 virtual void readExtendingObjects( void *baseObj );
120
123 virtual void deletePersistentObjects();
124
129
130protected:
131 // typeless invocation to handle types #defined in AthenaPoolCnv
132 void usingTPCnvForReading( void *cnv );
133
134protected:
135 typedef std::map<unsigned, AthenaConverterTLPExtension*> extCnvMap_t;
136
139
140 typedef std::map<TopLevelTPCnvBase*, extCnvMap_t*> extCnvMapMap_t;
141
142 // map of different extCnvMap_t for each of the old version of the TLP converter
144
150
153 std::vector< AthenaConverterTLPExtension* > m_clonedExtendingCnvs;
154};
155
156#endif
157
158
159
160
161
162
163
This file contains the class definition for the Token class (migrated from POOL).
This class is used to add functionality to a standard AthenaConverter.
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.
void resetTPCnvForReading()
Reset to 0 the TL TP converter for reading.
virtual void readObjectFromPool(const Token *)
Read the extending object.
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 bool needsCloning() const
Find out if this converter needs to be cloned Returns true if this converter was already registered o...
unsigned short getTPCnvID()
Returns the ID of the main top-level TP converter.
std::map< TopLevelTPCnvBase *, extCnvMap_t * > extCnvMapMap_t
TopLevelTPCnvBase * getTopLevelTPCnvForReading()
returns the current top-level TP converter.
std::map< unsigned, AthenaConverterTLPExtension * > extCnvMap_t
virtual std::unique_ptr< const Token > writeObject(const std::string &, const std::string &)
Writes the extending persistent object created by this converter Called from the EXTENDED (principal)...
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:21
Base class for top-level TP converters.