Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

BaseCnv.cpp

Go to the documentation of this file.
00001 //  ====================================================================
00002 //  BaseCnv.cpp
00003 //  --------------------------------------------------------------------
00004 //
00005 //  Package   : GlastSvc/src/EventSelector
00006 //
00007 //  Implementation of class :  BaseCnv
00008 //
00009 //  Modified SicbBaseCnv
00010 //
00011 //  ====================================================================
00012 #define _BASECNV_CPP 
00013 
00014 #include "GaudiKernel/IService.h"
00015 #include "GaudiKernel/ISvcLocator.h"
00016 
00017 #include "GlastSvc/GlastDetSvc/IGlastDetSvc.h"
00018 #include "GaudiKernel/MsgStream.h"
00019 
00020 #include "BaseCnv.h"
00021 
00022 
00023 //extern const IID& IID_ISicbEventCnvSvc;
00024 static const InterfaceID IID_IBaseCnv(902, 1 , 0); 
00025 
00026 // RCS Id for identification of object version
00027 static const char* rcsid = "$Id: BaseCnv.cpp,v 1.4 2001/04/19 01:32:29 igable Exp $";
00028 
00030 StatusCode BaseCnv::createRep(DataObject* pObject, IOpaqueAddress*& refpAddress)   {
00031   return StatusCode::FAILURE;
00032 }
00033 
00035 StatusCode BaseCnv::fillRepRefs(IOpaqueAddress* pAddress,DataObject* pObject)    {
00036   return StatusCode::FAILURE;
00037 }
00038 
00040 StatusCode BaseCnv::updateRep(IOpaqueAddress* pAddress, DataObject* pObject)   {
00041   return StatusCode::FAILURE;
00042 }
00043 
00045 StatusCode BaseCnv::updateRepRefs(IOpaqueAddress* pAddress, DataObject* pObject)   {
00046   return StatusCode::FAILURE;
00047 }
00048 
00049 
00051 StatusCode BaseCnv::initialize()   {
00052   StatusCode status = Converter::initialize();
00053   if ( status.isSuccess() )   {
00054     IService* isvc = 0;
00055     status = serviceLocator()->getService("EventCnvSvc", isvc);
00056     if ( status.isSuccess() )   {
00057       status = isvc->queryInterface(IID_IBaseCnv, (void**)&m_CnvSvc);
00058       if ( status.isSuccess() )   {
00059         for ( std::vector<IEventCnvSvc::Leaf>::iterator i = m_leaves.begin(); i != m_leaves.end(); i++ )    {
00060           m_CnvSvc->declareObject(*i);
00061         }
00062       }
00063     }
00064   }
00065   return status;
00066 }
00067 
00069 StatusCode BaseCnv::finalize()   {
00070   if ( m_CnvSvc )     {
00071     m_CnvSvc->release();
00072     m_CnvSvc = 0;
00073   }
00074   // Put in here SicbConverter initialization
00075   return Converter::finalize();
00076 }
00077 
00079 void BaseCnv::declareObject(const std::string& path, const CLID& cl, const std::string& bank, long par)  {
00080   m_leaves.push_back(IEventCnvSvc::Leaf(path, cl, bank, par));
00081 }
00082 
00084 BaseCnv::BaseCnv(const CLID& clid, ISvcLocator* svc)
00085 : Converter(SICB_StorageType, clid, svc), m_CnvSvc(0)   {
00086 
00087     StatusCode sc;
00088     MsgStream log(msgSvc(), "BaseCnv");
00089 
00090     // provide access to the Glast Detector Service, so that we may call the accept method
00091     // from within our converters
00092     sc = serviceLocator()->getService ("GlastDetSvc",
00093         IID_IGlastDetSvc, reinterpret_cast<IInterface*&>( m_detSvc ));
00094     
00095     if(sc.isFailure()){
00096        log << MSG::ERROR << "Unable start Glast detector service within BaseCnv" << endreq;
00097     } 
00098 }
00099 
00101 BaseCnv::~BaseCnv()    { 
00102 }
00103 

Generated at Wed Nov 21 12:21:12 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000