ATLAS Offline Software
T_AthenaPoolExtendingCnv.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 ATHENAPOOLCNVSVC_T_ATHENAPOOLEXTENDCNV_H
6 #define ATHENAPOOLCNVSVC_T_ATHENAPOOLEXTENDCNV_H
7 
13 #include "T_AthenaPoolCustomCnv.h"
14 //#include "TPTools/AthenaConverterTLPExtension.h"
16 
21 template <class TRANS, class PERS>
23  : public T_AthenaPoolCustomCnv<TRANS, PERS>,
25 {
26 friend class CnvFactory<T_AthenaPoolExtendingCnv<TRANS, PERS> >;
27 
28 public:
30 
31 public:
32  // -------------------------------------------------------------
34  T_AthenaPoolExtendingCnv(ISvcLocator* svcloc);
35 
36 protected:
37  // Methods to be implemented in the derived converter class
38  // ##########################################################
39 
42 
45  virtual void readObjectFromPool( const std::string& token ) = 0 ;
46 
47 protected:
48  // redirect to the old API readObjectFromPool()
49  virtual void readObject( const std::string& token ) { this->readObjectFromPool(token); }
50 
53  virtual const Token* writeObject(const std::string& key, const std::string& output);
54 
59 
61  virtual void wasClonedFrom( AthenaConverterTLPExtension *orig_converter );
62 
65  virtual bool needsCloning() const { return m_originalExtendingCnv != 0; }
66 
68  virtual void setToken(const std::string& token);
69 
72  template <class P>
74 
76  template <class P>
77  void poolReadObject( TopLevelTPCnvBase& tlp_converter );
78 
79 
80 protected:
81  //-------------------------------------------------------------------
82  // Internal methods
83 
86  virtual const std::string name() const;
87 
88 
89  // hidden away, as they don't make sense for this converter
91  virtual PERS *createPersistent( TRANS *) { return 0; }
92  virtual TRANS *createTransient() { return 0; }
93 
96 };
97 
98 
100 
101 
102 #endif
T_AthenaPoolExtendingCnv::poolReadObject
P * poolReadObject()
Read object of type P.
T_AthenaPoolExtendingCnv::name
virtual const std::string name() const
Get the name of this converter (anything that identifies it).
T_AthenaPoolExtendingCnv::readObjectFromPool
virtual void readObjectFromPool(const std::string &token)=0
Read the persistent object from POOL.
T_AthenaPoolExtendingCnv::writeObject
virtual const Token * writeObject(const std::string &key, const std::string &output)
Write the persistent object to POOL.
AthenaPoolCnvTPExtension
Definition: AthenaPoolCnvTPExtension.h:15
T_AthenaPoolExtendingCnv::baseAthenaPoolCnv
virtual BaseType * baseAthenaPoolCnv()
return the original AthenaPool converter this one was cloned from if not cloned this returns self if ...
Definition: T_AthenaPoolExtendingCnv.h:58
T_AthenaPoolExtendingCnv::createPersistent
virtual PERS * createPersistent(TRANS *)
no-op
Definition: T_AthenaPoolExtendingCnv.h:91
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
T_AthenaPoolExtendingCnv::needsCloning
virtual bool needsCloning() const
tells if this converter needs to be cloned (true after the converter has been registered once already...
Definition: T_AthenaPoolExtendingCnv.h:65
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
T_AthenaPoolExtendingCnv::setToken
virtual void setToken(const std::string &token)
Set the token (in std::string representation) and classID for the object that will be read next.
AthenaConverterTLPExtension
This class is used to add functionality to a standard AthenaConverter.
Definition: AthenaConverterTLPExtension.h:43
T_AthenaPoolExtendingCnv::BaseType
T_AthenaPoolCustomCnv< TRANS, PERS > BaseType
Definition: T_AthenaPoolExtendingCnv.h:29
T_AthenaPoolCustomCnv.h
his file contains the class definition for the templated T_AthenaPoolCustomCnv class.
CnvFactory
Abstract factory to create the converter.
Definition: ToyConverter.h:16
T_AthenaPoolExtendingCnv::createTransient
virtual TRANS * createTransient()
Definition: T_AthenaPoolExtendingCnv.h:92
T_AthenaPoolExtendingCnv.icc
merge.output
output
Definition: merge.py:17
T_AthenaPoolExtendingCnv::m_originalExtendingCnv
BaseType * m_originalExtendingCnv
pointer to the original Gaudi converter - only this one is registered in the framework and has to be ...
Definition: T_AthenaPoolExtendingCnv.h:95
TopLevelTPCnvBase
Base class for top-level TP converters.
Definition: TopLevelTPCnvBase.h:32
RpcSectorLogicContainer_p1
Class to represent.
Definition: RpcSectorLogicContainer_p1.h:19
T_AthenaPoolExtendingCnv::poolReadObject
void poolReadObject(TopLevelTPCnvBase &tlp_converter)
Read object of type P (plus all extending objects) using the indicated top-level TP converter.
AthenaPoolCnvTPExtension.h
T_AthenaPoolExtendingCnv::T_AthenaPoolExtendingCnv
T_AthenaPoolExtendingCnv(ISvcLocator *svcloc)
Constructor.
T_AthenaPoolExtendingCnv::getTopLevelTPCnv
virtual TopLevelTPCnvBase * getTopLevelTPCnv()=0
Return the top level TP converter (which is always used for writing)
T_AthenaPoolExtendingCnv
This templated class extends T_AthenaPoolCustomCnv to provide additional/chaged functionality for Ath...
Definition: T_AthenaPoolCustomCnv.h:24
T_AthenaPoolExtendingCnv::readObject
virtual void readObject(const std::string &token)
Definition: T_AthenaPoolExtendingCnv.h:49
T_AthenaPoolExtendingCnv::wasClonedFrom
virtual void wasClonedFrom(AthenaConverterTLPExtension *orig_converter)
remember the original converter this one was cloned from
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37