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
22#include <map>
23
24class DataHeader_p5;
26
31class DataHeaderCnv : public DataHeaderCnvBase, virtual public IIncidentListener
32{
33 friend class CnvFactory<DataHeaderCnv>;
34public:
35 DataHeaderCnv(ISvcLocator* svcloc);
37 virtual StatusCode initialize() override;
38
40 virtual StatusCode updateRep(IOpaqueAddress* pAddress, DataObject* pObject) override;
41
42 virtual StatusCode updateRepRefs(IOpaqueAddress* pAddress, DataObject* pObject) override;
43
44 virtual StatusCode DataObjectToPool(IOpaqueAddress* pAddr, DataObject* pObj) override;
45
46 std::unique_ptr<DataHeader_p5> poolReadObject_p5();
47 std::unique_ptr<DataHeader_p6> poolReadObject_p6();
48
50 virtual DataHeader* createTransient() override;
51
52 [[deprecated("this converter uses createPersistent() with 2 arguments")]]
53 virtual DataHeader_p6* createPersistent(DataHeader*) override { return nullptr; }
54
56 virtual void handle(const Incident& incident) override;
57
59 void clearInputDHFormCache( const std::string& dbGuid );
60
63
64protected:
67
72 bool m_oneDHForm = true;
74 struct placementComp{ bool operator() (const std::string& lhs, const std::string& rhs) const; };
75 std::map<std::string, std::unique_ptr<DataHeaderForm_p6>, placementComp > m_persFormMap;
77 std::map<std::string, std::unique_ptr<DataHeaderForm_p6> > m_inputDHForms;
78
80 std::map<std::string, unsigned> m_inDHFormCount;
83
84 std::map< std::string, std::string> m_lastGoodDHFRef;
85
88 std::unique_ptr<DataHeaderForm_p5> m_dhInForm5;
89 std::string m_dhFormMdx;
90
92 DataHeader_p6* m_sharedWriterCachedDH = nullptr; // no ownership
94 std::map< std::string, std::unique_ptr<DataHeaderForm_p6> > m_sharedWriterCachedDHForm;
97};
98
99#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.
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
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
virtual DataHeader * createTransient() override
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.
DataHeader_p6 * m_sharedWriterCachedDH
cached values for use with SharedWriter server
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...
std::unique_ptr< DataHeader_p6 > poolReadObject_p6()
virtual void handle(const Incident &incident) override
Incident service handle listening for EndInputFile.
std::unique_ptr< DataHeader_p5 > poolReadObject_p5()
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.
Cache for new DHForms created when writing, indexed by ref or placement.
bool operator()(const std::string &lhs, const std::string &rhs) const