/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/RawDataCnv/RawDataCnv-00-04-35/src/RawDataTrigCnv.cxx

Go to the documentation of this file.
00001 #include "GaudiKernel/MsgStream.h"
00002 #include "GaudiKernel/IRegistry.h"
00003 #include "TrigEvent/TrigEvent.h"
00004 #include "RawDataCnv/RawDataAddress.h"
00005 #include "RawDataCnv/RawDataInputSvc.h"
00006 #include "RawDataCnv/RawDataTrigCnv.h"
00007 
00008 
00009 extern const CLID& CLID_TrigEvent;
00010 
00011 // Constructor.
00012 RawDataTrigCnv::RawDataTrigCnv(ISvcLocator* svc) :
00013 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc)
00014 {
00015   init();
00016 }
00017 
00018 const CLID& RawDataTrigCnv::classID()
00019 {
00020   return CLID_TrigEvent;
00021 }
00022 
00023 StatusCode RawDataTrigCnv::init() 
00024 {
00025     StatusCode sc = RawDataBaseCnv::initialize();
00026     if (sc.isFailure()) {
00027        return sc;
00028     }
00029 
00030     MsgStream log(messageService(), "RawDataTrigCnv");
00031 
00032     IService* svc = 0;
00033     sc = serviceLocator()->service("PackedRawDataCnvSvc", svc);
00034     if (sc != StatusCode::SUCCESS) {
00035         log << MSG::ERROR << "Can't get RawDataAccess interface" << endreq;
00036         return StatusCode::FAILURE;
00037     }
00038 
00039     m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (svc);
00040     if (m_RawDataAccess  == 0 ) {
00041       log << MSG::ERROR << "RawDataCnv: Cant cast to RawDataCnvSvc" << endreq;
00042       return StatusCode::FAILURE;
00043     }
00044 
00045     sc = serviceLocator()->getService("RawDataInputSvc", svc);
00046     if(sc != StatusCode::SUCCESS ) {
00047         log << MSG::WARNING << "Cant get RawDataInputSvc " << endreq;
00048         return sc ;
00049     }
00050  
00051     m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
00052     if(m_inputSvc == 0 ) {
00053         log << MSG::ERROR << "Cant cast to RawDataInputSvc" << endreq;
00054         return StatusCode::FAILURE ;
00055     }
00056 
00057     return StatusCode::SUCCESS;
00058 }
00059 
00060 StatusCode RawDataTrigCnv::updateObj(IOpaqueAddress* pAddr, DataObject* pObj) {
00061     MsgStream log(msgSvc(), "RawDataTrigCnv");
00062     log << MSG::DEBUG << "RawDataTrigCnv::updateObj" << endreq;
00063     return Converter::updateObj(pAddr, pObj);
00064 }
00065 
00066 StatusCode RawDataTrigCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj)
00067 {
00068   TrigEvent * evt = new TrigEvent();
00069   pObj = evt;
00070   return StatusCode::SUCCESS;
00071 }
00072 
00073 StatusCode RawDataTrigCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr)        
00074 {
00075     std::string nm = pObj->registry()->name(); 
00076     RawDataAddress* addr = new RawDataAddress(classID(), nm, ""); 
00077     pAddr = addr; 
00078  
00079   return StatusCode::SUCCESS;
00080 }

Generated on Tue Nov 29 22:58:32 2016 for BOSS_7.0.2 by  doxygen 1.4.7