Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:08:59

0001 /***********************************************************************************\
0002 * (c) Copyright 1998-2019 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 #ifndef GAUDIKERNEL_ICONVERSIONSVC_H
0012 #define GAUDIKERNEL_ICONVERSIONSVC_H
0013 
0014 // Include files
0015 #include <string>
0016 
0017 #include "GaudiKernel/IConverter.h"
0018 
0019 // Forward declarations
0020 class ICnvFactory;
0021 
0022 /** @class IConversionSvc IConversionSvc.h GaudiKernel/IConversionSvc.h
0023 
0024     <P> The conversion service interface allows to:
0025     <UL>
0026     <LI> Add, get and remove data converters from the service.
0027     <LI> Create objects using converters: e.g. create the transient
0028          representation of a persistent object.
0029     <LI> convert objects - the opposite of create: e.g. convert transient
0030          objects into the persistent representation of these objects.
0031          The objects to be converted are defined by a data selector object.
0032     <LI> update objects which already exist: e.g. update the existing
0033          persistent representation of objects which were read from the
0034                persistent store and should be modified.
0035                The objects to be converted are defined by a data selector object.
0036     <LI> Class specific aspects of the creation/update/conversion mechanism
0037          must be handled by the converters, the common aspects will be handled
0038          by the service.
0039     </UL>
0040 
0041    @author Markus Frank
0042    @version 1.2
0043 
0044   - Version 1.2 Remove createReps, updateReps - replaced by interface IConverter
0045 
0046 */
0047 class GAUDI_API IConversionSvc : virtual public IConverter {
0048 public:
0049   /// InterfaceID
0050   DeclareInterfaceID( IConversionSvc, 4, 0 );
0051 
0052   /** Add converter object to conversion service.
0053    *  @param      pConverter Pointer to converter object
0054    *  @return     Status code indicating success or failure.
0055    */
0056   virtual StatusCode addConverter( IConverter* pConverter ) = 0;
0057 
0058   /** Add converter object to conversion service.
0059    *  @param      clid   Class ID of the converter needed
0060    *  @return     Status code indicating success or failure.
0061    */
0062   virtual StatusCode addConverter( const CLID& clid ) = 0;
0063 
0064   /** Remove converter object from conversion service (if present).
0065    *  The converter is defined by the class type of the objects created.
0066    *  @param      clid   Class ID of the converter
0067    *  @return     Status code indicating success or failure.
0068    */
0069   virtual StatusCode removeConverter( const CLID& clid ) = 0;
0070 
0071   /** Retrieve converter from list
0072    *  @param clid the clid of the converter
0073    *  @return the converter corresponding to clid or 0 if none was found
0074    */
0075   virtual IConverter* converter( const CLID& clid ) = 0;
0076 
0077   /** Connect the output file to the service.
0078    *  @param      outputFile  String containing output file
0079    *  @return     Status code indicating success or failure.
0080    */
0081   virtual StatusCode connectOutput( const std::string& outputFile ) = 0;
0082 
0083   /** Connect the output file to the service with open mode.
0084    *  @param      outputFile  String containing output file
0085    *  @param      openMode    String containing opening mode of the output file
0086    *  @return     Status code indicating success or failure.
0087    */
0088   virtual StatusCode connectOutput( const std::string& outputFile, const std::string& openMode ) = 0;
0089 
0090   /** Commit pending output.
0091    *  @param      outputFile  String containing output file
0092    *  @param      do_commit   if true commit the output and flush
0093    *                          eventually pending items to the database
0094    *                          if false, discard pending buffers.
0095    *                          Note: The possibility to commit or roll-back
0096    *                          depends on the database technology used!
0097    *  @return     Status code indicating success or failure.
0098    */
0099   virtual StatusCode commitOutput( const std::string& outputFile, bool do_commit ) = 0;
0100 
0101   /// Status code definitions
0102   enum class Status : StatusCode::code_t {
0103     /// Invalid address information
0104     INVALID_ADDRESS = static_cast<StatusCode::code_t>( IInterface::Status::LAST_ERROR ) + 1,
0105     /// Object to be converted is invalid
0106     INVALID_OBJECT,
0107     /// No more memory available
0108     NO_MEMORY,
0109     /// Invalid storage type
0110     BAD_STORAGE_TYPE,
0111     /// Error retrieving source data from source store
0112     NO_SOURCE_OBJECT,
0113     /// No proper converter is available to the service
0114     NO_CONVERTER
0115   };
0116 };
0117 
0118 STATUSCODE_ENUM_DECL( IConversionSvc::Status )
0119 
0120 #endif // GAUDIKERNEL_ICONVERSIONSVC_H