| # Gaudi Framework, version v20r4
Generated: 8 Jan 2009

# Converter.h

Go to the documentation of this file.

    00001 // $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiKernel/GaudiKernel/Converter.h,v 1.10 2004/09/11 00:22:41 leggett Exp $
    00002 #ifndef GAUDIKERNEL_CONVERTER_H
    00003 #define GAUDIKERNEL_CONVERTER_H
    00004
    00005 // generic experiment headers
    00006 #include "GaudiKernel/IConverter.h"
    00007 #include "GaudiKernel/ISvcLocator.h"
    00008 #include "GaudiKernel/IService.h"
    00009 #include "GaudiKernel/ConversionSvc.h"
    00010
    00011 // Forward declarations
    00012 class IMessageSvc;
    00013 class IRegistry;
    00014 class IDataProviderSvc;
    00015 class IDataManagerSvc;
    00016
    00025 class Converter : virtual public IConverter         {
    00026
    00027 public:
    00028
    00030   virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
    00031
    00033   virtual unsigned long addRef();
    00034
    00036   virtual unsigned long release();
    00037
    00039   virtual StatusCode initialize();
    00040
    00042   virtual StatusCode finalize();
    00043
    00045   virtual StatusCode setDataProvider(IDataProviderSvc* svc);
    00046
    00048   virtual IDataProviderSvc* dataProvider()    const;
    00049
    00051   virtual StatusCode setConversionSvc(IConversionSvc* svc);
    00052
    00054   virtual IConversionSvc* conversionSvc()    const;
    00055
    00057   virtual StatusCode setAddressCreator(IAddressCreator* creator);
    00058
    00060   virtual IAddressCreator* addressCreator()   const;
    00061
    00063   virtual const CLID& objType() const;
    00064
    00066   // MSF: Masked to generate compiler error due to interface change
    00067   virtual long i_repSvcType() const;
    00068
    00070   virtual StatusCode createObj(IOpaqueAddress* pAddress,DataObject*& refpObject);
    00071
    00073   virtual StatusCode fillObjRefs(IOpaqueAddress* pAddress, DataObject* pObject);
    00074
    00076   virtual StatusCode updateObj(IOpaqueAddress* pAddress, DataObject* refpObject);
    00077
    00079   virtual StatusCode updateObjRefs(IOpaqueAddress* pAddress, DataObject* pObject);
    00080
    00082   virtual StatusCode createRep(DataObject* pObject, IOpaqueAddress*& refpAddress);
    00083
    00085   virtual StatusCode fillRepRefs(IOpaqueAddress* pAddress,DataObject* pObject);
    00086
    00088   virtual StatusCode updateRep(IOpaqueAddress* pAddress, DataObject* pObject);
    00089
    00091   virtual StatusCode updateRepRefs(IOpaqueAddress* pAddress, DataObject* pObject);
    00092
    00094   Converter(long storage_type, const CLID& class_type, ISvcLocator* svc);
    00095
    00097   template <class T>
    00098   StatusCode service( const std::string& name, T*& psvc, bool createIf = false ) const {
    00099     return service_i(name, createIf, T::interfaceID(), (void**)&psvc);
    00100   }
    00101
    00103   template <class T>
    00104   StatusCode service( const std::string& type, const std::string& name, T*& psvc) const {
    00105     return service_i(type, name, T::interfaceID(), (void**)&psvc);
    00106   }
    00107
    00108 protected:
    00109
    00111   virtual ~Converter();
    00112
    00114   ISvcLocator* serviceLocator()   const;
    00116   IMessageSvc* msgSvc()   const;
    00117   // Obsoleted name, kept due to the backwards compatibility
    00118   IMessageSvc* messageService()   const;
    00120   IDataManagerSvc* dataManager() const;
    00121
    00122 private:
    00123
    00125   unsigned long     m_refCount;
    00127   long              m_storageType;
    00129   const CLID        m_classType;
    00131   IAddressCreator*    m_addressCreator;
    00133   IDataProviderSvc* m_dataProvider;
    00135   IDataManagerSvc*  m_dataManager;
    00137   IConversionSvc*   m_conversionSvc;
    00139   ISvcLocator*      m_svcLocator;
    00141   mutable IMessageSvc* m_messageSvc;
    00142
    00144   StatusCode service_i(const std::string& svcName,
    00145                        bool createIf,
    00146                        const InterfaceID& iid,
    00147                        void** ppSvc) const;
    00148   StatusCode service_i(const std::string& svcType,
    00149                        const std::string& svcName,
    00150                        const InterfaceID& iid,
    00151                        void** ppSvc) const;
    00152 };
    00153
    00154
    00155 #endif // GAUDIKERNEL_CONVERTER_H