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"
19#include "PoolSvc/IPoolSvc.h"
20
21#include <string>
22#include <map>
23#include <mutex>
24
25class IOpaqueAddress;
26class DataObject;
27class StatusCode;
29class Guid;
30class Placement;
31class Token;
32
34template <class TYPE> class CnvFactory;
35
40class AthenaPoolConverter : public ::Converter, public ::AthMessaging, virtual public IAthenaPoolCleanUp {
41
42public:
44 virtual ~AthenaPoolConverter();
45
47 virtual StatusCode initialize() override;
48 virtual StatusCode finalize() override;
49
50 virtual long repSvcType() const override;
51
55 virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override;
56
60 virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override;
61
65 virtual StatusCode fillRepRefs(IOpaqueAddress* pAddr, DataObject* pObj) override;
66
69
71 static long storageType();
72
74 static const CLID& classID();
75
77 virtual StatusCode cleanUp(const std::string& output) override;
78
79
80protected:
82 AthenaPoolConverter(const CLID& id, ISvcLocator* pSvcLocator,
83 const char* name = nullptr);
84
88 virtual StatusCode DataObjectToPool(IOpaqueAddress* pAddr, DataObject* pObj) = 0;
89
94 virtual StatusCode PoolToDataObject(DataObject*& pObj, const Token* token,
95 const std::string& key) = 0;
96
100 virtual Placement setPlacementWithType(const std::string& tname, const std::string& key, const std::string& output);
102 virtual Placement setPlacement(const std::string& key, const std::string& output) = 0;
103
104 bool compareClassGuid(const Token* token, const Guid &guid) const;
105
106protected: // data
110
111 typedef std::mutex CallMutex;
113
116};
117
118#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.
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
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.
const ServiceHandle< StoreGateSvc > & detStore() const
Handle to DetectorStore.
virtual StatusCode DataObjectToPool(IOpaqueAddress *pAddr, DataObject *pObj)=0
Write an object into POOL.
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
::StatusCode StatusCode
StatusCode definition for legacy code.