RawDataCnv Class Reference

#include <RawDataCnv.h>

Inheritance diagram for RawDataCnv:

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

 RawDataCnv (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

Friends

class CnvFactory< RawDataCnv >

Detailed Description

Definition at line 29 of file RawDataCnv.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

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

Definition at line 27 of file RawDataCnv.cxx.

00027                                        : 
00028 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc) 
00029 {
00030     //init();
00031 }


Member Function Documentation

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

Reimplemented from RawDataBaseCnv.

Definition at line 83 of file RawDataCnv.cxx.

References CLID_Event.

Referenced by PackedRawDataCnvSvc::addConverters().

00084 {
00085     return CLID_Event;
00086 }

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

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

Definition at line 98 of file RawDataCnv.cxx.

References IRawDataInputSvc::currentEvent(), and m_inputSvc.

00099 {
00100   RawDataAddress *pEFAddr;
00101   const RAWEVENT *evt;
00102 
00103   Event::EventH * evh = new Event::EventH();
00104   pObj = evh;
00105 
00106   if ( (pEFAddr = dynamic_cast<RawDataAddress*>(pAddr)) ) {
00107     evt = m_inputSvc->currentEvent();
00108     if (evt == NULL) return StatusCode::FAILURE;
00109     return StatusCode::SUCCESS;
00110   }
00111   else {
00112     return StatusCode::FAILURE;
00113   }
00114 }

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 116 of file RawDataCnv.cxx.

References Bes_Common::DEBUG, calibUtil::ERROR, msgSvc(), and deljobs::string.

00117 {
00118   Event::EventH * evh=dynamic_cast<Event::EventH *> (pObj);
00119   if (!evh) {
00120     std::string RawDataCnv_Name("RawDataCnv");
00121     //ConversionSvc*  pCnvSvc = 0;
00122     //SmartIF<IService> pCnvSvc(conversionSvc());
00123     //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
00124     SmartIF<IService> pCnvSvc(conversionSvc());  
00125     if  (isGaudiThreaded(pCnvSvc->name())){
00126         RawDataCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00127       }
00128     //}
00129     MsgStream log(msgSvc(), RawDataCnv_Name.c_str());
00130     log << MSG::DEBUG << "RawDataCnv::createRep()" << endreq;
00131 
00132     log << MSG::ERROR << "Could not downcast Event" << endreq;
00133     return StatusCode::FAILURE;
00134   }
00135   // nothing to do, will be done in lower converters
00136   return StatusCode::SUCCESS;
00137 }

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 RawDataCnv::initialize (  ) 

Reimplemented from RawDataBaseCnv.

Definition at line 33 of file RawDataCnv.cxx.

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

00034 {
00035     StatusCode sc = RawDataBaseCnv::initialize();
00036     if( sc.isFailure() ) return sc;
00037     
00038     std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
00039     std::string RawDataInputSvc_Name("RawDataInputSvc");
00040     std::string RawDataCnv_Name("RawDataCnv");
00041     
00042     // for Mutil-thread by tianhl
00043     //ConversionSvc*  pCnvSvc = 0;
00044     //SmartIF<IService> pCnvSvc(conversionSvc());
00045     //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
00046     SmartIF<IService> pCnvSvc(conversionSvc());  
00047     if  (isGaudiThreaded(pCnvSvc->name())){
00048         PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00049         RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00050         RawDataCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
00051       }
00052     //}
00053     // for Mutil-thread by tianhl
00054  
00055     MsgStream log(messageService(), RawDataCnv_Name.c_str());
00056     /*if (StatusCode::SUCCESS != service("PackedRawDataCnvSvc",
00057         m_RawDataAccess) || !m_RawDataAccess )
00058     {
00059         log << MSG::ERROR << " Can't get RawDataAccess interface "
00060             << endreq;
00061         return StatusCode::FAILURE;
00062     }
00063     log << MSG::INFO << " RawDataCnvSvc retrieved "<< endreq; */
00064  
00065     IService* svc ;
00066     sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc); 
00067     if(sc != StatusCode::SUCCESS ) {
00068         log<<MSG::WARNING << " Cant get RawDataInputSvc " <<endreq;
00069         return sc ;
00070     }
00071  
00072     m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc); 
00073     if(m_inputSvc == 0 ) {
00074         log<<MSG::WARNING << " Cant cast to  RawDataInputSvc " <<endreq; 
00075         return StatusCode::FAILURE ;
00076     } 
00077 
00078     return StatusCode::SUCCESS;
00079 }

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

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

Reimplemented from RawDataBaseCnv.

Definition at line 44 of file RawDataCnv.h.

References PACKEDRAWEVENT_StorageType.

00044                                    {
00045        return PACKEDRAWEVENT_StorageType;
00046    }

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

Reimplemented from RawDataBaseCnv.

Definition at line 48 of file RawDataCnv.h.

References PACKEDRAWEVENT_StorageType.

00048                                             {
00049        return PACKEDRAWEVENT_StorageType;
00050    }

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

override the RawDataBaseCnv version

Definition at line 88 of file RawDataCnv.cxx.

00088                                                                         {
00089     // Purpose and Method:  This method does nothing other than announce it has
00090     //   been called.
00091 
00092     //MsgStream log(msgSvc(), "RawDataCnv");
00093     //log << MSG::DEBUG << "RawDataCnv::updateObj" << endreq;
00094     return Converter::updateObj(pAddr, pObj);
00095 }

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< RawDataCnv > [friend]

Definition at line 33 of file RawDataCnv.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* RawDataCnv::m_inputSvc [private]

Definition at line 61 of file RawDataCnv.h.

Referenced by createObj(), and 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.


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