ATLAS Offline Software
Loading...
Searching...
No Matches
DataHeaderCnv.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 DATAHEADERCNV_H
6#define DATAHEADERCNV_H
7
13
19
20#include "GaudiKernel/IIncidentListener.h"
21#include "GaudiKernel/ServiceHandle.h"
22#include "PoolSvc/IPoolSvc.h"
23
24#include <map>
25
26class DataHeader_p5;
28
33class DataHeaderCnv : public DataHeaderCnvBase, virtual public IIncidentListener
34{
35 friend class CnvFactory<DataHeaderCnv>;
36public:
37 DataHeaderCnv(ISvcLocator* svcloc);
39 virtual StatusCode initialize() override;
40
42 virtual StatusCode updateRep(IOpaqueAddress* pAddress, DataObject* pObject) override;
43
44 virtual StatusCode updateRepRefs(IOpaqueAddress* pAddress, DataObject* pObject) override;
45
46 virtual StatusCode DataObjectToPool(IOpaqueAddress* pAddr, DataObject* pObj) override;
47
48 std::unique_ptr<DataHeader_p5> poolReadObject_p5(const Token* token);
49 std::unique_ptr<DataHeader_p6> poolReadObject_p6(const Token* token);
50
52 virtual DataHeader* createTransient(const Token* token) override;
53
54 [[deprecated("this converter uses createPersistent() with 2 arguments")]]
55 virtual DataHeader_p6* createPersistent(DataHeader*) override { return nullptr; }
56
58 virtual void handle(const Incident& incident) override;
59
61 void clearInputDHFormCache( const std::string& dbGuid );
62
65
66protected:
69
74 bool m_oneDHForm = true;
76 struct placementComp{ bool operator() (const std::string& lhs, const std::string& rhs) const; };
77 std::map<std::string, std::unique_ptr<DataHeaderForm_p6>, placementComp > m_persFormMap;
79 std::map<std::string, std::unique_ptr<DataHeaderForm_p6> > m_inputDHForms;
80
82 std::map<std::string, unsigned> m_inDHFormCount;
85
86 std::map< std::string, std::string> m_lastGoodDHFRef;
87
90 std::unique_ptr<DataHeaderForm_p5> m_dhInForm5;
91 std::string m_dhFormMdx;
92
94 DataHeader_p6* m_sharedWriterCachedDH = nullptr; // no ownership
96 std::map< std::string, std::unique_ptr<DataHeaderForm_p6> > m_sharedWriterCachedDHForm;
99 ServiceHandle<IPoolSvc> m_poolSvc{"PoolSvc", "DataHeaderCnv"};
100};
101
102#endif
T_AthenaPoolCustomCnv< DataHeader, DataHeader_p6 > DataHeaderCnvBase
This file contains the class definition for the DataHeaderCnv_p5 and DataHeaderElementCnv_p5 classes.
This file contains the class definition for DataHeaderCnv_p6.
This file contains the class definition for the DataHeader and DataHeaderElement classes.
This file contains the class definitions for the DataHeader_p6 and DataHeaderForm_p6.
This file contains the class definition for the IPoolSvc interface class.
TTypeAdapter RootType
Definition RootType.h:211
his file contains the class definition for the templated T_AthenaPoolCustomCnv class.
Abstract factory to create the converter.
This class provides the converter to customize the saving of DataHeader_p5.
This class provides the converter to customize the saving of DataHeader_p6.
unsigned m_inDHFMapMaxsize
Max DHForms to cache per input file.
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
DataHeaderCnv_p6 m_tpInConverter
virtual StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject) override
Extend base-class conversion methods.
std::map< std::string, unsigned > m_inDHFormCount
How many DHForms for an input file are in the cache.
void clearInputDHFormCache(const std::string &dbGuid)
Delete cached DHForms for a given input file GUID.
RootType m_dhFormType
cached shape of the DataHeaderForm_pN
virtual StatusCode DataObjectToPool(IOpaqueAddress *pAddr, DataObject *pObj) override
Write an object into POOL.
DataHeaderCnv_p5 m_tpInConverter_p5
for use when reading DataHeader_p5
std::unique_ptr< DataHeaderForm_p5 > m_dhInForm5
std::string m_sharedWriterCachedDHKey
ServiceHandle< IPoolSvc > m_poolSvc
virtual DataHeader_p6 * createPersistent(DataHeader *) override
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
DataHeaderCnv(ISvcLocator *svcloc)
std::map< std::string, std::unique_ptr< DataHeaderForm_p6 > > m_sharedWriterCachedDHForm
map of cached DHForms for DataHeader ID
std::map< std::string, std::unique_ptr< DataHeaderForm_p6 > > m_inputDHForms
DHForm cache indexed by the DHForm reference (from DataHeader) that was used to read it.
virtual DataHeader * createTransient(const Token *token) override
DataHeader_p6 * m_sharedWriterCachedDH
cached values for use with SharedWriter server
std::unique_ptr< DataHeader_p6 > poolReadObject_p6(const Token *token)
std::string m_sharedWriterCachedDHToken
std::map< std::string, std::unique_ptr< DataHeaderForm_p6 >, placementComp > m_persFormMap
bool m_oneDHForm
if true write only one DataHeaderForm at the end (stop, finalize, or WriteDataHeaderForms incident) t...
virtual void handle(const Incident &incident) override
Incident service handle listening for EndInputFile.
std::unique_ptr< DataHeader_p5 > poolReadObject_p5(const Token *token)
DataHeaderCnv_p6 m_tpOutConverter
DataHeader_p6 * createPersistent(DataHeader *transObj, DataHeaderForm_p6 *)
std::map< std::string, std::string > m_lastGoodDHFRef
std::string m_dhFormMdx
void removeBadElements(DataHeader *dh)
Remove DataHeaderElements with incomplete (dbID="") refs.
This class provides storage for the constant fields of the persistent DataHeader class.
This class provides a persistent representation for the DataHeader class.
This class provides a persistent representation for the DataHeader class.
This class provides the layout for summary information stored for data written to POOL.
Definition DataHeader.h:123
Compatibility for old converter classes that don't get passed the key.
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:22
Cache for new DHForms created when writing, indexed by ref or placement.
bool operator()(const std::string &lhs, const std::string &rhs) const