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