ATLAS Offline Software
AthenaConverterTLPExtension.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHENACONVERTER_TP_EXT_H
6 #define ATHENACONVERTER_TP_EXT_H
7 
13 class TopLevelTPCnvBase;
14 class IConverter;
15 class Token;
16 #include <vector>
17 #include <string>
18 #include <map>
19 
43 {
44 public:
47 
50 
51 
52  // ---- empty method stubs, implemented only in EXTENDED Athena converters
53 
60  virtual const Token* writeObject( const std::string& /*key*/, const std::string& /*output*/ ) { return 0; }
61 
65  virtual void readObject( const std::string& ) { }
66 
70  virtual AthenaConverterTLPExtension* clone() { return 0; }
71 
76 
80  virtual bool needsCloning() const { return false; }
81 
85  virtual const std::string name() const { return "Extended Athena TP Converter"; }
86 
87 
91 
92 
93 // --------------------------------------------------------------------------------
94 
96  unsigned short getTPCnvID();
97 
101 
105 
112 
113 
117  virtual void readExtendingObjects( void *baseObj );
118 
121  virtual void deletePersistentObjects();
122 
127 
128 protected:
129  // typeless invocation to handle types #defined in AthenaPoolCnv
130  void usingTPCnvForReading( void *cnv );
131 
132 protected:
133  typedef std::map<unsigned, AthenaConverterTLPExtension*> extCnvMap_t;
134 
137 
138  typedef std::map<TopLevelTPCnvBase*, extCnvMap_t*> extCnvMapMap_t;
139 
140  // map of different extCnvMap_t for each of the old version of the TLP converter
142 
148 
151  std::vector< AthenaConverterTLPExtension* > m_clonedExtendingCnvs;
152 };
153 
154 #endif
155 
156 
157 
158 
159 
160 
161 
AthenaConverterTLPExtension::readObject
virtual void readObject(const std::string &)
Read the extending object.
Definition: AthenaConverterTLPExtension.h:65
AthenaConverterTLPExtension::extCnvMapMap_t
std::map< TopLevelTPCnvBase *, extCnvMap_t * > extCnvMapMap_t
Definition: AthenaConverterTLPExtension.h:138
AthenaConverterTLPExtension::getTopLevelTPCnvForReading
TopLevelTPCnvBase * getTopLevelTPCnvForReading()
returns the current top-level TP converter.
Definition: AthenaConverterTLPExtension.h:100
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
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
AthenaConverterTLPExtension::needsCloning
virtual bool needsCloning() const
Find out if this converter needs to be cloned Returns true if this converter was already registered o...
Definition: AthenaConverterTLPExtension.h:80
AthenaConverterTLPExtension::readExtendingObjects
virtual void readExtendingObjects(void *baseObj)
Read all component persistent objects.
Definition: AthenaConverterTLPExtension.cxx:99
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::AthenaConverterTLPExtension
AthenaConverterTLPExtension()
Constructor.
Definition: AthenaConverterTLPExtension.h:46
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::name
virtual const std::string name() const
Get name of this converter (anything that identifies it)
Definition: AthenaConverterTLPExtension.h:85
AthenaConverterTLPExtension::clone
virtual AthenaConverterTLPExtension * clone()
Clone this Athena Converter.
Definition: AthenaConverterTLPExtension.h:70
AthenaConverterTLPExtension::~AthenaConverterTLPExtension
virtual ~AthenaConverterTLPExtension()
Destructor.
Definition: AthenaConverterTLPExtension.cxx:164
AthenaConverterTLPExtension::wasClonedFrom
virtual void wasClonedFrom(AthenaConverterTLPExtension *)
Remember the original converter that this one was cloned from.
Definition: AthenaConverterTLPExtension.h:75
AthenaConverterTLPExtension::getTPCnvID
unsigned short getTPCnvID()
Returns the ID of the main top-level TP converter.
Definition: AthenaConverterTLPExtension.cxx:23
AthenaConverterTLPExtension::deletePersistentObjects
virtual void deletePersistentObjects()
Delete persistent objects held by attached extending converters (used mainly in case of abort)
Definition: AthenaConverterTLPExtension.cxx:148
AthenaConverterTLPExtension::resetTPCnvForReading
void resetTPCnvForReading()
Reset to 0 the TL TP converter for reading.
Definition: AthenaConverterTLPExtension.h:111
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
AthenaConverterTLPExtension::writeObject
virtual const Token * writeObject(const std::string &, const std::string &)
Writes the extending persistent object created by this converter Called from the EXTENDED (principal)...
Definition: AthenaConverterTLPExtension.h:60