11#ifndef ATHENABASECOMPS_ATHCNVSVC_H
12#define ATHENABASECOMPS_ATHCNVSVC_H 1
16#include <unordered_map>
20#include "GaudiKernel/IConversionSvc.h"
21#include "GaudiKernel/IAddressCreator.h"
105 typedef std::unordered_map<CLID,WorkerEntry>
Workers;
115 AthCnvSvc(
const std::string& name, ISvcLocator* pSvcLocator,
long type );
123 virtual StatusCode
finalize()
override;
144 virtual SmartIF<IDataProviderSvc>&
dataProvider()
const override;
164 StatusCode
createObj(IOpaqueAddress* pAddress,DataObject*& refpObject)
override;
168 StatusCode
fillObjRefs(IOpaqueAddress* pAddress, DataObject* pObject)
override;
172 StatusCode
updateObj(IOpaqueAddress* pAddress, DataObject* refpObject)
override;
176 StatusCode
updateObjRefs(IOpaqueAddress* pAddress, DataObject* pObject)
override;
180 StatusCode
createRep(DataObject* pObject, IOpaqueAddress*& refpAddress)
override;
184 StatusCode
fillRepRefs(IOpaqueAddress* pAddress,DataObject* pObject)
override;
188 StatusCode
updateRep(IOpaqueAddress* pAddress, DataObject* pObject)
override;
192 StatusCode
updateRepRefs(IOpaqueAddress* pAddress, DataObject* pObject)
override;
200 StatusCode
addConverter(IConverter* pConverter)
override;
213 const std::string& openMode)
override;
217 StatusCode
connectOutput(
const std::string& output)
override;
221 StatusCode
commitOutput(
const std::string& output,
bool do_commit)
override;
235 const std::string* par,
236 const unsigned long* ip,
237 IOpaqueAddress*& refpAddress)
override;
242 std::string& refAddress)
override;
248 const std::string& refAddress,
249 IOpaqueAddress*& refpAddress)
override;
277 const ICnvFactory* fac);
306 IOpaqueAddress*& pAddress,
307 DataObject*& pObject);
uint32_t CLID
The Class ID type.
bool operator<(const WorkerEntry &rhs)
bool operator==(const WorkerEntry &rhs)
WorkerEntry(const CLID &cl, IConverter *cnv)
WorkerEntry & operator=(const WorkerEntry ©)
const CLID & clID() const
WorkerEntry(const WorkerEntry ©)
virtual SmartIF< IAddressCreator > & addressCreator() const override
Retrieve address creator facility.
virtual StatusCode setAddressCreator(IAddressCreator *creator) override
Set address creator facility.
virtual StatusCode activateConverter(long typ, const CLID &clid, IConverter *cnv)
Activate the new converter after initialization.
virtual StatusCode connectOutput(const std::string &outputFile, const std::string &openMode) override
Connect the output file to the service with open mode.
virtual IConverter * createConverter(long typ, const CLID &clid, const ICnvFactory *fac)
Create new Converter using factory.
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the references of an already converted object.
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the references of an updated transient object.
virtual StatusCode updateServiceState(IOpaqueAddress *pAddress)
Update state of the service.
StatusCode makeCall(int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject)
SmartIF< IDataProviderSvc > m_dataSvc
Pointer to data provider service.
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject) override
Implementation of IConverter: Update the transient object from the other representation.
virtual void loadConverter(DataObject *pObject)
Load converter or dictionary needed by the converter.
virtual StatusCode finalize() override
virtual SmartIF< IConversionSvc > & conversionSvc() const override
Implementation of IConverter: Get conversion service the converter is connected to.
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
virtual StatusCode setDataProvider(IDataProviderSvc *pService) override
Implementation of IConverter: Set Data provider service.
virtual ~AthCnvSvc()
Destructor:
virtual long repSvcType() const override
Retrieve the class type of the data store the converter uses.
AthCnvSvc(const std::string &name, ISvcLocator *pSvcLocator, long type)
Constructor with parameters:
virtual StatusCode addConverter(const CLID &clid) override
Add converter object to conversion service.
virtual StatusCode removeConverter(const CLID &clid) override
Remove converter object from conversion service (if present).
virtual StatusCode convertAddress(const IOpaqueAddress *pAddress, std::string &refAddress) override
Convert an address to string form.
Workers m_workers
List of conversion workers.
virtual const CLID & objType() const override
Implementation of IConverter: dummy call.
virtual StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the converted representation of a transient object.
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override
Create a Generic address using explicit arguments to identify a single object.
virtual StatusCode initializeConverter(long typ, const CLID &clid, IConverter *cnv)
Initialize the new converter.
std::unordered_map< CLID, WorkerEntry > Workers
AthCnvSvc()
Default constructor:
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Implementation of IConverter: Create the transient representation of an object.
virtual StatusCode disconnectOutput(const std::string &output)
Disconnect output files from the service.
SmartIF< IAddressCreator > m_addressCreator
Pointer to the address creation service interface.
long m_type
Conversion service type.
virtual StatusCode initialize() override
Gaudi Service Implementation.
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the created transient object.
virtual IConverter * converter(const CLID &wanted) override
Retrieve converter from list.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the converted object.
virtual StatusCode commitOutput(const std::string &output, bool do_commit) override
Commit pending output.
virtual SmartIF< IDataProviderSvc > & dataProvider() const override
Implementation of IConverter: Get Data provider service.
virtual StatusCode configureConverter(long typ, const CLID &clid, IConverter *cnv)
Configure the new converter before initialize is called.
std::recursive_mutex CallMutex
Mutex to protect Converter creation.
virtual SmartIF< IAddressCreator > & addressCreator()
Retrieve address creation interface.
SmartIF< IConversionSvc > m_cnvSvc
Pointer to the IConversionSvc interface of this.
AthCnvSvc & operator=(const AthCnvSvc &)
AthCnvSvc(const AthCnvSvc &)
virtual StatusCode setConversionSvc(IConversionSvc *svc) override
Implementation of IConverter: Set conversion service the converter is connected to.