Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:31:47

0001 /***********************************************************************************\
0002 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
0003 *                                                                                   *
0004 * This software is distributed under the terms of the Apache version 2 licence,     *
0005 * copied verbatim in the file "LICENSE".                                            *
0006 *                                                                                   *
0007 * In applying this licence, CERN does not waive the privileges and immunities       *
0008 * granted to it by virtue of its status as an Intergovernmental Organization        *
0009 * or submit itself to any jurisdiction.                                             *
0010 \***********************************************************************************/
0011 //====================================================================
0012 //  RootConverter class definition
0013 //
0014 //  Author     : M.Frank
0015 //====================================================================
0016 #ifndef GAUDIROOTCNV_ROOTCONVERTER_H
0017 #define GAUDIROOTCNV_ROOTCONVERTER_H
0018 
0019 // Framework include files
0020 #include <GaudiKernel/Converter.h>
0021 #include <RootCnv/RootCnvSvc.h>
0022 
0023 /*
0024  * Gaudi namespace declaration
0025  */
0026 namespace Gaudi {
0027 
0028   /** @class RootConverter RootConverter.h Root/RootConverter.h
0029    *
0030    * Description:
0031    * Definition of the ROOT data converter.
0032    * The generic data converter provides the infrastructure
0033    * of all data converters. All actions are delegated to
0034    * the corresponding conversion service.
0035    *
0036    * For a detailed description of the overridden function see the the
0037    * base class.
0038    *
0039    * @author  M.Frank
0040    * @version 1.0
0041    */
0042   class GAUDI_API RootConverter : public Converter {
0043   protected:
0044     /// Conversion service needed for proper operation to forward requests
0045     RootCnvSvc* m_dbMgr;
0046 
0047   public:
0048     /** Initializing Constructor
0049      * @param      typ      [IN]     Concrete storage type of the converter
0050      * @param      clid     [IN]     Class identifier of the object
0051      * @param      svc      [IN]     Pointer to service locator object
0052      *
0053      * @return Reference to RootConverter object
0054      */
0055     RootConverter( long typ, const CLID& clid, ISvcLocator* svc, RootCnvSvc* mgr )
0056         : Converter( typ, clid, svc ), m_dbMgr( mgr ) {}
0057 
0058     /// Retrieve the class type of the data store the converter uses.
0059     long repSvcType() const override { return i_repSvcType(); }
0060 
0061     /** Converter overrides: Create transient object from persistent data
0062      *
0063      * @param    pAddr       [IN]   Pointer to object address.
0064      * @param    refpObj     [OUT]  Location to pointer to store data object
0065      *
0066      * @return Status code indicating success or failure.
0067      */
0068     StatusCode createObj( IOpaqueAddress* pAddr, DataObject*& refpObj ) override {
0069       return m_dbMgr->i__createObj( pAddr, refpObj );
0070     }
0071 
0072     /** Resolve the references of the created transient object.
0073      *
0074      * @param    pAddr    [IN]   Pointer to object address.
0075      * @param    pObj     [IN]   Pointer to data object
0076      *
0077      * @return Status code indicating success or failure.
0078      */
0079     StatusCode fillObjRefs( IOpaqueAddress* pAddr, DataObject* pObj ) override {
0080       return m_dbMgr->i__fillObjRefs( pAddr, pObj );
0081     }
0082 
0083     /** Converter overrides: Convert the transient object to the
0084      * requested representation.
0085      *
0086      * @param    pObj     [IN]   Pointer to data object
0087      * @param    refpAddr [OUT]  Location to store pointer to object address.
0088      *
0089      * @return Status code indicating success or failure.
0090      */
0091     StatusCode createRep( DataObject* pObj, IOpaqueAddress*& refpAddr ) override {
0092       return m_dbMgr->i__createRep( pObj, refpAddr );
0093     }
0094 
0095     /** Resolve the references of the created transient object.
0096      *
0097      * @param    pAddr    [IN]   Pointer to object address.
0098      * @param    pObj     [IN]   Pointer to data object
0099      *
0100      * @return Status code indicating success or failure.
0101      */
0102     StatusCode fillRepRefs( IOpaqueAddress* pAddr, DataObject* pObj ) override {
0103       return m_dbMgr->i__fillRepRefs( pAddr, pObj );
0104     }
0105   };
0106 } // namespace Gaudi
0107 
0108 #endif // GAUDIROOTCNV_ROOTCONVERTER_H