ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaPoolConverter.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ATHENAPOOLCNVSVC_ATHENAPOOLCONVERTER_H
6#define ATHENAPOOLCNVSVC_ATHENAPOOLCONVERTER_H
7
12
13#include "GaudiKernel/Converter.h"
14#include "GaudiKernel/ServiceHandle.h"
20#include "PoolSvc/IPoolSvc.h"
21
22#include <string>
23#include <map>
24#include <mutex>
25
26class IOpaqueAddress;
27class DataObject;
28class StatusCode;
30class Guid;
31class Placement;
32class Token;
33
35template <class TYPE> class CnvFactory;
36
41class AthenaPoolConverter : public ::Converter, public ::AthMessaging, virtual public IAthenaPoolCleanUp {
42
43public:
45 virtual ~AthenaPoolConverter();
46
48 virtual StatusCode initialize() override;
49 virtual StatusCode finalize() override;
50
51 virtual long repSvcType() const override;
52
56 virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override;
57
61 virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override;
62
66 virtual StatusCode fillRepRefs(IOpaqueAddress* pAddr, DataObject* pObj) override;
67
70
72 static long storageType();
73
75 static const CLID& classID();
76
78 virtual StatusCode cleanUp(const std::string& output) override;
79
80
81protected:
83 AthenaPoolConverter(const CLID& id, ISvcLocator* pSvcLocator,
84 const char* name = nullptr);
85
89 virtual StatusCode DataObjectToPers(DataObject* pObj, IOpaqueAddress*& pAddr) = 0;
90
94 virtual StatusCode DataObjectToPool(IOpaqueAddress* pAddr, DataObject* pObj) = 0;
95
100 virtual StatusCode PoolToDataObject(DataObject*& pObj, const Token* token,
101 const std::string& key) = 0;
102
106 virtual Placement setPlacementWithType(const std::string& tname, const std::string& key, const std::string& output);
108 virtual Placement setPlacement(const std::string& key, const std::string& output) = 0;
109
110 bool compareClassGuid(const Token* token, const Guid &guid) const;
111
112protected: // data
117
118 typedef std::map<std::string, RootType> ClassMap;
119 typedef ClassMap::const_iterator ClassMapIt;
120 std::string m_className;
122
123 typedef std::mutex CallMutex;
125
128};
129
130#endif
uint32_t CLID
The Class ID type.
This file contains the class definition for the IAthenaPoolCleanUp class.
This file contains the class definition for the IPoolSvc interface class.
TTypeAdapter RootType
Definition RootType.h:211
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
bool compareClassGuid(const Token *token, const Guid &guid) const
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
ServiceHandle< StoreGateSvc > m_detStore
std::map< std::string, RootType > ClassMap
static const CLID & classID()
virtual ~AthenaPoolConverter()
Destructor.
ServiceHandle< IAthenaPoolCnvSvc > m_athenaPoolCnvSvc
int m_defContainerType
Default container type (from PoolSvc)
virtual Placement setPlacementWithType(const std::string &tname, const std::string &key, const std::string &output)
Set POOL placement hint for a given type.
virtual long repSvcType() const override
virtual StatusCode PoolToDataObject(DataObject *&pObj, const Token *token, const std::string &key)=0
Read an object from POOL.
ClassMap::const_iterator ClassMapIt
const ServiceHandle< StoreGateSvc > & detStore() const
Handle to DetectorStore.
virtual StatusCode DataObjectToPool(IOpaqueAddress *pAddr, DataObject *pObj)=0
Write an object into POOL.
virtual StatusCode DataObjectToPers(DataObject *pObj, IOpaqueAddress *&pAddr)=0
Convert an object into Persistent.
AthenaPoolConverter(const CLID &id, ISvcLocator *pSvcLocator, const char *name=nullptr)
Standard Service Constructor.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddr, DataObject *pObj) override
Create a POOL persistent representation for a transient object.
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj) override
Create a transient object from a POOL persistent representation.
virtual StatusCode cleanUp(const std::string &output) override
Implement cleanUp for AthenaPoolConverter to do nothing.
ServiceHandle< IPoolSvc > m_poolSvc
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr) override
Create a POOL persistent representation for a transient object.
virtual StatusCode finalize() override
virtual Placement setPlacement(const std::string &key, const std::string &output)=0
Set POOL placement hint; pure virtual method implemented by classes templated by type.
Abstract factory to create the converter.
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition Guid.h:25
IAthenaPoolCleanUp()=default
Standard Constructor.
This class provides the interface between Athena and PoolSvc.
This class holds all the necessary information to guide the writing of an object in a physical place.
Definition Placement.h:19
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:21