RawDataDigiCnv Class Reference

#include <RawDataDigiCnv.h>

Inheritance diagram for RawDataDigiCnv:

RawDataBaseCnv Converter< Ty1, Ty2 > List of all members.

Public Types

typedef Ty1 source
typedef Ty2 destination

Public Member Functions

StatusCode initialize ()
virtual long repSvcType () const
StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&pObj)
virtual StatusCode updateObj (IOpaqueAddress *, DataObject *)
 override the RawDataBaseCnv version
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&pAddr)
 Convert the transient object to the requested representation.
virtual StatusCode finalize ()
void declareObject (const std::string &fullPath, const CLID &clid, const std::string &bank, long par=0)
 Store TDS path to link a particular converter to an object on the TDS.
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
 Update the converted representation of a transient object.
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Update the references of an already converted object.
destinationoperator (const source &) const

Static Public Member Functions

static const CLID & classID ()
static const unsigned char storageType ()

Protected Member Functions

 RawDataDigiCnv (ISvcLocator *svc)
virtual destinationconvert (const source &) const =0

Protected Attributes

IRawDataCnvSvcm_CnvSvc
 Pointer to event conversion service interface.
std::vector< IRawDataCnvSvc::Leafm_leaves
 Leaf objects giving the locations of the objects in the data store.

Private Attributes

IRawDataInputSvcm_inputSvc
IRawDataCnvSvcm_RawDataAccess
 Define the interface to raw data cnv.

Friends

class CnvFactory< RawDataDigiCnv >

Detailed Description

Definition at line 29 of file RawDataDigiCnv.h.


Member Typedef Documentation

template<class Ty1, class Ty2>
typedef Ty2 Converter< Ty1, Ty2 >::destination [inherited]

Definition at line 19 of file Converter.h.

template<class Ty1, class Ty2>
typedef Ty1 Converter< Ty1, Ty2 >::source [inherited]

Definition at line 18 of file Converter.h.


Constructor & Destructor Documentation

RawDataDigiCnv::RawDataDigiCnv ( ISvcLocator *  svc  )  [protected]

Definition at line 31 of file RawDataDigiCnv.cxx.

00031                                                : 
00032 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc) 
00033 {
00034     //init();
00035 }


Member Function Documentation

const CLID & RawDataDigiCnv::classID (  )  [static]

Reimplemented from RawDataBaseCnv.

Definition at line 39 of file RawDataDigiCnv.cxx.

References CLID_DigiEvent.

Referenced by PackedRawDataCnvSvc::addConverters(), and createRep().

00040 {
00041   return CLID_DigiEvent;
00042 }

template<class Ty1, class Ty2>
virtual destination* Converter< Ty1, Ty2 >::convert ( const source  )  const [protected, pure virtual, inherited]

StatusCode RawDataDigiCnv::createObj ( IOpaqueAddress *  pAddr,
DataObject *&  pObj 
)

Definition at line 108 of file RawDataDigiCnv.cxx.

References DigiEvent::initialize(), and msgSvc().

00109 {
00110    MsgStream log(msgSvc(), "RawDataDigiCnv");
00111    //RawDataAddress *pEFAddr;
00112    
00113    // Purpose and Method:  This converter will create an empty EventHeader on
00114    //   the TDS.
00115    DigiEvent *digi = new DigiEvent();
00116    // Set fromMc to false
00117    digi->initialize(false);
00118    pObj = digi;
00119    return StatusCode::SUCCESS;
00120 
00121 }

StatusCode RawDataDigiCnv::createRep ( DataObject *  pObj,
IOpaqueAddress *&  pAddr 
) [virtual]

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 123 of file RawDataDigiCnv.cxx.

References classID(), and deljobs::string.

00124 {
00125     // convert Raws in the container into ByteStream
00126     StatusCode sc = StatusCode::SUCCESS ; 
00127     //MsgStream log(messageService(), "RawDataDigiCnv");
00128  
00129     //WriteRawEvent* re = static_cast<WriteRawEvent*>(m_RawDataAccess->getRawEvent()); 
00130  
00131  
00132     std::string nm = pObj->registry()->name(); 
00133  
00134     RawDataAddress* addr = new RawDataAddress(classID(), nm, ""); 
00135  
00136     pAddr = addr; 
00137  
00138     return StatusCode::SUCCESS; 
00139  
00140 }

void RawDataBaseCnv::declareObject ( const std::string fullPath,
const CLID &  clid,
const std::string bank,
long  par = 0 
) [inherited]

Store TDS path to link a particular converter to an object on the TDS.

Definition at line 81 of file RawDataBaseCnv.cxx.

00082                                                                       {
00083     // Purpose and Method:  Save the path on the TDS, in the m_leaves vector, 
00084     //   corresponding to the DataObject that the converter handles.
00085     // m_leaves.push_back(IRawDataCnvSvc::Leaf(path, cl, bank, par));
00086 }

StatusCode RawDataBaseCnv::fillRepRefs ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
) [virtual, inherited]

Resolve the references of the converted object.

Definition at line 29 of file RawDataBaseCnv.cxx.

00030                                                  {
00031     // Purpose and Method:  Resolve the references of the converted object.
00032     //     It is expected that derived classes will override this method.
00033     return StatusCode::SUCCESS;
00034 }

StatusCode RawDataBaseCnv::finalize (  )  [virtual, inherited]

Definition at line 73 of file RawDataBaseCnv.cxx.

References RawDataBaseCnv::m_CnvSvc.

00073                                       {
00074     if ( m_CnvSvc )     {
00075         m_CnvSvc->release();
00076         m_CnvSvc = 0;
00077     }
00078     return Converter::finalize();
00079 }

StatusCode RawDataDigiCnv::initialize (  ) 

Reimplemented from RawDataBaseCnv.

Definition at line 44 of file RawDataDigiCnv.cxx.

References calibUtil::ERROR, RawDataBaseCnv::initialize(), m_inputSvc, m_RawDataAccess, deljobs::string, and Bes_Common::WARNING.

00045 {
00046     std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
00047     std::string RawDataInputSvc_Name("RawDataInputSvc");
00048     std::string RawDataDigiCnv_Name("RawDataDigiCnv");
00049     
00050     // for Mutil-thread by tianhl
00051     //ConversionSvc*  pCnvSvc = 0;
00052     SmartIF<IService> pCnvSvc(conversionSvc());
00053     //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
00054       if  (isGaudiThreaded(pCnvSvc->name())){
00055         PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00056         RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00057         RawDataDigiCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00058       }
00059     //}
00060     // for Mutil-thread by tianhl
00061     StatusCode sc = RawDataBaseCnv::initialize();
00062     if(StatusCode::SUCCESS!=sc)
00063     {
00064        return sc;
00065     }
00066 
00067     MsgStream log(messageService(), RawDataDigiCnv_Name.c_str());
00068 
00069     IService* svc = 0;
00070     sc = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), svc);
00071     if (sc != StatusCode::SUCCESS) {
00072         log << MSG::ERROR << "Can't get RawDataAccess interface" << endreq;
00073         return StatusCode::FAILURE;
00074     }
00075 
00076     m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (svc);
00077     if (m_RawDataAccess  == 0 ) {
00078       log << MSG::ERROR << "RawDataCnv: Cant cast to RawDataCnvSvc" << endreq;
00079       return StatusCode::FAILURE;
00080     }
00081 
00082     sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
00083     if(sc != StatusCode::SUCCESS ) {
00084         log << MSG::WARNING << "Cant get RawDataInputSvc " << endreq;
00085         return sc ;
00086     }
00087  
00088     m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
00089     if(m_inputSvc == 0 ) {
00090         log << MSG::ERROR << "Cant cast to RawDataInputSvc" << endreq;
00091         return StatusCode::FAILURE ;
00092     }
00093 
00094     return StatusCode::SUCCESS;
00095 }

template<class Ty1, class Ty2>
destination* Converter< Ty1, Ty2 >::operator ( const source  )  const [inline, inherited]

virtual long RawDataDigiCnv::repSvcType (  )  const [inline, virtual]

Reimplemented from RawDataBaseCnv.

Definition at line 43 of file RawDataDigiCnv.h.

References PACKEDRAWEVENT_StorageType.

00043                                    {
00044        return PACKEDRAWEVENT_StorageType;
00045    }

static const unsigned char RawDataDigiCnv::storageType (  )  [inline, static]

Reimplemented from RawDataBaseCnv.

Definition at line 47 of file RawDataDigiCnv.h.

References PACKEDRAWEVENT_StorageType.

00047                                             {
00048        return PACKEDRAWEVENT_StorageType;
00049    }

StatusCode RawDataDigiCnv::updateObj ( IOpaqueAddress *  ,
DataObject *   
) [virtual]

override the RawDataBaseCnv version

Definition at line 98 of file RawDataDigiCnv.cxx.

00098                                                                             {
00099     // Purpose and Method:  This method does nothing other than announce it has
00100     //   been called.
00101 
00102     //MsgStream log(msgSvc(), "RawDataDigiCnv");
00103     //log << MSG::DEBUG << "RawDataDigiCnv::updateObj" << endreq;
00104     return Converter::updateObj(pAddr, pObj);
00105 }

StatusCode RawDataBaseCnv::updateRep ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
) [virtual, inherited]

Update the converted representation of a transient object.

Definition at line 36 of file RawDataBaseCnv.cxx.

00037                                               {
00038     // Purpose and Method:  Update the converted representation of a transient 
00039     //     object.  It is expected that derived classes will override this.
00040     return StatusCode::SUCCESS;
00041 }

StatusCode RawDataBaseCnv::updateRepRefs ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
) [virtual, inherited]

Update the references of an already converted object.

Definition at line 43 of file RawDataBaseCnv.cxx.

00044                                                 {
00045     // Purpose and Method:  Update the references of an already converted object.
00046     //   It is expected that derived classes will override this method.
00047     return StatusCode::SUCCESS;
00048 }


Friends And Related Function Documentation

friend class CnvFactory< RawDataDigiCnv > [friend]

Definition at line 33 of file RawDataDigiCnv.h.


Member Data Documentation

IRawDataCnvSvc* RawDataBaseCnv::m_CnvSvc [protected, inherited]

Pointer to event conversion service interface.

Definition at line 28 of file RawDataBaseCnv.h.

Referenced by RawDataBaseCnv::finalize().

IRawDataInputSvc* RawDataDigiCnv::m_inputSvc [private]

Definition at line 60 of file RawDataDigiCnv.h.

Referenced by initialize().

std::vector<IRawDataCnvSvc::Leaf> RawDataBaseCnv::m_leaves [protected, inherited]

Leaf objects giving the locations of the objects in the data store.

Definition at line 30 of file RawDataBaseCnv.h.

IRawDataCnvSvc* RawDataDigiCnv::m_RawDataAccess [private]

Define the interface to raw data cnv.

Definition at line 62 of file RawDataDigiCnv.h.

Referenced by initialize().


Generated on Tue Nov 29 23:20:44 2016 for BOSS_7.0.2 by  doxygen 1.4.7