| # Gaudi Framework, version v21r11 |

Home |  | Generated: 30 Sep 2010

# 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 #include "GaudiKernel/IDataProviderSvc.h"
    00011 #include "GaudiKernel/IDataManagerSvc.h"
    00012
    00013 // Forward declarations
    00014 class IMessageSvc;
    00015 class IRegistry;
    00016
    00025 class GAUDI_API Converter : public implements1<IConverter> {
    00026 public:
    00027
    00029   virtual StatusCode initialize();
    00030
    00032   virtual StatusCode finalize();
    00033
    00035   virtual StatusCode setDataProvider(IDataProviderSvc* svc);
    00036
    00038   virtual SmartIF<IDataProviderSvc>& dataProvider()    const;
    00039
    00041   virtual StatusCode setConversionSvc(IConversionSvc* svc);
    00042
    00044   virtual SmartIF<IConversionSvc>& conversionSvc()    const;
    00045
    00047   virtual StatusCode setAddressCreator(IAddressCreator* creator);
    00048
    00050   virtual SmartIF<IAddressCreator>& addressCreator()   const;
    00051
    00053   virtual const CLID& objType() const;
    00054
    00056   // MSF: Masked to generate compiler error due to interface change
    00057   virtual long i_repSvcType() const;
    00058
    00060   virtual StatusCode createObj(IOpaqueAddress* pAddress,DataObject*& refpObject);
    00061
    00063   virtual StatusCode fillObjRefs(IOpaqueAddress* pAddress, DataObject* pObject);
    00064
    00066   virtual StatusCode updateObj(IOpaqueAddress* pAddress, DataObject* refpObject);
    00067
    00069   virtual StatusCode updateObjRefs(IOpaqueAddress* pAddress, DataObject* pObject);
    00070
    00072   virtual StatusCode createRep(DataObject* pObject, IOpaqueAddress*& refpAddress);
    00073
    00075   virtual StatusCode fillRepRefs(IOpaqueAddress* pAddress,DataObject* pObject);
    00076
    00078   virtual StatusCode updateRep(IOpaqueAddress* pAddress, DataObject* pObject);
    00079
    00081   virtual StatusCode updateRepRefs(IOpaqueAddress* pAddress, DataObject* pObject);
    00082
    00084   Converter(long storage_type, const CLID& class_type, ISvcLocator* svc = 0);
    00085
    00087   template <class T>
    00088   StatusCode service( const std::string& name, T*& psvc, bool createIf = false ) const {
    00089     return service_i(name, createIf, T::interfaceID(), (void**)&psvc);
    00090   }
    00091
    00093   template <class T>
    00094   StatusCode service( const std::string& type, const std::string& name, T*& psvc) const {
    00095     return service_i(type, name, T::interfaceID(), (void**)&psvc);
    00096   }
    00097
    00099   SmartIF<IService> service(const std::string& name, const bool createIf = true) const;
    00100
    00101 protected:
    00102
    00104   virtual ~Converter();
    00105
    00107   SmartIF<ISvcLocator>& serviceLocator()   const;
    00109   SmartIF<IMessageSvc>& msgSvc()   const;
    00110   // Obsoleted name, kept due to the backwards compatibility
    00111   SmartIF<IMessageSvc>& messageService()   const;
    00113   SmartIF<IDataManagerSvc>& dataManager() const;
    00114
    00115 private:
    00116
    00118   long              m_storageType;
    00120   const CLID        m_classType;
    00122   mutable SmartIF<IAddressCreator> m_addressCreator;
    00124   mutable SmartIF<IDataProviderSvc> m_dataProvider;
    00126   mutable SmartIF<IDataManagerSvc>  m_dataManager;
    00128   mutable SmartIF<IConversionSvc>   m_conversionSvc;
    00130   mutable SmartIF<ISvcLocator>      m_svcLocator;
    00132   mutable SmartIF<IMessageSvc> m_messageSvc;
    00133
    00135   StatusCode service_i(const std::string& svcName,
    00136                        bool createIf,
    00137                        const InterfaceID& iid,
    00138                        void** ppSvc) const;
    00139   StatusCode service_i(const std::string& svcType,
    00140                        const std::string& svcName,
    00141                        const InterfaceID& iid,
    00142                        void** ppSvc) const;
    00143 };
    00144
    00145
    00146 #endif // GAUDIKERNEL_CONVERTER_H